chrome/browser/extensions: Remove use of MessageLoopProxy and deprecated MessageLoop...
[chromium-blink-merge.git] / skia / BUILD.gn
blob45916bf31ee1ea562a8f537747cce2fc7ceababc
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 (current_cpu == "arm") {
9   import("//build/config/arm.gni")
11 if (current_cpu == "mipsel" || current_cpu == "mips64el") {
12   import("//build/config/mips.gni")
15 skia_support_gpu = !is_ios
16 skia_support_pdf = !is_ios && (enable_basic_printing || enable_print_preview)
18 # The list of Skia defines that are to be set for blink.
19 gypi_blink_skia_defines =
20     exec_script("//build/gypi_to_gn.py",
21                 [
22                   rebase_path(
23                       "//third_party/WebKit/public/blink_skia_config.gypi"),
24                   "--replace=<(skia_include_path)=//third_party/skia/include",
25                   "--replace=<(skia_src_path)=//third_party/skia/src",
26                 ],
27                 "scope",
28                 [ "//third_party/WebKit/public/blink_skia_config.gypi" ])
30 # The list of Skia defines that are to be set for chromium.
31 gypi_skia_defines =
32     exec_script("//build/gypi_to_gn.py",
33                 [
34                   rebase_path(
35                       "//third_party/skia/gyp/skia_for_chromium_defines.gypi"),
36                   "--replace=<(skia_include_path)=//third_party/skia/include",
37                   "--replace=<(skia_src_path)=//third_party/skia/src",
38                 ],
39                 "scope",
40                 [ "//third_party/skia/gyp/skia_for_chromium_defines.gypi" ])
42 # The list of Skia core sources that are to be set for chromium.
43 gypi_skia_core =
44     exec_script("//build/gypi_to_gn.py",
45                 [
46                   rebase_path("//third_party/skia/gyp/core.gypi"),
47                   "--replace=<(skia_include_path)=//third_party/skia/include",
48                   "--replace=<(skia_src_path)=//third_party/skia/src",
49                 ],
50                 "scope",
51                 [ "//third_party/skia/gyp/core.gypi" ])
53 # The list of Skia gpu sources that are to be set for chromium.
54 if (skia_support_gpu) {
55   gypi_skia_gpu =
56       exec_script("//build/gypi_to_gn.py",
57                   [
58                     rebase_path("//third_party/skia/gyp/gpu.gypi"),
59                     "--replace=<(skia_include_path)=//third_party/skia/include",
60                     "--replace=<(skia_src_path)=//third_party/skia/src",
61                   ],
62                   "scope",
63                   [ "//third_party/skia/gyp/gpu.gypi" ])
66 # The list of Skia pdf sources that are to be set for chromium.
67 if (skia_support_pdf) {
68   gypi_skia_pdf =
69       exec_script("//build/gypi_to_gn.py",
70                   [
71                     rebase_path("//third_party/skia/gyp/pdf.gypi"),
72                     "--replace=<(skia_include_path)=//third_party/skia/include",
73                     "--replace=<(skia_src_path)=//third_party/skia/src",
74                   ],
75                   "scope",
76                   [ "//third_party/skia/gyp/pdf.gypi" ])
79 # The list of Skia effects that are to be set for chromium.
80 gypi_skia_effects =
81     exec_script("//build/gypi_to_gn.py",
82                 [
83                   rebase_path("//third_party/skia/gyp/effects.gypi"),
84                   "--replace=<(skia_include_path)=//third_party/skia/include",
85                   "--replace=<(skia_src_path)=//third_party/skia/src",
86                 ],
87                 "scope",
88                 [ "//third_party/skia/gyp/effects.gypi" ])
90 # The list of Skia utils that are to be set for chromium.
91 gypi_skia_utils =
92     exec_script("//build/gypi_to_gn.py",
93                 [
94                   rebase_path("//third_party/skia/gyp/utils.gypi"),
95                   "--replace=<(skia_include_path)=//third_party/skia/include",
96                   "--replace=<(skia_src_path)=//third_party/skia/src",
97                 ],
98                 "scope",
99                 [ "//third_party/skia/gyp/utils.gypi" ])
101 gypi_skia_opts =
102     exec_script("//build/gypi_to_gn.py",
103                 [
104                   rebase_path("//third_party/skia/gyp/opts.gypi"),
105                   "--replace=<(skia_include_path)=//third_party/skia/include",
106                   "--replace=<(skia_src_path)=//third_party/skia/src",
107                 ],
108                 "scope",
109                 [ "//third_party/skia/gyp/opts.gypi" ])
111 # The list of Skia files is kept in skia_gn_files.gypi. Read it.
112 gypi_values =
113     exec_script("//build/gypi_to_gn.py",
114                 [
115                   rebase_path("skia_gn_files.gypi"),
116                   "--replace=<(skia_include_path)=//third_party/skia/include",
117                   "--replace=<(skia_src_path)=//third_party/skia/src",
118                 ],
119                 "scope",
120                 [ "skia_gn_files.gypi" ])
122 # External-facing config for dependent code.
123 config("skia_config") {
124   include_dirs = [
125     "config",
126     "ext",
127     "//third_party/skia/include/c",
128     "//third_party/skia/include/config",
129     "//third_party/skia/include/core",
130     "//third_party/skia/include/effects",
131     "//third_party/skia/include/images",
132     "//third_party/skia/include/lazy",
133     "//third_party/skia/include/pathops",
134     "//third_party/skia/include/pdf",
135     "//third_party/skia/include/pipe",
136     "//third_party/skia/include/ports",
137     "//third_party/skia/include/utils",
138   ]
140   defines = gypi_blink_skia_defines.blink_skia_defines
141   defines += gypi_skia_defines.skia_for_chromium_defines
143   defines += []
145   if (component_mode == "shared_library") {
146     defines += [
147       "SKIA_DLL",
148       "GR_GL_IGNORE_ES3_MSAA=0",
149     ]
150   }
152   if (skia_support_gpu) {
153     include_dirs += [
154       "//third_party/skia/include/gpu",
155       "//third_party/skia/src/gpu",
156     ]
157     defines += [ "SK_SUPPORT_GPU=1" ]
158   } else {
159     defines += [ "SK_SUPPORT_GPU=0" ]
160   }
162   if (is_android) {
163     defines += [
164       "SK_BUILD_FOR_ANDROID",
165       "USE_CHROMIUM_SKIA",
166     ]
167   }
169   if (is_mac) {
170     defines += [ "SK_BUILD_FOR_MAC" ]
171   }
174 # Internal-facing config for Skia library code.
175 config("skia_library_config") {
176   # These include directories are only included for Skia code and are not
177   # exported to dependents. It's not clear if this is on purpose, but this
178   # matches the GYP build.
179   include_dirs = [
180     "//third_party/skia/src/core",
181     "//third_party/skia/src/image",
182     "//third_party/skia/src/opts",
183     "//third_party/skia/src/pdf",
184     "//third_party/skia/src/ports",
185     "//third_party/skia/src/sfnt",
186     "//third_party/skia/src/utils",
187     "//third_party/skia/src/lazy",
188   ]
189   if (is_mac || is_ios) {
190     include_dirs += [ "//third_party/skia/include/utils/mac" ]
191   }
192   if (is_mac) {
193     include_dirs += [ "//third_party/skia/include/utils/ios" ]
194   }
196   defines = []
198   if (component_mode == "shared_library") {
199     defines += [ "SKIA_IMPLEMENTATION=1" ]
200   }
202   if (current_cpu == "arm") {
203     if (arm_use_neon) {
204       defines += [ "SK_ARM_HAS_NEON" ]
205     } else if (arm_optionally_use_neon) {
206       defines += [ "SK_ARM_HAS_OPTIONAL_NEON" ]
207     }
208   }
210   # Settings for text blitting, chosen to approximate the system browser.
211   if (is_linux) {
212     defines += [
213       "SK_GAMMA_EXPONENT=1.2",
214       "SK_GAMMA_CONTRAST=0.2",
215       "SK_HIGH_QUALITY_IS_LANCZOS",
216     ]
217   } else if (is_android) {
218     defines += [
219       "SK_GAMMA_APPLY_TO_A8",
220       "SK_GAMMA_EXPONENT=1.4",
221       "SK_GAMMA_CONTRAST=0.0",
222     ]
223   } else if (is_win) {
224     defines += [
225       "SK_GAMMA_SRGB",
226       "SK_GAMMA_CONTRAST=0.5",
227       "SK_HIGH_QUALITY_IS_LANCZOS",
228     ]
229   } else if (is_mac) {
230     defines += [
231       "SK_GAMMA_SRGB",
232       "SK_GAMMA_CONTRAST=0.0",
233       "SK_HIGH_QUALITY_IS_LANCZOS",
234     ]
235   }
237   if (is_android) {
238     defines += [
239       # Android devices are typically more memory constrained, so default to a
240       # smaller glyph cache (it may be overriden at runtime when the renderer
241       # starts up, depending on the actual device memory).
242       "SK_DEFAULT_FONT_CACHE_LIMIT=1048576",  # 1024 * 1024
243     ]
244   } else {
245     defines += [ "SK_DEFAULT_FONT_CACHE_LIMIT=20971520" ]  # 20 * 1024 * 1024
246   }
248   if (is_win) {
249     include_dirs += [
250       "//third_party/skia/include/utils/win",
251       "//third_party/skia/src/utils/win",
252     ]
254     defines += [
255       # On windows, GDI handles are a scarse system-wide resource so we have to
256       # keep the glyph cache, which holds up to 4 GDI handles per entry, to a
257       # fairly small size. http://crbug.com/314387
258       "SK_DEFAULT_FONT_CACHE_COUNT_LIMIT=256",
259     ]
261     cflags = [
262       "/wd4244",  # conversion from 'type1( __int64)' to 'type2 (unsigned int)'
263       "/wd4267",  # conversion from 'size_t' (64 bit) to 'type'(32 bit).
264       "/wd4341",  # signed value is out of range for enum constant.
265       "/wd4345",  # Object is default-initialized if initialization is omitted.
266       "/wd4390",  # ';'empty statement found in looping;is it what was intended?
267       "/wd4554",  # 'operator' : check operator precedence for possible error
268       "/wd4748",  # compiler will disable optimizations if a function has inline
269                   # assembly code contains flow control(jmp or jcc) statements.
271       "/wd4800",  # forcing value to bool 'true/false'(assigning int to bool).
272     ]
273   }
276 component("skia") {
277   sources = [
278     # Chrome sources.
279     "config/SkUserConfig.h",
280     "ext/SkDiscardableMemory_chrome.cc",
281     "ext/SkDiscardableMemory_chrome.h",
282     "ext/SkMemory_new_handler.cpp",
283     "ext/analysis_canvas.cc",
284     "ext/analysis_canvas.h",
285     "ext/benchmarking_canvas.cc",
286     "ext/benchmarking_canvas.h",
287     "ext/bitmap_platform_device.h",
288     "ext/convolver.cc",
289     "ext/convolver.h",
290     "ext/event_tracer_impl.cc",
291     "ext/event_tracer_impl.h",
292     "ext/fontmgr_default_win.cc",
293     "ext/fontmgr_default_win.h",
294     "ext/google_logging.cc",
295     "ext/image_operations.cc",
296     "ext/image_operations.h",
297     "ext/opacity_draw_filter.cc",
298     "ext/opacity_draw_filter.h",
299     "ext/pixel_ref_utils.cc",
300     "ext/pixel_ref_utils.h",
301     "ext/platform_canvas.cc",
302     "ext/platform_canvas.h",
303     "ext/platform_device.cc",
304     "ext/platform_device.h",
305     "ext/platform_device_linux.cc",
306     "ext/platform_device_mac.cc",
307     "ext/platform_device_win.cc",
308     "ext/recursive_gaussian_convolution.cc",
309     "ext/recursive_gaussian_convolution.h",
310     "ext/refptr.h",
311     "ext/skia_utils_base.cc",
312     "ext/skia_utils_base.h",
313     "ext/skia_utils_ios.h",
314     "ext/skia_utils_ios.mm",
315     "ext/skia_utils_mac.h",
316     "ext/skia_utils_mac.mm",
317     "ext/skia_utils_win.cc",
318     "ext/skia_utils_win.h",
319   ]
321   if (current_cpu == "x86" || current_cpu == "x64") {
322     sources += [
323       "ext/convolver_SSE2.cc",
324       "ext/convolver_SSE2.h",
325     ]
326   } else if (current_cpu == "mipsel" && mips_dsp_rev >= 2) {
327     sources += [
328       "ext/convolver_mips_dspr2.cc",
329       "ext/convolver_mips_dspr2.h",
330     ]
331   }
333   # The skia gypi values are relative to the skia_dir, so we need to rebase.
334   sources += gypi_skia_core.sources
335   sources += gypi_skia_effects.sources
336   sources += gypi_skia_utils.sources
337   sources += gypi_values.skia_library_sources
339   # This and skia_opts are really the same conceptual target so share headers.
340   allow_circular_includes_from = [ ":skia_opts" ]
342   if (current_cpu == "arm") {
343     sources += [
344       "//third_party/skia/src/core/SkUtilsArm.cpp",
345       "//third_party/skia/src/core/SkUtilsArm.h",
346     ]
347   }
349   # GPU
350   if (skia_support_gpu) {
351     sources += gypi_skia_gpu.skgpu_sources
352     sources += gypi_skia_gpu.skgpu_null_gl_sources
353   }
355   # Remove unused util files include in utils.gypi
356   sources -= [
357     "//third_party/skia/include/utils/SkBoundaryPatch.h",
358     "//third_party/skia/include/utils/SkCamera.h",
359     "//third_party/skia/include/utils/SkCanvasStateUtils.h",
360     "//third_party/skia/include/utils/SkCubicInterval.h",
361     "//third_party/skia/include/utils/SkCullPoints.h",
362     "//third_party/skia/include/utils/SkDebugUtils.h",
363     "//third_party/skia/include/utils/SkDumpCanvas.h",
364     "//third_party/skia/include/utils/SkEventTracer.h",
365     "//third_party/skia/include/utils/SkFrontBufferedStream.h",
366     "//third_party/skia/include/utils/SkInterpolator.h",
367     "//third_party/skia/include/utils/SkLayer.h",
368     "//third_party/skia/include/utils/SkMeshUtils.h",
369     "//third_party/skia/include/utils/SkNinePatch.h",
370     "//third_party/skia/include/utils/SkParsePaint.h",
371     "//third_party/skia/include/utils/SkParsePath.h",
372     "//third_party/skia/include/utils/SkRandom.h",
373     "//third_party/skia/src/utils/SkBitmapHasher.cpp",
374     "//third_party/skia/src/utils/SkBitmapHasher.h",
375     "//third_party/skia/src/utils/SkBoundaryPatch.cpp",
376     "//third_party/skia/src/utils/SkCamera.cpp",
377     "//third_party/skia/src/utils/SkCanvasStack.h",
378     "//third_party/skia/src/utils/SkCubicInterval.cpp",
379     "//third_party/skia/src/utils/SkCullPoints.cpp",
380     "//third_party/skia/src/utils/SkDumpCanvas.cpp",
381     "//third_party/skia/src/utils/SkFloatUtils.h",
382     "//third_party/skia/src/utils/SkFrontBufferedStream.cpp",
383     "//third_party/skia/src/utils/SkInterpolator.cpp",
384     "//third_party/skia/src/utils/SkLayer.cpp",
385     "//third_party/skia/src/utils/SkMD5.cpp",
386     "//third_party/skia/src/utils/SkMD5.h",
387     "//third_party/skia/src/utils/SkMeshUtils.cpp",
388     "//third_party/skia/src/utils/SkNinePatch.cpp",
389     "//third_party/skia/src/utils/SkOSFile.cpp",
390     "//third_party/skia/src/utils/SkParsePath.cpp",
391     "//third_party/skia/src/utils/SkSHA1.cpp",
392     "//third_party/skia/src/utils/SkSHA1.h",
393     "//third_party/skia/src/utils/SkTFitsIn.h",
394     "//third_party/skia/src/utils/SkTLogic.h",
396     # We don't currently need to change thread affinity, so leave out this complexity for now.
397     "//third_party/skia/src/utils/SkThreadUtils_pthread_linux.cpp",
398     "//third_party/skia/src/utils/SkThreadUtils_pthread_mach.cpp",
400     #testing
401     "//third_party/skia/src/fonts/SkGScalerContext.cpp",
402     "//third_party/skia/src/fonts/SkGScalerContext.h",
403   ]
405   if (is_win) {
406     sources -= [
407       # Keeping _win.cpp
408       "//third_party/skia/src/utils/SkThreadUtils_pthread.cpp",
409       "//third_party/skia/src/utils/SkThreadUtils_pthread_other.cpp",
410     ]
411   } else {
412     sources -= [
413       # Keeping _pthread.cpp and _pthread_other.cpp.
414       "//third_party/skia/src/utils/SkThreadUtils_win.cpp",
415     ]
416   }
418   # need separate win section to handle chromes auto gn filter
419   # (build/config/BUILDCONFIG.gn)
420   if (is_win) {
421     sources -= [
422       #windows
423       "//third_party/skia/include/utils/win/SkAutoCoInitialize.h",
424       "//third_party/skia/include/utils/win/SkHRESULT.h",
425       "//third_party/skia/include/utils/win/SkIStream.h",
426       "//third_party/skia/include/utils/win/SkTScopedComPtr.h",
427       "//third_party/skia/src/utils/win/SkAutoCoInitialize.cpp",
428       "//third_party/skia/src/utils/win/SkIStream.cpp",
429       "//third_party/skia/src/utils/win/SkWGL_win.cpp",
430     ]
431   }
433   if (is_android && (!enable_basic_printing && !enable_print_preview)) {
434     sources -= [ "ext/skia_utils_base.cc" ]
435   }
437   # Fixup skia library sources.
438   if (is_win) {
439     sources -= [
440       "//third_party/skia/src/ports/SkOSFile_posix.cpp",
441       "//third_party/skia/src/ports/SkTLS_pthread.cpp",
442       "//third_party/skia/src/ports/SkTime_Unix.cpp",
443     ]
444   } else {
445     sources -= [
446       "//third_party/skia/src/ports/SkFontHost_win.cpp",
447       "//third_party/skia/src/ports/SkFontMgr_win_dw.cpp",
448       "//third_party/skia/src/ports/SkOSFile_win.cpp",
449       "//third_party/skia/src/ports/SkRemotableFontMgr_win_dw.cpp",
450       "//third_party/skia/src/ports/SkScalerContext_win_dw.cpp",
451       "//third_party/skia/src/ports/SkScalerContext_win_dw.h",
452       "//third_party/skia/src/ports/SkTLS_win.cpp",
453       "//third_party/skia/src/ports/SkTypeface_win_dw.cpp",
454       "//third_party/skia/src/ports/SkTypeface_win_dw.h",
455     ]
456   }
457   if (!is_android) {
458     sources -= [
459       "//third_party/skia/src/ports/SkFontConfigParser_android.cpp",
460       "//third_party/skia/src/ports/SkFontMgr_android.cpp",
461     ]
462   }
463   if (!is_mac) {
464     sources -= [ "//third_party/skia/src/ports/SkFontHost_mac.cpp" ]
465   }
467   if (!is_linux) {
468     sources -= [
469       "//third_party/skia/src/fonts/SkFontMgr_fontconfig.cpp",
470       "//third_party/skia/src/ports/SkFontConfigInterface_direct.cpp",
471       "//third_party/skia/src/ports/SkFontHost_fontconfig.cpp",
472     ]
473   }
475   if (!is_linux && !is_android) {
476     sources -= [
477       "//third_party/skia/src/ports/SkFontHost_FreeType.cpp",
478       "//third_party/skia/src/ports/SkFontHost_FreeType_common.cpp",
479     ]
480   }
482   # Select the right BitmapPlatformDevice.
483   if (is_win) {
484     sources += [
485       "ext/bitmap_platform_device_win.cc",
486       "ext/bitmap_platform_device_win.h",
487     ]
488   } else if (is_mac) {
489     sources += [
490       "ext/bitmap_platform_device_mac.cc",
491       "ext/bitmap_platform_device_mac.h",
492     ]
493   } else if (use_cairo) {
494     sources += [
495       "ext/bitmap_platform_device_cairo.cc",
496       "ext/bitmap_platform_device_cairo.h",
497     ]
498   } else {
499     sources += [
500       "ext/bitmap_platform_device_skia.cc",
501       "ext/bitmap_platform_device_skia.h",
502     ]
503   }
505   if (is_clang) {
506     # Skia won't compile with some of the more strict clang warnings.
507     # e.g. it does:
508     #  SkASSERT(!"sk_out_of_memory");
509     configs -= [ "//build/config/clang:extra_warnings" ]
510   }
512   configs -= [ "//build/config/compiler:chromium_code" ]
513   configs += [
514     ":skia_library_config",
515     "//build/config/compiler:no_chromium_code",
516   ]
517   public_configs = [ ":skia_config" ]
519   deps = [
520     ":skia_opts",
521     "//base",
522     "//base/third_party/dynamic_annotations",
523     "//third_party/zlib",
524   ]
526   if (is_linux) {
527     configs += [
528       "//build/config/linux:fontconfig",
529       "//build/config/linux:freetype2",
530     ]
531     if (use_pango) {
532       configs += [ "//build/config/linux:pangocairo" ]
533     }
534     deps += [ "//third_party/icu:icuuc" ]
535   }
537   if (is_android) {
538     set_sources_assignment_filter([])
539     sources += [ "ext/platform_device_linux.cc" ]
540     set_sources_assignment_filter(sources_assignment_filter)
541     deps += [
542       "//third_party/expat",
543       "//third_party/freetype-android:freetype",
544       "//third_party/android_tools:cpu_features",
545     ]
546   }
548   if (skia_support_pdf) {
549     deps += [ "//third_party/sfntly" ]
550     sources += gypi_skia_pdf.sources
551   }
553   if (is_android && !is_debug) {
554     configs -= [ "//build/config/compiler:optimize" ]
555     configs += [ "//build/config/compiler:optimize_max" ]
556   }
559 # Separated out so it can be compiled with different flags for SSE.
560 if (current_cpu == "x86" || current_cpu == "x64") {
561   source_set("skia_opts_sse3") {
562     sources = gypi_skia_opts.ssse3_sources
563     if (!is_win || is_clang) {
564       cflags = [ "-mssse3" ]
565     }
566     if (is_win) {
567       defines = [ "SK_CPU_SSE_LEVEL=31" ]
568     }
569     visibility = [ ":skia_opts" ]
570     configs -= [ "//build/config/compiler:chromium_code" ]
571     configs += [
572       ":skia_config",
573       ":skia_library_config",
574       "//build/config/compiler:no_chromium_code",
575     ]
576   }
577   source_set("skia_opts_sse4") {
578     sources = gypi_skia_opts.sse41_sources
579     if (!is_win || is_clang) {
580       cflags = [ "-msse4.1" ]
581     }
582     if (is_win) {
583       defines = [ "SK_CPU_SSE_LEVEL=41" ]
584     }
585     visibility = [ ":skia_opts" ]
586     configs -= [ "//build/config/compiler:chromium_code" ]
587     configs += [
588       ":skia_config",
589       ":skia_library_config",
590       "//build/config/compiler:no_chromium_code",
591     ]
592   }
594 source_set("skia_opts") {
595   cflags = []
596   defines = []
598   deps = [
599     "//base",
600   ]
602   if (current_cpu == "x86" || current_cpu == "x64") {
603     sources = gypi_skia_opts.sse2_sources
604     deps += [
605       ":skia_opts_sse3",
606       ":skia_opts_sse4",
607     ]
608   } else if (current_cpu == "arm") {
609     # The assembly uses the frame pointer register (r7 in Thumb/r11 in
610     # ARM), the compiler doesn't like that.
611     cflags += [ "-fomit-frame-pointer" ]
613     if (arm_version >= 7) {
614       sources = gypi_skia_opts.armv7_sources
615       if (arm_use_neon || arm_optionally_use_neon) {
616         sources += gypi_skia_opts.neon_sources
618         # Root build config sets -mfpu=$arm_fpu, which we expect to be neon
619         # when running this.
620         if (!arm_use_neon) {
621           configs -= [ "//build/config/compiler:compiler_arm_fpu" ]
622           cflags += [ "-mfpu=neon" ]
623         }
624       }
625     } else {
626       sources = gypi_skia_opts.none_sourcees
627     }
628   } else if (current_cpu == "mipsel") {
629     cflags += [ "-fomit-frame-pointer" ]
631     if (mips_dsp_rev >= 1) {
632       sources = gypi_skia_opts.mips_dsp_sources
633     } else {
634       sources = gypi_skia_opts.none_sources
635     }
636   } else {
637     assert(false, "Need to port cpu specific stuff from skia_library_opts.gyp")
638   }
640   if (is_android && !is_debug) {
641     configs -= [ "//build/config/compiler:optimize" ]
642     configs += [ "//build/config/compiler:optimize_max" ]
643   }
645   configs -= [ "//build/config/compiler:chromium_code" ]
646   configs += [
647     ":skia_config",
648     ":skia_library_config",
649     "//build/config/compiler:no_chromium_code",
650   ]
652   visibility = [ ":skia" ]
655 test("skia_unittests") {
656   sources = [
657     "ext/analysis_canvas_unittest.cc",
658     "ext/bitmap_platform_device_mac_unittest.cc",
659     "ext/convolver_unittest.cc",
660     "ext/image_operations_unittest.cc",
661     "ext/pixel_ref_utils_unittest.cc",
662     "ext/platform_canvas_unittest.cc",
663     "ext/recursive_gaussian_convolution_unittest.cc",
664     "ext/refptr_unittest.cc",
665     "ext/skia_utils_ios_unittest.mm",
666     "ext/skia_utils_mac_unittest.mm",
667   ]
669   if (!is_win && !is_mac) {
670     sources -= [ "ext/platform_canvas_unittest.cc" ]
671   }
673   deps = [
674     ":skia",
675     "//base",
676     "//base/test:run_all_unittests",
677     "//cc:test_support",  # TODO: Fix this test to not depend on cc.
678     "//testing/gtest",
679     "//ui/gfx",
680     "//ui/gfx/geometry",
681   ]
684 if (is_linux && !is_chromeos) {
685   # TODO(GYP): Figure out which of these work and are needed on other platforms.
686   executable("image_operations_bench") {
687     sources = [
688       "ext/image_operations_bench.cc",
689     ]
691     deps = [
692       ":skia",
693       "//base",
694     ]
695   }
697   executable("filter_fuzz_stub") {
698     testonly = true
699     sources = [
700       "tools/filter_fuzz_stub/filter_fuzz_stub.cc",
701     ]
703     deps = [
704       ":skia",
705       "//base",
706       "//base/test:test_support",
707     ]
708   }