src/java.desktop/share/native/libfontmanager/harfbuzz/hb-static.cc
author jiefu
Fri, 15 Nov 2019 20:39:26 +0800
changeset 59110 8c4c358272a9
parent 54232 7c11a7cc7c1d
permissions -rw-r--r--
8234232: [TESTBUG] gc/shenandoah/jvmti/TestHeapDump.java fails with -Xcomp Reviewed-by: zgu
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
50826
f5b95be8b6e2 8205441: Upgrade to harfbuzz 1.8.1
prr
parents:
diff changeset
     1
/*
f5b95be8b6e2 8205441: Upgrade to harfbuzz 1.8.1
prr
parents:
diff changeset
     2
 * Copyright © 2018  Google, Inc.
f5b95be8b6e2 8205441: Upgrade to harfbuzz 1.8.1
prr
parents:
diff changeset
     3
 *
f5b95be8b6e2 8205441: Upgrade to harfbuzz 1.8.1
prr
parents:
diff changeset
     4
 *  This is part of HarfBuzz, a text shaping library.
f5b95be8b6e2 8205441: Upgrade to harfbuzz 1.8.1
prr
parents:
diff changeset
     5
 *
f5b95be8b6e2 8205441: Upgrade to harfbuzz 1.8.1
prr
parents:
diff changeset
     6
 * Permission is hereby granted, without written agreement and without
f5b95be8b6e2 8205441: Upgrade to harfbuzz 1.8.1
prr
parents:
diff changeset
     7
 * license or royalty fees, to use, copy, modify, and distribute this
f5b95be8b6e2 8205441: Upgrade to harfbuzz 1.8.1
prr
parents:
diff changeset
     8
 * software and its documentation for any purpose, provided that the
f5b95be8b6e2 8205441: Upgrade to harfbuzz 1.8.1
prr
parents:
diff changeset
     9
 * above copyright notice and the following two paragraphs appear in
f5b95be8b6e2 8205441: Upgrade to harfbuzz 1.8.1
prr
parents:
diff changeset
    10
 * all copies of this software.
f5b95be8b6e2 8205441: Upgrade to harfbuzz 1.8.1
prr
parents:
diff changeset
    11
 *
f5b95be8b6e2 8205441: Upgrade to harfbuzz 1.8.1
prr
parents:
diff changeset
    12
 * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
f5b95be8b6e2 8205441: Upgrade to harfbuzz 1.8.1
prr
parents:
diff changeset
    13
 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
f5b95be8b6e2 8205441: Upgrade to harfbuzz 1.8.1
prr
parents:
diff changeset
    14
 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
f5b95be8b6e2 8205441: Upgrade to harfbuzz 1.8.1
prr
parents:
diff changeset
    15
 * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
f5b95be8b6e2 8205441: Upgrade to harfbuzz 1.8.1
prr
parents:
diff changeset
    16
 * DAMAGE.
f5b95be8b6e2 8205441: Upgrade to harfbuzz 1.8.1
prr
parents:
diff changeset
    17
 *
f5b95be8b6e2 8205441: Upgrade to harfbuzz 1.8.1
prr
parents:
diff changeset
    18
 * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
f5b95be8b6e2 8205441: Upgrade to harfbuzz 1.8.1
prr
parents:
diff changeset
    19
 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
f5b95be8b6e2 8205441: Upgrade to harfbuzz 1.8.1
prr
parents:
diff changeset
    20
 * FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
f5b95be8b6e2 8205441: Upgrade to harfbuzz 1.8.1
prr
parents:
diff changeset
    21
 * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
f5b95be8b6e2 8205441: Upgrade to harfbuzz 1.8.1
prr
parents:
diff changeset
    22
 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
f5b95be8b6e2 8205441: Upgrade to harfbuzz 1.8.1
prr
parents:
diff changeset
    23
 *
f5b95be8b6e2 8205441: Upgrade to harfbuzz 1.8.1
prr
parents:
diff changeset
    24
 * Google Author(s): Behdad Esfahbod
f5b95be8b6e2 8205441: Upgrade to harfbuzz 1.8.1
prr
parents:
diff changeset
    25
 */
f5b95be8b6e2 8205441: Upgrade to harfbuzz 1.8.1
prr
parents:
diff changeset
    26
54232
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents: 50826
diff changeset
    27
#include "hb.hh"
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents: 50826
diff changeset
    28
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents: 50826
diff changeset
    29
#include "hb-open-type.hh"
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents: 50826
diff changeset
    30
#include "hb-face.hh"
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents: 50826
diff changeset
    31
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents: 50826
diff changeset
    32
#include "hb-aat-layout-common.hh"
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents: 50826
diff changeset
    33
#include "hb-aat-layout-feat-table.hh"
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents: 50826
diff changeset
    34
#include "hb-ot-layout-common.hh"
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents: 50826
diff changeset
    35
#include "hb-ot-cmap-table.hh"
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents: 50826
diff changeset
    36
#include "hb-ot-head-table.hh"
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents: 50826
diff changeset
    37
#include "hb-ot-maxp-table.hh"
50826
f5b95be8b6e2 8205441: Upgrade to harfbuzz 1.8.1
prr
parents:
diff changeset
    38
f5b95be8b6e2 8205441: Upgrade to harfbuzz 1.8.1
prr
parents:
diff changeset
    39
#ifndef HB_NO_VISIBILITY
54232
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents: 50826
diff changeset
    40
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents: 50826
diff changeset
    41
hb_vector_size_impl_t const _hb_NullPool[(HB_NULL_POOL_SIZE + sizeof (hb_vector_size_impl_t) - 1) / sizeof (hb_vector_size_impl_t)] = {};
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents: 50826
diff changeset
    42
/*thread_local*/ hb_vector_size_impl_t _hb_CrapPool[(HB_NULL_POOL_SIZE + sizeof (hb_vector_size_impl_t) - 1) / sizeof (hb_vector_size_impl_t)] = {};
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents: 50826
diff changeset
    43
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents: 50826
diff changeset
    44
DEFINE_NULL_NAMESPACE_BYTES (OT, Index) =  {0xFF,0xFF};
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents: 50826
diff changeset
    45
DEFINE_NULL_NAMESPACE_BYTES (OT, LangSys) = {0x00,0x00, 0xFF,0xFF, 0x00,0x00};
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents: 50826
diff changeset
    46
DEFINE_NULL_NAMESPACE_BYTES (OT, RangeRecord) = {0x00,0x01, 0x00,0x00, 0x00, 0x00};
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents: 50826
diff changeset
    47
DEFINE_NULL_NAMESPACE_BYTES (OT, CmapSubtableLongGroup) = {0x00,0x00,0x00,0x01, 0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00};
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents: 50826
diff changeset
    48
DEFINE_NULL_NAMESPACE_BYTES (AAT, SettingName) = {0xFF,0xFF, 0xFF,0xFF};
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents: 50826
diff changeset
    49
/* Hand-coded because Lookup is a template.  Sad. */
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents: 50826
diff changeset
    50
const unsigned char _hb_Null_AAT_Lookup[2] = {0xFF, 0xFF};
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents: 50826
diff changeset
    51
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents: 50826
diff changeset
    52
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents: 50826
diff changeset
    53
unsigned int
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents: 50826
diff changeset
    54
hb_face_t::load_num_glyphs () const
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents: 50826
diff changeset
    55
{
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents: 50826
diff changeset
    56
  hb_sanitize_context_t c = hb_sanitize_context_t ();
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents: 50826
diff changeset
    57
  c.set_num_glyphs (0); /* So we don't recurse ad infinitum. */
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents: 50826
diff changeset
    58
  hb_blob_t *maxp_blob = c.reference_table<OT::maxp> (this);
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents: 50826
diff changeset
    59
  const OT::maxp *maxp_table = maxp_blob->as<OT::maxp> ();
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents: 50826
diff changeset
    60
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents: 50826
diff changeset
    61
  unsigned int ret = maxp_table->get_num_glyphs ();
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents: 50826
diff changeset
    62
  num_glyphs.set_relaxed (ret);
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents: 50826
diff changeset
    63
  hb_blob_destroy (maxp_blob);
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents: 50826
diff changeset
    64
  return ret;
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents: 50826
diff changeset
    65
}
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents: 50826
diff changeset
    66
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents: 50826
diff changeset
    67
unsigned int
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents: 50826
diff changeset
    68
hb_face_t::load_upem () const
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents: 50826
diff changeset
    69
{
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents: 50826
diff changeset
    70
  unsigned int ret = table.head->get_upem ();
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents: 50826
diff changeset
    71
  upem.set_relaxed (ret);
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents: 50826
diff changeset
    72
  return ret;
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents: 50826
diff changeset
    73
}
7c11a7cc7c1d 8210782: Upgrade HarfBuzz to the latest 2.3.1
prr
parents: 50826
diff changeset
    74
50826
f5b95be8b6e2 8205441: Upgrade to harfbuzz 1.8.1
prr
parents:
diff changeset
    75
#endif