Files.app: Resize MetadataProviderCache depneding on file number in the current direc...
[chromium-blink-merge.git] / skia / BUILD.gn
blob029c83016aa70f3c9055fbe8c0abd59ac28fa9b0
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
5 import("//build/config/features.gni")
6 import("//build/config/ui.gni")
7 import("//testing/test.gni")
8 if (cpu_arch == "arm") {
9   import("//build/config/arm.gni")
12 skia_support_gpu = !is_ios
13 skia_support_pdf = !is_ios && (enable_basic_printing || enable_print_preview)
15 # The list of Skia defines that are to be set for blink.
16 gypi_blink_skia_defines =
17     exec_script("//build/gypi_to_gn.py",
18                 [
19                   rebase_path(
20                       "//third_party/WebKit/public/blink_skia_config.gypi"),
21                   "--replace=<(skia_include_path)=//third_party/skia/include",
22                   "--replace=<(skia_src_path)=//third_party/skia/src",
23                 ],
24                 "scope",
25                 [ "//third_party/WebKit/public/blink_skia_config.gypi" ])
27 # The list of Skia defines that are to be set for chromium.
28 gypi_skia_defines =
29     exec_script("//build/gypi_to_gn.py",
30                 [
31                   rebase_path(
32                       "//third_party/skia/gyp/skia_for_chromium_defines.gypi"),
33                   "--replace=<(skia_include_path)=//third_party/skia/include",
34                   "--replace=<(skia_src_path)=//third_party/skia/src",
35                 ],
36                 "scope",
37                 [ "//third_party/skia/gyp/skia_for_chromium_defines.gypi" ])
39 # The list of Skia core sources that are to be set for chromium.
40 gypi_skia_core =
41     exec_script("//build/gypi_to_gn.py",
42                 [
43                   rebase_path("//third_party/skia/gyp/core.gypi"),
44                   "--replace=<(skia_include_path)=//third_party/skia/include",
45                   "--replace=<(skia_src_path)=//third_party/skia/src",
46                 ],
47                 "scope",
48                 [ "//third_party/skia/gyp/core.gypi" ])
50 # The list of Skia gpu sources that are to be set for chromium.
51 gypi_skia_gpu =
52     exec_script("//build/gypi_to_gn.py",
53                 [
54                   rebase_path("//third_party/skia/gyp/gpu.gypi"),
55                   "--replace=<(skia_include_path)=//third_party/skia/include",
56                   "--replace=<(skia_src_path)=//third_party/skia/src",
57                 ],
58                 "scope",
59                 [ "//third_party/skia/gyp/gpu.gypi" ])
61 # The list of Skia pdf sources that are to be set for chromium.
62 gypi_skia_pdf =
63     exec_script("//build/gypi_to_gn.py",
64                 [
65                   rebase_path("//third_party/skia/gyp/pdf.gypi"),
66                   "--replace=<(skia_include_path)=//third_party/skia/include",
67                   "--replace=<(skia_src_path)=//third_party/skia/src",
68                 ],
69                 "scope",
70                 [ "//third_party/skia/gyp/pdf.gypi" ])
72 # The list of Skia effects that are to be set for chromium.
73 gypi_skia_effects =
74     exec_script("//build/gypi_to_gn.py",
75                 [
76                   rebase_path("//third_party/skia/gyp/effects.gypi"),
77                   "--replace=<(skia_include_path)=//third_party/skia/include",
78                   "--replace=<(skia_src_path)=//third_party/skia/src",
79                 ],
80                 "scope",
81                 [ "//third_party/skia/gyp/effects.gypi" ])
83 # The list of Skia utils that are to be set for chromium.
84 gypi_skia_utils =
85     exec_script("//build/gypi_to_gn.py",
86                 [
87                   rebase_path("//third_party/skia/gyp/utils.gypi"),
88                   "--replace=<(skia_include_path)=//third_party/skia/include",
89                   "--replace=<(skia_src_path)=//third_party/skia/src",
90                 ],
91                 "scope",
92                 [ "//third_party/skia/gyp/utils.gypi" ])
94 gypi_skia_opts =
95     exec_script("//build/gypi_to_gn.py",
96                 [
97                   rebase_path("//third_party/skia/gyp/opts.gypi"),
98                   "--replace=<(skia_include_path)=//third_party/skia/include",
99                   "--replace=<(skia_src_path)=//third_party/skia/src",
100                 ],
101                 "scope",
102                 [ "//third_party/skia/gyp/opts.gypi" ])
104 # The list of Skia files is kept in skia_gn_files.gypi. Read it.
105 gypi_values =
106     exec_script("//build/gypi_to_gn.py",
107                 [
108                   rebase_path("skia_gn_files.gypi"),
109                   "--replace=<(skia_include_path)=//third_party/skia/include",
110                   "--replace=<(skia_src_path)=//third_party/skia/src",
111                 ],
112                 "scope",
113                 [ "skia_gn_files.gypi" ])
115 # External-facing config for dependent code.
116 config("skia_config") {
117   include_dirs = [
118     "config",
119     "ext",
120     "//third_party/skia/include/c",
121     "//third_party/skia/include/config",
122     "//third_party/skia/include/core",
123     "//third_party/skia/include/effects",
124     "//third_party/skia/include/images",
125     "//third_party/skia/include/lazy",
126     "//third_party/skia/include/pathops",
127     "//third_party/skia/include/pdf",
128     "//third_party/skia/include/pipe",
129     "//third_party/skia/include/ports",
130     "//third_party/skia/include/utils",
132     # need to move this to internal. see crbug.com/457691
133     "//third_party/skia/src/core",
134   ]
136   defines = gypi_blink_skia_defines.blink_skia_defines
137   defines += gypi_skia_defines.skia_for_chromium_defines
139   defines += [
140     "SK_ENABLE_INST_COUNT=0",
141     "GR_GL_CUSTOM_SETUP_HEADER=\"GrGLConfig_chrome.h\"",
142     "SK_ENABLE_LEGACY_API_ALIASING=1",
143     "SK_ATTR_DEPRECATED=SK_NOTHING_ARG1",
144     "GR_GL_IGNORE_ES3_MSAA=0",
145     "SK_WILL_NEVER_DRAW_PERSPECTIVE_TEXT",
146     "SK_SUPPORT_LEGACY_GETTOTALCLIP",
147   ]
149   if (component_mode == "shared_library") {
150     defines += [ "SKIA_DLL" ]
151   }
153   if (skia_support_gpu) {
154     include_dirs += [
155       "//third_party/skia/include/gpu",
156       "//third_party/skia/src/gpu",
157     ]
158     defines += [ "SK_SUPPORT_GPU=1" ]
159   } else {
160     defines += [ "SK_SUPPORT_GPU=0" ]
161   }
163   # For POSIX platforms, prefer the Mutex implementation provided by Skia
164   # since it does not generate static initializers.
165   if (is_posix) {
166     defines += [ "SK_USE_POSIX_THREADS" ]
167   }
169   if (is_android) {
170     defines += [
171       "SK_BUILD_FOR_ANDROID",
172       "USE_CHROMIUM_SKIA",
173     ]
174   }
176   if (is_mac) {
177     defines += [ "SK_BUILD_FOR_MAC" ]
178   }
181 # Internal-facing config for Skia library code.
182 config("skia_library_config") {
183   # These include directories are only included for Skia code and are not
184   # exported to dependents. It's not clear if this is on purpose, but this
185   # matches the GYP build.
186   include_dirs = [
187     "//third_party/skia/src/image",
188     "//third_party/skia/src/opts",
189     "//third_party/skia/src/pdf",
190     "//third_party/skia/src/ports",
191     "//third_party/skia/src/sfnt",
192     "//third_party/skia/src/utils",
193     "//third_party/skia/src/lazy",
194   ]
195   if (is_mac || is_ios) {
196     include_dirs += [ "//third_party/skia/include/utils/mac" ]
197   }
198   if (is_mac) {
199     include_dirs += [ "//third_party/skia/include/utils/ios" ]
200   }
202   defines = [
203     #skia_export_defines ???) TODO
205     # skia uses static initializers to initialize the serialization logic
206     # of its "pictures" library. This is currently not used in chrome; if
207     # it ever gets used the processes that use it need to call
208     # SkGraphics::Init().
209     "SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0",
211     # Forcing the unoptimized path for the offset image filter in skia until
212     # all filters used in Blink support the optimized path properly
213     "SK_DISABLE_OFFSETIMAGEFILTER_OPTIMIZATION",
214     "IGNORE_ROT_AA_RECT_OPT",
215     "SK_IGNORE_BLURRED_RRECT_OPT",
217     # this flag forces Skia not to use typographic metrics with GDI.
218     "SK_GDI_ALWAYS_USE_TEXTMETRICS_FOR_FONT_METRICS",
219     "SK_USE_DISCARDABLE_SCALEDIMAGECACHE",
220   ]
222   if (component_mode == "shared_library") {
223     defines += [ "SKIA_IMPLEMENTATION=1" ]
224   }
226   if (cpu_arch == "arm") {
227     if (arm_use_neon) {
228       defines += [ "SK_ARM_HAS_NEON" ]
229     }
230     if (arm_optionally_use_neon) {
231       defines += [ "SK_ARM_HAS_OPTIONAL_NEON" ]
232     }
233   }
235   # Settings for text blitting, chosen to approximate the system browser.
236   if (is_linux) {
237     defines += [
238       "SK_GAMMA_EXPONENT=1.2",
239       "SK_GAMMA_CONTRAST=0.2",
240       "SK_HIGH_QUALITY_IS_LANCZOS",
241     ]
242   } else if (is_android) {
243     defines += [
244       "SK_GAMMA_APPLY_TO_A8",
245       "SK_GAMMA_EXPONENT=1.4",
246       "SK_GAMMA_CONTRAST=0.0",
247     ]
248   } else if (is_win) {
249     defines += [
250       "SK_GAMMA_SRGB",
251       "SK_GAMMA_CONTRAST=0.5",
252       "SK_HIGH_QUALITY_IS_LANCZOS",
253     ]
254   } else if (is_mac) {
255     defines += [
256       "SK_GAMMA_SRGB",
257       "SK_GAMMA_CONTRAST=0.0",
258       "SK_HIGH_QUALITY_IS_LANCZOS",
259     ]
260   }
262   if (is_android) {
263     defines += [
264       # Android devices are typically more memory constrained, so default to a
265       # smaller glyph cache (it may be overriden at runtime when the renderer
266       # starts up, depending on the actual device memory).
267       "SK_DEFAULT_FONT_CACHE_LIMIT=1048576",  # 1024 * 1024
268     ]
269   } else {
270     defines += [ "SK_DEFAULT_FONT_CACHE_LIMIT=20971520" ]  # 20 * 1024 * 1024
271   }
273   if (is_win) {
274     include_dirs += [
275       "//third_party/skia/include/utils/win",
276       "//third_party/skia/src/utils/win",
277     ]
279     defines += [ "SK_FONTHOST_USES_FONTMGR" ]
281     cflags = [
282       "/wd4244",  # conversion from 'type1( __int64)' to 'type2 (unsigned int)'
283       "/wd4267",  # conversion from 'size_t' (64 bit) to 'type'(32 bit).
284       "/wd4341",  # signed value is out of range for enum constant.
285       "/wd4345",  # Object is default-initialized if initialization is omitted.
286       "/wd4390",  # ';'empty statement found in looping;is it what was intended?
287       "/wd4554",  # 'operator' : check operator precedence for possible error
288       "/wd4748",  # compiler will disable optimizations if a function has inline
289                   # assembly code contains flow control(jmp or jcc) statements.
290       "/wd4800",  # forcing value to bool 'true/false'(assigning int to bool).
291     ]
292   }
295 component("skia") {
296   sources = [
297     # Chrome sources.
298     "config/SkUserConfig.h",
299     "ext/analysis_canvas.cc",
300     "ext/analysis_canvas.h",
301     "ext/benchmarking_canvas.cc",
302     "ext/benchmarking_canvas.h",
303     "ext/bitmap_platform_device.h",
304     "ext/convolver.cc",
305     "ext/convolver.h",
306     "ext/event_tracer_impl.cc",
307     "ext/event_tracer_impl.h",
308     "ext/fontmgr_default_win.cc",
309     "ext/fontmgr_default_win.h",
310     "ext/google_logging.cc",
311     "ext/image_operations.cc",
312     "ext/image_operations.h",
313     "ext/opacity_draw_filter.cc",
314     "ext/opacity_draw_filter.h",
315     "ext/pixel_ref_utils.cc",
316     "ext/pixel_ref_utils.h",
317     "ext/platform_canvas.cc",
318     "ext/platform_canvas.h",
319     "ext/platform_device.cc",
320     "ext/platform_device.h",
321     "ext/platform_device_linux.cc",
322     "ext/platform_device_mac.cc",
323     "ext/platform_device_win.cc",
324     "ext/recursive_gaussian_convolution.cc",
325     "ext/recursive_gaussian_convolution.h",
326     "ext/refptr.h",
327     "ext/SkDiscardableMemory_chrome.h",
328     "ext/SkDiscardableMemory_chrome.cc",
329     "ext/SkMemory_new_handler.cpp",
330     "ext/skia_utils_base.cc",
331     "ext/skia_utils_base.h",
332     "ext/skia_utils_ios.mm",
333     "ext/skia_utils_ios.h",
334     "ext/skia_utils_mac.mm",
335     "ext/skia_utils_mac.h",
336     "ext/skia_utils_win.cc",
337     "ext/skia_utils_win.h",
338   ]
340   # The skia gypi values are relative to the skia_dir, so we need to rebase.
341   sources += gypi_skia_core.sources
342   sources += gypi_skia_effects.sources
343   sources += gypi_skia_utils.sources
344   sources += gypi_values.skia_library_sources
346   if (cpu_arch == "arm") {
347     sources += [
348       "//third_party/skia/src/core/SkUtilsArm.cpp",
349       "//third_party/skia/src/core/SkUtilsArm.h",
350     ]
351   }
353   # GPU
354   if (skia_support_gpu) {
355     sources += gypi_skia_gpu.skgpu_sources
356     sources += gypi_skia_gpu.skgpu_null_gl_sources
357   }
359   # Remove unused util files include in utils.gypi
360   sources -= [
361     "//third_party/skia/include/utils/SkBoundaryPatch.h",
362     "//third_party/skia/include/utils/SkFrontBufferedStream.h",
363     "//third_party/skia/include/utils/SkCamera.h",
364     "//third_party/skia/include/utils/SkCanvasStateUtils.h",
365     "//third_party/skia/include/utils/SkCubicInterval.h",
366     "//third_party/skia/include/utils/SkCullPoints.h",
367     "//third_party/skia/include/utils/SkDebugUtils.h",
368     "//third_party/skia/include/utils/SkDumpCanvas.h",
369     "//third_party/skia/include/utils/SkEventTracer.h",
370     "//third_party/skia/include/utils/SkInterpolator.h",
371     "//third_party/skia/include/utils/SkLayer.h",
372     "//third_party/skia/include/utils/SkMeshUtils.h",
373     "//third_party/skia/include/utils/SkNinePatch.h",
374     "//third_party/skia/include/utils/SkParse.h",
375     "//third_party/skia/include/utils/SkParsePaint.h",
376     "//third_party/skia/include/utils/SkParsePath.h",
377     "//third_party/skia/include/utils/SkRandom.h",
378     "//third_party/skia/src/utils/SkBitmapHasher.cpp",
379     "//third_party/skia/src/utils/SkBitmapHasher.h",
380     "//third_party/skia/src/utils/SkBoundaryPatch.cpp",
381     "//third_party/skia/src/utils/SkFrontBufferedStream.cpp",
382     "//third_party/skia/src/utils/SkCamera.cpp",
383     "//third_party/skia/src/utils/SkCanvasStack.h",
384     "//third_party/skia/src/utils/SkCubicInterval.cpp",
385     "//third_party/skia/src/utils/SkCullPoints.cpp",
386     "//third_party/skia/src/utils/SkDumpCanvas.cpp",
387     "//third_party/skia/src/utils/SkFloatUtils.h",
388     "//third_party/skia/src/utils/SkInterpolator.cpp",
389     "//third_party/skia/src/utils/SkLayer.cpp",
390     "//third_party/skia/src/utils/SkMD5.cpp",
391     "//third_party/skia/src/utils/SkMD5.h",
392     "//third_party/skia/src/utils/SkMeshUtils.cpp",
393     "//third_party/skia/src/utils/SkNinePatch.cpp",
394     "//third_party/skia/src/utils/SkOSFile.cpp",
395     "//third_party/skia/src/utils/SkParse.cpp",
396     "//third_party/skia/src/utils/SkParseColor.cpp",
397     "//third_party/skia/src/utils/SkParsePath.cpp",
398     "//third_party/skia/src/utils/SkPathUtils.cpp",
399     "//third_party/skia/src/utils/SkSHA1.cpp",
400     "//third_party/skia/src/utils/SkSHA1.h",
401     "//third_party/skia/src/utils/SkTFitsIn.h",
402     "//third_party/skia/src/utils/SkTLogic.h",
404     # We don't currently need to change thread affinity, so leave out this complexity for now.
405     "//third_party/skia/src/utils/SkThreadUtils_pthread_mach.cpp",
406     "//third_party/skia/src/utils/SkThreadUtils_pthread_linux.cpp",
408     #testing
409     "//third_party/skia/src/fonts/SkGScalerContext.cpp",
410     "//third_party/skia/src/fonts/SkGScalerContext.h",
411   ]
413   if (is_win) {
414     sources -= [
415       # Keeping _win.cpp
416       "//third_party/skia/src/utils/SkThreadUtils_pthread.cpp",
417       "//third_party/skia/src/utils/SkThreadUtils_pthread_other.cpp",
418     ]
419   } else {
420     sources -= [
421       # Keeping _pthread.cpp and _pthread_other.cpp.
422       "//third_party/skia/src/utils/SkThreadUtils_win.cpp",
423     ]
424   }
426   # need separate win section to handle chromes auto gn filter
427   # (build/config/BUILDCONFIG.gn)
428   if (is_win) {
429     sources -= [
430       #windows
431       "//third_party/skia/include/utils/win/SkAutoCoInitialize.h",
432       "//third_party/skia/include/utils/win/SkHRESULT.h",
433       "//third_party/skia/include/utils/win/SkIStream.h",
434       "//third_party/skia/include/utils/win/SkTScopedComPtr.h",
435       "//third_party/skia/src/utils/win/SkAutoCoInitialize.cpp",
436       "//third_party/skia/src/utils/win/SkIStream.cpp",
437       "//third_party/skia/src/utils/win/SkWGL_win.cpp",
438     ]
439   }
441   if (is_android && (!enable_basic_printing && !enable_print_preview)) {
442     sources -= [ "ext/skia_utils_base.cc" ]
443   }
445   # Fixup skia library sources.
446   if (is_win) {
447     sources -= [
448       "//third_party/skia/src/ports/SkOSFile_posix.cpp",
449       "//third_party/skia/src/ports/SkTime_Unix.cpp",
450       "//third_party/skia/src/ports/SkTLS_pthread.cpp",
451     ]
452   } else {
453     sources -= [
454       "//third_party/skia/src/ports/SkFontHost_win.cpp",
455       "//third_party/skia/src/ports/SkFontMgr_win_dw.cpp",
456       "//third_party/skia/src/ports/SkOSFile_win.cpp",
457       "//third_party/skia/src/ports/SkRemotableFontMgr_win_dw.cpp",
458       "//third_party/skia/src/ports/SkScalerContext_win_dw.cpp",
459       "//third_party/skia/src/ports/SkScalerContext_win_dw.h",
460       "//third_party/skia/src/ports/SkTLS_win.cpp",
461       "//third_party/skia/src/ports/SkTypeface_win_dw.cpp",
462       "//third_party/skia/src/ports/SkTypeface_win_dw.h",
463     ]
464   }
465   if (!is_android) {
466     sources -= [
467       "//third_party/skia/src/ports/SkFontConfigParser_android.cpp",
468       "//third_party/skia/src/ports/SkFontMgr_android.cpp",
469     ]
470   }
471   if (!is_mac) {
472     sources -= [ "//third_party/skia/src/ports/SkFontHost_mac.cpp" ]
473   }
475   if (!is_linux) {
476     sources -= [
477       "//third_party/skia/src/ports/SkFontHost_fontconfig.cpp",
478       "//third_party/skia/src/fonts/SkFontMgr_fontconfig.cpp",
479       "//third_party/skia/src/ports/SkFontConfigInterface_direct.cpp",
480     ]
481   }
483   if (!is_linux && !is_android) {
484     sources -= [
485       "//third_party/skia/src/ports/SkFontHost_FreeType_common.cpp",
486       "//third_party/skia/src/ports/SkFontHost_FreeType.cpp",
487     ]
488   }
490   # Select the right BitmapPlatformDevice.
491   if (is_win) {
492     sources += [
493       "ext/bitmap_platform_device_win.cc",
494       "ext/bitmap_platform_device_win.h",
495     ]
496   } else if (is_mac) {
497     sources += [
498       "ext/bitmap_platform_device_mac.cc",
499       "ext/bitmap_platform_device_mac.h",
500     ]
501   } else if (use_cairo) {
502     sources += [
503       "ext/bitmap_platform_device_cairo.cc",
504       "ext/bitmap_platform_device_cairo.h",
505     ]
506   } else {
507     sources += [
508       "ext/bitmap_platform_device_skia.cc",
509       "ext/bitmap_platform_device_skia.h",
510     ]
511   }
513   if (is_clang) {
514     # Skia won't compile with some of the more strict clang warnings.
515     # e.g. it does:
516     #  SkASSERT(!"sk_out_of_memory");
517     configs -= [ "//build/config/clang:extra_warnings" ]
518   }
520   configs -= [ "//build/config/compiler:chromium_code" ]
521   configs += [
522     ":skia_library_config",
523     "//build/config/compiler:no_chromium_code",
524   ]
525   public_configs = [ ":skia_config" ]
527   deps = [
528     ":skia_opts",
529     "//base",
530     "//base/third_party/dynamic_annotations",
531     "//third_party/zlib",
532   ]
534   if (is_win) {
535     configs -= [
536       # Some files define WIN32_LEAN_AND_MEAN and we want to avoid a duplicate
537       # definition warning.
538       "//build/config/win:lean_and_mean",
539     ]
540   }
542   if (is_linux) {
543     configs += [
544       "//build/config/linux:fontconfig",
545       "//build/config/linux:freetype2",
546     ]
547     if (use_pango) {
548       configs += [ "//build/config/linux:pangocairo" ]
549     }
550     deps += [ "//third_party/icu:icuuc" ]
551   }
553   if (is_android) {
554     set_sources_assignment_filter([])
555     sources += [ "ext/platform_device_linux.cc" ]
556     set_sources_assignment_filter(sources_assignment_filter)
557     deps += [
558       "//third_party/expat",
559       "//third_party/freetype",
560       "//third_party/android_tools:cpu_features",
561     ]
562   }
564   if (skia_support_pdf) {
565     deps += [ "//third_party/sfntly" ]
566     sources += gypi_skia_pdf.sources
567   }
569   if (is_android && !is_debug) {
570     configs -= [ "//build/config/compiler:optimize" ]
571     configs += [ "//build/config/compiler:optimize_max" ]
572   }
575 # Separated out so it can be compiled with different flags for SSE.
576 source_set("skia_opts") {
577   cflags = []
578   defines = []
580   if (cpu_arch == "x86" || cpu_arch == "x64") {
581     sources = gypi_skia_opts.sse2_sources + gypi_skia_opts.ssse3_sources +
582               gypi_skia_opts.sse41_sources +
583               [
584                 # Chrome-specific.
585                 "ext/convolver_SSE2.cc",
586               ]
588     if (is_linux || is_mac) {
589       cflags += [ "-msse4.1" ]
590     }
591   } else if (cpu_arch == "arm") {
592     # The assembly uses the frame pointer register (r7 in Thumb/r11 in
593     # ARM), the compiler doesn't like that.
594     cflags += [ "-fomit-frame-pointer" ]
596     if (arm_version >= 7) {
597       sources = gypi_skia_opts.armv7_sources
598       if (arm_use_neon || arm_optionally_use_neon) {
599         sources += gypi_skia_opts.neon_sources
601         # Root build config sets -mfpu=$arm_fpu, which we expect to be neon
602         # when running this.
603         if (!arm_use_neon) {
604           configs -= [ "//build/config/compiler:compiler_arm_fpu" ]
605           cflags += [ "-mfpu=neon" ]
606         }
607       }
608     } else {
609       sources = gypi_skia_opts.none_sourcees
610     }
611   } else if (cpu_arch == "mipsel") {
612     cflags += [ "-fomit-frame-pointer" ]
613     sources = gypi_skia_opts.none_sources
614   } else {
615     assert(false, "Need to port cpu specific stuff from skia_library_opts.gyp")
616   }
618   if (is_android && !is_debug) {
619     configs -= [ "//build/config/compiler:optimize" ]
620     configs += [ "//build/config/compiler:optimize_max" ]
621   }
623   configs -= [ "//build/config/compiler:chromium_code" ]
624   configs += [
625     ":skia_config",
626     ":skia_library_config",
627     "//build/config/compiler:no_chromium_code",
628   ]
630   deps = [
631     "//base",
632   ]
634   visibility = [ ":skia" ]
637 test("skia_unittests") {
638   sources = [
639     "ext/analysis_canvas_unittest.cc",
640     "ext/bitmap_platform_device_mac_unittest.cc",
641     "ext/convolver_unittest.cc",
642     "ext/image_operations_unittest.cc",
643     "ext/pixel_ref_utils_unittest.cc",
644     "ext/platform_canvas_unittest.cc",
645     "ext/recursive_gaussian_convolution_unittest.cc",
646     "ext/refptr_unittest.cc",
647     "ext/skia_utils_ios_unittest.mm",
648     "ext/skia_utils_mac_unittest.mm",
649   ]
651   if (!is_win && !is_mac) {
652     sources -= [ "ext/platform_canvas_unittest.cc" ]
653   }
655   deps = [
656     ":skia",
657     "//base",
658     "//base/test:run_all_unittests",
659     "//testing/gtest",
660     "//ui/gfx",
661     "//ui/gfx/geometry",
662   ]