| # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 
 | # Use of this source code is governed by a BSD-style license that can be | 
 | # found in the LICENSE file. | 
 |  | 
 | import("//build/config/features.gni") | 
 | import("//build/config/ui.gni") | 
 | import("//testing/test.gni") | 
 | if (current_cpu == "arm" || current_cpu == "arm64") { | 
 |   import("//build/config/arm.gni") | 
 | } | 
 | if (current_cpu == "mipsel" || current_cpu == "mips64el") { | 
 |   import("//build/config/mips.gni") | 
 | } | 
 |  | 
 | # The list of Skia defines that are to be set for chromium. | 
 | gypi_skia_defines = | 
 |     exec_script("//build/gypi_to_gn.py", | 
 |                 [ | 
 |                   rebase_path( | 
 |                       "//third_party/skia/gyp/skia_for_chromium_defines.gypi"), | 
 |                   "--replace=<(skia_include_path)=//third_party/skia/include", | 
 |                   "--replace=<(skia_src_path)=//third_party/skia/src", | 
 |                 ], | 
 |                 "scope", | 
 |                 [ "//third_party/skia/gyp/skia_for_chromium_defines.gypi" ]) | 
 |  | 
 | # The list of Skia core sources that are to be set for chromium. | 
 | gypi_skia_core = | 
 |     exec_script("//build/gypi_to_gn.py", | 
 |                 [ | 
 |                   rebase_path("//third_party/skia/gyp/core.gypi"), | 
 |                   "--replace=<(skia_include_path)=//third_party/skia/include", | 
 |                   "--replace=<(skia_src_path)=//third_party/skia/src", | 
 |                 ], | 
 |                 "scope", | 
 |                 [ "//third_party/skia/gyp/core.gypi" ]) | 
 |  | 
 | # The list of Skia gpu sources that are to be set for chromium. | 
 | gypi_skia_gpu = | 
 |     exec_script("//build/gypi_to_gn.py", | 
 |                 [ | 
 |                   rebase_path("//third_party/skia/gyp/gpu.gypi"), | 
 |                   "--replace=<(skia_include_path)=//third_party/skia/include", | 
 |                   "--replace=<(skia_src_path)=//third_party/skia/src", | 
 |                 ], | 
 |                 "scope", | 
 |                 [ "//third_party/skia/gyp/gpu.gypi" ]) | 
 |  | 
 | # The list of Skia effects that are to be set for chromium. | 
 | gypi_skia_effects = | 
 |     exec_script("//build/gypi_to_gn.py", | 
 |                 [ | 
 |                   rebase_path("//third_party/skia/gyp/effects.gypi"), | 
 |                   "--replace=<(skia_include_path)=//third_party/skia/include", | 
 |                   "--replace=<(skia_src_path)=//third_party/skia/src", | 
 |                 ], | 
 |                 "scope", | 
 |                 [ "//third_party/skia/gyp/effects.gypi" ]) | 
 |  | 
 | # The list of Skia utils that are to be set for chromium. | 
 | gypi_skia_utils = | 
 |     exec_script("//build/gypi_to_gn.py", | 
 |                 [ | 
 |                   rebase_path("//third_party/skia/gyp/utils.gypi"), | 
 |                   "--replace=<(skia_include_path)=//third_party/skia/include", | 
 |                   "--replace=<(skia_src_path)=//third_party/skia/src", | 
 |                 ], | 
 |                 "scope", | 
 |                 [ "//third_party/skia/gyp/utils.gypi" ]) | 
 |  | 
 | gypi_skia_opts = | 
 |     exec_script("//build/gypi_to_gn.py", | 
 |                 [ | 
 |                   rebase_path("//third_party/skia/gyp/opts.gypi"), | 
 |                   "--replace=<(skia_include_path)=//third_party/skia/include", | 
 |                   "--replace=<(skia_src_path)=//third_party/skia/src", | 
 |                 ], | 
 |                 "scope", | 
 |                 [ "//third_party/skia/gyp/opts.gypi" ]) | 
 |  | 
 | # External-facing config for dependent code. | 
 | config("skia_config") { | 
 |   include_dirs = [ | 
 |     "config", | 
 |     "ext", | 
 |     "//third_party/skia/include/c", | 
 |     "//third_party/skia/include/config", | 
 |     "//third_party/skia/include/core", | 
 |     "//third_party/skia/include/effects", | 
 |     "//third_party/skia/include/images", | 
 |     "//third_party/skia/include/lazy", | 
 |     "//third_party/skia/include/pathops", | 
 |     "//third_party/skia/include/pdf", | 
 |     "//third_party/skia/include/pipe", | 
 |     "//third_party/skia/include/ports", | 
 |     "//third_party/skia/include/utils", | 
 |   ] | 
 |  | 
 |   defines = gypi_skia_defines.skia_for_chromium_defines | 
 |  | 
 |   defines += [ "SK_SUPPORT_LEGACY_SHADERBITMAPTYPE" ] | 
 |  | 
 |   if (component_mode == "shared_library") { | 
 |     defines += [ | 
 |       "SKIA_DLL", | 
 |       "GR_GL_IGNORE_ES3_MSAA=0", | 
 |     ] | 
 |   } | 
 |  | 
 |   include_dirs += [ | 
 |     "//third_party/skia/include/gpu", | 
 |     "//third_party/skia/src/gpu", | 
 |   ] | 
 |   defines += [ "SK_SUPPORT_GPU=1" ] | 
 |  | 
 |   if (is_android) { | 
 |     defines += [ | 
 |       "SK_BUILD_FOR_ANDROID", | 
 |       "USE_CHROMIUM_SKIA", | 
 |     ] | 
 |   } | 
 |  | 
 |   if (is_mac) { | 
 |     defines += [ "SK_BUILD_FOR_MAC" ] | 
 |   } else if (is_ios) { | 
 |     defines += [ "SK_BUILD_FOR_IOS" ] | 
 |   } else { | 
 |     defines += [ "SK_BUILD_FOR_UNIX" ] | 
 |   } | 
 | } | 
 |  | 
 | # Internal-facing config for Skia library code. | 
 | config("skia_library_config") { | 
 |   # These include directories are only included for Skia code and are not | 
 |   # exported to dependents. It's not clear if this is on purpose, but this | 
 |   # matches the GYP build. | 
 |   include_dirs = [ | 
 |     "//third_party/skia/include/private", | 
 |     "//third_party/skia/src/core", | 
 |     "//third_party/skia/src/image", | 
 |     "//third_party/skia/src/opts", | 
 |     "//third_party/skia/src/pdf", | 
 |     "//third_party/skia/src/ports", | 
 |     "//third_party/skia/src/sfnt", | 
 |     "//third_party/skia/src/utils", | 
 |     "//third_party/skia/src/lazy", | 
 |   ] | 
 |   if (is_mac || is_ios) { | 
 |     include_dirs += [ "//third_party/skia/include/utils/mac" ] | 
 |   } | 
 |   if (is_mac) { | 
 |     include_dirs += [ "//third_party/skia/include/utils/ios" ] | 
 |   } | 
 |  | 
 |   defines = [] | 
 |  | 
 |   if (component_mode == "shared_library") { | 
 |     defines += [ "SKIA_IMPLEMENTATION=1" ] | 
 |   } | 
 |  | 
 |   if (current_cpu == "arm") { | 
 |     if (arm_use_neon) { | 
 |       defines += [ "SK_ARM_HAS_NEON" ] | 
 |     } | 
 |     if (arm_optionally_use_neon) { | 
 |       defines += [ "SK_ARM_HAS_OPTIONAL_NEON" ] | 
 |     } | 
 |   } | 
 |  | 
 |   # Settings for text blitting, chosen to approximate the system browser. | 
 |   if (is_linux) { | 
 |     defines += [ | 
 |       "SK_GAMMA_EXPONENT=1.2", | 
 |       "SK_GAMMA_CONTRAST=0.2", | 
 |       "SK_HIGH_QUALITY_IS_LANCZOS", | 
 |     ] | 
 |   } else if (is_android) { | 
 |     defines += [ | 
 |       "SK_GAMMA_APPLY_TO_A8", | 
 |       "SK_GAMMA_EXPONENT=1.4", | 
 |       "SK_GAMMA_CONTRAST=0.0", | 
 |     ] | 
 |   } else if (is_mac) { | 
 |     defines += [ | 
 |       "SK_GAMMA_SRGB", | 
 |       "SK_GAMMA_CONTRAST=0.0", | 
 |       "SK_HIGH_QUALITY_IS_LANCZOS", | 
 |     ] | 
 |   } | 
 |  | 
 |   if (is_android) { | 
 |     defines += [ | 
 |       # Android devices are typically more memory constrained, so default to a | 
 |       # smaller glyph cache (it may be overriden at runtime when the renderer | 
 |       # starts up, depending on the actual device memory). | 
 |       "SK_DEFAULT_FONT_CACHE_LIMIT=1048576",  # 1024 * 1024 | 
 |     ] | 
 |   } else { | 
 |     defines += [ "SK_DEFAULT_FONT_CACHE_LIMIT=20971520" ]  # 20 * 1024 * 1024 | 
 |   } | 
 |  | 
 |   if (is_ios) { | 
 |     cflags = [ | 
 |       # Skia uses routines deprecated in iOS 7 and above | 
 |       "-Wno-deprecated-declarations", | 
 |     ] | 
 |  | 
 |     libs = [ "ImageIO.framework" ] | 
 |   } | 
 | } | 
 |  | 
 | component("skia") { | 
 |   sources = [ | 
 |     # Chrome sources. | 
 |     "config/SkUserConfig.h", | 
 |     "ext/SkDiscardableMemory_chrome.cc", | 
 |     "ext/SkDiscardableMemory_chrome.h", | 
 |     "ext/SkMemory_new_handler.cpp", | 
 |     "ext/bitmap_platform_device.h", | 
 |     "ext/event_tracer_impl.cc", | 
 |     "ext/event_tracer_impl.h", | 
 |     "ext/google_logging.cc", | 
 |     "ext/opacity_draw_filter.cc", | 
 |     "ext/opacity_draw_filter.h", | 
 |     "ext/platform_canvas.cc", | 
 |     "ext/platform_canvas.h", | 
 |     "ext/platform_device.cc", | 
 |     "ext/platform_device.h", | 
 |     "ext/platform_device_linux.cc", | 
 |     "ext/platform_device_mac.cc", | 
 |     "ext/refptr.h", | 
 |     "ext/skia_utils_base.cc", | 
 |     "ext/skia_utils_base.h", | 
 |     "ext/skia_utils_ios.h", | 
 |     "ext/skia_utils_ios.mm", | 
 |     "ext/skia_utils_mac.h", | 
 |     "ext/skia_utils_mac.mm", | 
 |   ] | 
 |  | 
 |   # The skia gypi values are relative to the skia_dir, so we need to rebase. | 
 |   sources += gypi_skia_core.sources | 
 |   sources += gypi_skia_effects.sources | 
 |   sources += gypi_skia_utils.sources | 
 |  | 
 |   sources += [ | 
 |     "//third_party/skia/include/images/SkMovie.h", | 
 |     "//third_party/skia/include/images/SkPageFlipper.h", | 
 |     "//third_party/skia/include/ports/SkTypeface_win.h", | 
 |     "//third_party/skia/src/fonts/SkFontMgr_indirect.cpp", | 
 |     "//third_party/skia/src/fonts/SkRemotableFontMgr.cpp", | 
 |     "//third_party/skia/src/images/SkScaledBitmapSampler.cpp", | 
 |     "//third_party/skia/src/images/SkScaledBitmapSampler.h", | 
 |     "//third_party/skia/src/ports/SkFontHost_FreeType.cpp", | 
 |     "//third_party/skia/src/ports/SkFontHost_FreeType_common.cpp", | 
 |     "//third_party/skia/src/ports/SkFontHost_FreeType_common.h", | 
 |     "//third_party/skia/src/ports/SkFontHost_mac.cpp", | 
 |     "//third_party/skia/src/ports/SkFontHost_win.cpp", | 
 |     "//third_party/skia/src/ports/SkFontMgr_android.cpp", | 
 |     "//third_party/skia/src/ports/SkFontMgr_android_factory.cpp", | 
 |     "//third_party/skia/src/ports/SkFontMgr_android_parser.cpp", | 
 |     "//third_party/skia/src/ports/SkFontMgr_win_dw.cpp", | 
 |     "//third_party/skia/src/ports/SkGlobalInitialization_chromium.cpp", | 
 |     "//third_party/skia/src/ports/SkImageDecoder_empty.cpp", | 
 |     "//third_party/skia/src/ports/SkImageGenerator_none.cpp", | 
 |     "//third_party/skia/src/ports/SkOSFile_posix.cpp", | 
 |     "//third_party/skia/src/ports/SkOSFile_stdio.cpp", | 
 |     "//third_party/skia/src/ports/SkOSFile_win.cpp", | 
 |     "//third_party/skia/src/ports/SkRemotableFontMgr_win_dw.cpp", | 
 |     "//third_party/skia/src/ports/SkScalerContext_win_dw.cpp", | 
 |     "//third_party/skia/src/ports/SkScalerContext_win_dw.h", | 
 |     "//third_party/skia/src/ports/SkTLS_pthread.cpp", | 
 |     "//third_party/skia/src/ports/SkTLS_win.cpp", | 
 |     "//third_party/skia/src/ports/SkTime_Unix.cpp", | 
 |     "//third_party/skia/src/ports/SkTypeface_win_dw.cpp", | 
 |     "//third_party/skia/src/ports/SkTypeface_win_dw.h", | 
 |     "//third_party/skia/src/sfnt/SkOTTable_name.cpp", | 
 |     "//third_party/skia/src/sfnt/SkOTTable_name.h", | 
 |     "//third_party/skia/src/sfnt/SkOTUtils.cpp", | 
 |     "//third_party/skia/src/sfnt/SkOTUtils.h", | 
 |     "//third_party/skia/src/utils/mac/SkStream_mac.cpp", | 
 |   ] | 
 |  | 
 |   # This and skia_opts are really the same conceptual target so share headers. | 
 |   allow_circular_includes_from = [ ":skia_opts" ] | 
 |  | 
 |   if (current_cpu == "arm") { | 
 |     sources += [ | 
 |       "//third_party/skia/src/core/SkUtilsArm.cpp", | 
 |       "//third_party/skia/src/core/SkUtilsArm.h", | 
 |     ] | 
 |   } | 
 |  | 
 |   # GPU | 
 |  | 
 |   sources += gypi_skia_gpu.skgpu_sources | 
 |   sources += gypi_skia_gpu.skgpu_null_gl_sources | 
 |  | 
 |   # Remove unused files from utils. | 
 |   sources -= [ | 
 |     "//third_party/skia/include/utils/SkBoundaryPatch.h", | 
 |     "//third_party/skia/include/utils/SkCamera.h", | 
 |     "//third_party/skia/include/utils/SkCanvasStateUtils.h", | 
 |     "//third_party/skia/include/utils/SkCubicInterval.h", | 
 |     "//third_party/skia/include/utils/SkCullPoints.h", | 
 |     "//third_party/skia/include/utils/SkDebugUtils.h", | 
 |     "//third_party/skia/include/utils/SkDumpCanvas.h", | 
 |     "//third_party/skia/include/utils/SkEventTracer.h", | 
 |     "//third_party/skia/include/utils/SkFrontBufferedStream.h", | 
 |     "//third_party/skia/include/utils/SkInterpolator.h", | 
 |     "//third_party/skia/include/utils/SkLayer.h", | 
 |     "//third_party/skia/include/utils/SkMeshUtils.h", | 
 |     "//third_party/skia/include/utils/SkNinePatch.h", | 
 |     "//third_party/skia/include/utils/SkParsePaint.h", | 
 |     "//third_party/skia/include/utils/SkParsePath.h", | 
 |     "//third_party/skia/include/utils/SkRandom.h", | 
 |     "//third_party/skia/src/utils/SkBitmapHasher.cpp", | 
 |     "//third_party/skia/src/utils/SkBitmapHasher.h", | 
 |     "//third_party/skia/src/utils/SkBoundaryPatch.cpp", | 
 |     "//third_party/skia/src/utils/SkCamera.cpp", | 
 |     "//third_party/skia/src/utils/SkCanvasStack.h", | 
 |     "//third_party/skia/src/utils/SkCubicInterval.cpp", | 
 |     "//third_party/skia/src/utils/SkCullPoints.cpp", | 
 |     "//third_party/skia/src/utils/SkDumpCanvas.cpp", | 
 |     "//third_party/skia/src/utils/SkFloatUtils.h", | 
 |     "//third_party/skia/src/utils/SkFrontBufferedStream.cpp", | 
 |     "//third_party/skia/src/utils/SkInterpolator.cpp", | 
 |     "//third_party/skia/src/utils/SkLayer.cpp", | 
 |     "//third_party/skia/src/utils/SkMD5.cpp", | 
 |     "//third_party/skia/src/utils/SkMD5.h", | 
 |     "//third_party/skia/src/utils/SkMeshUtils.cpp", | 
 |     "//third_party/skia/src/utils/SkNinePatch.cpp", | 
 |     "//third_party/skia/src/utils/SkParsePath.cpp", | 
 |     "//third_party/skia/src/utils/SkSHA1.cpp", | 
 |     "//third_party/skia/src/utils/SkSHA1.h", | 
 |     "//third_party/skia/src/utils/SkTFitsIn.h", | 
 |   ] | 
 |  | 
 |   if (is_ios || is_mac || is_android) { | 
 |     sources -= | 
 |         [ "//third_party/skia/src/gpu/gl/GrGLCreateNativeInterface_none.cpp" ] | 
 |  | 
 |     set_sources_assignment_filter([]) | 
 |  | 
 |     if (is_ios) { | 
 |       sources += [ "//third_party/skia/src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp" ] | 
 |     } else if (is_mac) { | 
 |       sources += [ "//third_party/skia/src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp" ] | 
 |     } else if (is_android) { | 
 |       sources += [ "//third_party/skia/src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp" ] | 
 |     } | 
 |  | 
 |     set_sources_assignment_filter(sources_assignment_filter) | 
 |   } | 
 |  | 
 |   if (is_ios) { | 
 |     set_sources_assignment_filter([]) | 
 |  | 
 |     sources += [ | 
 |       "//third_party/skia/src/utils/mac/SkCreateCGImageRef.cpp", | 
 |       "//third_party/skia/src/utils/mac/SkStream_mac.cpp", | 
 |     ] | 
 |  | 
 |     set_sources_assignment_filter(sources_assignment_filter) | 
 |   } | 
 |  | 
 |   if (is_android) { | 
 |     sources -= [ "ext/skia_utils_base.cc" ] | 
 |   } | 
 |  | 
 |   # Fixup skia library sources. | 
 |   sources -= [ | 
 |     "//third_party/skia/src/ports/SkFontHost_win.cpp", | 
 |     "//third_party/skia/src/ports/SkFontMgr_win_dw.cpp", | 
 |     "//third_party/skia/src/ports/SkOSFile_win.cpp", | 
 |     "//third_party/skia/src/ports/SkRemotableFontMgr_win_dw.cpp", | 
 |     "//third_party/skia/src/ports/SkScalerContext_win_dw.cpp", | 
 |     "//third_party/skia/src/ports/SkScalerContext_win_dw.h", | 
 |     "//third_party/skia/src/ports/SkTLS_win.cpp", | 
 |     "//third_party/skia/src/ports/SkTypeface_win_dw.cpp", | 
 |     "//third_party/skia/src/ports/SkTypeface_win_dw.h", | 
 |     "//third_party/skia/src/utils/SkThreadUtils_win.cpp", | 
 |   ] | 
 |   if (!is_android) { | 
 |     sources -= [ | 
 |       "//third_party/skia/src/ports/SkFontMgr_android.cpp", | 
 |       "//third_party/skia/src/ports/SkFontMgr_android_factory.cpp", | 
 |       "//third_party/skia/src/ports/SkFontMgr_android_parser.cpp", | 
 |     ] | 
 |   } | 
 |   if (!is_mac && !is_ios) { | 
 |     sources -= [ "//third_party/skia/src/ports/SkFontHost_mac.cpp" ] | 
 |   } | 
 |  | 
 |   # On "Linux" (i.e., not Android), we use our a custom SkFontMgr. | 
 |   # TODO(vtl): We should probably do the same on Android. | 
 |   if (is_linux || is_nacl) { | 
 |     sources += [ | 
 |       "//third_party/skia/src/ports/SkFontMgr_custom.cpp", | 
 |       "ports/font_mgr_factory.cc", | 
 |     ] | 
 |   } | 
 |  | 
 |   if (!is_linux && !is_android && !is_nacl) { | 
 |     sources -= [ | 
 |       "//third_party/skia/src/ports/SkFontHost_FreeType.cpp", | 
 |       "//third_party/skia/src/ports/SkFontHost_FreeType_common.cpp", | 
 |     ] | 
 |   } | 
 |  | 
 |   # Select the right BitmapPlatformDevice. | 
 |   if (is_mac || is_ios) { | 
 |     sources += [ | 
 |       "ext/bitmap_platform_device_mac.cc", | 
 |       "ext/bitmap_platform_device_mac.h", | 
 |     ] | 
 |   } else { | 
 |     sources += [ | 
 |       "ext/bitmap_platform_device_skia.cc", | 
 |       "ext/bitmap_platform_device_skia.h", | 
 |     ] | 
 |   } | 
 |  | 
 |   if (is_clang) { | 
 |     # Skia won't compile with some of the more strict clang warnings. | 
 |     # e.g. it does: | 
 |     #  SkASSERT(!"sk_out_of_memory"); | 
 |     configs -= [ "//build/config/clang:extra_warnings" ] | 
 |   } | 
 |  | 
 |   configs -= [ "//build/config/compiler:chromium_code" ] | 
 |   configs += [ | 
 |     ":skia_library_config", | 
 |     "//build/config/compiler:no_chromium_code", | 
 |   ] | 
 |   public_configs = [ ":skia_config" ] | 
 |  | 
 |   deps = [ | 
 |     ":skia_opts", | 
 |     "//base", | 
 |     "//base/third_party/dynamic_annotations", | 
 |     "//third_party/zlib", | 
 |   ] | 
 |  | 
 |   if (is_linux || is_nacl) { | 
 |     deps += [ | 
 |       "//third_party/freetype2", | 
 |       "//third_party/icu:icuuc", | 
 |     ] | 
 |   } | 
 |  | 
 |   if (is_android) { | 
 |     set_sources_assignment_filter([]) | 
 |     sources += [ "ext/platform_device_linux.cc" ] | 
 |     set_sources_assignment_filter(sources_assignment_filter) | 
 |     deps += [ | 
 |       "//third_party/android_tools:cpu_features", | 
 |       "//third_party/expat", | 
 |       "//third_party/freetype-android:freetype", | 
 |     ] | 
 |   } | 
 |  | 
 |   if (is_android && !is_debug) { | 
 |     configs -= [ "//build/config/compiler:optimize" ] | 
 |     configs += [ "//build/config/compiler:optimize_max" ] | 
 |   } | 
 | } | 
 |  | 
 | # Separated out so it can be compiled with different flags for SSE. | 
 | source_set("skia_opts") { | 
 |   cflags = [] | 
 |   defines = [] | 
 |  | 
 |   if (current_cpu == "x86" || current_cpu == "x64") { | 
 |     sources = gypi_skia_opts.sse2_sources + gypi_skia_opts.ssse3_sources + | 
 |               gypi_skia_opts.sse41_sources + gypi_skia_opts.avx_sources | 
 |     if (is_linux || is_mac) { | 
 |       cflags += [ "-msse4.1" ] | 
 |     } | 
 |   } else if (current_cpu == "arm" || current_cpu == "arm64") { | 
 |     # The assembly uses the frame pointer register (r7 in Thumb/r11 in | 
 |     # ARM), the compiler doesn't like that. | 
 |     cflags += [ "-fomit-frame-pointer" ] | 
 |     if (arm_version >= 7 && (arm_use_neon || arm_optionally_use_neon)) { | 
 |       sources = gypi_skia_opts.armv7_sources | 
 |       if (arm_use_neon || arm_optionally_use_neon) { | 
 |         sources += gypi_skia_opts.neon_sources | 
 |  | 
 |         # Root build config sets -mfpu=$arm_fpu, which we expect to be neon | 
 |         # when running this. | 
 |         if (!arm_use_neon) { | 
 |           configs -= [ "//build/config/compiler:compiler_arm_fpu" ] | 
 |           cflags += [ "-mfpu=neon" ] | 
 |         } | 
 |       } | 
 |     } else { | 
 |       sources = gypi_skia_opts.none_sources | 
 |     } | 
 |   } else if (current_cpu == "arm64") { | 
 |     # TODO(1841): NEON sources are not currently used on arm64. | 
 |     sources = gypi_skia_opts.none_sources | 
 |   } else if (current_cpu == "mipsel") { | 
 |     cflags += [ "-fomit-frame-pointer" ] | 
 |  | 
 |     sources = gypi_skia_opts.none_sources | 
 |   } else if (current_cpu == "pnacl") { | 
 |     sources = gypi_skia_opts.none_sources | 
 |   } else { | 
 |     assert(false, "Need to port cpu specific stuff from skia_library_opts.gyp") | 
 |   } | 
 |  | 
 |   if (is_android && !is_debug) { | 
 |     configs -= [ "//build/config/compiler:optimize" ] | 
 |     configs += [ "//build/config/compiler:optimize_max" ] | 
 |   } | 
 |  | 
 |   configs -= [ "//build/config/compiler:chromium_code" ] | 
 |   configs += [ | 
 |     ":skia_config", | 
 |     ":skia_library_config", | 
 |     "//build/config/compiler:no_chromium_code", | 
 |   ] | 
 |  | 
 |   deps = [ | 
 |     "//base", | 
 |   ] | 
 |  | 
 |   visibility = [ ":skia" ] | 
 | } | 
 |  | 
 | test("skia_unittests") { | 
 |   sources = [ | 
 |     "ext/bitmap_platform_device_mac_unittest.cc", | 
 |     "ext/platform_canvas_unittest.cc", | 
 |     "ext/refptr_unittest.cc", | 
 |     "ext/skia_utils_ios_unittest.mm", | 
 |     "ext/skia_utils_mac_unittest.mm", | 
 |   ] | 
 |  | 
 |   if (!is_mac) { | 
 |     sources -= [ "ext/platform_canvas_unittest.cc" ] | 
 |   } | 
 |  | 
 |   deps = [ | 
 |     ":skia", | 
 |     "//base", | 
 |     "//base/test:run_all_unittests", | 
 |     "//testing/gtest", | 
 |     "//ui/gfx", | 
 |     "//ui/gfx/geometry", | 
 |   ] | 
 | } |