• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-2023 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14import("//build/ohos.gni")
15import("//foundation/arkui/ace_engine/ace_config.gni")
16import("//foundation/graphic/graphic_2d/graphic_config.gni")
17import("//third_party/flutter/flutter_config.gni")
18
19# ------------------------------------------------
20#      Skia main target config begin
21# ------------------------------------------------
22
23# symbol link for skia include dirs
24system_skia_override_path = root_out_dir + "/override/system"
25third_party_skia_override_path = root_out_dir + "/override/third_party"
26
27template("make_skia_include_dir") {
28  forward_variables_from(invoker, "*")
29
30  action("make_${target_name}_skia_include_dir") {
31    script = "make_skia_include_dir.py"
32    inputs = [ src_path ]
33
34    # refer to tmp.txt that doesn't exist because we need to relink the dir to support run on different build dir.
35    outputs = [ "${dst_path}/tmp.txt" ]
36    args = [
37      rebase_path(dst_path, root_build_dir),
38      rebase_path(src_path, root_build_dir),
39    ]
40  }
41}
42
43make_skia_include_dir("system") {
44  src_path = "$libs_root/shared_library/${target_os}_${target_cpu}/include/external/skia"
45  dst_path = system_skia_override_path + "/third_party"
46}
47
48make_skia_include_dir("third_party") {
49  src_path = "$flutter_root/skia"
50  dst_path = third_party_skia_override_path + "/third_party"
51}
52
53# Config for using system skia
54config("system_skia_config") {
55  include_dirs = [
56    "$system_skia_override_path",
57    "$system_skia_override_path/third_party/skia",
58    "$system_skia_override_path/third_party/skia/include",
59    "$system_skia_override_path/third_party/skia/include/codec",
60    "$system_skia_override_path/third_party/skia/include/config",
61    "$system_skia_override_path/third_party/skia/include/config/android",
62    "$system_skia_override_path/third_party/skia/include/core",
63    "$system_skia_override_path/third_party/skia/include/gpu",
64    "$system_skia_override_path/third_party/skia/include/private",
65    "$system_skia_override_path/third_party/skia/include/utils",
66  ]
67
68  include_dirs += [ "$libs_root/shared_library/${target_os}_${target_cpu}/include/external/vulkan-headers/include" ]
69  include_dirs += [ "$libs_root/shared_library/${target_os}_${target_cpu}/include/frameworks/native/opengl/include" ]
70  include_dirs += [ "$libs_root/shared_library/${target_os}_${target_cpu}/include/frameworks/native/opengl/libs/EGL/include" ]
71  defines = [ "USE_SYSTEM_SKIA" ]
72}
73
74config("system_harfbuzz_config") {
75  include_dirs = [ "$libs_root/shared_library/${target_os}_${target_cpu}/include/external/harfbuzz_ng/src" ]
76  defines = [ "USE_SYSTEM_HARFBUZZ" ]
77}
78
79template("make_skia_deps") {
80  forward_variables_from(invoker, "*")
81
82  ohos_source_set("ace_skia_$platform") {
83    part_name = flutter_part
84    subsystem_name = flutter_subsystem
85    license_file = "$flutter_root/skia/LICENSE"
86    if (platform == "ohos" &&
87        (!defined(config.disable_gpu) || !config.disable_gpu) &&
88        defined(config.enable_rosen_backend) && config.enable_rosen_backend) {
89      public_configs = [
90        ":skia_config",
91        ":harfbuzz_config",
92      ]
93      public_deps = [ "ohos:skia_ohos" ]
94    } else if (platform == "ohos" && defined(config.enable_native_view) &&
95               config.enable_native_view) {
96      public_configs = [
97        ":system_skia_config",
98        ":system_harfbuzz_config",
99      ]
100
101      deps = [ ":ace_skia_ext_$platform" ]
102      deps += [ ":make_system_skia_include_dir" ]
103
104      aosp_deps = [
105        "shared_library:libharfbuzz_ng",
106        "shared_library:libhwui",
107      ]
108
109      sources = [ "$flutter_root/skia/src/utils/SkParsePath.cpp" ]
110    } else if ((platform == "linux" || platform == "mac" ||
111                platform == "windows") &&
112               defined(config.enable_rosen_backend) &&
113               config.enable_rosen_backend) {
114      public_configs = [
115        ":skia_config",
116        ":harfbuzz_config",
117      ]
118      public_deps = [ ":skia_shared" ]
119    } else {
120      public_configs = [
121        ":skia_config",
122        ":harfbuzz_config",
123      ]
124      configs = [ ":skia_visibility_hidden_config" ]
125
126      deps = [
127        ":ace_fontmgr_$platform",
128        ":ace_gif",
129        ":ace_gpu_$platform",
130        ":ace_heif",
131        ":ace_jpeg",
132        ":ace_pdf_$platform",
133        ":ace_png_$platform",
134        ":ace_skcms",
135        ":ace_skia_core_$platform",
136        ":ace_skia_opts_$platform",
137        ":ace_svg_model_$platform",
138        ":ace_typeface_freetype",
139        ":ace_webp",
140        ":ace_xml",
141        ":make_third_party_skia_include_dir",
142        "$ace_flutter_engine_root/freetype:ace_libfreetype2",
143        "$ace_flutter_engine_root/harfbuzz:ace_libharfbuzz_$platform",
144        "$ace_flutter_engine_root/icu:ace_libicu_$platform",
145        "$ace_flutter_engine_root/libjpeg:ace_libjpeg",
146        "$ace_flutter_engine_root/libpng:ace_libpng",
147        "$ace_flutter_engine_root/libwebp:ace_libwebp",
148        "$ace_flutter_engine_root/sfntly:ace_libsfntly_$platform",
149      ]
150
151      if (defined(config.disable_gpu) && config.disable_gpu) {
152        deps -= [ ":ace_gpu_$platform" ]
153      }
154    }
155
156    public_configs += [
157      ":ace_svg_model_config",
158      ":skia_deps_include_config",
159    ]
160  }
161}
162
163foreach(item, ace_platforms) {
164  make_skia_deps(item.name) {
165    platform = item.name
166    config = {
167    }
168
169    if (defined(item.config)) {
170      config = item.config
171    }
172  }
173}
174
175# ------------------------------------------------
176#      Skia main target config end
177# ------------------------------------------------
178
179ohos_shared_library("skia_shared") {
180  platform = current_os
181  if (current_os == "mingw") {
182    platform = "windows"
183  }
184  part_name = flutter_part
185  subsystem_name = flutter_subsystem
186  public_configs = [
187    ":skia_config",
188    ":harfbuzz_config",
189  ]
190
191  deps = [
192    ":ace_fontmgr_$platform",
193    ":ace_gif",
194    ":ace_gpu_$platform",
195    ":ace_heif",
196    ":ace_jpeg",
197    ":ace_png_$platform",
198    ":ace_skcms",
199    ":ace_skia_core_$platform",
200    ":ace_skia_opts_$platform",
201    ":ace_svg_model_$platform",
202    ":ace_typeface_freetype",
203    ":ace_webp",
204    ":ace_xml",
205    ":make_third_party_skia_include_dir",
206    "$ace_flutter_engine_root/freetype:ace_libfreetype2",
207    "$ace_flutter_engine_root/libjpeg:ace_libjpeg",
208    "$ace_flutter_engine_root/libpng:ace_libpng",
209    "$ace_flutter_engine_root/libwebp:ace_libwebp",
210  ]
211
212  if (defined(disable_gpu) && disable_gpu) {
213    deps -= [ ":ace_gpu_$platform" ]
214  } else {
215    public_deps = [ "//foundation/graphic/graphic_2d:libgl" ]
216  }
217
218  public_configs += [
219    ":ace_svg_model_config",
220    ":skia_deps_include_config",
221  ]
222
223  deps += [ "//third_party/bounds_checking_function:libsec_shared" ]
224}
225
226# ------------------------------------------------
227#      Skia common config begin
228# ------------------------------------------------
229config("skia_deps_include_config") {
230  include_dirs =
231      [ "$libs_root/shared_library/global_header/frameworks/native/include/" ]
232  include_dirs += [
233    "$libs_root/shared_library/${target_os}_${target_cpu}/include/frameworks/native/libs/nativewindow/include",
234    "$libs_root/shared_library/${target_os}_${target_cpu}/include/frameworks/native/libs/arect/include",
235  ]
236}
237
238config("skia_visibility_hidden_config") {
239  cflags_cc = [ "-fvisibility-inlines-hidden" ]
240
241  cflags = [ "-fvisibility=hidden" ]
242}
243
244ace_skia_common_ccflags = [
245  "-std=c++14",
246  "-fno-exceptions",
247  "-fno-rtti",
248  "-Wnon-virtual-dtor",
249  "-Wno-noexcept-type",
250  "-Wno-abstract-vbase-init",
251  "-Wno-weak-vtables",
252  "-Wno-c++98-compat",
253  "-Wno-c++98-compat-pedantic",
254  "-Wno-undefined-func-template",
255  "-Wno-return-std-move-in-c++11",
256  "-Wno-implicit-fallthrough",
257  "-Wno-suggest-destructor-override",
258  "-Wno-tautological-value-range-compare",
259  "-Wno-suggest-override",
260  "-Wno-psabi",
261  "-Wno-four-char-constants",
262  "-Os",
263  "-DSKIA_DLL",
264]
265
266ace_skia_common_cflags = [
267  "-fstrict-aliasing",
268  "-fdata-sections",
269  "-ffunction-sections",
270  "-gline-tables-only",
271  "-funwind-tables",
272  "-Wall",
273  "-Wextra",
274  "-Winit-self",
275  "-Wpointer-arith",
276  "-Wsign-compare",
277  "-Wvla",
278  "-Wno-deprecated-declarations",
279  "-Wno-maybe-uninitialized",
280  "-fcolor-diagnostics",
281  "-Weverything",
282  "-Wno-unknown-warning-option",
283  "-Wno-nonportable-include-path",
284  "-Wno-nonportable-system-include-path",
285  "-Wno-cast-align",
286  "-Wno-cast-qual",
287  "-Wno-conversion",
288  "-Wno-disabled-macro-expansion",
289  "-Wno-documentation",
290  "-Wno-documentation-unknown-command",
291  "-Wno-double-promotion",
292  "-Wno-exit-time-destructors",
293  "-Wno-float-equal",
294  "-Wno-format-nonliteral",
295  "-Wno-global-constructors",
296  "-Wno-missing-prototypes",
297  "-Wno-missing-variable-declarations",
298  "-Wno-pedantic",
299  "-Wno-reserved-id-macro",
300  "-Wno-shadow",
301  "-Wno-shift-sign-overflow",
302  "-Wno-signed-enum-bitfield",
303  "-Wno-switch-enum",
304  "-Wno-undef",
305  "-Wno-unreachable-code",
306  "-Wno-unreachable-code-break",
307  "-Wno-unreachable-code-return",
308  "-Wno-unused-macros",
309  "-Wno-unused-member-function",
310  "-Wno-unused-template",
311  "-Wno-zero-as-null-pointer-constant",
312  "-Wno-thread-safety-negative",
313  "-Wno-bad-function-cast",
314  "-Wno-covered-switch-default",
315  "-Wno-deprecated",
316  "-Wno-missing-noreturn",
317  "-Wno-old-style-cast",
318  "-Wno-padded",
319  "-Wno-newline-eof",
320  "-Wno-implicit-fallthrough",
321  "-Wno-unused-parameter",
322  "-Wno-suggest-destructor-override",
323  "-Wno-tautological-value-range-compare",
324  "-Wno-suggest-override",
325  "-Wno-reserved-identifier",
326  "-Os",
327  "-DSKIA_DLL",
328]
329
330ace_skia_common_defines = [
331  "SK_SUPPORT_ATLAS_TEXT=1",
332  "SK_GAMMA_APPLY_TO_A8",
333  "SK_GAMMA_EXPONENT=1.4",
334  "SK_GAMMA_CONTRAST=0.0",
335  "SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=1",
336  "GR_TEST_UTILS=1",
337  "SKIA_IMPLEMENTATION=1",
338  "SK_GL",
339  "SK_SUPPORT_PDF",
340  "SK_HAS_JPEG_LIBRARY",
341  "SK_HAS_HEIF_LIBRARY",
342  "SK_HAS_PNG_LIBRARY",
343  "SK_ENABLE_SKSL_INTERPRETER",
344  "SK_HAS_WEBP_LIBRARY",
345  "SK_XML",
346  "XML_STATIC",
347  "XML_POOR_ENTROPY",
348  "SK_DISABLE_AAA",
349  "SK_DISABLE_READBUFFER",
350  "SK_DISABLE_EFFECT_DESERIALIZATION",
351  "SK_DISABLE_LEGACY_SHADERCONTEXT",
352  "SK_DISABLE_LOWP_RASTER_PIPELINE",
353  "SK_FORCE_RASTER_PIPELINE_BLITTER",
354  "SK_LEGACY_SKCODEC_NONE_ENUM",
355  "SK_ENABLE_DUMP_GPU",
356]
357
358config("harfbuzz_config") {
359  visibility = [ ":*" ]
360
361  include_dirs = [ "$flutter_root/skia/third_party/externals/harfbuzz/src" ]
362
363  defines = [
364    "HAVE_ICU",
365    "HAVE_ICU_BUILTIN",
366    "HAVE_INTEL_ATOMIC_PRIMITIVES",
367    "HAVE_OT",
368  ]
369}
370
371config("skia_config") {
372  visibility = [ ":*" ]
373
374  include_dirs = [
375    "$third_party_skia_override_path",
376    "$flutter_root/skia",
377    "$third_party_skia_override_path/third_party/skia",
378    "$third_party_skia_override_path/third_party/skia/include/config/android",
379  ]
380
381  defines = ace_skia_common_defines
382  defines -= [
383    "SK_DISABLE_READBUFFER",
384    "SK_DISABLE_EFFECT_DESERIALIZATION",
385  ]
386}
387
388# ------------------------------------------------
389#      Skia common config end
390# ------------------------------------------------
391
392# ------------------------------------------------
393#      Skia opts config begin
394# ------------------------------------------------
395config("ace_skia_opts_config") {
396  visibility = [ ":*" ]
397  include_dirs = [ "$flutter_root/skia" ]
398  cflags_cc = ace_skia_common_ccflags
399}
400
401template("ace_skia_opts") {
402  forward_variables_from(invoker, "*")
403
404  ohos_source_set(target_name) {
405    part_name = flutter_part
406    subsystem_name = flutter_subsystem
407    defines = [
408      "SK_SUPPORT_ATLAS_TEXT=1",
409      "SK_GAMMA_APPLY_TO_A8",
410      "SK_GAMMA_EXPONENT=1.4",
411      "SK_GAMMA_CONTRAST=0.0",
412      "SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=1",
413      "GR_TEST_UTILS=1",
414      "SKIA_IMPLEMENTATION=1",
415    ]
416
417    configs = [ ":ace_skia_opts_config" ]
418    cflags = ace_skia_common_cflags
419    cflags += [ "-march=armv8-a+crc" ]
420
421    sources = []
422
423    if (target_cpu == "x86_64" || platform == "windows" || platform == "mac" ||
424        platform == "linux" || platform == "ios") {
425      cflags -= [ "-march=armv8-a+crc" ]
426      sources += [
427        "$flutter_root/skia/src/opts/SkOpts_avx.cpp",
428        "$flutter_root/skia/src/opts/SkOpts_hsw.cpp",
429      ]
430      cflags_cc = [ "-Wno-psabi" ]
431    }
432
433    if (platform == "windows" || target_cpu == "x86_64") {
434      sources += [
435        "$flutter_root/skia/src/opts/SkOpts_sse41.cpp",
436        "$flutter_root/skia/src/opts/SkOpts_sse42.cpp",
437        "$flutter_root/skia/src/opts/SkOpts_ssse3.cpp",
438      ]
439    } else if (platform == "linux") {
440      sources += [
441        "$flutter_root/skia/src/opts/SkOpts_sse41.cpp",
442        "$flutter_root/skia/src/opts/SkOpts_sse42.cpp",
443        "$flutter_root/skia/src/opts/SkOpts_ssse3.cpp",
444      ]
445    } else if (platform == "mac") {
446      cflags += [
447        "-mavx",
448        "-mssse3",
449        "-msse4.1",
450        "-msse4.2",
451      ]
452      if (host_cpu == "arm64") {
453        cflags += [ "-mcpu=native" ]
454      } else {
455        cflags += [ "-march=haswell" ]
456      }
457
458      sources += [
459        "$flutter_root/skia/src/opts/SkOpts_sse41.cpp",
460        "$flutter_root/skia/src/opts/SkOpts_sse42.cpp",
461        "$flutter_root/skia/src/opts/SkOpts_ssse3.cpp",
462      ]
463    } else if (platform == "ios") {
464      sources += [
465        "$flutter_root/skia/src/opts/SkOpts_sse41.cpp",
466        "$flutter_root/skia/src/opts/SkOpts_sse42.cpp",
467        "$flutter_root/skia/src/opts/SkOpts_ssse3.cpp",
468      ]
469    } else {
470      sources += [ "$flutter_root/skia/src/opts/SkOpts_crc32.cpp" ]
471    }
472    cflags += [ "-Wno-unused-command-line-argument" ]
473  }
474}
475
476foreach(item, ace_platforms) {
477  ace_skia_opts("ace_skia_opts_" + item.name) {
478    platform = item.name
479  }
480}
481
482# ------------------------------------------------
483#      Skia opts config end
484# ------------------------------------------------
485
486# ------------------------------------------------
487#      Skia core config begin
488# ------------------------------------------------
489config("ace_skia_core_config") {
490  visibility = [ ":*" ]
491  include_dirs = [ "$flutter_root/skia" ]
492  cflags_cc = ace_skia_common_ccflags
493  cflags_cc += [ "-Wno-extra-semi" ]
494  cflags = ace_skia_common_cflags
495  cflags += [ "-Wno-extra-semi" ]
496}
497
498template("ace_skia_core") {
499  forward_variables_from(invoker, "*")
500
501  ohos_source_set(target_name) {
502    part_name = flutter_part
503    subsystem_name = flutter_subsystem
504    defines += invoker.defines
505    defines += ace_skia_common_defines
506    cflags_cc += invoker.cflags_cc
507    configs = [
508      ":ace_skia_core_config",
509      ":skia_deps_include_config",
510    ]
511    if (platform == "android") {
512      configs += [ "$ace_root/build:reduce_eh_frame_config" ]
513    }
514    sources = [
515      "$flutter_root/skia/src/android/SkAndroidFrameworkUtils.cpp",
516      "$flutter_root/skia/src/android/SkAnimatedImage.cpp",
517      "$flutter_root/skia/src/android/SkBitmapRegionCodec.cpp",
518      "$flutter_root/skia/src/android/SkBitmapRegionDecoder.cpp",
519      "$flutter_root/skia/src/c/sk_effects.cpp",
520      "$flutter_root/skia/src/c/sk_imageinfo.cpp",
521      "$flutter_root/skia/src/c/sk_paint.cpp",
522      "$flutter_root/skia/src/c/sk_surface.cpp",
523      "$flutter_root/skia/src/codec/SkAndroidCodec.cpp",
524      "$flutter_root/skia/src/codec/SkAndroidCodecAdapter.cpp",
525      "$flutter_root/skia/src/codec/SkBmpBaseCodec.cpp",
526      "$flutter_root/skia/src/codec/SkBmpCodec.cpp",
527      "$flutter_root/skia/src/codec/SkBmpMaskCodec.cpp",
528      "$flutter_root/skia/src/codec/SkBmpRLECodec.cpp",
529      "$flutter_root/skia/src/codec/SkBmpStandardCodec.cpp",
530      "$flutter_root/skia/src/codec/SkCodec.cpp",
531      "$flutter_root/skia/src/codec/SkCodecImageGenerator.cpp",
532      "$flutter_root/skia/src/codec/SkColorTable.cpp",
533      "$flutter_root/skia/src/codec/SkEncodedInfo.cpp",
534      "$flutter_root/skia/src/codec/SkMaskSwizzler.cpp",
535      "$flutter_root/skia/src/codec/SkMasks.cpp",
536      "$flutter_root/skia/src/codec/SkSampledCodec.cpp",
537      "$flutter_root/skia/src/codec/SkSampler.cpp",
538      "$flutter_root/skia/src/codec/SkStreamBuffer.cpp",
539      "$flutter_root/skia/src/codec/SkSwizzler.cpp",
540      "$flutter_root/skia/src/codec/SkWbmpCodec.cpp",
541      "$flutter_root/skia/src/core/SkAAClip.cpp",
542      "$flutter_root/skia/src/core/SkATrace.cpp",
543      "$flutter_root/skia/src/core/SkAlphaRuns.cpp",
544      "$flutter_root/skia/src/core/SkAnalyticEdge.cpp",
545      "$flutter_root/skia/src/core/SkAnnotation.cpp",
546      "$flutter_root/skia/src/core/SkArenaAlloc.cpp",
547      "$flutter_root/skia/src/core/SkAutoPixmapStorage.cpp",
548      "$flutter_root/skia/src/core/SkBBHFactory.cpp",
549      "$flutter_root/skia/src/core/SkBigPicture.cpp",
550      "$flutter_root/skia/src/core/SkBitmap.cpp",
551      "$flutter_root/skia/src/core/SkBitmapCache.cpp",
552      "$flutter_root/skia/src/core/SkBitmapController.cpp",
553      "$flutter_root/skia/src/core/SkBitmapDevice.cpp",
554      "$flutter_root/skia/src/core/SkBitmapProcState.cpp",
555      "$flutter_root/skia/src/core/SkBitmapProcState_matrixProcs.cpp",
556      "$flutter_root/skia/src/core/SkBlendMode.cpp",
557      "$flutter_root/skia/src/core/SkBlitRow_D32.cpp",
558      "$flutter_root/skia/src/core/SkBlitter.cpp",
559      "$flutter_root/skia/src/core/SkBlitter_A8.cpp",
560      "$flutter_root/skia/src/core/SkBlitter_ARGB32.cpp",
561      "$flutter_root/skia/src/core/SkBlitter_RGB565.cpp",
562      "$flutter_root/skia/src/core/SkBlitter_Sprite.cpp",
563      "$flutter_root/skia/src/core/SkBlurMF.cpp",
564      "$flutter_root/skia/src/core/SkBlurMask.cpp",
565      "$flutter_root/skia/src/core/SkBuffer.cpp",
566      "$flutter_root/skia/src/core/SkCachedData.cpp",
567      "$flutter_root/skia/src/core/SkCanvas.cpp",
568      "$flutter_root/skia/src/core/SkCanvasPriv.cpp",
569      "$flutter_root/skia/src/core/SkClipStack.cpp",
570      "$flutter_root/skia/src/core/SkClipStackDevice.cpp",
571      "$flutter_root/skia/src/core/SkColor.cpp",
572      "$flutter_root/skia/src/core/SkColorFilter.cpp",
573      "$flutter_root/skia/src/core/SkColorFilter_Matrix.cpp",
574      "$flutter_root/skia/src/core/SkColorSpace.cpp",
575      "$flutter_root/skia/src/core/SkColorSpaceXformSteps.cpp",
576      "$flutter_root/skia/src/core/SkContourMeasure.cpp",
577      "$flutter_root/skia/src/core/SkConvertPixels.cpp",
578      "$flutter_root/skia/src/core/SkCpu.cpp",
579      "$flutter_root/skia/src/core/SkCubicClipper.cpp",
580      "$flutter_root/skia/src/core/SkCubicMap.cpp",
581      "$flutter_root/skia/src/core/SkData.cpp",
582      "$flutter_root/skia/src/core/SkDataTable.cpp",
583      "$flutter_root/skia/src/core/SkDebug.cpp",
584      "$flutter_root/skia/src/core/SkDeferredDisplayList.cpp",
585      "$flutter_root/skia/src/core/SkDeferredDisplayListRecorder.cpp",
586      "$flutter_root/skia/src/core/SkDeque.cpp",
587      "$flutter_root/skia/src/core/SkDescriptor.cpp",
588      "$flutter_root/skia/src/core/SkDevice.cpp",
589      "$flutter_root/skia/src/core/SkDistanceFieldGen.cpp",
590      "$flutter_root/skia/src/core/SkDocument.cpp",
591      "$flutter_root/skia/src/core/SkDraw.cpp",
592      "$flutter_root/skia/src/core/SkDrawLooper.cpp",
593      "$flutter_root/skia/src/core/SkDrawShadowInfo.cpp",
594      "$flutter_root/skia/src/core/SkDraw_atlas.cpp",
595      "$flutter_root/skia/src/core/SkDraw_text.cpp",
596      "$flutter_root/skia/src/core/SkDraw_vertices.cpp",
597      "$flutter_root/skia/src/core/SkDrawable.cpp",
598      "$flutter_root/skia/src/core/SkEdge.cpp",
599      "$flutter_root/skia/src/core/SkEdgeBuilder.cpp",
600      "$flutter_root/skia/src/core/SkEdgeClipper.cpp",
601      "$flutter_root/skia/src/core/SkExecutor.cpp",
602      "$flutter_root/skia/src/core/SkFlattenable.cpp",
603      "$flutter_root/skia/src/core/SkFont.cpp",
604      "$flutter_root/skia/src/core/SkFontDescriptor.cpp",
605      "$flutter_root/skia/src/core/SkFontLCDConfig.cpp",
606      "$flutter_root/skia/src/core/SkFontMgr.cpp",
607      "$flutter_root/skia/src/core/SkFontStream.cpp",
608      "$flutter_root/skia/src/core/SkGaussFilter.cpp",
609      "$flutter_root/skia/src/core/SkGeometry.cpp",
610      "$flutter_root/skia/src/core/SkGlobalInitialization_core.cpp",
611      "$flutter_root/skia/src/core/SkGlyph.cpp",
612      "$flutter_root/skia/src/core/SkGlyphRun.cpp",
613      "$flutter_root/skia/src/core/SkGlyphRunPainter.cpp",
614      "$flutter_root/skia/src/core/SkGpuBlurUtils.cpp",
615      "$flutter_root/skia/src/core/SkGraphics.cpp",
616      "$flutter_root/skia/src/core/SkHalf.cpp",
617      "$flutter_root/skia/src/core/SkICC.cpp",
618      "$flutter_root/skia/src/core/SkImageFilter.cpp",
619      "$flutter_root/skia/src/core/SkImageFilterCache.cpp",
620      "$flutter_root/skia/src/core/SkImageGenerator.cpp",
621      "$flutter_root/skia/src/core/SkImageInfo.cpp",
622      "$flutter_root/skia/src/core/SkLatticeIter.cpp",
623      "$flutter_root/skia/src/core/SkLineClipper.cpp",
624      "$flutter_root/skia/src/core/SkLocalMatrixImageFilter.cpp",
625      "$flutter_root/skia/src/core/SkMD5.cpp",
626      "$flutter_root/skia/src/core/SkMallocPixelRef.cpp",
627      "$flutter_root/skia/src/core/SkMask.cpp",
628      "$flutter_root/skia/src/core/SkMaskBlurFilter.cpp",
629      "$flutter_root/skia/src/core/SkMaskCache.cpp",
630      "$flutter_root/skia/src/core/SkMaskFilter.cpp",
631      "$flutter_root/skia/src/core/SkMaskGamma.cpp",
632      "$flutter_root/skia/src/core/SkMath.cpp",
633      "$flutter_root/skia/src/core/SkMatrix.cpp",
634      "$flutter_root/skia/src/core/SkMatrix44.cpp",
635      "$flutter_root/skia/src/core/SkMatrixImageFilter.cpp",
636      "$flutter_root/skia/src/core/SkMiniRecorder.cpp",
637      "$flutter_root/skia/src/core/SkMipMap.cpp",
638      "$flutter_root/skia/src/core/SkModeColorFilter.cpp",
639      "$flutter_root/skia/src/core/SkMultiPictureDraw.cpp",
640      "$flutter_root/skia/src/core/SkNormalFlatSource.cpp",
641      "$flutter_root/skia/src/core/SkNormalMapSource.cpp",
642      "$flutter_root/skia/src/core/SkNormalSource.cpp",
643      "$flutter_root/skia/src/core/SkOpts.cpp",
644      "$flutter_root/skia/src/core/SkOverdrawCanvas.cpp",
645      "$flutter_root/skia/src/core/SkPaint.cpp",
646      "$flutter_root/skia/src/core/SkPaintPriv.cpp",
647      "$flutter_root/skia/src/core/SkPath.cpp",
648      "$flutter_root/skia/src/core/SkPathEffect.cpp",
649      "$flutter_root/skia/src/core/SkPathMeasure.cpp",
650      "$flutter_root/skia/src/core/SkPathRef.cpp",
651      "$flutter_root/skia/src/core/SkPath_serial.cpp",
652      "$flutter_root/skia/src/core/SkPicture.cpp",
653      "$flutter_root/skia/src/core/SkPictureData.cpp",
654      "$flutter_root/skia/src/core/SkPictureFlat.cpp",
655      "$flutter_root/skia/src/core/SkPictureImageGenerator.cpp",
656      "$flutter_root/skia/src/core/SkPicturePlayback.cpp",
657      "$flutter_root/skia/src/core/SkPictureRecord.cpp",
658      "$flutter_root/skia/src/core/SkPictureRecorder.cpp",
659      "$flutter_root/skia/src/core/SkPixelRef.cpp",
660      "$flutter_root/skia/src/core/SkPixmap.cpp",
661      "$flutter_root/skia/src/core/SkPoint.cpp",
662      "$flutter_root/skia/src/core/SkPoint3.cpp",
663      "$flutter_root/skia/src/core/SkPromiseImageTexture.cpp",
664      "$flutter_root/skia/src/core/SkPtrRecorder.cpp",
665      "$flutter_root/skia/src/core/SkQuadClipper.cpp",
666      "$flutter_root/skia/src/core/SkRRect.cpp",
667      "$flutter_root/skia/src/core/SkRTree.cpp",
668      "$flutter_root/skia/src/core/SkRWBuffer.cpp",
669      "$flutter_root/skia/src/core/SkRasterClip.cpp",
670      "$flutter_root/skia/src/core/SkRasterPipeline.cpp",
671      "$flutter_root/skia/src/core/SkRasterPipelineBlitter.cpp",
672      "$flutter_root/skia/src/core/SkReadBuffer.cpp",
673      "$flutter_root/skia/src/core/SkRecord.cpp",
674      "$flutter_root/skia/src/core/SkRecordDraw.cpp",
675      "$flutter_root/skia/src/core/SkRecordOpts.cpp",
676      "$flutter_root/skia/src/core/SkRecordedDrawable.cpp",
677      "$flutter_root/skia/src/core/SkRecorder.cpp",
678      "$flutter_root/skia/src/core/SkRecords.cpp",
679      "$flutter_root/skia/src/core/SkRect.cpp",
680      "$flutter_root/skia/src/core/SkRegion.cpp",
681      "$flutter_root/skia/src/core/SkRegion_path.cpp",
682      "$flutter_root/skia/src/core/SkRemoteGlyphCache.cpp",
683      "$flutter_root/skia/src/core/SkResourceCache.cpp",
684      "$flutter_root/skia/src/core/SkScalar.cpp",
685      "$flutter_root/skia/src/core/SkScalerContext.cpp",
686      "$flutter_root/skia/src/core/SkScan.cpp",
687      "$flutter_root/skia/src/core/SkScan_AAAPath.cpp",
688      "$flutter_root/skia/src/core/SkScan_AntiPath.cpp",
689      "$flutter_root/skia/src/core/SkScan_Antihair.cpp",
690      "$flutter_root/skia/src/core/SkScan_Hairline.cpp",
691      "$flutter_root/skia/src/core/SkScan_Path.cpp",
692      "$flutter_root/skia/src/core/SkSemaphore.cpp",
693      "$flutter_root/skia/src/core/SkSharedMutex.cpp",
694      "$flutter_root/skia/src/core/SkSpecialImage.cpp",
695      "$flutter_root/skia/src/core/SkSpecialSurface.cpp",
696      "$flutter_root/skia/src/core/SkSpinlock.cpp",
697      "$flutter_root/skia/src/core/SkSpriteBlitter_ARGB32.cpp",
698      "$flutter_root/skia/src/core/SkSpriteBlitter_RGB565.cpp",
699      "$flutter_root/skia/src/core/SkStream.cpp",
700      "$flutter_root/skia/src/core/SkStrike.cpp",
701      "$flutter_root/skia/src/core/SkStrikeCache.cpp",
702      "$flutter_root/skia/src/core/SkStrikeSpec.cpp",
703      "$flutter_root/skia/src/core/SkString.cpp",
704      "$flutter_root/skia/src/core/SkStringUtils.cpp",
705      "$flutter_root/skia/src/core/SkStroke.cpp",
706      "$flutter_root/skia/src/core/SkStrokeRec.cpp",
707      "$flutter_root/skia/src/core/SkStrokerPriv.cpp",
708      "$flutter_root/skia/src/core/SkSurfaceCharacterization.cpp",
709      "$flutter_root/skia/src/core/SkSwizzle.cpp",
710      "$flutter_root/skia/src/core/SkTLS.cpp",
711      "$flutter_root/skia/src/core/SkTSearch.cpp",
712      "$flutter_root/skia/src/core/SkTaskGroup.cpp",
713      "$flutter_root/skia/src/core/SkTextBlob.cpp",
714      "$flutter_root/skia/src/core/SkThreadID.cpp",
715      "$flutter_root/skia/src/core/SkTime.cpp",
716      "$flutter_root/skia/src/core/SkTypeface.cpp",
717      "$flutter_root/skia/src/core/SkTypefaceCache.cpp",
718      "$flutter_root/skia/src/core/SkTypeface_remote.cpp",
719      "$flutter_root/skia/src/core/SkUnPreMultiply.cpp",
720      "$flutter_root/skia/src/core/SkUtils.cpp",
721      "$flutter_root/skia/src/core/SkVM.cpp",
722      "$flutter_root/skia/src/core/SkVMBlitter.cpp",
723      "$flutter_root/skia/src/core/SkVertState.cpp",
724      "$flutter_root/skia/src/core/SkVertices.cpp",
725      "$flutter_root/skia/src/core/SkWriteBuffer.cpp",
726      "$flutter_root/skia/src/core/SkWriter32.cpp",
727      "$flutter_root/skia/src/core/SkXfermode.cpp",
728      "$flutter_root/skia/src/core/SkXfermodeInterpretation.cpp",
729      "$flutter_root/skia/src/core/SkYUVASizeInfo.cpp",
730      "$flutter_root/skia/src/core/SkYUVMath.cpp",
731      "$flutter_root/skia/src/core/SkYUVPlanesCache.cpp",
732      "$flutter_root/skia/src/effects/Sk1DPathEffect.cpp",
733      "$flutter_root/skia/src/effects/Sk2DPathEffect.cpp",
734      "$flutter_root/skia/src/effects/SkColorMatrix.cpp",
735      "$flutter_root/skia/src/effects/SkColorMatrixFilter.cpp",
736      "$flutter_root/skia/src/effects/SkCornerPathEffect.cpp",
737      "$flutter_root/skia/src/effects/SkDashPathEffect.cpp",
738      "$flutter_root/skia/src/effects/SkDiscretePathEffect.cpp",
739      "$flutter_root/skia/src/effects/SkEmbossMask.cpp",
740      "$flutter_root/skia/src/effects/SkEmbossMaskFilter.cpp",
741      "$flutter_root/skia/src/effects/SkHighContrastFilter.cpp",
742      "$flutter_root/skia/src/effects/SkLayerDrawLooper.cpp",
743      "$flutter_root/skia/src/effects/SkLumaColorFilter.cpp",
744      "$flutter_root/skia/src/effects/SkOpPathEffect.cpp",
745      "$flutter_root/skia/src/effects/SkOverdrawColorFilter.cpp",
746      "$flutter_root/skia/src/effects/SkPackBits.cpp",
747      "$flutter_root/skia/src/effects/SkShaderMaskFilter.cpp",
748      "$flutter_root/skia/src/effects/SkTableColorFilter.cpp",
749      "$flutter_root/skia/src/effects/SkTableMaskFilter.cpp",
750      "$flutter_root/skia/src/effects/SkTrimPathEffect.cpp",
751      "$flutter_root/skia/src/effects/imagefilters/SkAlphaThresholdFilter.cpp",
752      "$flutter_root/skia/src/effects/imagefilters/SkArithmeticImageFilter.cpp",
753      "$flutter_root/skia/src/effects/imagefilters/SkBlurImageFilter.cpp",
754      "$flutter_root/skia/src/effects/imagefilters/SkColorFilterImageFilter.cpp",
755      "$flutter_root/skia/src/effects/imagefilters/SkComposeImageFilter.cpp",
756      "$flutter_root/skia/src/effects/imagefilters/SkDisplacementMapEffect.cpp",
757      "$flutter_root/skia/src/effects/imagefilters/SkDropShadowImageFilter.cpp",
758      "$flutter_root/skia/src/effects/imagefilters/SkImageFilters.cpp",
759      "$flutter_root/skia/src/effects/imagefilters/SkImageSource.cpp",
760      "$flutter_root/skia/src/effects/imagefilters/SkLightingImageFilter.cpp",
761      "$flutter_root/skia/src/effects/imagefilters/SkMagnifierImageFilter.cpp",
762      "$flutter_root/skia/src/effects/imagefilters/SkMatrixConvolutionImageFilter.cpp",
763      "$flutter_root/skia/src/effects/imagefilters/SkMergeImageFilter.cpp",
764      "$flutter_root/skia/src/effects/imagefilters/SkMorphologyImageFilter.cpp",
765      "$flutter_root/skia/src/effects/imagefilters/SkOffsetImageFilter.cpp",
766      "$flutter_root/skia/src/effects/imagefilters/SkPaintImageFilter.cpp",
767      "$flutter_root/skia/src/effects/imagefilters/SkPictureImageFilter.cpp",
768      "$flutter_root/skia/src/effects/imagefilters/SkTileImageFilter.cpp",
769      "$flutter_root/skia/src/effects/imagefilters/SkXfermodeImageFilter.cpp",
770      "$flutter_root/skia/src/image/SkImage.cpp",
771      "$flutter_root/skia/src/image/SkImage_Lazy.cpp",
772      "$flutter_root/skia/src/image/SkImage_Raster.cpp",
773      "$flutter_root/skia/src/image/SkSurface.cpp",
774      "$flutter_root/skia/src/image/SkSurface_Raster.cpp",
775      "$flutter_root/skia/src/images/SkImageEncoder.cpp",
776      "$flutter_root/skia/src/lazy/SkDiscardableMemoryPool.cpp",
777      "$flutter_root/skia/src/pathops/SkAddIntersections.cpp",
778      "$flutter_root/skia/src/pathops/SkDConicLineIntersection.cpp",
779      "$flutter_root/skia/src/pathops/SkDCubicLineIntersection.cpp",
780      "$flutter_root/skia/src/pathops/SkDCubicToQuads.cpp",
781      "$flutter_root/skia/src/pathops/SkDLineIntersection.cpp",
782      "$flutter_root/skia/src/pathops/SkDQuadLineIntersection.cpp",
783      "$flutter_root/skia/src/pathops/SkIntersections.cpp",
784      "$flutter_root/skia/src/pathops/SkOpAngle.cpp",
785      "$flutter_root/skia/src/pathops/SkOpBuilder.cpp",
786      "$flutter_root/skia/src/pathops/SkOpCoincidence.cpp",
787      "$flutter_root/skia/src/pathops/SkOpContour.cpp",
788      "$flutter_root/skia/src/pathops/SkOpCubicHull.cpp",
789      "$flutter_root/skia/src/pathops/SkOpEdgeBuilder.cpp",
790      "$flutter_root/skia/src/pathops/SkOpSegment.cpp",
791      "$flutter_root/skia/src/pathops/SkOpSpan.cpp",
792      "$flutter_root/skia/src/pathops/SkPathOpsAsWinding.cpp",
793      "$flutter_root/skia/src/pathops/SkPathOpsCommon.cpp",
794      "$flutter_root/skia/src/pathops/SkPathOpsConic.cpp",
795      "$flutter_root/skia/src/pathops/SkPathOpsCubic.cpp",
796      "$flutter_root/skia/src/pathops/SkPathOpsCurve.cpp",
797      "$flutter_root/skia/src/pathops/SkPathOpsDebug.cpp",
798      "$flutter_root/skia/src/pathops/SkPathOpsLine.cpp",
799      "$flutter_root/skia/src/pathops/SkPathOpsOp.cpp",
800      "$flutter_root/skia/src/pathops/SkPathOpsQuad.cpp",
801      "$flutter_root/skia/src/pathops/SkPathOpsRect.cpp",
802      "$flutter_root/skia/src/pathops/SkPathOpsSimplify.cpp",
803      "$flutter_root/skia/src/pathops/SkPathOpsTSect.cpp",
804      "$flutter_root/skia/src/pathops/SkPathOpsTightBounds.cpp",
805      "$flutter_root/skia/src/pathops/SkPathOpsTypes.cpp",
806      "$flutter_root/skia/src/pathops/SkPathOpsWinding.cpp",
807      "$flutter_root/skia/src/pathops/SkPathWriter.cpp",
808      "$flutter_root/skia/src/pathops/SkReduceOrder.cpp",
809      "$flutter_root/skia/src/ports/SkDebug_android.cpp",
810      "$flutter_root/skia/src/ports/SkDiscardableMemory_none.cpp",
811      "$flutter_root/skia/src/ports/SkGlobalInitialization_default.cpp",
812      "$flutter_root/skia/src/ports/SkImageGenerator_skia.cpp",
813      "$flutter_root/skia/src/ports/SkMemory_malloc.cpp",
814      "$flutter_root/skia/src/ports/SkOSFile_posix.cpp",
815      "$flutter_root/skia/src/ports/SkOSFile_stdio.cpp",
816      "$flutter_root/skia/src/ports/SkOSLibrary_posix.cpp",
817      "$flutter_root/skia/src/ports/SkTLS_pthread.cpp",
818      "$flutter_root/skia/src/sfnt/SkOTTable_name.cpp",
819      "$flutter_root/skia/src/sfnt/SkOTUtils.cpp",
820      "$flutter_root/skia/src/shaders/SkBitmapProcShader.cpp",
821      "$flutter_root/skia/src/shaders/SkColorFilterShader.cpp",
822      "$flutter_root/skia/src/shaders/SkColorShader.cpp",
823      "$flutter_root/skia/src/shaders/SkComposeShader.cpp",
824      "$flutter_root/skia/src/shaders/SkImageShader.cpp",
825      "$flutter_root/skia/src/shaders/SkLightingShader.cpp",
826      "$flutter_root/skia/src/shaders/SkLights.cpp",
827      "$flutter_root/skia/src/shaders/SkLocalMatrixShader.cpp",
828      "$flutter_root/skia/src/shaders/SkPerlinNoiseShader.cpp",
829      "$flutter_root/skia/src/shaders/SkPictureShader.cpp",
830      "$flutter_root/skia/src/shaders/SkRTShader.cpp",
831      "$flutter_root/skia/src/shaders/SkShader.cpp",
832      "$flutter_root/skia/src/shaders/gradients/Sk4fGradientBase.cpp",
833      "$flutter_root/skia/src/shaders/gradients/Sk4fLinearGradient.cpp",
834      "$flutter_root/skia/src/shaders/gradients/SkGradientShader.cpp",
835      "$flutter_root/skia/src/shaders/gradients/SkLinearGradient.cpp",
836      "$flutter_root/skia/src/shaders/gradients/SkRadialGradient.cpp",
837      "$flutter_root/skia/src/shaders/gradients/SkSweepGradient.cpp",
838      "$flutter_root/skia/src/shaders/gradients/SkTwoPointConicalGradient.cpp",
839      "$flutter_root/skia/src/sksl/SkSLASTNode.cpp",
840      "$flutter_root/skia/src/sksl/SkSLByteCode.cpp",
841      "$flutter_root/skia/src/sksl/SkSLByteCodeGenerator.cpp",
842      "$flutter_root/skia/src/sksl/SkSLCFGGenerator.cpp",
843      "$flutter_root/skia/src/sksl/SkSLCompiler.cpp",
844      "$flutter_root/skia/src/sksl/SkSLIRGenerator.cpp",
845      "$flutter_root/skia/src/sksl/SkSLJIT.cpp",
846      "$flutter_root/skia/src/sksl/SkSLLexer.cpp",
847      "$flutter_root/skia/src/sksl/SkSLParser.cpp",
848      "$flutter_root/skia/src/sksl/SkSLString.cpp",
849      "$flutter_root/skia/src/sksl/SkSLUtil.cpp",
850      "$flutter_root/skia/src/sksl/ir/SkSLSetting.cpp",
851      "$flutter_root/skia/src/sksl/ir/SkSLSymbolTable.cpp",
852      "$flutter_root/skia/src/sksl/ir/SkSLType.cpp",
853      "$flutter_root/skia/src/sksl/ir/SkSLVariableReference.cpp",
854      "$flutter_root/skia/src/utils/Sk3D.cpp",
855      "$flutter_root/skia/src/utils/SkAnimCodecPlayer.cpp",
856      "$flutter_root/skia/src/utils/SkBase64.cpp",
857      "$flutter_root/skia/src/utils/SkCamera.cpp",
858      "$flutter_root/skia/src/utils/SkCanvasStack.cpp",
859      "$flutter_root/skia/src/utils/SkCanvasStateUtils.cpp",
860      "$flutter_root/skia/src/utils/SkCharToGlyphCache.cpp",
861      "$flutter_root/skia/src/utils/SkDashPath.cpp",
862      "$flutter_root/skia/src/utils/SkEventTracer.cpp",
863      "$flutter_root/skia/src/utils/SkFloatToDecimal.cpp",
864      "$flutter_root/skia/src/utils/SkFrontBufferedStream.cpp",
865      "$flutter_root/skia/src/utils/SkInterpolator.cpp",
866      "$flutter_root/skia/src/utils/SkJSON.cpp",
867      "$flutter_root/skia/src/utils/SkJSONWriter.cpp",
868      "$flutter_root/skia/src/utils/SkMatrix22.cpp",
869      "$flutter_root/skia/src/utils/SkMultiPictureDocument.cpp",
870      "$flutter_root/skia/src/utils/SkNWayCanvas.cpp",
871      "$flutter_root/skia/src/utils/SkNullCanvas.cpp",
872      "$flutter_root/skia/src/utils/SkOSPath.cpp",
873      "$flutter_root/skia/src/utils/SkPaintFilterCanvas.cpp",
874      "$flutter_root/skia/src/utils/SkParse.cpp",
875      "$flutter_root/skia/src/utils/SkParseColor.cpp",
876      "$flutter_root/skia/src/utils/SkParsePath.cpp",
877      "$flutter_root/skia/src/utils/SkPatchUtils.cpp",
878      "$flutter_root/skia/src/utils/SkPolyUtils.cpp",
879      "$flutter_root/skia/src/utils/SkShadowTessellator.cpp",
880      "$flutter_root/skia/src/utils/SkShadowUtils.cpp",
881      "$flutter_root/skia/src/utils/SkShaperJSONWriter.cpp",
882      "$flutter_root/skia/src/utils/SkTextUtils.cpp",
883      "$flutter_root/skia/src/utils/SkThreadUtils_pthread.cpp",
884      "$flutter_root/skia/src/utils/SkThreadUtils_win.cpp",
885      "$flutter_root/skia/src/utils/SkUTF.cpp",
886      "$flutter_root/skia/src/utils/SkWhitelistTypefaces.cpp",
887      "$flutter_root/skia/src/utils/mac/SkCreateCGImageRef.cpp",
888      "$flutter_root/skia/src/utils/mac/SkStream_mac.cpp",
889      "$flutter_root/skia/src/utils/win/SkAutoCoInitialize.cpp",
890      "$flutter_root/skia/src/utils/win/SkDWrite.cpp",
891      "$flutter_root/skia/src/utils/win/SkDWriteFontFileStream.cpp",
892      "$flutter_root/skia/src/utils/win/SkDWriteGeometrySink.cpp",
893      "$flutter_root/skia/src/utils/win/SkHRESULT.cpp",
894      "$flutter_root/skia/src/utils/win/SkIStream.cpp",
895      "$flutter_root/skia/src/utils/win/SkWGL_win.cpp",
896      "$flutter_root/skia/src/xps/SkXPSDevice.cpp",
897      "$flutter_root/skia/src/xps/SkXPSDocument.cpp",
898    ]
899
900    if (enable_dump_drawcmd) {
901      defines += [ "DUMP_DRAW_CMD" ]
902    }
903
904    if (platform == "windows") {
905      defines -= [ "NOGDI" ]
906
907      sources -= [
908        "$flutter_root/skia/src/ports/SkOSFile_posix.cpp",
909        "$flutter_root/skia/src/ports/SkOSLibrary_posix.cpp",
910        "$flutter_root/skia/src/ports/SkTLS_pthread.cpp",
911
912        # SkXPS - Experimental XPS backend, maybe we can remove this.
913        "$flutter_root/skia/src/xps/SkXPSDevice.cpp",
914        "$flutter_root/skia/src/xps/SkXPSDocument.cpp",
915      ]
916
917      sources += [
918        "$flutter_root/skia/src/ports/SkDebug_win.cpp",
919        "$flutter_root/skia/src/ports/SkImageEncoder_WIC.cpp",
920        "$flutter_root/skia/src/ports/SkImageGeneratorWIC.cpp",
921        "$flutter_root/skia/src/ports/SkOSFile_win.cpp",
922        "$flutter_root/skia/src/ports/SkOSLibrary_win.cpp",
923        "$flutter_root/skia/src/ports/SkTLS_win.cpp",
924      ]
925
926      libs = [
927        "//prebuilts/mingw-w64/ohos/linux-x86_64/clang-mingw/x86_64-w64-mingw32/lib/libfontsub.a",
928        "//prebuilts/mingw-w64/ohos/linux-x86_64/clang-mingw/x86_64-w64-mingw32/lib/libole32.a",
929        "//prebuilts/mingw-w64/ohos/linux-x86_64/clang-mingw/x86_64-w64-mingw32/lib/liboleaut32.a",
930        "//prebuilts/mingw-w64/ohos/linux-x86_64/clang-mingw/x86_64-w64-mingw32/lib/libuser32.a",
931        "//prebuilts/mingw-w64/ohos/linux-x86_64/clang-mingw/x86_64-w64-mingw32/lib/libusp10.a",
932        "//prebuilts/mingw-w64/ohos/linux-x86_64/clang-mingw/x86_64-w64-mingw32/lib/libwindowscodecs.a",
933      ]
934    } else if (platform == "mac") {
935      sources += [
936        "$flutter_root/skia/src/ports/SkDebug_stdio.cpp",
937        "$flutter_root/skia/src/ports/SkImageEncoder_CG.cpp",
938        "$flutter_root/skia/src/ports/SkImageGeneratorCG.cpp",
939      ]
940
941      libs = [
942        # AppKit symbols NSFontWeightXXX may be dlsym'ed.
943        "AppKit.framework",
944        "ApplicationServices.framework",
945        "OpenGL.framework",
946      ]
947    } else if (platform == "ios") {
948      sources += [
949        "$flutter_root/skia/src/ports/SkDebug_stdio.cpp",
950        "$flutter_root/skia/src/ports/SkFontHost_mac.cpp",
951        "$flutter_root/skia/src/ports/SkImageEncoder_CG.cpp",
952        "$flutter_root/skia/src/ports/SkImageGeneratorCG.cpp",
953      ]
954      libs = [
955        "CoreFoundation.framework",
956        "CoreGraphics.framework",
957        "CoreText.framework",
958        "ImageIO.framework",
959        "MobileCoreServices.framework",
960
961        # UIKit symbols UIFontWeightXXX may be dlsym'ed.
962        "UIKit.framework",
963      ]
964    } else if (platform == "linux") {
965      sources += [ "$flutter_root/skia/src/ports/SkDebug_stdio.cpp" ]
966      libs = [ "GL" ]
967    } else {
968      # Ohos and Android plarform
969      if (target_cpu != "arm") {
970        defines += [ "SKVM_JIT" ]
971      }
972
973      if (platform == "ohos") {
974        defines -= [
975          "SK_DISABLE_READBUFFER",
976          "SK_DISABLE_EFFECT_DESERIALIZATION",
977        ]
978      }
979
980      if (defined(config.disable_gpu) && config.disable_gpu) {
981        defines += [
982          "SK_BUILD_FOR_UNIX",
983          "SK_SUPPORT_ATLAS_TEXT=0",
984          "SK_SUPPORT_GPU=0",
985        ]
986        defines -= [
987          "SK_SUPPORT_ATLAS_TEXT=1",
988          "SK_GL",
989        ]
990      } else {
991        if (is_standard_system) {
992          public_deps = [ "//foundation/graphic/graphic_2d:libgl" ]
993        } else {
994          aosp_deps = [
995            "shared_library:libEGL",
996            "shared_library:libGLESv2",
997            "shared_library:liblog",
998          ]
999        }
1000      }
1001
1002      if (defined(config.sk_use_hilog) && config.sk_use_hilog) {
1003        sources -= [ "$flutter_root/skia/src/ports/SkDebug_android.cpp" ]
1004        sources += [ "$flutter_root/skia/src/ports/SkDebug_ohos.cpp" ]
1005        external_deps = [ "hiviewdfx_hilog_native:libhilog" ]
1006      }
1007    }
1008  }
1009}
1010
1011foreach(item, ace_platforms) {
1012  ace_skia_core("ace_skia_core_" + item.name) {
1013    platform = item.name
1014    defines = []
1015    cflags_cc = []
1016    config = {
1017    }
1018
1019    if (defined(item.config)) {
1020      config = item.config
1021    }
1022
1023    if (defined(config.defines)) {
1024      defines = config.defines
1025    }
1026
1027    if (defined(config.cflags_cc)) {
1028      cflags_cc = config.cflags_cc
1029    }
1030  }
1031}
1032
1033# ------------------------------------------------
1034#      Skia core config end
1035# ------------------------------------------------
1036
1037# ------------------------------------------------
1038#      Skia ext config begin
1039# ------------------------------------------------
1040config("ace_skia_ext_config") {
1041  visibility = [ ":*" ]
1042  include_dirs = [
1043    "$flutter_root",
1044    "$flutter_root/skia",
1045    "$flutter_root/engine",
1046  ]
1047
1048  cflags = [ "-fvisibility=hidden" ]
1049}
1050
1051template("ace_skia_ext") {
1052  forward_variables_from(invoker, "*")
1053
1054  ohos_source_set(target_name) {
1055    part_name = flutter_part
1056    subsystem_name = flutter_subsystem
1057    defines += invoker.defines
1058    defines += [ "OHOS_ACE_SKIA_EXT" ]
1059    configs = [ ":ace_skia_ext_config" ]
1060    cflags_cc += invoker.cflags_cc
1061    cflags_cc += ace_skia_common_ccflags
1062
1063    sources = [
1064      # enable ext utils
1065      "$flutter_root/skia/src/core/SkArenaAlloc.cpp",
1066      "$flutter_root/skia/src/core/SkOpts.cpp",
1067      "$flutter_root/skia/src/core/SkTSearch.cpp",
1068      "$flutter_root/skia/src/utils/SkBase64.cpp",
1069
1070      # use ohos fontmgr
1071      "$flutter_root/skia/src/ports/SkFontMgr_ohos.cpp",
1072    ]
1073
1074    deps = [
1075      ":ace_skia_opts_$platform",
1076      ":ace_svg_model_$platform",
1077      ":ace_xml",
1078    ]
1079
1080    if (platform == "ohos" && defined(config.enable_native_view) &&
1081        config.enable_native_view) {
1082      aosp_deps = [
1083        "shared_library:libexpat",
1084        "shared_library:libhwui",
1085      ]
1086    }
1087  }
1088}
1089
1090foreach(item, ace_platforms) {
1091  ace_skia_ext("ace_skia_ext_" + item.name) {
1092    platform = item.name
1093    defines = []
1094    cflags_cc = []
1095    config = {
1096    }
1097
1098    if (defined(item.config)) {
1099      config = item.config
1100    }
1101
1102    if (defined(config.defines)) {
1103      defines = config.defines
1104    }
1105
1106    if (defined(config.cflags_cc)) {
1107      cflags_cc = config.cflags_cc
1108    }
1109  }
1110}
1111
1112# ------------------------------------------------
1113#      Skia ext config end
1114# ------------------------------------------------
1115
1116# ------------------------------------------------
1117#      Skia jpeg config begin
1118# ------------------------------------------------
1119config("ace_jpeg_config") {
1120  visibility = [ ":*" ]
1121  include_dirs = [
1122    "$flutter_root/skia",
1123    "$flutter_root/skia/third_party/libjpeg-turbo",
1124    "$flutter_root/skia/third_party/externals/libjpeg-turbo",
1125  ]
1126  cflags_cc = ace_skia_common_ccflags
1127  cflags = ace_skia_common_cflags
1128}
1129
1130ohos_source_set("ace_jpeg") {
1131  part_name = flutter_part
1132  subsystem_name = flutter_subsystem
1133  configs = [ ":ace_jpeg_config" ]
1134
1135  sources = [
1136    "$flutter_root/skia/src/codec/SkJpegCodec.cpp",
1137    "$flutter_root/skia/src/codec/SkJpegDecoderMgr.cpp",
1138    "$flutter_root/skia/src/codec/SkJpegUtility.cpp",
1139    "$flutter_root/skia/src/images/SkJPEGWriteUtility.cpp",
1140    "$flutter_root/skia/src/images/SkJpegEncoder.cpp",
1141  ]
1142
1143  defines = ace_skia_common_defines
1144  defines += [ "SK_HAS_JPEG_LIBRARY" ]
1145}
1146
1147# ------------------------------------------------
1148#      Skia jpeg config end
1149# ------------------------------------------------
1150
1151# ------------------------------------------------
1152#      Skia skcms config begin
1153# ------------------------------------------------
1154config("ace_skcms_config") {
1155  visibility = [ ":*" ]
1156  include_dirs = [ "$flutter_root/skia/include/third_party/skcms" ]
1157  cflags_cc = ace_skia_common_ccflags
1158  cflags = [
1159    "-w",
1160    "-std=c11",
1161  ]
1162  cflags += ace_skia_common_cflags
1163}
1164
1165ohos_source_set("ace_skcms") {
1166  part_name = flutter_part
1167  subsystem_name = flutter_subsystem
1168  configs = [ ":ace_skcms_config" ]
1169  sources = [ "$flutter_root/skia/third_party/skcms/skcms.cc" ]
1170}
1171
1172# ------------------------------------------------
1173#      Skia skcms config end
1174# ------------------------------------------------
1175
1176# ------------------------------------------------
1177#      Skia pdf config begin
1178# ------------------------------------------------
1179config("pdf_compile_flags") {
1180  cflags_cc = ace_skia_common_ccflags
1181  cflags_cc += [ "-Wno-extra-semi" ]
1182  cflags = ace_skia_common_cflags
1183  cflags += [ "-Wno-extra-semi" ]
1184  include_dirs = [
1185    "$flutter_root/skia",
1186    "$flutter_root/skia/third_party/icu",
1187  ]
1188}
1189
1190template("ace_pdf") {
1191  forward_variables_from(invoker, "*")
1192
1193  ohos_source_set(target_name) {
1194    part_name = flutter_part
1195    subsystem_name = flutter_subsystem
1196    defines += invoker.defines
1197    cflags_cc += invoker.cflags_cc
1198    defines += ace_skia_common_defines
1199    defines += [
1200      "SK_PDF_USE_SFNTLY",
1201      "U_USING_ICU_NAMESPACE=0",
1202      "SK_USING_THIRD_PARTY_ICU",
1203    ]
1204
1205    configs = [
1206      ":skia_deps_include_config",
1207      ":pdf_compile_flags",
1208    ]
1209    if (platform == "android") {
1210      configs += [ "$ace_root/build:reduce_eh_frame_config" ]
1211    }
1212
1213    sources = [
1214      "$flutter_root/skia/src/pdf/SkClusterator.cpp",
1215      "$flutter_root/skia/src/pdf/SkDeflate.cpp",
1216      "$flutter_root/skia/src/pdf/SkJpegInfo.cpp",
1217      "$flutter_root/skia/src/pdf/SkKeyedImage.cpp",
1218      "$flutter_root/skia/src/pdf/SkPDFBitmap.cpp",
1219      "$flutter_root/skia/src/pdf/SkPDFDevice.cpp",
1220      "$flutter_root/skia/src/pdf/SkPDFDocument.cpp",
1221      "$flutter_root/skia/src/pdf/SkPDFFont.cpp",
1222      "$flutter_root/skia/src/pdf/SkPDFFormXObject.cpp",
1223      "$flutter_root/skia/src/pdf/SkPDFGradientShader.cpp",
1224      "$flutter_root/skia/src/pdf/SkPDFGraphicStackState.cpp",
1225      "$flutter_root/skia/src/pdf/SkPDFGraphicState.cpp",
1226      "$flutter_root/skia/src/pdf/SkPDFMakeCIDGlyphWidthsArray.cpp",
1227      "$flutter_root/skia/src/pdf/SkPDFMakeToUnicodeCmap.cpp",
1228      "$flutter_root/skia/src/pdf/SkPDFMetadata.cpp",
1229      "$flutter_root/skia/src/pdf/SkPDFResourceDict.cpp",
1230      "$flutter_root/skia/src/pdf/SkPDFShader.cpp",
1231      "$flutter_root/skia/src/pdf/SkPDFSubsetFont.cpp",
1232      "$flutter_root/skia/src/pdf/SkPDFTag.cpp",
1233      "$flutter_root/skia/src/pdf/SkPDFType1Font.cpp",
1234      "$flutter_root/skia/src/pdf/SkPDFTypes.cpp",
1235      "$flutter_root/skia/src/pdf/SkPDFUtils.cpp",
1236    ]
1237
1238    if (platform == "windows") {
1239      sources += [ "$flutter_root/skia/third_party/icu/SkLoadICU.cpp" ]
1240    }
1241
1242    deps = [
1243      "$ace_flutter_engine_root/icu:ace_libicu_$platform",
1244      "$ace_flutter_engine_root/sfntly:ace_libsfntly_$platform",
1245      "//third_party/zlib:libz",
1246    ]
1247  }
1248}
1249
1250foreach(item, ace_platforms) {
1251  ace_pdf("ace_pdf_" + item.name) {
1252    platform = item.name
1253    defines = []
1254    cflags_cc = []
1255    config = {
1256    }
1257
1258    if (defined(item.config)) {
1259      config = item.config
1260    }
1261
1262    if (defined(config.defines)) {
1263      defines = config.defines
1264    }
1265
1266    if (defined(config.cflags_cc)) {
1267      cflags_cc = config.cflags_cc
1268    }
1269  }
1270}
1271
1272# ------------------------------------------------
1273#      Skia pdf config end
1274# ------------------------------------------------
1275
1276# ------------------------------------------------
1277#      Skia gpu config begin
1278# ------------------------------------------------
1279config("ace_gpu_config") {
1280  visibility = [ ":*" ]
1281  include_dirs = [ "$flutter_root/skia" ]
1282  cflags_cc = ace_skia_common_ccflags
1283  cflags_cc += [ "-Wno-extra-semi" ]
1284  cflags = ace_skia_common_cflags
1285  cflags += [ "-Wno-extra-semi" ]
1286}
1287
1288template("ace_gpu") {
1289  forward_variables_from(invoker, "*")
1290
1291  ohos_source_set(target_name) {
1292    part_name = flutter_part
1293    subsystem_name = flutter_subsystem
1294    defines += invoker.defines
1295    defines += ace_skia_common_defines
1296    defines += [ "SK_DISABLE_REDUCE_OPLIST_SPLITTING" ]
1297    cflags_cc += invoker.cflags_cc
1298    configs = [
1299      ":ace_gpu_config",
1300      ":skia_deps_include_config",
1301    ]
1302    if (platform == "android") {
1303      configs += [ "$ace_root/build:reduce_eh_frame_config" ]
1304    }
1305
1306    sources = [
1307      "$flutter_root/skia/src/atlastext/SkAtlasTextContext.cpp",
1308      "$flutter_root/skia/src/atlastext/SkAtlasTextTarget.cpp",
1309      "$flutter_root/skia/src/atlastext/SkInternalAtlasTextContext.cpp",
1310      "$flutter_root/skia/src/gpu/GrAHardwareBufferImageGenerator.cpp",
1311      "$flutter_root/skia/src/gpu/GrAHardwareBufferUtils.cpp",
1312      "$flutter_root/skia/src/gpu/GrAuditTrail.cpp",
1313      "$flutter_root/skia/src/gpu/GrBackendSurface.cpp",
1314      "$flutter_root/skia/src/gpu/GrBackendTextureImageGenerator.cpp",
1315      "$flutter_root/skia/src/gpu/GrBitmapTextureMaker.cpp",
1316      "$flutter_root/skia/src/gpu/GrBlurUtils.cpp",
1317      "$flutter_root/skia/src/gpu/GrBufferAllocPool.cpp",
1318      "$flutter_root/skia/src/gpu/GrCaps.cpp",
1319      "$flutter_root/skia/src/gpu/GrClipStackClip.cpp",
1320      "$flutter_root/skia/src/gpu/GrColorSpaceInfo.cpp",
1321      "$flutter_root/skia/src/gpu/GrColorSpaceXform.cpp",
1322      "$flutter_root/skia/src/gpu/GrContext.cpp",
1323      "$flutter_root/skia/src/gpu/GrContextPriv.cpp",
1324      "$flutter_root/skia/src/gpu/GrContextThreadSafeProxy.cpp",
1325      "$flutter_root/skia/src/gpu/GrContext_Base.cpp",
1326      "$flutter_root/skia/src/gpu/GrDDLContext.cpp",
1327      "$flutter_root/skia/src/gpu/GrDataUtils.cpp",
1328      "$flutter_root/skia/src/gpu/GrDefaultGeoProcFactory.cpp",
1329      "$flutter_root/skia/src/gpu/GrDeinstantiateProxyTracker.cpp",
1330      "$flutter_root/skia/src/gpu/GrDistanceFieldGenFromVector.cpp",
1331      "$flutter_root/skia/src/gpu/GrDrawOpAtlas.cpp",
1332      "$flutter_root/skia/src/gpu/GrDrawOpTest.cpp",
1333      "$flutter_root/skia/src/gpu/GrDrawingManager.cpp",
1334      "$flutter_root/skia/src/gpu/GrDriverBugWorkarounds.cpp",
1335      "$flutter_root/skia/src/gpu/GrFixedClip.cpp",
1336      "$flutter_root/skia/src/gpu/GrFragmentProcessor.cpp",
1337      "$flutter_root/skia/src/gpu/GrGpu.cpp",
1338      "$flutter_root/skia/src/gpu/GrGpuBuffer.cpp",
1339      "$flutter_root/skia/src/gpu/GrGpuCommandBuffer.cpp",
1340      "$flutter_root/skia/src/gpu/GrGpuResource.cpp",
1341      "$flutter_root/skia/src/gpu/GrImageContext.cpp",
1342      "$flutter_root/skia/src/gpu/GrImageTextureMaker.cpp",
1343      "$flutter_root/skia/src/gpu/GrLegacyDirectContext.cpp",
1344      "$flutter_root/skia/src/gpu/GrMemoryPool.cpp",
1345      "$flutter_root/skia/src/gpu/GrOnFlushResourceProvider.cpp",
1346      "$flutter_root/skia/src/gpu/GrOpFlushState.cpp",
1347      "$flutter_root/skia/src/gpu/GrOpList.cpp",
1348      "$flutter_root/skia/src/gpu/GrPaint.cpp",
1349      "$flutter_root/skia/src/gpu/GrPath.cpp",
1350      "$flutter_root/skia/src/gpu/GrPathProcessor.cpp",
1351      "$flutter_root/skia/src/gpu/GrPathRenderer.cpp",
1352      "$flutter_root/skia/src/gpu/GrPathRendererChain.cpp",
1353      "$flutter_root/skia/src/gpu/GrPathRendering.cpp",
1354      "$flutter_root/skia/src/gpu/GrPipeline.cpp",
1355      "$flutter_root/skia/src/gpu/GrPrimitiveProcessor.cpp",
1356      "$flutter_root/skia/src/gpu/GrProcessor.cpp",
1357      "$flutter_root/skia/src/gpu/GrProcessorAnalysis.cpp",
1358      "$flutter_root/skia/src/gpu/GrProcessorSet.cpp",
1359      "$flutter_root/skia/src/gpu/GrProcessorUnitTest.cpp",
1360      "$flutter_root/skia/src/gpu/GrProgramDesc.cpp",
1361      "$flutter_root/skia/src/gpu/GrProxyProvider.cpp",
1362      "$flutter_root/skia/src/gpu/GrRecordingContext.cpp",
1363      "$flutter_root/skia/src/gpu/GrRectanizer_pow2.cpp",
1364      "$flutter_root/skia/src/gpu/GrRectanizer_skyline.cpp",
1365      "$flutter_root/skia/src/gpu/GrReducedClip.cpp",
1366      "$flutter_root/skia/src/gpu/GrRenderTarget.cpp",
1367      "$flutter_root/skia/src/gpu/GrRenderTargetContext.cpp",
1368      "$flutter_root/skia/src/gpu/GrRenderTargetOpList.cpp",
1369      "$flutter_root/skia/src/gpu/GrRenderTargetProxy.cpp",
1370      "$flutter_root/skia/src/gpu/GrRenderTask.cpp",
1371      "$flutter_root/skia/src/gpu/GrResourceAllocator.cpp",
1372      "$flutter_root/skia/src/gpu/GrResourceCache.cpp",
1373      "$flutter_root/skia/src/gpu/GrResourceProvider.cpp",
1374      "$flutter_root/skia/src/gpu/GrSWMaskHelper.cpp",
1375      "$flutter_root/skia/src/gpu/GrSamplePatternDictionary.cpp",
1376      "$flutter_root/skia/src/gpu/GrShaderCaps.cpp",
1377      "$flutter_root/skia/src/gpu/GrShaderUtils.cpp",
1378      "$flutter_root/skia/src/gpu/GrShaderVar.cpp",
1379      "$flutter_root/skia/src/gpu/GrSoftwarePathRenderer.cpp",
1380      "$flutter_root/skia/src/gpu/GrStencilAttachment.cpp",
1381      "$flutter_root/skia/src/gpu/GrStencilSettings.cpp",
1382      "$flutter_root/skia/src/gpu/GrStyle.cpp",
1383      "$flutter_root/skia/src/gpu/GrSurface.cpp",
1384      "$flutter_root/skia/src/gpu/GrSurfaceContext.cpp",
1385      "$flutter_root/skia/src/gpu/GrSurfaceProxy.cpp",
1386      "$flutter_root/skia/src/gpu/GrSwizzle.cpp",
1387      "$flutter_root/skia/src/gpu/GrTessellator.cpp",
1388      "$flutter_root/skia/src/gpu/GrTestUtils.cpp",
1389      "$flutter_root/skia/src/gpu/GrTexture.cpp",
1390      "$flutter_root/skia/src/gpu/GrTextureAdjuster.cpp",
1391      "$flutter_root/skia/src/gpu/GrTextureContext.cpp",
1392      "$flutter_root/skia/src/gpu/GrTextureMaker.cpp",
1393      "$flutter_root/skia/src/gpu/GrTextureOpList.cpp",
1394      "$flutter_root/skia/src/gpu/GrTextureProducer.cpp",
1395      "$flutter_root/skia/src/gpu/GrTextureProxy.cpp",
1396      "$flutter_root/skia/src/gpu/GrTextureRenderTargetProxy.cpp",
1397      "$flutter_root/skia/src/gpu/GrTextureResolveRenderTask.cpp",
1398      "$flutter_root/skia/src/gpu/GrXferProcessor.cpp",
1399      "$flutter_root/skia/src/gpu/GrYUVProvider.cpp",
1400      "$flutter_root/skia/src/gpu/SkGpuDevice.cpp",
1401      "$flutter_root/skia/src/gpu/SkGpuDevice_drawTexture.cpp",
1402      "$flutter_root/skia/src/gpu/SkGr.cpp",
1403      "$flutter_root/skia/src/gpu/ccpr/GrCCAtlas.cpp",
1404      "$flutter_root/skia/src/gpu/ccpr/GrCCClipPath.cpp",
1405      "$flutter_root/skia/src/gpu/ccpr/GrCCClipProcessor.cpp",
1406      "$flutter_root/skia/src/gpu/ccpr/GrCCConicShader.cpp",
1407      "$flutter_root/skia/src/gpu/ccpr/GrCCCoverageProcessor.cpp",
1408      "$flutter_root/skia/src/gpu/ccpr/GrCCCubicShader.cpp",
1409      "$flutter_root/skia/src/gpu/ccpr/GrCCDrawPathsOp.cpp",
1410      "$flutter_root/skia/src/gpu/ccpr/GrCCFillGeometry.cpp",
1411      "$flutter_root/skia/src/gpu/ccpr/GrCCFiller.cpp",
1412      "$flutter_root/skia/src/gpu/ccpr/GrCCPathCache.cpp",
1413      "$flutter_root/skia/src/gpu/ccpr/GrCCPathProcessor.cpp",
1414      "$flutter_root/skia/src/gpu/ccpr/GrCCPerFlushResources.cpp",
1415      "$flutter_root/skia/src/gpu/ccpr/GrCCQuadraticShader.cpp",
1416      "$flutter_root/skia/src/gpu/ccpr/GrCCStrokeGeometry.cpp",
1417      "$flutter_root/skia/src/gpu/ccpr/GrCCStroker.cpp",
1418      "$flutter_root/skia/src/gpu/ccpr/GrCoverageCountingPathRenderer.cpp",
1419      "$flutter_root/skia/src/gpu/ccpr/GrGSCoverageProcessor.cpp",
1420      "$flutter_root/skia/src/gpu/ccpr/GrOctoBounds.cpp",
1421      "$flutter_root/skia/src/gpu/ccpr/GrSampleMaskProcessor.cpp",
1422      "$flutter_root/skia/src/gpu/ccpr/GrStencilAtlasOp.cpp",
1423      "$flutter_root/skia/src/gpu/ccpr/GrVSCoverageProcessor.cpp",
1424      "$flutter_root/skia/src/gpu/effects/GrBezierEffect.cpp",
1425      "$flutter_root/skia/src/gpu/effects/GrBicubicEffect.cpp",
1426      "$flutter_root/skia/src/gpu/effects/GrBitmapTextGeoProc.cpp",
1427      "$flutter_root/skia/src/gpu/effects/GrConvexPolyEffect.cpp",
1428      "$flutter_root/skia/src/gpu/effects/GrCoverageSetOpXP.cpp",
1429      "$flutter_root/skia/src/gpu/effects/GrCustomXfermode.cpp",
1430      "$flutter_root/skia/src/gpu/effects/GrDisableColorXP.cpp",
1431      "$flutter_root/skia/src/gpu/effects/GrDistanceFieldGeoProc.cpp",
1432      "$flutter_root/skia/src/gpu/effects/GrGaussianConvolutionFragmentProcessor.cpp",
1433      "$flutter_root/skia/src/gpu/effects/GrMatrixConvolutionEffect.cpp",
1434      "$flutter_root/skia/src/gpu/effects/GrOvalEffect.cpp",
1435      "$flutter_root/skia/src/gpu/effects/GrPorterDuffXferProcessor.cpp",
1436      "$flutter_root/skia/src/gpu/effects/GrRRectEffect.cpp",
1437      "$flutter_root/skia/src/gpu/effects/GrSRGBEffect.cpp",
1438      "$flutter_root/skia/src/gpu/effects/GrShadowGeoProc.cpp",
1439      "$flutter_root/skia/src/gpu/effects/GrSkSLFP.cpp",
1440      "$flutter_root/skia/src/gpu/effects/GrTextureDomain.cpp",
1441      "$flutter_root/skia/src/gpu/effects/GrXfermodeFragmentProcessor.cpp",
1442      "$flutter_root/skia/src/gpu/effects/GrYUVtoRGBEffect.cpp",
1443      "$flutter_root/skia/src/gpu/effects/generated/GrAARectEffect.cpp",
1444      "$flutter_root/skia/src/gpu/effects/generated/GrAlphaThresholdFragmentProcessor.cpp",
1445      "$flutter_root/skia/src/gpu/effects/generated/GrBlurredEdgeFragmentProcessor.cpp",
1446      "$flutter_root/skia/src/gpu/effects/generated/GrCircleBlurFragmentProcessor.cpp",
1447      "$flutter_root/skia/src/gpu/effects/generated/GrCircleEffect.cpp",
1448      "$flutter_root/skia/src/gpu/effects/generated/GrColorMatrixFragmentProcessor.cpp",
1449      "$flutter_root/skia/src/gpu/effects/generated/GrComposeLerpEffect.cpp",
1450      "$flutter_root/skia/src/gpu/effects/generated/GrComposeLerpRedEffect.cpp",
1451      "$flutter_root/skia/src/gpu/effects/generated/GrConfigConversionEffect.cpp",
1452      "$flutter_root/skia/src/gpu/effects/generated/GrConstColorProcessor.cpp",
1453      "$flutter_root/skia/src/gpu/effects/generated/GrEllipseEffect.cpp",
1454      "$flutter_root/skia/src/gpu/effects/generated/GrLumaColorFilterEffect.cpp",
1455      "$flutter_root/skia/src/gpu/effects/generated/GrMagnifierEffect.cpp",
1456      "$flutter_root/skia/src/gpu/effects/generated/GrMixerEffect.cpp",
1457      "$flutter_root/skia/src/gpu/effects/generated/GrOverrideInputFragmentProcessor.cpp",
1458      "$flutter_root/skia/src/gpu/effects/generated/GrPremulInputFragmentProcessor.cpp",
1459      "$flutter_root/skia/src/gpu/effects/generated/GrRRectBlurEffect.cpp",
1460      "$flutter_root/skia/src/gpu/effects/generated/GrRectBlurEffect.cpp",
1461      "$flutter_root/skia/src/gpu/effects/generated/GrSimpleTextureEffect.cpp",
1462      "$flutter_root/skia/src/gpu/geometry/GrPathUtils.cpp",
1463      "$flutter_root/skia/src/gpu/geometry/GrQuad.cpp",
1464      "$flutter_root/skia/src/gpu/geometry/GrQuadUtils.cpp",
1465      "$flutter_root/skia/src/gpu/geometry/GrShape.cpp",
1466      "$flutter_root/skia/src/gpu/gl/GrGLAssembleGLESInterfaceAutogen.cpp",
1467      "$flutter_root/skia/src/gpu/gl/GrGLAssembleGLInterfaceAutogen.cpp",
1468      "$flutter_root/skia/src/gpu/gl/GrGLAssembleHelpers.cpp",
1469      "$flutter_root/skia/src/gpu/gl/GrGLAssembleInterface.cpp",
1470      "$flutter_root/skia/src/gpu/gl/GrGLAssembleWebGLInterfaceAutogen.cpp",
1471      "$flutter_root/skia/src/gpu/gl/GrGLBuffer.cpp",
1472      "$flutter_root/skia/src/gpu/gl/GrGLCaps.cpp",
1473      "$flutter_root/skia/src/gpu/gl/GrGLContext.cpp",
1474      "$flutter_root/skia/src/gpu/gl/GrGLExtensions.cpp",
1475      "$flutter_root/skia/src/gpu/gl/GrGLGLSL.cpp",
1476      "$flutter_root/skia/src/gpu/gl/GrGLGpu.cpp",
1477      "$flutter_root/skia/src/gpu/gl/GrGLGpuCommandBuffer.cpp",
1478      "$flutter_root/skia/src/gpu/gl/GrGLGpuProgramCache.cpp",
1479      "$flutter_root/skia/src/gpu/gl/GrGLInterfaceAutogen.cpp",
1480      "$flutter_root/skia/src/gpu/gl/GrGLPath.cpp",
1481      "$flutter_root/skia/src/gpu/gl/GrGLPathRendering.cpp",
1482      "$flutter_root/skia/src/gpu/gl/GrGLProgram.cpp",
1483      "$flutter_root/skia/src/gpu/gl/GrGLProgramDataManager.cpp",
1484      "$flutter_root/skia/src/gpu/gl/GrGLRenderTarget.cpp",
1485      "$flutter_root/skia/src/gpu/gl/GrGLSemaphore.cpp",
1486      "$flutter_root/skia/src/gpu/gl/GrGLStencilAttachment.cpp",
1487      "$flutter_root/skia/src/gpu/gl/GrGLTexture.cpp",
1488      "$flutter_root/skia/src/gpu/gl/GrGLTextureRenderTarget.cpp",
1489      "$flutter_root/skia/src/gpu/gl/GrGLTypesPriv.cpp",
1490      "$flutter_root/skia/src/gpu/gl/GrGLUniformHandler.cpp",
1491      "$flutter_root/skia/src/gpu/gl/GrGLUtil.cpp",
1492      "$flutter_root/skia/src/gpu/gl/GrGLVaryingHandler.cpp",
1493      "$flutter_root/skia/src/gpu/gl/GrGLVertexArray.cpp",
1494      "$flutter_root/skia/src/gpu/gl/builders/GrGLProgramBuilder.cpp",
1495      "$flutter_root/skia/src/gpu/gl/builders/GrGLShaderStringBuilder.cpp",
1496      "$flutter_root/skia/src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp",
1497      "$flutter_root/skia/src/gpu/glsl/GrGLSL.cpp",
1498      "$flutter_root/skia/src/gpu/glsl/GrGLSLBlend.cpp",
1499      "$flutter_root/skia/src/gpu/glsl/GrGLSLFragmentProcessor.cpp",
1500      "$flutter_root/skia/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp",
1501      "$flutter_root/skia/src/gpu/glsl/GrGLSLGeometryProcessor.cpp",
1502      "$flutter_root/skia/src/gpu/glsl/GrGLSLPrimitiveProcessor.cpp",
1503      "$flutter_root/skia/src/gpu/glsl/GrGLSLProgramBuilder.cpp",
1504      "$flutter_root/skia/src/gpu/glsl/GrGLSLProgramDataManager.cpp",
1505      "$flutter_root/skia/src/gpu/glsl/GrGLSLShaderBuilder.cpp",
1506      "$flutter_root/skia/src/gpu/glsl/GrGLSLUtil.cpp",
1507      "$flutter_root/skia/src/gpu/glsl/GrGLSLVarying.cpp",
1508      "$flutter_root/skia/src/gpu/glsl/GrGLSLVertexGeoBuilder.cpp",
1509      "$flutter_root/skia/src/gpu/glsl/GrGLSLXferProcessor.cpp",
1510      "$flutter_root/skia/src/gpu/gradients/GrGradientBitmapCache.cpp",
1511      "$flutter_root/skia/src/gpu/gradients/GrGradientShader.cpp",
1512      "$flutter_root/skia/src/gpu/gradients/generated/GrClampedGradientEffect.cpp",
1513      "$flutter_root/skia/src/gpu/gradients/generated/GrDualIntervalGradientColorizer.cpp",
1514      "$flutter_root/skia/src/gpu/gradients/generated/GrLinearGradientLayout.cpp",
1515      "$flutter_root/skia/src/gpu/gradients/generated/GrRadialGradientLayout.cpp",
1516      "$flutter_root/skia/src/gpu/gradients/generated/GrSingleIntervalGradientColorizer.cpp",
1517      "$flutter_root/skia/src/gpu/gradients/generated/GrSweepGradientLayout.cpp",
1518      "$flutter_root/skia/src/gpu/gradients/generated/GrTextureGradientColorizer.cpp",
1519      "$flutter_root/skia/src/gpu/gradients/generated/GrTiledGradientEffect.cpp",
1520      "$flutter_root/skia/src/gpu/gradients/generated/GrTwoPointConicalGradientLayout.cpp",
1521      "$flutter_root/skia/src/gpu/gradients/generated/GrUnrolledBinaryGradientColorizer.cpp",
1522      "$flutter_root/skia/src/gpu/mock/GrMockCaps.cpp",
1523      "$flutter_root/skia/src/gpu/mock/GrMockGpu.cpp",
1524      "$flutter_root/skia/src/gpu/mock/GrMockTypes.cpp",
1525      "$flutter_root/skia/src/gpu/ops/GrAAConvexPathRenderer.cpp",
1526      "$flutter_root/skia/src/gpu/ops/GrAAConvexTessellator.cpp",
1527      "$flutter_root/skia/src/gpu/ops/GrAAHairLinePathRenderer.cpp",
1528      "$flutter_root/skia/src/gpu/ops/GrAALinearizingConvexPathRenderer.cpp",
1529      "$flutter_root/skia/src/gpu/ops/GrAtlasTextOp.cpp",
1530      "$flutter_root/skia/src/gpu/ops/GrClearOp.cpp",
1531      "$flutter_root/skia/src/gpu/ops/GrClearStencilClipOp.cpp",
1532      "$flutter_root/skia/src/gpu/ops/GrCopySurfaceOp.cpp",
1533      "$flutter_root/skia/src/gpu/ops/GrDashLinePathRenderer.cpp",
1534      "$flutter_root/skia/src/gpu/ops/GrDashOp.cpp",
1535      "$flutter_root/skia/src/gpu/ops/GrDebugMarkerOp.cpp",
1536      "$flutter_root/skia/src/gpu/ops/GrDefaultPathRenderer.cpp",
1537      "$flutter_root/skia/src/gpu/ops/GrDrawAtlasOp.cpp",
1538      "$flutter_root/skia/src/gpu/ops/GrDrawPathOp.cpp",
1539      "$flutter_root/skia/src/gpu/ops/GrDrawVerticesOp.cpp",
1540      "$flutter_root/skia/src/gpu/ops/GrDrawableOp.cpp",
1541      "$flutter_root/skia/src/gpu/ops/GrFillRRectOp.cpp",
1542      "$flutter_root/skia/src/gpu/ops/GrFillRectOp.cpp",
1543      "$flutter_root/skia/src/gpu/ops/GrLatticeOp.cpp",
1544      "$flutter_root/skia/src/gpu/ops/GrMeshDrawOp.cpp",
1545      "$flutter_root/skia/src/gpu/ops/GrOp.cpp",
1546      "$flutter_root/skia/src/gpu/ops/GrOvalOpFactory.cpp",
1547      "$flutter_root/skia/src/gpu/ops/GrQuadPerEdgeAA.cpp",
1548      "$flutter_root/skia/src/gpu/ops/GrRegionOp.cpp",
1549      "$flutter_root/skia/src/gpu/ops/GrSemaphoreOp.cpp",
1550      "$flutter_root/skia/src/gpu/ops/GrShadowRRectOp.cpp",
1551      "$flutter_root/skia/src/gpu/ops/GrSimpleMeshDrawOpHelper.cpp",
1552      "$flutter_root/skia/src/gpu/ops/GrSmallPathRenderer.cpp",
1553      "$flutter_root/skia/src/gpu/ops/GrStencilAndCoverPathRenderer.cpp",
1554      "$flutter_root/skia/src/gpu/ops/GrStencilPathOp.cpp",
1555      "$flutter_root/skia/src/gpu/ops/GrStrokeRectOp.cpp",
1556      "$flutter_root/skia/src/gpu/ops/GrTessellatingPathRenderer.cpp",
1557      "$flutter_root/skia/src/gpu/ops/GrTextureOp.cpp",
1558      "$flutter_root/skia/src/gpu/ops/GrTransferFromOp.cpp",
1559      "$flutter_root/skia/src/gpu/text/GrAtlasManager.cpp",
1560      "$flutter_root/skia/src/gpu/text/GrDistanceFieldAdjustTable.cpp",
1561      "$flutter_root/skia/src/gpu/text/GrSDFMaskFilter.cpp",
1562      "$flutter_root/skia/src/gpu/text/GrStrikeCache.cpp",
1563      "$flutter_root/skia/src/gpu/text/GrTextBlob.cpp",
1564      "$flutter_root/skia/src/gpu/text/GrTextBlobCache.cpp",
1565      "$flutter_root/skia/src/gpu/text/GrTextBlobVertexRegenerator.cpp",
1566      "$flutter_root/skia/src/gpu/text/GrTextContext.cpp",
1567      "$flutter_root/skia/src/image/SkImage_Gpu.cpp",
1568      "$flutter_root/skia/src/image/SkImage_GpuBase.cpp",
1569      "$flutter_root/skia/src/image/SkImage_GpuYUVA.cpp",
1570      "$flutter_root/skia/src/image/SkSurface_Gpu.cpp",
1571      "$flutter_root/skia/src/sksl/SkSLCPPCodeGenerator.cpp",
1572      "$flutter_root/skia/src/sksl/SkSLCPPUniformCTypes.cpp",
1573      "$flutter_root/skia/src/sksl/SkSLGLSLCodeGenerator.cpp",
1574      "$flutter_root/skia/src/sksl/SkSLHCodeGenerator.cpp",
1575      "$flutter_root/skia/src/sksl/SkSLMetalCodeGenerator.cpp",
1576      "$flutter_root/skia/src/sksl/SkSLOutputStream.cpp",
1577      "$flutter_root/skia/src/sksl/SkSLPipelineStageCodeGenerator.cpp",
1578      "$flutter_root/skia/src/sksl/SkSLSPIRVCodeGenerator.cpp",
1579    ]
1580
1581    if (platform == "windows") {
1582      defines -= [ "NOGDI" ]
1583      include_dirs =
1584          [ "$flutter_root/skia/third_party/externals/angle2/include" ]
1585      sources -= [
1586        "$flutter_root/skia/src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp",
1587      ]
1588      sources += [
1589        "$flutter_root/skia/src/gpu/gl/win/GrGLMakeNativeInterface_win.cpp",
1590      ]
1591
1592      libs = [ "//prebuilts/mingw-w64/ohos/linux-x86_64/clang-mingw/x86_64-w64-mingw32/lib/libopengl32.a" ]
1593    } else if (platform == "mac") {
1594      defines += [ "SK_ASSUME_GL=1" ]
1595      sources -= [
1596        "$flutter_root/skia/src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp",
1597      ]
1598      sources += [
1599        "$flutter_root/skia/src/gpu/gl/mac/GrGLMakeNativeInterface_mac.cpp",
1600      ]
1601    } else if (platform == "linux") {
1602      defines += [ "SK_R32_SHIFT=16" ]
1603      sources -= [
1604        "$flutter_root/skia/src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp",
1605      ]
1606      sources += [
1607        "$flutter_root/skia/src/gpu/gl/glx/GrGLMakeNativeInterface_glx.cpp",
1608      ]
1609    } else if (platform == "ios") {
1610      defines += [
1611        "SK_BUILD_FOR_IOS",
1612        "SK_ASSUME_GL_ES=1",
1613      ]
1614      sources -= [
1615        "$flutter_root/skia/src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp",
1616      ]
1617      sources += [
1618        "$flutter_root/skia/src/gpu/gl/iOS/GrGLMakeNativeInterface_iOS.cpp",
1619      ]
1620    } else {
1621      if (!defined(config.disable_gpu) || !config.disable_gpu) {
1622        # Ohos or Android platform
1623        if (is_standard_system) {
1624          public_deps = [ "//foundation/graphic/graphic_2d:libgl" ]
1625          if (flutter_feature_skia_small_page_enable) {
1626            defines += [ "SK_ENABLE_SMALL_PAGE" ]
1627          }
1628        } else {
1629          aosp_deps = [
1630            "shared_library:libEGL",
1631            "shared_library:libGLESv2",
1632          ]
1633        }
1634      }
1635    }
1636  }
1637}
1638
1639foreach(item, ace_platforms) {
1640  ace_gpu("ace_gpu_" + item.name) {
1641    platform = item.name
1642    defines = []
1643    cflags_cc = []
1644    config = {
1645    }
1646
1647    if (defined(item.config)) {
1648      config = item.config
1649    }
1650
1651    if (defined(config.defines)) {
1652      defines = config.defines
1653    }
1654
1655    if (defined(config.cflags_cc)) {
1656      cflags_cc = config.cflags_cc
1657    }
1658  }
1659}
1660
1661# ------------------------------------------------
1662#      Skia gpu config end
1663# ------------------------------------------------
1664
1665# ------------------------------------------------
1666#      Skia typeface config begin
1667# ------------------------------------------------
1668config("ace_typeface_freetype_config") {
1669  visibility = [ ":*" ]
1670  include_dirs = [
1671    "$flutter_root/skia",
1672    "$flutter_root/skia/third_party/externals/freetype/include",
1673  ]
1674  cflags_cc = ace_skia_common_ccflags
1675  cflags = ace_skia_common_cflags
1676}
1677
1678ohos_source_set("ace_typeface_freetype") {
1679  part_name = flutter_part
1680  subsystem_name = flutter_subsystem
1681  defines = ace_skia_common_defines
1682  defines += [ "SK_FREETYPE_MINIMUM_RUNTIME_VERSION=(((FREETYPE_MAJOR) << 24) | ((FREETYPE_MINOR) << 16) | ((FREETYPE_PATCH) << 8))" ]
1683  configs = [
1684    ":ace_typeface_freetype_config",
1685    ":skia_deps_include_config",
1686  ]
1687  sources = [
1688    "$flutter_root/skia/src/ports/SkFontHost_FreeType.cpp",
1689    "$flutter_root/skia/src/ports/SkFontHost_FreeType_common.cpp",
1690  ]
1691}
1692
1693# ------------------------------------------------
1694#      Skia typeface config end
1695# ------------------------------------------------
1696
1697# ------------------------------------------------
1698#      Skia gif config begin
1699# ------------------------------------------------
1700config("ace_gif_config") {
1701  visibility = [ ":*" ]
1702  include_dirs = [ "$flutter_root/skia" ]
1703  cflags_cc = ace_skia_common_ccflags
1704  cflags = ace_skia_common_cflags
1705}
1706
1707ohos_source_set("ace_gif") {
1708  part_name = flutter_part
1709  subsystem_name = flutter_subsystem
1710  defines = ace_skia_common_defines
1711  configs = [ ":ace_gif_config" ]
1712  sources = [
1713    "$flutter_root/skia/src/codec/SkGifCodec.cpp",
1714    "$flutter_root/skia/third_party/gif/SkGifImageReader.cpp",
1715  ]
1716}
1717
1718# ------------------------------------------------
1719#      Skia gif config end
1720# ------------------------------------------------
1721
1722# ------------------------------------------------
1723#      Skia xml config begin
1724# ------------------------------------------------
1725config("ace_xml_config") {
1726  visibility = [ ":*" ]
1727  include_dirs = [ "$flutter_root/skia" ]
1728  cflags_cc = ace_skia_common_ccflags
1729  cflags = ace_skia_common_cflags
1730}
1731
1732ohos_source_set("ace_xml") {
1733  part_name = flutter_part
1734  subsystem_name = flutter_subsystem
1735  configs = [
1736    ":ace_xml_config",
1737    ":skia_deps_include_config",
1738  ]
1739  defines = ace_skia_common_defines
1740
1741  sources = [
1742    "$flutter_root/skia/src/xml/SkXMLParser.cpp",
1743    "$flutter_root/skia/src/xml/SkXMLWriter.cpp",
1744  ]
1745
1746  deps = [ "$expat_root:expat" ]
1747}
1748
1749# ------------------------------------------------
1750#      Skia xml config end
1751# ------------------------------------------------
1752
1753# ------------------------------------------------
1754#      Skia font manager config begin
1755# ------------------------------------------------
1756config("ace_fontmgr_config") {
1757  visibility = [ ":*" ]
1758  include_dirs = [
1759    "$flutter_root",
1760    "$flutter_root/skia",
1761  ]
1762
1763  cflags_cc = ace_skia_common_ccflags
1764  cflags = ace_skia_common_cflags
1765}
1766
1767template("ace_fontmgr") {
1768  forward_variables_from(invoker, "*")
1769
1770  ohos_source_set(target_name) {
1771    part_name = flutter_part
1772    subsystem_name = flutter_subsystem
1773    configs = [
1774      ":ace_fontmgr_config",
1775      ":skia_deps_include_config",
1776    ]
1777    if (platform == "android") {
1778      configs += [ "$ace_root/build:reduce_eh_frame_config" ]
1779    }
1780    defines += invoker.defines
1781    defines += ace_skia_common_defines
1782    cflags_cc += invoker.cflags_cc
1783
1784    if (platform == "windows") {
1785      defines -= [
1786        "UNICODE",
1787        "NOGDI",
1788      ]
1789      defines += [ "SK_BUILD_FONT_MGR_FOR_PREVIEW_WIN" ]
1790      deps = [ "$expat_root:expat" ]
1791      sources = [
1792        # Use font installed in windows platform
1793        "$flutter_root/skia/src/fonts/SkFontMgr_indirect.cpp",
1794        "$flutter_root/skia/src/ports/SkFontHost_win.cpp",
1795        "$flutter_root/skia/src/ports/SkFontMgr_win_dw.cpp",
1796        "$flutter_root/skia/src/ports/SkScalerContext_win_dw.cpp",
1797        "$flutter_root/skia/src/ports/SkTypeface_win_dw.cpp",
1798
1799        # Use hos font
1800        "$flutter_root/skia/src/ports/SkFontMgr_config_parser.cpp",
1801        "$flutter_root/skia/src/ports/SkFontMgr_preview.cpp",
1802        "$flutter_root/skia/src/ports/SkFontMgr_win_factory.cpp",
1803      ]
1804
1805      # Use ohos font
1806      deps += [ ":ace_fontmgr_standard" ]
1807      libs = [
1808        "//prebuilts/mingw-w64/ohos/linux-x86_64/clang-mingw/x86_64-w64-mingw32/lib/libgdi32.a",
1809        "//prebuilts/mingw-w64/ohos/linux-x86_64/clang-mingw/x86_64-w64-mingw32/lib/libuuid.a",
1810      ]
1811    } else if (platform == "mac") {
1812      defines += [ "SK_BUILD_FONT_MGR_FOR_PREVIEW_MAC" ]
1813      sources = [
1814        # Use font installed in mac platform
1815        "$flutter_root/skia/src/ports/SkFontHost_mac.cpp",
1816
1817        # Use hos font
1818        "$flutter_root/skia/src/ports/SkFontMgr_config_parser.cpp",
1819        "$flutter_root/skia/src/ports/SkFontMgr_preview.cpp",
1820      ]
1821
1822      # Use ohos font
1823      deps = [ ":ace_fontmgr_standard" ]
1824    } else if (platform == "linux") {
1825      defines += [ "SK_BUILD_FONT_MGR_FOR_PREVIEW_LINUX" ]
1826      sources = [
1827        # Use font installed in linux platform
1828        "$flutter_root/skia/src/ports/SkFontMgr_custom.cpp",
1829        "$flutter_root/skia/src/ports/SkFontMgr_custom_directory.cpp",
1830        "$flutter_root/skia/src/ports/SkFontMgr_custom_directory_factory.cpp",
1831
1832        # Use hos font
1833        "$flutter_root/skia/src/ports/SkFontMgr_config_parser.cpp",
1834        "$flutter_root/skia/src/ports/SkFontMgr_preview.cpp",
1835      ]
1836
1837      # Use ohos font
1838      deps = [ ":ace_fontmgr_standard" ]
1839    } else {
1840      # Ohos or Android platform
1841      if (defined(config.ohos_standard_fontmgr) &&
1842          config.ohos_standard_fontmgr) {
1843        sources = []
1844        deps = [ ":ace_fontmgr_standard" ]
1845      } else {
1846        sources = [
1847          "$flutter_root/skia/src/ports/SkFontMgr_android.cpp",
1848          "$flutter_root/skia/src/ports/SkFontMgr_android_factory.cpp",
1849          "$flutter_root/skia/src/ports/SkFontMgr_android_parser.cpp",
1850        ]
1851        if (platform == "ohos") {
1852          sources += [ "$flutter_root/skia/src/ports/SkFontMgr_ohos.cpp" ]
1853        }
1854        deps = [ "$expat_root:expat" ]
1855      }
1856    }
1857  }
1858}
1859
1860foreach(item, ace_platforms) {
1861  ace_fontmgr("ace_fontmgr_" + item.name) {
1862    platform = item.name
1863    defines = []
1864    cflags_cc = []
1865    config = {
1866    }
1867
1868    if (defined(item.config)) {
1869      config = item.config
1870    }
1871
1872    if (defined(config.defines)) {
1873      defines = config.defines
1874    }
1875
1876    if (defined(config.cflags_cc)) {
1877      cflags_cc = config.cflags_cc
1878    }
1879  }
1880}
1881
1882config("ace_fontmgr_standard_config") {
1883  visibility = [ ":*" ]
1884  include_dirs = [
1885    "$flutter_root/skia/include/private",
1886    "$flutter_root/skia/include/core",
1887    "$flutter_root/skia/src/core",
1888    "$flutter_root/skia/src/ports",
1889    "$flutter_root/skia/src/ports/skia_ohos",
1890    "//third_party/bounds_checking_function/include",
1891  ]
1892}
1893
1894ohos_source_set("ace_fontmgr_standard") {
1895  part_name = flutter_part
1896  subsystem_name = flutter_subsystem
1897  configs = [
1898    ":ace_fontmgr_config",
1899    ":ace_fontmgr_standard_config",
1900    ":skia_deps_include_config",
1901  ]
1902
1903  sources = [
1904    "$flutter_root/skia/src/ports/skia_ohos/FontConfig_ohos.cpp",
1905    "$flutter_root/skia/src/ports/skia_ohos/SkFontMgr_ohos.cpp",
1906    "$flutter_root/skia/src/ports/skia_ohos/SkFontMgr_ohos_factory.cpp",
1907    "$flutter_root/skia/src/ports/skia_ohos/SkFontStyleSet_ohos.cpp",
1908    "$flutter_root/skia/src/ports/skia_ohos/SkTypeface_ohos.cpp",
1909  ]
1910  defines = []
1911  cflags_cc = ace_skia_common_ccflags
1912  cflags_cc += [
1913    "-Wsign-compare",
1914    "-Wno-vla",
1915    "-Wno-tautological-unsigned-enum-zero-compare",
1916  ]
1917
1918  deps = [ ":ace_fontconfig.json" ]
1919
1920  # Only standard system has ohos_fonts source
1921  if (is_standard_system) {
1922    deps += [ "$jsoncpp_root:jsoncpp_static" ]
1923
1924    if (graphic_standard_feature_wuji_enable) {
1925      deps += [ "//foundation/graphic/graphic_2d_ext:ohos_fonts_wuji" ]
1926    } else if (ace_engine_standard_fonts_enable) {
1927      deps += [ "//base/global/system_resources:ohos_fonts" ]
1928    }
1929  }
1930
1931  if (use_mingw_win) {
1932    defines += [ "SK_BUILD_FONT_MGR_FOR_PREVIEW_WIN" ]
1933  } else if (use_mac) {
1934    defines += [ "SK_BUILD_FONT_MGR_FOR_PREVIEW_MAC" ]
1935  } else if (use_linux) {
1936    defines += [ "SK_BUILD_FONT_MGR_FOR_PREVIEW_LINUX" ]
1937  } else {
1938    defines += [ "SK_BUILD_FONT_MGR_FOR_OHOS" ]
1939  }
1940}
1941
1942ohos_prebuilt_etc("ace_fontconfig.json") {
1943  source = "$flutter_root/skia/src/ports/skia_ohos/config/fontconfig.json"
1944  part_name = "flutter"
1945  subsystem_name = flutter_subsystem
1946}
1947
1948# ------------------------------------------------
1949#      Skia font manager config end
1950# ------------------------------------------------
1951
1952# ------------------------------------------------
1953#      Skia webp config begin
1954# ------------------------------------------------
1955config("ace_webp_config") {
1956  visibility = [ ":*" ]
1957  include_dirs = [
1958    "$flutter_root/skia",
1959    "$flutter_root/skia/third_party/externals/libwebp/src",
1960    "$flutter_root/skia/third_party/externals/libwebp",
1961  ]
1962  cflags_cc = ace_skia_common_ccflags
1963  cflags = ace_skia_common_cflags
1964}
1965
1966ohos_source_set("ace_webp") {
1967  part_name = flutter_part
1968  subsystem_name = flutter_subsystem
1969  configs = [ ":ace_webp_config" ]
1970  sources = [
1971    "$flutter_root/skia/src/codec/SkWebpCodec.cpp",
1972    "$flutter_root/skia/src/images/SkWebpEncoder.cpp",
1973  ]
1974
1975  defines = ace_skia_common_defines
1976}
1977
1978# ------------------------------------------------
1979#      Skia webp config end
1980# ------------------------------------------------
1981
1982# ------------------------------------------------
1983#      Skia png config begin
1984# ------------------------------------------------
1985config("ace_png_config") {
1986  visibility = [ ":*" ]
1987  include_dirs = [
1988    "$flutter_root/skia",
1989    "$flutter_root/skia/third_party/libpng",
1990    "$flutter_root/skia/third_party/externals/libpng",
1991  ]
1992  cflags_cc = ace_skia_common_ccflags
1993  cflags = ace_skia_common_cflags
1994}
1995
1996template("ace_png") {
1997  forward_variables_from(invoker, "*")
1998
1999  ohos_source_set(target_name) {
2000    part_name = flutter_part
2001    subsystem_name = flutter_subsystem
2002    defines += invoker.defines
2003    defines += ace_skia_common_defines
2004    cflags_cc += invoker.cflags_cc
2005    if (platform == "windows") {
2006      cflags_cc += [ "-Wno-unknown-pragmas" ]
2007    }
2008
2009    configs = [ ":ace_png_config" ]
2010    if (platform == "android") {
2011      configs += [ "$ace_root/build:reduce_eh_frame_config" ]
2012    }
2013    sources = [
2014      "$flutter_root/skia/src/codec/SkIcoCodec.cpp",
2015      "$flutter_root/skia/src/codec/SkPngCodec.cpp",
2016      "$flutter_root/skia/src/images/SkPngEncoder.cpp",
2017    ]
2018  }
2019}
2020
2021foreach(item, ace_platforms) {
2022  ace_png("ace_png_" + item.name) {
2023    platform = item.name
2024    defines = []
2025    cflags_cc = []
2026    config = {
2027    }
2028
2029    if (defined(item.config)) {
2030      config = item.config
2031    }
2032
2033    if (defined(config.defines)) {
2034      defines = config.defines
2035    }
2036
2037    if (defined(config.cflags_cc)) {
2038      cflags_cc = config.cflags_cc
2039    }
2040  }
2041}
2042
2043# ------------------------------------------------
2044#      Skia png config end
2045# ------------------------------------------------
2046
2047# ------------------------------------------------
2048#      Skia heif config begin
2049# ------------------------------------------------
2050config("ace_heif_config") {
2051  visibility = [ ":*" ]
2052  include_dirs = [ "$flutter_root/skia" ]
2053  cflags_cc = ace_skia_common_ccflags
2054  cflags = ace_skia_common_cflags
2055}
2056
2057ohos_source_set("ace_heif") {
2058  part_name = flutter_part
2059  subsystem_name = flutter_subsystem
2060  configs = [ ":ace_heif_config" ]
2061  sources = [ "$flutter_root/skia/src/codec/SkHeifCodec.cpp" ]
2062  defines = ace_skia_common_defines
2063}
2064
2065# ------------------------------------------------
2066#      Skia heif config end
2067# ------------------------------------------------
2068
2069# ------------------------------------------------
2070#      Skia svg config begin
2071# ------------------------------------------------
2072config("ace_svg_model_config") {
2073  visibility = [ ":*" ]
2074  include_dirs = [ "$flutter_root/skia" ]
2075}
2076
2077config("svg_compile_flags") {
2078  cflags_cc = ace_skia_common_ccflags
2079  cflags_cc += [ "-Wno-extra-semi" ]
2080  cflags = ace_skia_common_cflags
2081  cflags += [ "-Wno-extra-semi" ]
2082  ldflags = [ "-Wl,–gc-sections" ]
2083}
2084
2085template("ace_svg_model") {
2086  forward_variables_from(invoker, "*")
2087
2088  ohos_source_set(target_name) {
2089    part_name = flutter_part
2090    subsystem_name = flutter_subsystem
2091    defines += invoker.defines
2092    configs = []
2093    if (platform == "ohos" && defined(config.enable_native_view) &&
2094        config.enable_native_view) {
2095      configs += [ ":system_skia_config" ]
2096      deps = [ ":make_system_skia_include_dir" ]
2097    } else {
2098      defines += ace_skia_common_defines
2099    }
2100
2101    configs += [
2102      ":ace_svg_model_config",
2103      ":svg_compile_flags",
2104    ]
2105
2106    if (platform == "android") {
2107      configs += [ "$ace_root/build:reduce_eh_frame_config" ]
2108    }
2109
2110    sources = [
2111      "$flutter_root/skia/experimental/svg/model/CssStyleParser.cpp",
2112      "$flutter_root/skia/experimental/svg/model/SkSVGAttribute.cpp",
2113      "$flutter_root/skia/experimental/svg/model/SkSVGAttributeParser.cpp",
2114      "$flutter_root/skia/experimental/svg/model/SkSVGCircle.cpp",
2115      "$flutter_root/skia/experimental/svg/model/SkSVGClipPath.cpp",
2116      "$flutter_root/skia/experimental/svg/model/SkSVGContainer.cpp",
2117      "$flutter_root/skia/experimental/svg/model/SkSVGDOM.cpp",
2118      "$flutter_root/skia/experimental/svg/model/SkSVGEllipse.cpp",
2119      "$flutter_root/skia/experimental/svg/model/SkSVGGradient.cpp",
2120      "$flutter_root/skia/experimental/svg/model/SkSVGLine.cpp",
2121      "$flutter_root/skia/experimental/svg/model/SkSVGLinearGradient.cpp",
2122      "$flutter_root/skia/experimental/svg/model/SkSVGNode.cpp",
2123      "$flutter_root/skia/experimental/svg/model/SkSVGPath.cpp",
2124      "$flutter_root/skia/experimental/svg/model/SkSVGPattern.cpp",
2125      "$flutter_root/skia/experimental/svg/model/SkSVGPoly.cpp",
2126      "$flutter_root/skia/experimental/svg/model/SkSVGRadialGradient.cpp",
2127      "$flutter_root/skia/experimental/svg/model/SkSVGRect.cpp",
2128      "$flutter_root/skia/experimental/svg/model/SkSVGRenderContext.cpp",
2129      "$flutter_root/skia/experimental/svg/model/SkSVGSVG.cpp",
2130      "$flutter_root/skia/experimental/svg/model/SkSVGShape.cpp",
2131      "$flutter_root/skia/experimental/svg/model/SkSVGStop.cpp",
2132      "$flutter_root/skia/experimental/svg/model/SkSVGTransformableNode.cpp",
2133      "$flutter_root/skia/experimental/svg/model/SkSVGUse.cpp",
2134      "$flutter_root/skia/experimental/svg/model/SkSVGValue.cpp",
2135      "$flutter_root/skia/experimental/svg/model/SkSVGXMLDOM.cpp",
2136    ]
2137  }
2138}
2139
2140foreach(item, ace_platforms) {
2141  ace_svg_model("ace_svg_model_" + item.name) {
2142    platform = item.name
2143    defines = []
2144    config = {
2145    }
2146
2147    if (defined(item.config)) {
2148      config = item.config
2149    }
2150
2151    if (defined(config.defines)) {
2152      defines = config.defines
2153    }
2154  }
2155}
2156# ------------------------------------------------
2157#      Skia svg config  end
2158# ------------------------------------------------
2159