Commit c6b39038 authored by Christopher Cameron's avatar Christopher Cameron Committed by Commit Bot

Add Skia/Metal to the Chromium build

Keep it behind a skia_use_metal flag for the moment.

Put the Metal sources in a separate place from skia_util_mac.mm, because
Metal uses ARC and skia_util_mac.mm uses explicit reference counting.

Bug: 952063
Change-Id: I601b3c9814b4beaf6a091871ba4dc2592c2fc498
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1565387Reviewed-by: default avatarBrian Salomon <bsalomon@google.com>
Commit-Queue: ccameron <ccameron@chromium.org>
Cr-Commit-Position: refs/heads/master@{#652229}
parent 189db680
...@@ -25,6 +25,7 @@ skia_support_skottie = true ...@@ -25,6 +25,7 @@ skia_support_skottie = true
declare_args() { declare_args() {
skia_whitelist_serialized_typefaces = false skia_whitelist_serialized_typefaces = false
skia_use_metal = false
} }
# External-facing config for dependent code. # External-facing config for dependent code.
...@@ -555,6 +556,15 @@ component("skia") { ...@@ -555,6 +556,15 @@ component("skia") {
} }
if (is_mac) { if (is_mac) {
if (skia_use_metal) {
deps += [ ":skia_metal" ]
defines += [ "SK_METAL" ]
libs += [
"Metal.framework",
"Foundation.framework",
]
}
libs = [ libs = [
"AppKit.framework", "AppKit.framework",
"CoreFoundation.framework", "CoreFoundation.framework",
...@@ -790,6 +800,18 @@ skia_source_set("skia_opts") { ...@@ -790,6 +800,18 @@ skia_source_set("skia_opts") {
visibility = [ ":skia" ] visibility = [ ":skia" ]
} }
# Split out metal sources, because they require ARC.
if (is_mac && skia_use_metal) {
skia_source_set("skia_metal") {
defines = [ "SK_METAL" ]
sources = skia_metal_sources
cflags_objcc = [
"-Wno-unguarded-availability",
"-fobjc-arc",
]
}
}
# Font copies. # Font copies.
if (is_android || is_fuchsia) { if (is_android || is_fuchsia) {
copy("copy_android_fonts_config") { copy("copy_android_fonts_config") {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment