Skip to content

Commit

Permalink
Update HarfBuzz from Chromium 112.0.5615.134
Browse files Browse the repository at this point in the history
Issue: 326748668
Reviewed-on: #3154
  • Loading branch information
dahlstrom-g committed May 4, 2024
2 parents 35f7288 + d199c77 commit d7a1523
Show file tree
Hide file tree
Showing 3,434 changed files with 204,531 additions and 47,109 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion cobalt/renderer/rasterizer/skia/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ static_library("common") {
"//cobalt/math",
"//cobalt/render_tree",
"//cobalt/renderer/rasterizer/skia/skia",
"//third_party/harfbuzz-ng",
"//third_party:freetype_harfbuzz",
"//third_party/icu:icuuc",
"//third_party/ots",
]
Expand Down
2 changes: 1 addition & 1 deletion cobalt/renderer/rasterizer/skia/harfbuzz_font.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <map>

#include "cobalt/renderer/rasterizer/skia/font.h"
#include "third_party/harfbuzz-ng/src/hb.h"
#include "third_party/harfbuzz-ng/src/src/hb.h"
#include "third_party/skia/include/core/SkTypeface.h"

namespace cobalt {
Expand Down
4 changes: 2 additions & 2 deletions cobalt/renderer/rasterizer/skia/skia/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ skia_common("skia_library") {
":skia_library_no_asan",
"//base",
"//starboard/common",
"//third_party/freetype",
"//third_party:freetype_harfbuzz",
"//third_party/libpng",
"//third_party/skia/third_party/skcms",
"//third_party/zlib",
Expand Down Expand Up @@ -161,7 +161,7 @@ skia_common("skia") {
"//cobalt/renderer:renderer_headers_only",
"//starboard:starboard_headers_only",
"//starboard/common",
"//third_party/freetype",
"//third_party:freetype_harfbuzz",
"//third_party/libxml",
]

Expand Down
4 changes: 2 additions & 2 deletions cobalt/renderer/rasterizer/skia/text_shaper.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
#include "cobalt/renderer/rasterizer/skia/font.h"
#include "cobalt/renderer/rasterizer/skia/glyph_buffer.h"
#include "cobalt/renderer/rasterizer/skia/harfbuzz_font.h"
#include "third_party/harfbuzz-ng/src/hb-icu.h"
#include "third_party/harfbuzz-ng/src/hb.h"
#include "third_party/harfbuzz-ng/src/src/hb-icu.h"
#include "third_party/harfbuzz-ng/src/src/hb.h"
#include "third_party/icu/source/common/unicode/uscript.h"
#include "third_party/skia/include/core/SkTextBlob.h"

Expand Down
63 changes: 63 additions & 0 deletions third_party/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Copyright 2014 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//build/config/features.gni")
import("//build/config/freetype/freetype.gni")
import("//third_party/harfbuzz-ng/harfbuzz.gni")
import("//third_party/libjpeg.gni")

config("system_libjpeg_config") {
libs = [ "jpeg" ]
defines = [ "USE_SYSTEM_LIBJPEG" ]
}

config("libjpeg_turbo_config") {
defines = [ "USE_LIBJPEG_TURBO=1" ]
}

# This is a meta target that forwards to the system's libjpeg,
# third_party/libjpeg, or third_party/libjpeg_turbo depending on the build args
# declared in this file.
group("jpeg") {
if (use_system_libjpeg) {
public_configs = [ ":system_libjpeg_config" ]
} else if (use_libjpeg_turbo) {
public_deps = [ "//third_party/libjpeg_turbo:libjpeg" ]
public_configs = [ ":libjpeg_turbo_config" ]
} else {
public_deps = [ "//third_party/libjpeg:libjpeg" ]
}
}

# This is a meta target that forwards include paths only to the system's
# libjpeg, third_party/libjpeg, or third_party/libjpeg_turbo depending on the
# build args declared in this file. This is needed, rarely, for targets that
# need to reference libjpeg without explicitly building it.
group("jpeg_includes") {
if (use_system_libjpeg) {
public_configs = [ ":system_libjpeg_config" ]
} else if (use_libjpeg_turbo) {
public_configs = [ "//third_party/libjpeg_turbo:libjpeg_config" ]
} else {
public_configs = [ "//third_party/libjpeg:libjpeg_config" ]
}
}

# FreeType and HarfBuzz libraries are dependent on each other. This component
# will depend on the appropriate source sets or export the system packages
# for both FreeType and HarfBuzz.
component("freetype_harfbuzz") {
public_configs = []
public_deps = []
if (use_system_freetype) {
public_configs += [ "//build/linux:freetype_from_pkgconfig" ]
} else {
public_deps += [ "//third_party/freetype:freetype_source" ]
}
if (use_system_harfbuzz) {
public_configs += [ "//third_party/harfbuzz-ng:harfbuzz_from_pkgconfig" ]
} else {
public_deps += [ "//third_party/harfbuzz-ng:harfbuzz_source" ]
}
}
13 changes: 13 additions & 0 deletions third_party/DEPS
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Undo everything in the include_rules section of src/DEPS.
include_rules = [
'-base',
'-build',
'-ipc',
'-third_party/perfetto/include/perfetto/tracing',
'-third_party/perfetto/include/perfetto/test',
'-library_loaders',
'-testing',
'-third_party/icu/source/common/unicode',
'-third_party/icu/source/i18n/unicode',
'-url',
]
15 changes: 15 additions & 0 deletions third_party/METADATA
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
third_party {
identifier {
type: "ChromiumVersion"
value: "114.0.5735.358" # from https://chromereleases.googleblog.com/2024/03/long-term-support-channel-update-for_26.html
}
identifier {
type: "Git"
value: "https://chromium.googlesource.com/chromium/src.git"
version: "1759c6ae9316996b9f150c0ce9d0ca78a3d15c02"
}
identifier {
type: "UpstreamSubdir"
value: "third_party"
}
}
27 changes: 26 additions & 1 deletion third_party/OWNERS
Original file line number Diff line number Diff line change
@@ -1 +1,26 @@
*
# Owner approval for 3rd party is only required for
# adding new libraries. Be sure to follow the instructions for adding
# new third party libraries.
#
# https://chromium.googlesource.com/chromium/src.git/+/main/docs/adding_to_third_party.md
#
# For changes to existing code that has no OWNER file, simply TBR= one of
# people below in addition to getting an appropriate code review. Generally
# third_party modules should have owners, so if you find yourself doing this
# more than once or twice for a directory, consider adding an OWNER file. If
# you're making changes and there isn't a more obvious person, the owner is
# probably you!

# ATL reviewer
file://ATL_OWNERS

# Automatic round-robin assignment of reviewer for third-party licenses.
# No one receives email to this list, just use it as a reviewer.
chromium-third-party@google.com

thakis@chromium.org

per-file .gitignore=*

# Translation artifacts:
per-file ....xtb=file://tools/translation/TRANSLATION_OWNERS
165 changes: 165 additions & 0 deletions third_party/PRESUBMIT.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
# Copyright 2011 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import os

USE_PYTHON3 = True

PRESUBMIT_VERSION = '2.0.0'

ANDROID_ALLOWED_LICENSES = [
'A(pple )?PSL 2(\.0)?',
'Android Software Development Kit License',
'Apache( License)?,?( Version)? 2(\.0)?',
'(New )?([23]-Clause )?BSD( [23]-Clause)?( with advertising clause)?',
'GNU Lesser Public License',
'L?GPL ?v?2(\.[01])?( or later)?( with the classpath exception)?',
'(The )?MIT(/X11)?(-like)?( License)?',
'MPL 1\.1 ?/ ?GPL 2(\.0)? ?/ ?LGPL 2\.1',
'MPL 2(\.0)?',
'Microsoft Limited Public License',
'Microsoft Permissive License',
'Public Domain',
'Python',
'SIL Open Font License, Version 1.1',
'SGI Free Software License B',
'Unicode, Inc. License',
'University of Illinois\/NCSA Open Source',
'X11',
'Zlib',
]

def LicenseIsCompatibleWithAndroid(input_api, license):
regex = '^(%s)$' % '|'.join(ANDROID_ALLOWED_LICENSES)
tokens = \
[x.strip() for x in input_api.re.split(' and |,', license) if len(x) > 0]
has_compatible_license = False
for token in tokens:
if input_api.re.match(regex, token, input_api.re.IGNORECASE):
has_compatible_license = True
break
return has_compatible_license

def CheckThirdPartyReadmesUpdated(input_api, output_api):
"""
Checks to make sure that README.chromium files are properly updated
when dependencies in third_party are modified.
"""
readmes = []
files = []
errors = []
for f in input_api.AffectedFiles():
local_path = f.LocalPath()
if input_api.os_path.dirname(local_path) == 'third_party':
continue
if (local_path.startswith('third_party' + input_api.os_path.sep) and
not local_path.startswith('third_party' + input_api.os_path.sep +
'blink' + input_api.os_path.sep) and
not local_path.startswith('third_party' + input_api.os_path.sep +
'boringssl' + input_api.os_path.sep) and
not local_path.startswith('third_party' + input_api.os_path.sep +
'closure_compiler' + input_api.os_path.sep +
'externs' + input_api.os_path.sep) and
not local_path.startswith('third_party' + input_api.os_path.sep +
'closure_compiler' + input_api.os_path.sep +
'interfaces' + input_api.os_path.sep) and
not local_path.startswith('third_party' + input_api.os_path.sep +
'feed_library' + input_api.os_path.sep) and
not local_path.startswith('third_party' + input_api.os_path.sep +
'ipcz' + input_api.os_path.sep) and
# TODO(danakj): We should look for the README.chromium file in
# third_party/rust/CRATE_NAME/vVERSION/.
not local_path.startswith('third_party' + input_api.os_path.sep +
'rust' + input_api.os_path.sep) and
not local_path.startswith('third_party' + input_api.os_path.sep +
'webxr_test_pages' + input_api.os_path.sep)):
files.append(f)
if local_path.endswith("README.chromium"):
readmes.append(f)
if files and not readmes:
errors.append(output_api.PresubmitPromptWarning(
'When updating or adding third party code the appropriate\n'
'\'README.chromium\' file should also be updated with the correct\n'
'version and package information.', files))
if not readmes:
return errors

name_pattern = input_api.re.compile(
r'^Name: [a-zA-Z0-9_\-\. \(\)]+\r?$',
input_api.re.IGNORECASE | input_api.re.MULTILINE)
shortname_pattern = input_api.re.compile(
r'^Short Name: [a-zA-Z0-9_\-\.]+\r?$',
input_api.re.IGNORECASE | input_api.re.MULTILINE)
version_pattern = input_api.re.compile(
r'^Version: [a-zA-Z0-9_\-\+\.:/]+\r?$',
input_api.re.IGNORECASE | input_api.re.MULTILINE)
release_pattern = input_api.re.compile(
r'^Security Critical: (yes|no)\r?$',
input_api.re.IGNORECASE | input_api.re.MULTILINE)
license_pattern = input_api.re.compile(
r'^License: (.+)\r?$',
input_api.re.IGNORECASE | input_api.re.MULTILINE)
not_shipped_pattern = input_api.re.compile(
r'^License File: NOT_SHIPPED\r?$',
input_api.re.IGNORECASE | input_api.re.MULTILINE)
license_android_compatible_pattern = input_api.re.compile(
r'^License Android Compatible: (yes|no)\r?$',
input_api.re.IGNORECASE | input_api.re.MULTILINE)

for f in readmes:
if 'D' in f.Action():
_IgnoreIfDeleting(input_api, output_api, f, errors)
continue

contents = input_api.ReadFile(f)
if (not shortname_pattern.search(contents)
and not name_pattern.search(contents)):
errors.append(output_api.PresubmitError(
'Third party README files should contain either a \'Short Name\' or\n'
'a \'Name\' which is the name under which the package is\n'
'distributed. Check README.chromium.template for details.',
[f]))
if not version_pattern.search(contents):
errors.append(output_api.PresubmitError(
'Third party README files should contain a \'Version\' field.\n'
'If the package is not versioned or the version is not known\n'
'list the version as \'unknown\'.\n'
'Check README.chromium.template for details.',
[f]))
if not release_pattern.search(contents):
errors.append(output_api.PresubmitError(
'Third party README files should contain a \'Security Critical\'\n'
'field. This field specifies whether the package is built with\n'
'Chromium. Check README.chromium.template for details.',
[f]))
license_match = license_pattern.search(contents)
if not license_match:
errors.append(output_api.PresubmitError(
'Third party README files should contain a \'License\' field.\n'
'This field specifies the license used by the package. Check\n'
'README.chromium.template for details.',
[f]))
not_shipped_match = not_shipped_pattern.search(contents)
android_compatible_match = (
license_android_compatible_pattern.search(contents))
if (not not_shipped_match and not android_compatible_match and
not LicenseIsCompatibleWithAndroid(input_api, license_match.group(1))):
errors.append(output_api.PresubmitPromptWarning(
'Cannot determine whether specified license is compatible with\n' +
'the Android licensing requirements. Please check that the license\n' +
'name is spelled according to third_party/PRESUBMIT.py. Please see\n' +
'README.chromium.template for details.',
[f]))
return errors


def _IgnoreIfDeleting(input_api, output_api, affected_file, errors):
third_party_dir = input_api.os_path.dirname(affected_file.LocalPath()) + \
os.path.sep
for f in input_api.AffectedFiles():
if f.LocalPath().startswith(third_party_dir):
if 'D' not in f.Action():
errors.append(output_api.PresubmitError(
'Third party README should only be removed when the whole\n'
'directory is being removed.\n', [f, affected_file]))
10 changes: 0 additions & 10 deletions third_party/README.chromium

This file was deleted.

33 changes: 17 additions & 16 deletions third_party/README.chromium.template
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
Name: Descriptive name of the package
Short Name: Name the package is distributed under (ex. libxml, openssl, etc)
URL: The URL where the package lives
Version: A searchable version number for the package (if the package does not version or is versioned by date or revision this field should be "0" and the revision, or date should be enumerated in the appropriate field)
Date: (OPTIONAL if version is supplied) The date that the package was updated
Revision: (OPTIONAL if version is supplied) The current revision of the package
License: The license under which the package is distributed. Arbitrary text is allowed, but prefer standard forms, eg MIT/X11/BSD/Apache 2.0/GPL/LGPL.
License File: (OPTIONAL) File that contains a copy of the package's license. Use the special value NOT_SHIPPED to indicate that the package is not included in the shipped product, so its license does not need to be included in about:credits and no license file is required.
Security Critical: Either yes or no depending on whether this package is shipped in releases. For example openssl is critical where cygwin is not.
License Android Compatible: (OPTIONAL) Whether the package uses a license compatible with Android. Required only if the package is compatible and the 'License' field uses a non-standard value.

Description:
A short description of what the package is and is used for.

Local Modifications:
Enumerate any changes that have been made locally to the package from the shipping version listed above.
Name: Descriptive name of the package
Short Name: Name the package is distributed under (ex. libxml, openssl, etc)
URL: The URL where the package lives
Version: A searchable version number for the package (if the package does not version or is versioned by date or revision this field should be "0" and the revision, or date should be enumerated in the appropriate field)
Date: (OPTIONAL if version is supplied) The date that the package was updated
Revision: (OPTIONAL if version is supplied) The current revision of the package
License: The license under which the package is distributed. Standard forms are only accepted, eg MIT/X11/BSD/Apache 2.0/GPL/LGPL. See ANDROID_ALLOWED_LICENSES in PRESUBMIT.py for allowed patterns.
License File: (OPTIONAL) File that contains a copy of the package's license. Use the special value NOT_SHIPPED to indicate that the package is not included in the shipped product, so its license does not need to be included in about:credits and no license file is required.
Security Critical: Either yes or no depending on whether this package is shipped in releases. For example openssl is critical where cygwin is not.
License Android Compatible: (OPTIONAL) Whether the package uses a license compatible with Android. Required only if the package is compatible and the 'License' field uses a non-standard value.
CPEPrefix: (OPTIONAL) A 'common platform enumeration' version 2.2, as per https://nvd.nist.gov/products/cpe/search, which represents the upstream package. This will be used to report known vulnerabilities in the upstream software package, such that we can be sure to merge fixes for those vulnerabilities. Please ensure you're using the closest applicable upstream version, according to the standard format for the CPE for that package. For example, cpe:/a:xmlsoft:libxslt:1.0.10. If no CPE is available for the package, please specify "unknown". If you're using a patched or modified version which is halfway between two public versions, please "round downwards" to the lower of the public versions (it's better for us to be notified of false-positive vulnerabilities than false-negatives).

Description:
A short description of what the package is and is used for.

Local Modifications:
Enumerate any changes that have been made locally to the package from the shipping version listed above.
5 changes: 5 additions & 0 deletions third_party/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
The third_party directory contains sources from other projects.

For guidelines on adding a new package to the third_party directory
can be found at
[//docs/adding_to_third_party.md](../docs/adding_to_third_party.md)

0 comments on commit d7a1523

Please sign in to comment.