Guest User

Untitled

a guest
Jan 26th, 2018
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 19.79 KB | None | 0 0
  1. diff --git i/build/config/freetype/BUILD.gn w/build/config/freetype/BUILD.gn
  2. index 0ba9027167..991419c9f3 100644
  3. --- i/build/config/freetype/BUILD.gn
  4. +++ w/build/config/freetype/BUILD.gn
  5. @@ -10,7 +10,7 @@ group("freetype") {
  6.      public_configs = [ "//build/linux:freetype_from_pkgconfig" ]
  7.    } else {
  8.      public_deps = [
  9. -      "//third_party:freetype_harfbuzz",
  10. +      "//third_party/freetype",
  11.      ]
  12.    }
  13.  }
  14. diff --git i/build/linux/BUILD.gn w/build/linux/BUILD.gn
  15. index 54314c7687..3d1a0fad97 100644
  16. --- i/build/linux/BUILD.gn
  17. +++ w/build/linux/BUILD.gn
  18. @@ -3,7 +3,6 @@
  19.  # found in the LICENSE file.
  20.  
  21.  import("//build/config/features.gni")
  22. -import("//build/config/freetype/freetype.gni")
  23.  import("//build/config/linux/pkg_config.gni")
  24.  
  25.  if (use_gio) {
  26. @@ -16,16 +15,11 @@ if (use_gio) {
  27.  
  28.  # Looking for libspeechd? Use //third_party/speech-dispatcher
  29.  
  30. -if (use_system_freetype) {
  31. -  assert(!is_chromecast)
  32. -
  33. +if (!is_chromecast) {
  34.    # Only provided for distributions which prefer to keep linking to FreeType on
  35.    # the system, use with caution,for details see build/config/freetype/BUILD.gn.
  36.    pkg_config("freetype_from_pkgconfig") {
  37. -    visibility = [
  38. -      "//third_party:freetype_harfbuzz",
  39. -      "//third_party/harfbuzz-ng:harfbuzz_source",
  40. -    ]
  41. +    visibility = [ ":freetype2" ]
  42.      packages = [ "freetype2" ]
  43.    }
  44.  }
  45. diff --git i/content/shell/BUILD.gn w/content/shell/BUILD.gn
  46. index e6abe24d2e..0e1fcc73e2 100644
  47. --- i/content/shell/BUILD.gn
  48. +++ w/content/shell/BUILD.gn
  49. @@ -394,7 +394,7 @@ static_library("content_shell_lib") {
  50.    }
  51.  
  52.    if (is_linux) {
  53. -    deps += [ "//build/config/freetype" ]
  54. +    deps += [ "//third_party/freetype" ]
  55.    }
  56.  
  57.    if (!enable_plugins) {
  58. diff --git i/headless/BUILD.gn w/headless/BUILD.gn
  59. index bf0905c2f7..9a9ed9fcc4 100644
  60. --- i/headless/BUILD.gn
  61. +++ w/headless/BUILD.gn
  62. @@ -249,8 +249,8 @@ if (headless_fontconfig_utils && !is_fuchsia) {
  63.      ]
  64.  
  65.      deps = [
  66. -      "//build/config/freetype",
  67.        "//third_party/fontconfig",
  68. +      "//third_party/freetype",
  69.      ]
  70.  
  71.      configs += [ ":headless_implementation" ]
  72. diff --git i/remoting/host/it2me/BUILD.gn w/remoting/host/it2me/BUILD.gn
  73. index 69e9583607..e732fe144d 100644
  74. --- i/remoting/host/it2me/BUILD.gn
  75. +++ w/remoting/host/it2me/BUILD.gn
  76. @@ -55,10 +55,10 @@ source_set("common") {
  77.      deps += [
  78.        "//build/config/linux/gtk",
  79.  
  80. -      # GTK pulls pangoft2, which requires HarfBuzz symbols. When linking
  81. -      # our own HarfBuzz avoid mixing symbols from system HarfBuzz and
  82. -      # our own through the indirect dependency to harfbuzz-ng here.
  83. -      "//third_party:freetype_harfbuzz",
  84. +      # GTK pulls pangoft2, which requires HarfBuzz symbols. Since we
  85. +      # link our own HarfBuzz, avoid mixing symbols from system HarfBuzz
  86. +      # and own ones, hence the dependency to harfbuzz-ng here.
  87. +      "//third_party/harfbuzz-ng",
  88.      ]
  89.    }
  90.  }
  91. diff --git i/third_party/BUILD.gn w/third_party/BUILD.gn
  92. index 7fccf382d8..1fa7ac45b2 100644
  93. --- i/third_party/BUILD.gn
  94. +++ w/third_party/BUILD.gn
  95. @@ -2,8 +2,9 @@
  96.  # Use of this source code is governed by a BSD-style license that can be
  97.  # found in the LICENSE file.
  98.  
  99. -import("//build/config/freetype/freetype.gni")
  100. -import("//third_party/harfbuzz-ng/harfbuzz.gni")
  101. +if (is_android) {
  102. +  import("//build/config/android/config.gni")
  103. +}
  104.  
  105.  assert(!is_ios, "This is not used on iOS, don't drag it in unintentionally")
  106.  
  107. @@ -56,21 +57,3 @@ group("jpeg_includes") {
  108.      public_configs = [ "//third_party/libjpeg:libjpeg_config" ]
  109.    }
  110.  }
  111. -
  112. -# FreeType and HarfBuzz libraries are dependent on each other. This component
  113. -# will depend on the appropriate source sets or export the system packages
  114. -# for both FreeType and HarfBuzz.
  115. -component("freetype_harfbuzz") {
  116. -  public_configs = []
  117. -  public_deps = []
  118. -  if (use_system_freetype) {
  119. -    public_configs += [ "//build/linux:freetype_from_pkgconfig" ]
  120. -  } else {
  121. -    public_deps += [ "//third_party/freetype:freetype_source" ]
  122. -  }
  123. -  if (use_system_harfbuzz) {
  124. -    public_configs += [ "//third_party/harfbuzz-ng:harfbuzz_from_pkgconfig" ]
  125. -  } else {
  126. -    public_deps += [ "//third_party/harfbuzz-ng:harfbuzz_source" ]
  127. -  }
  128. -}
  129. diff --git i/third_party/WebKit/Source/platform/BUILD.gn w/third_party/WebKit/Source/platform/BUILD.gn
  130. index 36ac2ec9aa..0d9d786579 100644
  131. --- i/third_party/WebKit/Source/platform/BUILD.gn
  132. +++ w/third_party/WebKit/Source/platform/BUILD.gn
  133. @@ -1557,9 +1557,9 @@ jumbo_component("platform") {
  134.      "//mojo/public/cpp/bindings",
  135.      "//mojo/public/cpp/bindings:wtf_support",
  136.      "//services/service_manager/public/cpp",
  137. -    "//third_party:freetype_harfbuzz",
  138.      "//third_party/WebKit/public:offscreen_canvas_mojo_bindings_blink",
  139.      "//third_party/ced",
  140. +    "//third_party/harfbuzz-ng",
  141.      "//third_party/icu",
  142.      "//ui/gfx",
  143.      "//ui/gfx/geometry",
  144. @@ -1753,7 +1753,6 @@ jumbo_static_library("test_support") {
  145.      "//components/viz/test:test_support",
  146.      "//testing/gmock",
  147.      "//testing/gtest:gtest",
  148. -    "//testing/perf",
  149.    ]
  150.  
  151.    deps = [
  152. @@ -1988,13 +1987,13 @@ jumbo_source_set("blink_platform_unittests_sources") {
  153.      "//skia",
  154.      "//testing/gmock",
  155.      "//testing/gtest",
  156. -    "//third_party:freetype_harfbuzz",
  157.      "//third_party/WebKit/Source/platform/blob:unit_tests",
  158.      "//third_party/WebKit/Source/platform/instrumentation:unit_tests",
  159.      "//third_party/WebKit/Source/platform/loader:unit_tests",
  160.      "//third_party/WebKit/Source/platform/network:unit_tests",
  161.      "//third_party/WebKit/Source/platform/scheduler:unit_tests",
  162.      "//third_party/WebKit/Source/platform/wtf",
  163. +    "//third_party/harfbuzz-ng",
  164.      "//ui/gfx",
  165.      "//ui/gfx/geometry",
  166.      "//ui/gfx/geometry/mojo:test_interfaces_blink",
  167. @@ -2039,7 +2038,6 @@ test("blink_platform_perftests") {
  168.      "testing/BlinkPerfTestSuite.cpp",
  169.      "testing/BlinkPerfTestSuite.h",
  170.      "testing/RunAllPerfTests.cpp",
  171. -    "testing/ShapingLineBreakerPerfTest.cpp",
  172.    ]
  173.  
  174.    configs += [
  175. @@ -2057,7 +2055,6 @@ test("blink_platform_perftests") {
  176.      "//services/network/public/cpp:cpp",
  177.      "//testing/gtest",
  178.      "//testing/perf",
  179. -    "//third_party:freetype_harfbuzz",
  180.      "//third_party/WebKit/Source/platform/scheduler:perf_tests",
  181.    ]
  182.  }
  183. diff --git i/third_party/WebKit/Source/platform/fonts/WebFontDecoder.cpp w/third_party/WebKit/Source/platform/fonts/WebFontDecoder.cpp
  184. index 4d17b5546b..5d78115848 100644
  185. --- i/third_party/WebKit/Source/platform/fonts/WebFontDecoder.cpp
  186. +++ w/third_party/WebKit/Source/platform/fonts/WebFontDecoder.cpp
  187. @@ -38,10 +38,10 @@
  188.  #include "platform/instrumentation/tracing/TraceEvent.h"
  189.  #include "platform/wtf/Time.h"
  190.  #include "public/platform/Platform.h"
  191. +#include "third_party/harfbuzz-ng/src/hb.h"
  192.  #include "third_party/ots/include/ots-memory-stream.h"
  193.  #include "third_party/skia/include/core/SkStream.h"
  194.  
  195. -#include <hb.h>
  196.  #include <stdarg.h>
  197.  
  198.  namespace blink {
  199. diff --git i/third_party/freetype/BUILD.gn w/third_party/freetype/BUILD.gn
  200. index 0213b648e2..1bab287a46 100644
  201. --- i/third_party/freetype/BUILD.gn
  202. +++ w/third_party/freetype/BUILD.gn
  203. @@ -6,8 +6,6 @@ import("//build/config/chromecast_build.gni")
  204.  import("//build/config/freetype/freetype.gni")
  205.  import("//third_party/harfbuzz-ng/harfbuzz.gni")
  206.  
  207. -assert(!use_system_freetype, "Not used when using system freetype.")
  208. -
  209.  config("freetype_config") {
  210.    include_dirs = [
  211.      "include",
  212. @@ -49,40 +47,32 @@ config("freetype-warnings") {
  213.    }
  214.  }
  215.  
  216. -source_set("freetype_source") {
  217. -  visibility = [ "//third_party:freetype_harfbuzz" ]
  218. +# This component is used to resolve a cyclic dependency between HarfBuzz and
  219. +# FreeType. HarfBuzz needs basic FreeType glyph information symbols for its
  220. +# hb-ft.* functions, FreeType needs HarfBuzz' OpenType parsing functionality in
  221. +# the autohinting code. We start by building a minimum FreeType here - enough to
  222. +# satisfy harfbuzz-ng-ft symbol requirements. Then we can build harfbuzz-ng-ft
  223. +# based on the minimal FreeType and harfbuzz-ng which does not depend on
  224. +# FreeType itself. Then we build FreeType depending on harfbuzz-ng-ft and
  225. +# harfbuzz-ng.
  226. +static_library("bootstrap_freetype_for_harfbuzz") {
  227. +  visibility = [
  228. +    "//third_party/harfbuzz-ng:harfbuzz-ng-ft",
  229. +    ":freetype",
  230. +  ]
  231.  
  232.    defines = []
  233. -  include_dirs = []
  234.  
  235.    sources = [
  236.      "include/freetype-custom-config/ftconfig.h",
  237.      "include/freetype-custom-config/ftmodule.h",
  238.      "include/freetype-custom-config/ftoption.h",
  239. -    "src/src/autofit/autofit.c",
  240.      "src/src/base/ftbase.c",
  241. -    "src/src/base/ftbbox.c",
  242.      "src/src/base/ftbitmap.c",
  243. -    "src/src/base/ftfntfmt.c",
  244. -    "src/src/base/ftfstype.c",
  245. -    "src/src/base/ftgasp.c",
  246. -    "src/src/base/ftglyph.c",
  247. -    "src/src/base/ftinit.c",
  248. -    "src/src/base/ftlcdfil.c",
  249. -    "src/src/base/ftmm.c",
  250. -    "src/src/base/ftstroke.c",
  251. -    "src/src/base/fttype1.c",
  252. -    "src/src/cff/cff.c",
  253. -    "src/src/gzip/ftgzip.c",
  254. -    "src/src/psaux/psaux.c",
  255. -    "src/src/pshinter/pshinter.c",
  256. -    "src/src/psnames/psnames.c",
  257. -    "src/src/raster/raster.c",
  258. -    "src/src/sfnt/sfnt.c",
  259. -    "src/src/smooth/smooth.c",
  260. -    "src/src/truetype/truetype.c",
  261.    ]
  262.  
  263. +  include_dirs = []
  264. +
  265.    # ftsystem.c provides implementations of FT_Memory and FT_Stream_Open.
  266.    # While Chromium itself avoids using this code, any build of Chromium which
  267.    # depends on //third_party/fontconfig:fontconfig with use_bundled_fontconfig
  268. @@ -105,6 +95,68 @@ source_set("freetype_source") {
  269.      sources += [ "src/src/base/ftsystem.c" ]
  270.    }
  271.  
  272. +  if (is_mac && !is_component_build) {
  273. +    defines += [ "MAC_RESTRICT_VISIBILITY" ]
  274. +  }
  275. +
  276. +  defines += [
  277. +    "FT2_BUILD_LIBRARY",
  278. +    "DARWIN_NO_CARBON",
  279. +
  280. +    # Long directory name to avoid accidentally using wrong headers.
  281. +    # GN currently does not escape '<' and '>' when generating xml based Visual
  282. +    # Studio project files. As a result, use quotes instead of pointy brackets
  283. +    # in these defines.
  284. +    "FT_CONFIG_CONFIG_H=\"freetype-custom-config/ftconfig.h\"",
  285. +    "FT_CONFIG_MODULES_H=\"freetype-custom-config/ftmodule.h\"",
  286. +    "FT_CONFIG_OPTIONS_H=\"freetype-custom-config/ftoption.h\"",
  287. +  ]
  288. +
  289. +  if (is_win && is_component_build) {
  290. +    # Used for managing declspec(dllimport/export) visibility.
  291. +    defines += [ "FT2_BUILD_DLL" ]
  292. +  }
  293. +
  294. +  public_configs = [ ":freetype_config" ]
  295. +  configs -= [ "//build/config/compiler:chromium_code" ]
  296. +  configs += [ "//build/config/compiler:no_chromium_code" ]
  297. +
  298. +  configs += [ ":freetype-warnings" ]
  299. +}
  300. +
  301. +component("freetype") {
  302. +  if (is_linux) {
  303. +    output_name = "freetype"
  304. +    output_extension = "so.6"
  305. +  }
  306. +
  307. +  defines = []
  308. +
  309. +  sources = [
  310. +    "include/freetype-custom-config/ftconfig.h",
  311. +    "include/freetype-custom-config/ftmodule.h",
  312. +    "include/freetype-custom-config/ftoption.h",
  313. +    "src/src/autofit/autofit.c",
  314. +    "src/src/base/ftbbox.c",
  315. +    "src/src/base/ftfntfmt.c",
  316. +    "src/src/base/ftfstype.c",
  317. +    "src/src/base/ftgasp.c",
  318. +    "src/src/base/ftglyph.c",
  319. +    "src/src/base/ftinit.c",
  320. +    "src/src/base/ftlcdfil.c",
  321. +    "src/src/base/ftmm.c",
  322. +    "src/src/base/ftstroke.c",
  323. +    "src/src/base/fttype1.c",
  324. +    "src/src/cff/cff.c",
  325. +    "src/src/gzip/ftgzip.c",
  326. +    "src/src/pshinter/pshinter.c",
  327. +    "src/src/psnames/psnames.c",
  328. +    "src/src/raster/raster.c",
  329. +    "src/src/sfnt/sfnt.c",
  330. +    "src/src/smooth/smooth.c",
  331. +    "src/src/truetype/truetype.c",
  332. +  ]
  333. +
  334.    if (!is_android) {
  335.      sources += [
  336.        "src/src/cid/type1cid.c",
  337. @@ -132,20 +184,29 @@ source_set("freetype_source") {
  338.      defines += [ "FT2_BUILD_DLL" ]
  339.    }
  340.  
  341. -  if (use_system_harfbuzz) {
  342. -    configs += [ "//third_party/harfbuzz-ng:harfbuzz_from_pkgconfig" ]
  343. -  } else {
  344. -    configs += [ "//third_party/harfbuzz-ng:harfbuzz_config" ]
  345. -  }
  346. +  public_configs = [ ":freetype_config" ]
  347.    configs -= [ "//build/config/compiler:chromium_code" ]
  348.    configs += [ "//build/config/compiler:no_chromium_code" ]
  349.    configs += [ "//build/config/sanitizers:cfi_icall_generalize_pointers" ]
  350.    configs += [ ":freetype-warnings" ]
  351.  
  352. -  public_configs = [ ":freetype_config" ]
  353. -
  354.    deps = [
  355.      "//third_party/libpng",
  356.      "//third_party/zlib",
  357.    ]
  358. +
  359. +  if (!use_system_freetype) {
  360. +    deps += [ ":bootstrap_freetype_for_harfbuzz" ]
  361. +  }
  362. +
  363. +  if (!use_system_harfbuzz) {
  364. +    if (!is_android) {
  365. +      # See "WITHOUT_HARFBUZZ" above, harfbuzz-ng-ft is only needed if we build
  366. +      # FreeType with HarfBuzz support.
  367. +      deps += [ "//third_party/harfbuzz-ng:harfbuzz-ng-ft" ]
  368. +    }
  369. +    deps += [ "//third_party/harfbuzz-ng:harfbuzz-ng-without-freetype" ]
  370. +  } else {
  371. +    deps += [ "//third_party/harfbuzz-ng:harfbuzz-ng" ]
  372. +  }
  373.  }
  374. diff --git i/third_party/harfbuzz-ng/BUILD.gn w/third_party/harfbuzz-ng/BUILD.gn
  375. index dcb74529d8..e9695c0356 100644
  376. --- i/third_party/harfbuzz-ng/BUILD.gn
  377. +++ w/third_party/harfbuzz-ng/BUILD.gn
  378. @@ -5,21 +5,31 @@
  379.  import("//build/config/chrome_build.gni")
  380.  import("//build/config/features.gni")
  381.  import("//build/config/freetype/freetype.gni")
  382. +import("//build/config/linux/pkg_config.gni")
  383.  import("//build/config/ui.gni")
  384.  import("//testing/libfuzzer/fuzzer_test.gni")
  385.  import("//third_party/harfbuzz-ng/harfbuzz.gni")
  386.  
  387.  if (use_system_harfbuzz) {
  388.    import("//build/config/linux/pkg_config.gni")
  389. -  pkg_config("harfbuzz_from_pkgconfig") {
  390. -    visibility = [
  391. -      "//third_party:freetype_harfbuzz",
  392. -      "//third_party/freetype:freetype_source",
  393. -    ]
  394. +  pkg_config("harfbuzz_pkgconfig") {
  395.      packages = [ "harfbuzz" ]
  396.    }
  397. +  group("harfbuzz-ng") {
  398. +    public_configs = [ ":harfbuzz_pkgconfig" ]
  399. +  }
  400.  } else {
  401. -  config("harfbuzz_config") {
  402. +  # The :harfbuzz-ng target combines the staged build steps required to resolve
  403. +  # the cyclic dependency between parts of FreeType and HarfBuzz.
  404. +  group("harfbuzz-ng") {
  405. +    public_deps = [
  406. +      ":harfbuzz-ng-ft",
  407. +      ":harfbuzz-ng-without-freetype",
  408. +      "//build/config/freetype",
  409. +    ]
  410. +  }
  411. +
  412. +  config("harfbuzz-ng_config") {
  413.      include_dirs = [ "src" ]
  414.    }
  415.  
  416. @@ -41,9 +51,7 @@ if (use_system_harfbuzz) {
  417.      }
  418.    }
  419.  
  420. -  source_set("harfbuzz_source") {
  421. -    visibility = [ "//third_party:freetype_harfbuzz" ]
  422. -
  423. +  static_library("harfbuzz-ng-without-freetype") {
  424.      sources = [
  425.        "src/hb-atomic-private.hh",
  426.        "src/hb-blob.cc",
  427. @@ -66,8 +74,6 @@ if (use_system_harfbuzz) {
  428.        "src/hb-font-private.hh",
  429.        "src/hb-font.cc",
  430.        "src/hb-font.h",
  431. -      "src/hb-ft.cc",
  432. -      "src/hb-ft.h",
  433.        "src/hb-icu.cc",
  434.        "src/hb-icu.h",
  435.        "src/hb-mutex-private.hh",
  436. @@ -156,6 +162,11 @@ if (use_system_harfbuzz) {
  437.        "src/hb.h",
  438.      ]
  439.  
  440. +    if (is_component_build && !is_win) {
  441. +      configs -= [ "//build/config/gcc:symbol_visibility_hidden" ]
  442. +      configs += [ "//build/config/gcc:symbol_visibility_default" ]
  443. +    }
  444. +
  445.      defines = [
  446.        "HAVE_OT",
  447.        "HAVE_ICU",
  448. @@ -163,20 +174,6 @@ if (use_system_harfbuzz) {
  449.        "HAVE_INTEL_ATOMIC_PRIMITIVES",
  450.      ]
  451.  
  452. -    if (is_component_build) {
  453. -      if (is_win) {
  454. -        defines += [ "HB_EXTERN=__declspec (dllexport) extern" ]
  455. -      } else {
  456. -        configs -= [ "//build/config/gcc:symbol_visibility_hidden" ]
  457. -        configs += [ "//build/config/gcc:symbol_visibility_default" ]
  458. -      }
  459. -    }
  460. -
  461. -    if (use_system_freetype) {
  462. -      configs += [ "//build/linux:freetype_from_pkgconfig" ]
  463. -    } else {
  464. -      configs += [ "//third_party/freetype:freetype_config" ]
  465. -    }
  466.      configs -= [ "//build/config/compiler:chromium_code" ]
  467.      configs += [
  468.        "//build/config/compiler:no_chromium_code",
  469. @@ -185,7 +182,7 @@ if (use_system_harfbuzz) {
  470.        # correctly.
  471.        ":harfbuzz_warnings",
  472.      ]
  473. -    public_configs = [ ":harfbuzz_config" ]
  474. +    public_configs = [ ":harfbuzz-ng_config" ]
  475.  
  476.      deps = [
  477.        "//third_party/icu:icuuc",
  478. @@ -212,6 +209,45 @@ if (use_system_harfbuzz) {
  479.        ]
  480.      }
  481.    }
  482. +
  483. +  static_library("harfbuzz-ng-ft") {
  484. +    sources = [
  485. +      "src/hb-ft.cc",
  486. +      "src/hb-ft.h",
  487. +    ]
  488. +
  489. +    if (is_component_build && !is_win) {
  490. +      configs -= [ "//build/config/gcc:symbol_visibility_hidden" ]
  491. +      configs += [ "//build/config/gcc:symbol_visibility_default" ]
  492. +    }
  493. +
  494. +    configs -= [ "//build/config/compiler:chromium_code" ]
  495. +    configs += [
  496. +      "//build/config/compiler:no_chromium_code",
  497. +
  498. +      # Must be after no_chromium_code for warning flags to be ordered
  499. +      # correctly.
  500. +      ":harfbuzz_warnings",
  501. +    ]
  502. +    public_configs = [ ":harfbuzz-ng_config" ]
  503. +
  504. +    defines = [
  505. +      "HAVE_OT",
  506. +      "HAVE_ICU",
  507. +      "HAVE_ICU_BUILTIN",
  508. +      "HAVE_INTEL_ATOMIC_PRIMITIVES",
  509. +    ]
  510. +
  511. +    if (use_system_freetype) {
  512. +      deps = [
  513. +        "//build/config/freetype:freetype",
  514. +      ]
  515. +    } else {
  516. +      deps = [
  517. +        "//third_party/freetype:bootstrap_freetype_for_harfbuzz",
  518. +      ]
  519. +    }
  520. +  }
  521.  }
  522.  
  523.  fuzzer_test("harfbuzz_fuzzer") {
  524. @@ -219,7 +255,7 @@ fuzzer_test("harfbuzz_fuzzer") {
  525.      "fuzz/harfbuzz_fuzzer.cc",
  526.    ]
  527.    deps = [
  528. -    "//third_party:freetype_harfbuzz",
  529. +    ":harfbuzz-ng",
  530.    ]
  531.    libfuzzer_options = [ "max_len=16800" ]
  532.    seed_corpus = "fuzz/seed_corpus"
  533. diff --git i/ui/gfx/BUILD.gn w/ui/gfx/BUILD.gn
  534. index 580b686cf4..cc19292227 100644
  535. --- i/ui/gfx/BUILD.gn
  536. +++ w/ui/gfx/BUILD.gn
  537. @@ -301,7 +301,7 @@ jumbo_component("gfx") {
  538.    } else {
  539.      deps += [
  540.        "//cc/paint",
  541. -      "//third_party:freetype_harfbuzz",
  542. +      "//third_party/harfbuzz-ng",
  543.      ]
  544.    }
  545.  
  546. @@ -713,6 +713,10 @@ test("gfx_unittests") {
  547.      sources += [ "paint_vector_icon_unittest.cc" ]
  548.    }
  549.  
  550. +  if (!is_android && !is_ios) {
  551. +    sources += [ "render_text_unittest.cc" ]
  552. +  }
  553. +
  554.    # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
  555.    configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
  556.  
  557. @@ -733,11 +737,6 @@ test("gfx_unittests") {
  558.      "//ui/resources:ui_test_pak",
  559.    ]
  560.  
  561. -  if (!is_android && !is_ios) {
  562. -    sources += [ "render_text_unittest.cc" ]
  563. -    deps += [ "//third_party:freetype_harfbuzz" ]
  564. -  }
  565. -
  566.    data_deps = [
  567.      "//ui/resources:ui_test_pak",
  568.    ]
  569. diff --git i/ui/gfx/harfbuzz_font_skia.h w/ui/gfx/harfbuzz_font_skia.h
  570. index abc6c79387..bdf6dc12e7 100644
  571. --- i/ui/gfx/harfbuzz_font_skia.h
  572. +++ w/ui/gfx/harfbuzz_font_skia.h
  573. @@ -5,12 +5,11 @@
  574.  #ifndef UI_GFX_HARFBUZZ_FONT_SKIA_H_
  575.  #define UI_GFX_HARFBUZZ_FONT_SKIA_H_
  576.  
  577. +#include "third_party/harfbuzz-ng/src/hb.h"
  578.  #include "third_party/skia/include/core/SkRefCnt.h"
  579.  #include "third_party/skia/include/core/SkScalar.h"
  580.  #include "ui/gfx/font_render_params.h"
  581.  
  582. -#include <hb.h>
  583. -
  584.  class SkTypeface;
  585.  
  586.  namespace gfx {
  587. diff --git i/ui/gfx/render_text_harfbuzz.cc w/ui/gfx/render_text_harfbuzz.cc
  588. index 79a7a863cd..11805e23d6 100644
  589. --- i/ui/gfx/render_text_harfbuzz.cc
  590. +++ w/ui/gfx/render_text_harfbuzz.cc
  591. @@ -20,6 +20,7 @@
  592.  #include "base/strings/utf_string_conversions.h"
  593.  #include "base/trace_event/trace_event.h"
  594.  #include "build/build_config.h"
  595. +#include "third_party/harfbuzz-ng/src/hb.h"
  596.  #include "third_party/icu/source/common/unicode/ubidi.h"
  597.  #include "third_party/icu/source/common/unicode/utf16.h"
  598.  #include "third_party/skia/include/core/SkColor.h"
  599. @@ -41,8 +42,6 @@
  600.  #include "base/mac/mac_util.h"
  601.  #endif
  602.  
  603. -#include <hb.h>
  604. -
  605.  namespace gfx {
  606.  
  607.  namespace {
  608. diff --git i/ui/gfx/render_text_harfbuzz.h w/ui/gfx/render_text_harfbuzz.h
  609. index b883e84fdd..c8ab77c62f 100644
  610. --- i/ui/gfx/render_text_harfbuzz.h
  611. +++ w/ui/gfx/render_text_harfbuzz.h
  612. @@ -12,12 +12,11 @@
  613.  #include <vector>
  614.  
  615.  #include "base/macros.h"
  616. +#include "third_party/harfbuzz-ng/src/hb.h"
  617.  #include "third_party/icu/source/common/unicode/ubidi.h"
  618.  #include "third_party/icu/source/common/unicode/uscript.h"
  619.  #include "ui/gfx/render_text.h"
  620.  
  621. -#include <hb.h>
  622. -
  623.  namespace base {
  624.  namespace i18n {
  625.  class BreakIterator;
Add Comment
Please, Sign In to add comment