Create a shell with no GPU configurations unless explicitly specified by the platform. (flutter/engine#5383)

This commit is contained in:
Chinmay Garde
2018-05-25 14:31:01 -07:00
committed by GitHub
parent fde250e4b1
commit aa608f192b
8 changed files with 97 additions and 50 deletions

View File

@@ -1,44 +0,0 @@
# Copyright 2016 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("$flutter_root/shell/config.gni")
source_set("gpu") {
sources = [
"gpu_surface_software.cc",
"gpu_surface_software.h",
]
if (!is_fuchsia) {
sources += [
"gpu_surface_gl.cc",
"gpu_surface_gl.h",
]
}
if (shell_enable_vulkan) {
sources += [
"gpu_surface_vulkan.cc",
"gpu_surface_vulkan.h",
]
}
deps = [
"$flutter_root/common",
"$flutter_root/flow",
"$flutter_root/fml",
"$flutter_root/glue",
"$flutter_root/shell/common",
"$flutter_root/synchronization",
"//garnet/public/lib/fxl",
"//third_party/skia",
"//third_party/skia:gpu",
]
public_configs = [ "$flutter_root:config" ]
if (shell_enable_vulkan) {
deps += [ "$flutter_root/vulkan" ]
}
}

View File

@@ -0,0 +1,64 @@
# Copyright 2016 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("$flutter_root/shell/config.gni")
template("shell_gpu_configuration") {
assert(defined(invoker.enable_software),
"Caller must declare if the Software backend must be enabled.")
assert(defined(invoker.enable_vulkan),
"Caller must declare if the Vulkan backend must be enabled.")
assert(defined(invoker.enable_gl),
"Caller must declare if the Open GL backend must be enabled.")
source_set(target_name) {
# vulkan_backend_enabled = shell_enable_vulkan
# gl_backend_enabled = !is_fuchsia
# software_backend_enabled = true
sources = []
gpu_dir = "$flutter_root/shell/gpu"
if (invoker.enable_software) {
sources += [
"$gpu_dir/gpu_surface_software.cc",
"$gpu_dir/gpu_surface_software.h",
]
}
if (invoker.enable_gl) {
sources += [
"$gpu_dir/gpu_surface_gl.cc",
"$gpu_dir/gpu_surface_gl.h",
]
}
if (invoker.enable_vulkan) {
sources += [
"$gpu_dir/gpu_surface_vulkan.cc",
"$gpu_dir/gpu_surface_vulkan.h",
]
}
deps = [
"$flutter_root/common",
"$flutter_root/flow",
"$flutter_root/fml",
"$flutter_root/glue",
"$flutter_root/shell/common",
"$flutter_root/synchronization",
"//garnet/public/lib/fxl",
"//third_party/skia",
]
if (invoker.enable_vulkan || invoker.enable_gl) {
deps += [ "//third_party/skia:gpu" ]
}
if (invoker.enable_vulkan) {
deps += [ "$flutter_root/vulkan" ]
}
}
}

View File

@@ -6,6 +6,13 @@ import("$flutter_root/common/config.gni")
import("$flutter_root/shell/config.gni")
import("//build/config/android/config.gni")
import("//build/config/android/rules.gni")
import("$flutter_root/shell/gpu/gpu.gni")
shell_gpu_configuration("android_gpu_configuration") {
enable_software = true
enable_vulkan = shell_enable_vulkan
enable_gl = true
}
shared_library("flutter_shell_native") {
visibility = [ ":*" ]
@@ -45,6 +52,7 @@ shared_library("flutter_shell_native") {
]
deps = [
":android_gpu_configuration",
"$flutter_root/assets",
"$flutter_root/common",
"$flutter_root/flow",
@@ -52,7 +60,6 @@ shared_library("flutter_shell_native") {
"$flutter_root/lib/ui",
"$flutter_root/runtime",
"$flutter_root/shell/common",
"$flutter_root/shell/gpu",
"//garnet/public/lib/fxl",
"//third_party/skia",
"//third_party/skia:gpu",

View File

@@ -41,7 +41,6 @@ source_set("flutter_channels") {
"$flutter_root/fml",
"$flutter_root/runtime",
"$flutter_root/shell/common",
"$flutter_root/shell/gpu",
"//garnet/public/lib/fxl",
"//third_party/skia",
]

View File

@@ -20,7 +20,6 @@ source_set("common") {
"$flutter_root/fml",
"$flutter_root/runtime",
"$flutter_root/shell/common",
"$flutter_root/shell/gpu",
"//garnet/public/lib/fxl",
"//third_party/dart/runtime:dart_api",
"//third_party/skia",

View File

@@ -4,6 +4,14 @@
assert(is_mac)
import("$flutter_root/shell/gpu/gpu.gni")
shell_gpu_configuration("darwin_desktop_gpu_configuration") {
enable_software = false
enable_vulkan = false
enable_gl = true
}
source_set("mac_desktop_platform") {
visibility = [ ":*" ]
@@ -20,11 +28,11 @@ source_set("mac_desktop_platform") {
]
deps = [
":darwin_desktop_gpu_configuration",
"$flutter_root/common",
"$flutter_root/fml",
"$flutter_root/lib/snapshot",
"$flutter_root/shell/common",
"$flutter_root/shell/gpu",
"$flutter_root/shell/platform/darwin/common",
"$flutter_root/synchronization",
"//garnet/public/lib/fxl",

View File

@@ -6,9 +6,16 @@ assert(is_ios)
import("$flutter_root/common/config.gni")
import("//build/config/ios/ios_sdk.gni")
import("$flutter_root/shell/gpu/gpu.gni")
_flutter_framework_dir = "$root_out_dir/Flutter.framework"
shell_gpu_configuration("ios_gpu_configuration") {
enable_software = true
enable_gl = true
enable_vulkan = false
}
# The headers that will be copied to the Flutter.framework and be accessed
# from outside the Flutter engine source root.
_flutter_framework_headers = [
@@ -81,6 +88,7 @@ shared_library("create_flutter_framework_dylib") {
sources += _flutter_framework_headers
deps = [
":ios_gpu_configuration",
"$flutter_root/common",
"$flutter_root/flow",
"$flutter_root/fml",
@@ -88,7 +96,6 @@ shared_library("create_flutter_framework_dylib") {
"$flutter_root/lib/ui",
"$flutter_root/runtime",
"$flutter_root/shell/common",
"$flutter_root/shell/gpu",
"$flutter_root/shell/platform/darwin/common",
"//garnet/public/lib/fxl",
"//third_party/skia",

View File

@@ -3,6 +3,13 @@
# found in the LICENSE file.
import("$flutter_root/testing/testing.gni")
import("$flutter_root/shell/gpu/gpu.gni")
shell_gpu_configuration("embedder_gpu_configuration") {
enable_software = false
enable_vulkan = false
enable_gl = true
}
source_set("embedder") {
sources = [
@@ -16,12 +23,12 @@ source_set("embedder") {
]
deps = [
":embedder_gpu_configuration",
"$flutter_root/assets",
"$flutter_root/common",
"$flutter_root/fml",
"$flutter_root/lib/snapshot",
"$flutter_root/shell/common",
"$flutter_root/shell/gpu",
"//garnet/public/lib/fxl",
"//third_party/dart/runtime:libdart_jit",
"//third_party/dart/runtime/bin:embedded_dart_io",