Skip to content

Commit

Permalink
skia flutter#2
Browse files Browse the repository at this point in the history
  • Loading branch information
brandon-bethke-timu committed Oct 4, 2024
1 parent 558680d commit 1a6de65
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions skia/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ skia_library_configs = [
":skia_library",
]

config("our_vulkan_headers") {
include_dirs = [ "include/third_party/vulkan" ]
defines = [ "SK_USE_INTERNAL_VULKAN_HEADERS" ]
}

# Use for CPU-specific Skia code that needs particular compiler flags.
template("opts") {
if (invoker.enabled) {
Expand Down Expand Up @@ -351,6 +356,7 @@ optional("fontmgr_win") {
optional("gpu_shared") {
enabled = skia_enable_ganesh

configs = []
deps = []
libs = []
public_defines = []
Expand All @@ -364,6 +370,7 @@ optional("gpu_shared") {
if (skia_use_vulkan) {
public_defines += [ "SK_VULKAN" ]
sources += skia_shared_vk_sources
configs += [ ":our_vulkan_headers" ]
if (skia_enable_vulkan_debug_layers) {
public_defines += [ "SK_ENABLE_VK_LAYERS" ]
}
Expand All @@ -380,6 +387,8 @@ optional("gpu_shared") {

optional("gpu") {
enabled = skia_enable_ganesh

configs = []
deps = [ ":gpu_shared" ]
public_defines = []
public_configs = []
Expand Down Expand Up @@ -431,10 +440,9 @@ optional("gpu") {
} else if (is_win) {
sources += [
"$_skia_root/src/gpu/ganesh/gl/win/GrGLMakeNativeInterface_win.cpp",
"$_skia_root/src/gpu/ganesh/gl/win/GrGLMakeWinInterface.cpp",
]
if (target_cpu != "arm64") {
libs += [ "OpenGL32.lib" ]
}
libs += [ "OpenGL32.lib" ]
} else {
sources +=
[ "$_skia_root/src/gpu/ganesh/gl/GrGLMakeNativeInterface_none.cpp" ]
Expand All @@ -446,6 +454,7 @@ optional("gpu") {
if (skia_use_vulkan) {
public += skia_gpu_vk_public
sources += skia_gpu_vk_private
configs += [ ":our_vulkan_headers" ]
if (is_fuchsia) {
public_deps += [ "${fuchsia_sdk}/pkg/vulkan" ]
}
Expand Down Expand Up @@ -528,10 +537,8 @@ optional("png_decode") {
]

deps = [ "//flutter/third_party/libpng" ]
sources = [
"$_skia_root/src/codec/SkIcoCodec.cpp",
"$_skia_root/src/codec/SkPngCodec.cpp",
]
sources = [ "$_skia_root/src/codec/SkIcoCodec.cpp" ]
sources += skia_codec_png
}

optional("png_encode") {
Expand Down

0 comments on commit 1a6de65

Please sign in to comment.