Commit 3ee20833 authored by Dominik Röttsches's avatar Dominik Röttsches Committed by Commit Bot

Manage HarfBuzz dependency using DEPS mechanism

Remove src/ from Chromium repo and retrieve HarfBuzz sources from the
mirror at [1].

Cherry picks can be done by HarfBuzz OWNERS by pushing new branches to
refs/heads/chromium/ of [1].

This was tested and confirmed working in::
https://chromium-review.googlesource.com/c/chromium/src/+/937502

[1] https://chromium.googlesource.com/external/github.com/harfbuzz/harfbuzz/

Bug: 814305
Change-Id: I8760f734839012b1c9c9b9b07f11fa71000e5531
Reviewed-on: https://chromium-review.googlesource.com/928761Reviewed-by: default avatarBen Wagner <bungeman@chromium.org>
Reviewed-by: default avatarBehdad Esfahbod <behdad@chromium.org>
Reviewed-by: default avatarEmil A Eklund <eae@chromium.org>
Commit-Queue: Dominik Röttsches <drott@chromium.org>
Cr-Commit-Position: refs/heads/master@{#544043}
parent 610ee355
......@@ -133,6 +133,10 @@ vars = {
# and whatever else without interference from each other.
'freetype_revision': '713d68ee9f47cc8df56e47fa2f54b191bb8c3186',
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling HarfBuzz
# and whatever else without interference from each other.
'harfbuzz_revision': '957e7756634a4fdf1654041e20e883cf964ecac9',
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling catapult
# and whatever else without interference from each other.
'catapult_revision': 'fa0f0f2dd7e9ee09a5bed38bba060750d92c2ef2',
......@@ -382,6 +386,9 @@ deps = {
'src/third_party/freetype/src':
Var('chromium_git') + '/chromium/src/third_party/freetype2.git' + '@' + Var('freetype_revision'),
'src/third_party/harfbuzz-ng/src':
Var('chromium_git') + '/external/github.com/harfbuzz/harfbuzz.git' + '@' + Var('harfbuzz_revision'),
# Chrome OS touchpad gestures library.
'src/third_party/gestures/gestures': {
'url': Var('chromium_git') + '/chromiumos/platform/gestures.git' + '@' + '74f55100df966280d305d5d5ada824605f875839',
......
......@@ -15,3 +15,4 @@ A PNG image exploded nearby, "Aw Snap!". What was that?
T'was the sound of a broken interval record.
But the data was inacurate.
......@@ -20,7 +20,7 @@ if (use_system_harfbuzz) {
}
} else {
config("harfbuzz_config") {
include_dirs = [ "src" ]
include_dirs = [ "src/src" ]
}
config("harfbuzz_warnings") {
......@@ -45,130 +45,130 @@ if (use_system_harfbuzz) {
visibility = [ "//third_party:freetype_harfbuzz" ]
sources = [
"src/hb-atomic-private.hh",
"src/hb-blob.cc",
"src/hb-blob.h",
"src/hb-buffer-deserialize-json.hh",
"src/hb-buffer-deserialize-text.hh",
"src/hb-buffer-private.hh",
"src/hb-buffer-serialize.cc",
"src/hb-buffer.cc",
"src/hb-buffer.h",
"src/hb-cache-private.hh",
"src/hb-common.cc",
"src/hb-common.h",
"src/hb-debug.hh",
"src/hb-deprecated.h",
"src/hb-dsalgs.hh",
"src/hb-face-private.hh",
"src/hb-face.cc",
"src/hb-face.h",
"src/hb-font-private.hh",
"src/hb-font.cc",
"src/hb-font.h",
"src/hb-ft.cc",
"src/hb-ft.h",
"src/hb-icu.cc",
"src/hb-icu.h",
"src/hb-mutex-private.hh",
"src/hb-object-private.hh",
"src/hb-open-file-private.hh",
"src/hb-open-type-private.hh",
"src/hb-ot-color-cbdt-table.hh",
"src/hb-ot-color-colr-table.hh",
"src/hb-ot-color-cpal-table.hh",
"src/hb-ot-font.cc",
"src/hb-ot-font.h",
"src/hb-ot-hdmx-table.hh",
"src/hb-ot-head-table.hh",
"src/hb-ot-hhea-table.hh",
"src/hb-ot-hmtx-table.hh",
"src/hb-ot-kern-table.hh",
"src/hb-ot-layout-base-table.hh",
"src/hb-ot-layout-base-table.hh",
"src/hb-ot-layout-common-private.hh",
"src/hb-ot-layout-gdef-table.hh",
"src/hb-ot-layout-gpos-table.hh",
"src/hb-ot-layout-gsub-table.hh",
"src/hb-ot-layout-gsubgpos-private.hh",
"src/hb-ot-layout-private.hh",
"src/hb-ot-layout.cc",
"src/hb-ot-layout.h",
"src/hb-ot-map-private.hh",
"src/hb-ot-map.cc",
"src/hb-ot-math-table.hh",
"src/hb-ot-math.cc",
"src/hb-ot-math.h",
"src/hb-ot-maxp-table.hh",
"src/hb-ot-name-table.hh",
"src/hb-ot-os2-unicode-ranges.hh",
"src/hb-ot-post-macroman.hh",
"src/hb-ot-shape-complex-arabic-fallback.hh",
"src/hb-ot-shape-complex-arabic-private.hh",
"src/hb-ot-shape-complex-arabic-table.hh",
"src/hb-ot-shape-complex-arabic.cc",
"src/hb-ot-shape-complex-default.cc",
"src/hb-ot-shape-complex-hangul.cc",
"src/hb-ot-shape-complex-hebrew.cc",
"src/hb-ot-shape-complex-indic-machine.hh",
"src/hb-ot-shape-complex-indic-private.hh",
"src/hb-ot-shape-complex-indic-table.cc",
"src/hb-ot-shape-complex-indic.cc",
"src/hb-ot-shape-complex-khmer-machine.hh",
"src/hb-ot-shape-complex-khmer-private.hh",
"src/hb-ot-shape-complex-khmer.cc",
"src/hb-ot-shape-complex-myanmar-machine.hh",
"src/hb-ot-shape-complex-myanmar-private.hh",
"src/hb-ot-shape-complex-myanmar.cc",
"src/hb-ot-shape-complex-private.hh",
"src/hb-ot-shape-complex-thai.cc",
"src/hb-ot-shape-complex-tibetan.cc",
"src/hb-ot-shape-complex-use-machine.hh",
"src/hb-ot-shape-complex-use-private.hh",
"src/hb-ot-shape-complex-use-table.cc",
"src/hb-ot-shape-complex-use.cc",
"src/hb-ot-shape-fallback-private.hh",
"src/hb-ot-shape-fallback.cc",
"src/hb-ot-shape-normalize-private.hh",
"src/hb-ot-shape-normalize.cc",
"src/hb-ot-shape-private.hh",
"src/hb-ot-shape.cc",
"src/hb-ot-shape.h",
"src/hb-ot-tag.cc",
"src/hb-ot-tag.h",
"src/hb-ot-var-avar-table.hh",
"src/hb-ot-var-fvar-table.hh",
"src/hb-ot-var-hvar-table.hh",
"src/hb-ot-var-mvar-table.hh",
"src/hb-ot-var.cc",
"src/hb-ot-var.h",
"src/hb-ot.h",
"src/hb-private.hh",
"src/hb-set-digest-private.hh",
"src/hb-set-private.hh",
"src/hb-set.cc",
"src/hb-set.h",
"src/hb-shape-plan-private.hh",
"src/hb-shape-plan.cc",
"src/hb-shape-plan.h",
"src/hb-shape.cc",
"src/hb-shape.h",
"src/hb-shaper-impl-private.hh",
"src/hb-shaper-list.hh",
"src/hb-shaper-private.hh",
"src/hb-shaper.cc",
"src/hb-string-array.hh",
"src/hb-subset-glyf.hh",
"src/hb-subset-plan.h",
"src/hb-subset-private.hh",
"src/hb-subset.h",
"src/hb-unicode-private.hh",
"src/hb-unicode.cc",
"src/hb-unicode.h",
"src/hb-utf-private.hh",
"src/hb-version.h",
"src/hb-warning.cc",
"src/hb.h",
"src/src/hb-atomic-private.hh",
"src/src/hb-blob.cc",
"src/src/hb-blob.h",
"src/src/hb-buffer-deserialize-json.hh",
"src/src/hb-buffer-deserialize-text.hh",
"src/src/hb-buffer-private.hh",
"src/src/hb-buffer-serialize.cc",
"src/src/hb-buffer.cc",
"src/src/hb-buffer.h",
"src/src/hb-cache-private.hh",
"src/src/hb-common.cc",
"src/src/hb-common.h",
"src/src/hb-debug.hh",
"src/src/hb-deprecated.h",
"src/src/hb-dsalgs.hh",
"src/src/hb-face-private.hh",
"src/src/hb-face.cc",
"src/src/hb-face.h",
"src/src/hb-font-private.hh",
"src/src/hb-font.cc",
"src/src/hb-font.h",
"src/src/hb-ft.cc",
"src/src/hb-ft.h",
"src/src/hb-icu.cc",
"src/src/hb-icu.h",
"src/src/hb-mutex-private.hh",
"src/src/hb-object-private.hh",
"src/src/hb-open-file-private.hh",
"src/src/hb-open-type-private.hh",
"src/src/hb-ot-color-cbdt-table.hh",
"src/src/hb-ot-color-colr-table.hh",
"src/src/hb-ot-color-cpal-table.hh",
"src/src/hb-ot-font.cc",
"src/src/hb-ot-font.h",
"src/src/hb-ot-hdmx-table.hh",
"src/src/hb-ot-head-table.hh",
"src/src/hb-ot-hhea-table.hh",
"src/src/hb-ot-hmtx-table.hh",
"src/src/hb-ot-kern-table.hh",
"src/src/hb-ot-layout-base-table.hh",
"src/src/hb-ot-layout-base-table.hh",
"src/src/hb-ot-layout-common-private.hh",
"src/src/hb-ot-layout-gdef-table.hh",
"src/src/hb-ot-layout-gpos-table.hh",
"src/src/hb-ot-layout-gsub-table.hh",
"src/src/hb-ot-layout-gsubgpos-private.hh",
"src/src/hb-ot-layout-private.hh",
"src/src/hb-ot-layout.cc",
"src/src/hb-ot-layout.h",
"src/src/hb-ot-map-private.hh",
"src/src/hb-ot-map.cc",
"src/src/hb-ot-math-table.hh",
"src/src/hb-ot-math.cc",
"src/src/hb-ot-math.h",
"src/src/hb-ot-maxp-table.hh",
"src/src/hb-ot-name-table.hh",
"src/src/hb-ot-os2-unicode-ranges.hh",
"src/src/hb-ot-post-macroman.hh",
"src/src/hb-ot-shape-complex-arabic-fallback.hh",
"src/src/hb-ot-shape-complex-arabic-private.hh",
"src/src/hb-ot-shape-complex-arabic-table.hh",
"src/src/hb-ot-shape-complex-arabic.cc",
"src/src/hb-ot-shape-complex-default.cc",
"src/src/hb-ot-shape-complex-hangul.cc",
"src/src/hb-ot-shape-complex-hebrew.cc",
"src/src/hb-ot-shape-complex-indic-machine.hh",
"src/src/hb-ot-shape-complex-indic-private.hh",
"src/src/hb-ot-shape-complex-indic-table.cc",
"src/src/hb-ot-shape-complex-indic.cc",
"src/src/hb-ot-shape-complex-khmer-machine.hh",
"src/src/hb-ot-shape-complex-khmer-private.hh",
"src/src/hb-ot-shape-complex-khmer.cc",
"src/src/hb-ot-shape-complex-myanmar-machine.hh",
"src/src/hb-ot-shape-complex-myanmar-private.hh",
"src/src/hb-ot-shape-complex-myanmar.cc",
"src/src/hb-ot-shape-complex-private.hh",
"src/src/hb-ot-shape-complex-thai.cc",
"src/src/hb-ot-shape-complex-tibetan.cc",
"src/src/hb-ot-shape-complex-use-machine.hh",
"src/src/hb-ot-shape-complex-use-private.hh",
"src/src/hb-ot-shape-complex-use-table.cc",
"src/src/hb-ot-shape-complex-use.cc",
"src/src/hb-ot-shape-fallback-private.hh",
"src/src/hb-ot-shape-fallback.cc",
"src/src/hb-ot-shape-normalize-private.hh",
"src/src/hb-ot-shape-normalize.cc",
"src/src/hb-ot-shape-private.hh",
"src/src/hb-ot-shape.cc",
"src/src/hb-ot-shape.h",
"src/src/hb-ot-tag.cc",
"src/src/hb-ot-tag.h",
"src/src/hb-ot-var-avar-table.hh",
"src/src/hb-ot-var-fvar-table.hh",
"src/src/hb-ot-var-hvar-table.hh",
"src/src/hb-ot-var-mvar-table.hh",
"src/src/hb-ot-var.cc",
"src/src/hb-ot-var.h",
"src/src/hb-ot.h",
"src/src/hb-private.hh",
"src/src/hb-set-digest-private.hh",
"src/src/hb-set-private.hh",
"src/src/hb-set.cc",
"src/src/hb-set.h",
"src/src/hb-shape-plan-private.hh",
"src/src/hb-shape-plan.cc",
"src/src/hb-shape-plan.h",
"src/src/hb-shape.cc",
"src/src/hb-shape.h",
"src/src/hb-shaper-impl-private.hh",
"src/src/hb-shaper-list.hh",
"src/src/hb-shaper-private.hh",
"src/src/hb-shaper.cc",
"src/src/hb-string-array.hh",
"src/src/hb-subset-glyf.hh",
"src/src/hb-subset-plan.h",
"src/src/hb-subset-private.hh",
"src/src/hb-subset.h",
"src/src/hb-unicode-private.hh",
"src/src/hb-unicode.cc",
"src/src/hb-unicode.h",
"src/src/hb-utf-private.hh",
"src/src/hb-version.h",
"src/src/hb-warning.cc",
"src/src/hb.h",
]
defines = [
......@@ -208,8 +208,8 @@ if (use_system_harfbuzz) {
if (is_mac) {
sources += [
"src/hb-coretext.cc",
"src/hb-coretext.h",
"src/src/hb-coretext.cc",
"src/src/hb-coretext.h",
]
defines += [ "HAVE_CORETEXT" ]
libs = [
......@@ -222,8 +222,8 @@ if (use_system_harfbuzz) {
if (use_glib) {
configs += [ "//build/config/linux:glib" ]
sources += [
"src/hb-glib.cc",
"src/hb-glib.h",
"src/src/hb-glib.cc",
"src/src/hb-glib.h",
]
}
}
......
HarfBuzz is licensed under the so-called "Old MIT" license. Details follow.
For parts of HarfBuzz that are licensed under different licenses see individual
files names COPYING in subdirectories where applicable.
Copyright © 2010,2011,2012 Google, Inc.
Copyright © 2012 Mozilla Foundation
Copyright © 2011 Codethink Limited
Copyright © 2008,2010 Nokia Corporation and/or its subsidiary(-ies)
Copyright © 2009 Keith Stribley
Copyright © 2009 Martin Hosken and SIL International
Copyright © 2007 Chris Wilson
Copyright © 2006 Behdad Esfahbod
Copyright © 2005 David Turner
Copyright © 2004,2007,2008,2009,2010 Red Hat, Inc.
Copyright © 1998-2004 David Turner and Werner Lemberg
For full copyright notices consult the individual files in the package.
Permission is hereby granted, without written agreement and without
license or royalty fees, to use, copy, modify, and distribute this
software and its documentation for any purpose, provided that the
above copyright notice and the following two paragraphs appear in
all copies of this software.
IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.
THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
This diff is collapsed.
[![Build Status](https://travis-ci.org/behdad/harfbuzz.svg)](https://travis-ci.org/behdad/harfbuzz)
[![Build Status](https://ci.appveyor.com/api/projects/status/4oaq58ns2h0m2soa?svg=true)](https://ci.appveyor.com/project/behdad/harfbuzz)
[![Coverage Status](https://img.shields.io/coveralls/behdad/harfbuzz.svg)](https://coveralls.io/r/behdad/harfbuzz)
[ABI Tracker](http://abi-laboratory.pro/tracker/timeline/harfbuzz/)
This is HarfBuzz, a text shaping library.
For bug reports, mailing list, and other information please visit:
http://harfbuzz.org/
For license information, see the file COPYING.
......@@ -2,23 +2,31 @@ Name: harfbuzz-ng
Short Name: harfbuzz-ng
URL: http://harfbuzz.org
Version: 1.7.6
Date: 20180307
Date: 20180319
Revision: 957e7756634a4fdf1654041e20e883cf964ecac9
Security Critical: yes
License: MIT
License File: COPYING
License File: src/COPYING
Description:
This is harfbuzz-ng, a new implementation of harfbuzz with a different
API from the old one.
This copy of harfbuzz is usually updated by downloading the release tarball from
http://www.freedesktop.org/software/harfbuzz/release/ , removing files in src,
copying *.h *.hh *.cc (except for the files below) from the tarball's src folder
over to src, then checking for removed or added files and update our build
recipes in BUILD.gn and harfbuzz.gyp accordingly, update the NEWS file from
HarfBuzz' release notes, and bump the version numbers in README.chromium.
This copy of harfbuzz is updated by putting the new commit hash matching one in
https://chromium.googlesource.com/external/github.com/harfbuzz/harfbuzz/ to the
top level DEPS file. When upgrading, check whether files have been added or
removed in upstream and whether the BUILD.gn file needs to be updated to reflect
that.
Currently the following files from HarfBuzz are unused and not copied:
Chromium-local cherry picks or patches can be done by pushing new branches to
refs/heads/chromium/ of [1]. The set of HarfBuzz OWNERS has write rights to this
part of the tree. We suggest to follow a pattern of naming branches needed for
Chromium revisions by the chromium milestone number. For example, if a
cherry-pick is needed for M65, push to "refs/heads/chromium/m65" and reference
the new commit in DEPS. Take a look at
https://chromium-review.googlesource.com/c/chromium/src/+/937502 for an example.
Currently we are intentionally not building the following files from HarfBuzz.
dump-indic-data.cc
dump-khmer-data.cc
dump-myanmar-data.cc
......
/*
* Copyright © 2007 Chris Wilson
* Copyright © 2009,2010 Red Hat, Inc.
* Copyright © 2011,2012 Google, Inc.
*
* This is part of HarfBuzz, a text shaping library.
*
* Permission is hereby granted, without written agreement and without
* license or royalty fees, to use, copy, modify, and distribute this
* software and its documentation for any purpose, provided that the
* above copyright notice and the following two paragraphs appear in
* all copies of this software.
*
* IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
* ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
* IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
* THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
* BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
* ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
*
* Contributor(s):
* Chris Wilson <chris@chris-wilson.co.uk>
* Red Hat Author(s): Behdad Esfahbod
* Google Author(s): Behdad Esfahbod
*/
#ifndef HB_ATOMIC_PRIVATE_HH
#define HB_ATOMIC_PRIVATE_HH
#include "hb-private.hh"
/* atomic_int */
/* We need external help for these */
#if defined(hb_atomic_int_impl_add) \
&& defined(hb_atomic_ptr_impl_get) \
&& defined(hb_atomic_ptr_impl_cmpexch)
/* Defined externally, i.e. in config.h; must have typedef'ed hb_atomic_int_impl_t as well. */
#elif !defined(HB_NO_MT) && (defined(_WIN32) || defined(__CYGWIN__))
#include <windows.h>
/* MinGW has a convoluted history of supporting MemoryBarrier
* properly. As such, define a function to wrap the whole
* thing. */
static inline void _HBMemoryBarrier (void) {
#if !defined(MemoryBarrier)
long dummy = 0;
InterlockedExchange (&dummy, 1);
#else
MemoryBarrier ();
#endif
}
typedef LONG hb_atomic_int_impl_t;
#define HB_ATOMIC_INT_IMPL_INIT(V) (V)
#define hb_atomic_int_impl_add(AI, V) InterlockedExchangeAdd (&(AI), (V))
#define hb_atomic_ptr_impl_get(P) (_HBMemoryBarrier (), (void *) *(P))
#define hb_atomic_ptr_impl_cmpexch(P,O,N) (InterlockedCompareExchangePointer ((void **) (P), (void *) (N), (void *) (O)) == (void *) (O))
#elif !defined(HB_NO_MT) && defined(HAVE_INTEL_ATOMIC_PRIMITIVES)
typedef int hb_atomic_int_impl_t;
#define HB_ATOMIC_INT_IMPL_INIT(V) (V)
#define hb_atomic_int_impl_add(AI, V) __sync_fetch_and_add (&(AI), (V))
#define hb_atomic_ptr_impl_get(P) (void *) (__sync_synchronize (), *(P))
#define hb_atomic_ptr_impl_cmpexch(P,O,N) __sync_bool_compare_and_swap ((P), (O), (N))
#elif !defined(HB_NO_MT) && defined(HAVE_SOLARIS_ATOMIC_OPS)
#include <atomic.h>
#include <mbarrier.h>
typedef unsigned int hb_atomic_int_impl_t;
#define HB_ATOMIC_INT_IMPL_INIT(V) (V)
#define hb_atomic_int_impl_add(AI, V) ( ({__machine_rw_barrier ();}), atomic_add_int_nv (&(AI), (V)) - (V))
#define hb_atomic_ptr_impl_get(P) ( ({__machine_rw_barrier ();}), (void *) *(P))
#define hb_atomic_ptr_impl_cmpexch(P,O,N) ( ({__machine_rw_barrier ();}), atomic_cas_ptr ((void **) (P), (void *) (O), (void *) (N)) == (void *) (O) ? true : false)
#elif !defined(HB_NO_MT) && defined(__APPLE__)
#include <libkern/OSAtomic.h>
#ifdef __MAC_OS_X_MIN_REQUIRED
#include <AvailabilityMacros.h>
#elif defined(__IPHONE_OS_MIN_REQUIRED)
#include <Availability.h>
#endif
typedef int32_t hb_atomic_int_impl_t;
#define HB_ATOMIC_INT_IMPL_INIT(V) (V)
#define hb_atomic_int_impl_add(AI, V) (OSAtomicAdd32Barrier ((V), &(AI)) - (V))
#define hb_atomic_ptr_impl_get(P) (OSMemoryBarrier (), (void *) *(P))
#if (MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_4 || __IPHONE_VERSION_MIN_REQUIRED >= 20100)
#define hb_atomic_ptr_impl_cmpexch(P,O,N) OSAtomicCompareAndSwapPtrBarrier ((void *) (O), (void *) (N), (void **) (P))
#else
#if __ppc64__ || __x86_64__ || __aarch64__
#define hb_atomic_ptr_impl_cmpexch(P,O,N) OSAtomicCompareAndSwap64Barrier ((int64_t) (void *) (O), (int64_t) (void *) (N), (int64_t*) (P))
#else
#define hb_atomic_ptr_impl_cmpexch(P,O,N) OSAtomicCompareAndSwap32Barrier ((int32_t) (void *) (O), (int32_t) (void *) (N), (int32_t*) (P))
#endif
#endif
#elif !defined(HB_NO_MT) && defined(_AIX) && defined(__IBMCPP__)
#include <builtins.h>
static inline int _hb_fetch_and_add(volatile int* AI, unsigned int V) {
__lwsync();
int result = __fetch_and_add(AI, V);
__isync();
return result;
}
static inline int _hb_compare_and_swaplp(volatile long* P, long O, long N) {
__sync();
int result = __compare_and_swaplp (P, &O, N);
__sync();
return result;
}
typedef int hb_atomic_int_impl_t;
#define HB_ATOMIC_INT_IMPL_INIT(V) (V)
#define hb_atomic_int_impl_add(AI, V) _hb_fetch_and_add (&(AI), (V))
#define hb_atomic_ptr_impl_get(P) (__sync(), (void *) *(P))
#define hb_atomic_ptr_impl_cmpexch(P,O,N) _hb_compare_and_swaplp ((long*)(P), (long)(O), (long)(N))
#elif !defined(HB_NO_MT)
#define HB_ATOMIC_INT_NIL 1 /* Warn that fallback implementation is in use. */
typedef volatile int hb_atomic_int_impl_t;
#define HB_ATOMIC_INT_IMPL_INIT(V) (V)
#define hb_atomic_int_impl_add(AI, V) (((AI) += (V)) - (V))
#define hb_atomic_ptr_impl_get(P) ((void *) *(P))
#define hb_atomic_ptr_impl_cmpexch(P,O,N) (* (void * volatile *) (P) == (void *) (O) ? (* (void * volatile *) (P) = (void *) (N), true) : false)
#else /* HB_NO_MT */
typedef int hb_atomic_int_impl_t;
#define HB_ATOMIC_INT_IMPL_INIT(V) (V)
#define hb_atomic_int_impl_add(AI, V) (((AI) += (V)) - (V))
#define hb_atomic_ptr_impl_get(P) ((void *) *(P))
#define hb_atomic_ptr_impl_cmpexch(P,O,N) (* (void **) (P) == (void *) (O) ? (* (void **) (P) = (void *) (N), true) : false)
#endif
#define HB_ATOMIC_INT_INIT(V) {HB_ATOMIC_INT_IMPL_INIT(V)}
struct hb_atomic_int_t
{
hb_atomic_int_impl_t v;
inline void set_unsafe (int v_) { v = v_; }
inline int get_unsafe (void) const { return v; }
inline int inc (void) { return hb_atomic_int_impl_add (const_cast<hb_atomic_int_impl_t &> (v), 1); }
inline int dec (void) { return hb_atomic_int_impl_add (const_cast<hb_atomic_int_impl_t &> (v), -1); }
};
#define hb_atomic_ptr_get(P) hb_atomic_ptr_impl_get(P)
#define hb_atomic_ptr_cmpexch(P,O,N) hb_atomic_ptr_impl_cmpexch((P),(O),(N))
#endif /* HB_ATOMIC_PRIVATE_HH */
This diff is collapsed.
/*
* Copyright © 2009 Red Hat, Inc.
*
* This is part of HarfBuzz, a text shaping library.
*
* Permission is hereby granted, without written agreement and without
* license or royalty fees, to use, copy, modify, and distribute this
* software and its documentation for any purpose, provided that the
* above copyright notice and the following two paragraphs appear in
* all copies of this software.
*
* IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
* ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
* IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
* THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
* BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
* ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
*
* Red Hat Author(s): Behdad Esfahbod
*/
#ifndef HB_H_IN
#error "Include <hb.h> instead."
#endif
#ifndef HB_BLOB_H
#define HB_BLOB_H
#include "hb-common.h"
HB_BEGIN_DECLS
/*
* Note re various memory-modes:
*
* - In no case shall the HarfBuzz client modify memory
* that is passed to HarfBuzz in a blob. If there is
* any such possibility, MODE_DUPLICATE should be used
* such that HarfBuzz makes a copy immediately,
*
* - Use MODE_READONLY otherwise, unless you really really
* really know what you are doing,
*
* - MODE_WRITABLE is appropriate if you really made a
* copy of data solely for the purpose of passing to
* HarfBuzz and doing that just once (no reuse!),
*
* - If the font is mmap()ed, it's ok to use
* READONLY_MAY_MAKE_WRITABLE, however, using that mode
* correctly is very tricky. Use MODE_READONLY instead.
*/
typedef enum {
HB_MEMORY_MODE_DUPLICATE,
HB_MEMORY_MODE_READONLY,
HB_MEMORY_MODE_WRITABLE,
HB_MEMORY_MODE_READONLY_MAY_MAKE_WRITABLE
} hb_memory_mode_t;
typedef struct hb_blob_t hb_blob_t;
HB_EXTERN hb_blob_t *
hb_blob_create (const char *data,
unsigned int length,
hb_memory_mode_t mode,
void *user_data,
hb_destroy_func_t destroy);
/* Always creates with MEMORY_MODE_READONLY.
* Even if the parent blob is writable, we don't
* want the user of the sub-blob to be able to
* modify the parent data as that data may be
* shared among multiple sub-blobs.
*/
HB_EXTERN hb_blob_t *
hb_blob_create_sub_blob (hb_blob_t *parent,
unsigned int offset,
unsigned int length);
HB_EXTERN hb_blob_t *
hb_blob_copy_writable_or_fail (hb_blob_t *blob);
HB_EXTERN hb_blob_t *
hb_blob_get_empty (void);
HB_EXTERN hb_blob_t *
hb_blob_reference (hb_blob_t *blob);
HB_EXTERN void
hb_blob_destroy (hb_blob_t *blob);
HB_EXTERN hb_bool_t
hb_blob_set_user_data (hb_blob_t *blob,
hb_user_data_key_t *key,
void * data,
hb_destroy_func_t destroy,
hb_bool_t replace);
HB_EXTERN void *
hb_blob_get_user_data (hb_blob_t *blob,
hb_user_data_key_t *key);
HB_EXTERN void
hb_blob_make_immutable (hb_blob_t *blob);
HB_EXTERN hb_bool_t
hb_blob_is_immutable (hb_blob_t *blob);
HB_EXTERN unsigned int
hb_blob_get_length (hb_blob_t *blob);
HB_EXTERN const char *
hb_blob_get_data (hb_blob_t *blob, unsigned int *length);
HB_EXTERN char *
hb_blob_get_data_writable (hb_blob_t *blob, unsigned int *length);
HB_END_DECLS
#endif /* HB_BLOB_H */
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/*
* Copyright © 2012 Mozilla Foundation.
*
* This is part of HarfBuzz, a text shaping library.
*
* Permission is hereby granted, without written agreement and without
* license or royalty fees, to use, copy, modify, and distribute this
* software and its documentation for any purpose, provided that the
* above copyright notice and the following two paragraphs appear in
* all copies of this software.
*
* IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
* ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
* IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
* THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
* BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
* ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
*
* Mozilla Author(s): Jonathan Kew
*/
#ifndef HB_CORETEXT_H
#define HB_CORETEXT_H
#include "hb.h"
#include <TargetConditionals.h>
#if TARGET_OS_IPHONE
# include <CoreText/CoreText.h>
# include <CoreGraphics/CoreGraphics.h>
#else
# include <ApplicationServices/ApplicationServices.h>
#endif
HB_BEGIN_DECLS
#define HB_CORETEXT_TAG_MORT HB_TAG('m','o','r','t')
#define HB_CORETEXT_TAG_MORX HB_TAG('m','o','r','x')
#define HB_CORETEXT_TAG_KERX HB_TAG('k','e','r','x')
HB_EXTERN hb_face_t *
hb_coretext_face_create (CGFontRef cg_font);
HB_EXTERN hb_font_t *
hb_coretext_font_create (CTFontRef ct_font);
HB_EXTERN CGFontRef
hb_coretext_face_get_cg_font (hb_face_t *face);
HB_EXTERN CTFontRef
hb_coretext_font_get_ct_font (hb_font_t *font);
HB_END_DECLS
#endif /* HB_CORETEXT_H */
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/*
* Copyright © 2009 Red Hat, Inc.
* Copyright © 2011 Google, Inc.
*
* This is part of HarfBuzz, a text shaping library.
*
* Permission is hereby granted, without written agreement and without
* license or royalty fees, to use, copy, modify, and distribute this
* software and its documentation for any purpose, provided that the
* above copyright notice and the following two paragraphs appear in
* all copies of this software.
*
* IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
* ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
* IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
* THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
* BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
* ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
*
* Red Hat Author(s): Behdad Esfahbod
* Google Author(s): Behdad Esfahbod
*/
#ifndef HB_GLIB_H
#define HB_GLIB_H
#include "hb.h"
#include <glib.h>
HB_BEGIN_DECLS
HB_EXTERN hb_script_t
hb_glib_script_to_script (GUnicodeScript script);
HB_EXTERN GUnicodeScript
hb_glib_script_from_script (hb_script_t script);
HB_EXTERN hb_unicode_funcs_t *
hb_glib_get_unicode_funcs (void);
#if GLIB_CHECK_VERSION(2,31,10)
HB_EXTERN hb_blob_t *
hb_glib_blob_create (GBytes *gbytes);
#endif
HB_END_DECLS
#endif /* HB_GLIB_H */
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment