Revert "Don't build GL on Metal, Vulkan, Dawn, Direct3D bots"

This reverts commit f6784a8c84.

Reason for revert: breakage of builds

Original change's description:
> Don't build GL on Metal, Vulkan, Dawn, Direct3D bots
> 
> Misc fixes to omit GL-dependent targets and fix assumptions that
> SK_SUPPORT_GPU implies SK_GL.
> 
> Bug: skia:10051
> Change-Id: Ida88ac3f1bf4d9e23f66d0700c2bce18b938ed6f
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277456
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>

TBR=egdaniel@google.com,jvanverth@google.com,bsalomon@google.com

Change-Id: I4e02f675fd8820ed3c8efee192c64e570a23c3e5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10051
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277601
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This commit is contained in:
Brian Salomon 2020-03-18 14:42:05 +00:00 committed by Skia Commit-Bot
parent 4f93c573e2
commit 00ba5ef4a6
29 changed files with 170 additions and 241 deletions

294
BUILD.gn
View File

@ -74,7 +74,7 @@ config("skia_private") {
}
libs = []
lib_dirs = []
if (skia_use_gl && skia_use_angle) {
if (skia_use_angle) {
defines += [ "SK_ANGLE" ]
}
}
@ -531,37 +531,36 @@ optional("gpu") {
}
libs = []
if (is_android) {
sources += [ "src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp" ]
# this lib is required to link against AHardwareBuffer
if (defined(ndk_api) && ndk_api >= 26) {
libs += [ "android" ]
}
} else if (skia_use_egl) {
sources += [ "src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp" ]
libs += [ "EGL" ]
} else if (is_linux && skia_use_x11) {
sources += [ "src/gpu/gl/glx/GrGLMakeNativeInterface_glx.cpp" ]
libs += [ "GL" ]
} else if (is_mac) {
sources += [ "src/gpu/gl/mac/GrGLMakeNativeInterface_mac.cpp" ]
} else if (is_ios) {
sources += [ "src/gpu/gl/iOS/GrGLMakeNativeInterface_iOS.cpp" ]
} else if (is_win) {
sources += [ "src/gpu/gl/win/GrGLMakeNativeInterface_win.cpp" ]
if (target_cpu != "arm64") {
libs += [ "OpenGL32.lib" ]
}
} else {
sources += [ "src/gpu/gl/GrGLMakeNativeInterface_none.cpp" ]
}
if (skia_use_gl) {
public_defines += [ "SK_GL" ]
if (is_android) {
sources += [ "src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp" ]
# this lib is required to link against AHardwareBuffer
if (defined(ndk_api) && ndk_api >= 26) {
libs += [ "android" ]
}
} else if (skia_use_egl) {
sources += [ "src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp" ]
libs += [ "EGL" ]
} else if (is_linux && skia_use_x11) {
sources += [ "src/gpu/gl/glx/GrGLMakeNativeInterface_glx.cpp" ]
libs += [ "GL" ]
} else if (is_mac) {
sources += [ "src/gpu/gl/mac/GrGLMakeNativeInterface_mac.cpp" ]
} else if (is_ios) {
sources += [ "src/gpu/gl/iOS/GrGLMakeNativeInterface_iOS.cpp" ]
} else if (is_win) {
sources += [ "src/gpu/gl/win/GrGLMakeNativeInterface_win.cpp" ]
if (target_cpu != "arm64") {
libs += [ "OpenGL32.lib" ]
}
} else {
sources += [ "src/gpu/gl/GrGLMakeNativeInterface_none.cpp" ]
}
sources += skia_gl_gpu_sources
}
if (skia_use_vulkan) {
public_defines += [ "SK_VULKAN" ]
deps += [ "third_party/vulkanmemoryallocator" ]
@ -578,13 +577,6 @@ optional("gpu") {
}
}
if (is_android && (skia_use_gl || skia_use_vulkan)) {
# this lib is required to link against AHardwareBuffer
if (defined(ndk_api) && ndk_api >= 26) {
libs += [ "android" ]
}
}
if (skia_use_dawn) {
public_defines += [ "SK_DAWN" ]
sources += skia_dawn_sources
@ -1384,39 +1376,45 @@ if (skia_enable_tools) {
"tools/gpu/YUVUtils.h",
"tools/gpu/mock/MockTestContext.cpp",
]
libs = []
if (skia_use_gl) {
sources += [
"tools/gpu/atlastext/GLTestAtlasTextRenderer.cpp",
"tools/gpu/gl/GLTestContext.cpp",
"tools/gpu/gl/command_buffer/GLTestContext_command_buffer.cpp",
]
if (is_android || skia_use_egl) {
sources += [ "tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp" ]
} else if (is_ios) {
sources += [ "tools/gpu/gl/iOS/CreatePlatformGLTestContext_iOS.mm" ]
libs += [ "OpenGLES.framework" ]
} else if (is_linux) {
sources += [ "tools/gpu/gl/glx/CreatePlatformGLTestContext_glx.cpp" ]
libs += [
"GLU",
"X11",
]
} else if (is_mac) {
sources += [ "tools/gpu/gl/mac/CreatePlatformGLTestContext_mac.cpp" ]
} else if (is_win) {
sources += [ "tools/gpu/gl/win/CreatePlatformGLTestContext_win.cpp" ]
libs += [ "Gdi32.lib" ]
if (target_cpu != "arm64") {
libs += [ "OpenGL32.lib" ]
}
}
if (skia_use_angle) {
deps += [ "//third_party/angle2" ]
sources += [ "tools/gpu/gl/angle/GLTestContext_angle.cpp" ]
}
libs = []
if (is_android || skia_use_egl) {
sources += [ "tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp" ]
} else if (is_ios) {
sources += [ "tools/gpu/gl/iOS/CreatePlatformGLTestContext_iOS.mm" ]
libs += [ "OpenGLES.framework" ]
} else if (is_linux) {
sources += [ "tools/gpu/gl/glx/CreatePlatformGLTestContext_glx.cpp" ]
libs += [
"GLU",
"X11",
]
} else if (is_mac) {
sources += [ "tools/gpu/gl/mac/CreatePlatformGLTestContext_mac.cpp" ]
} else if (is_win) {
sources += [ "tools/gpu/gl/win/CreatePlatformGLTestContext_win.cpp" ]
libs += [ "Gdi32.lib" ]
if (target_cpu != "arm64") {
libs += [ "OpenGL32.lib" ]
}
} else if (is_fuchsia && using_fuchsia_sdk) {
libs +=
[ "${fuchsia_sdk_path}/arch/${target_cpu}/sysroot/lib/libzircon.so" ]
}
cflags_objcc = [ "-fobjc-arc" ]
if (skia_use_angle) {
deps += [ "//third_party/angle2" ]
sources += [ "tools/gpu/gl/angle/GLTestContext_angle.cpp" ]
}
if (skia_use_vulkan) {
@ -1435,13 +1433,6 @@ if (skia_enable_tools) {
sources += [ "tools/gpu/dawn/DawnTestContext.cpp" ]
cflags_cc = [ "-Wno-microsoft-cast" ]
}
if (is_fuchsia && using_fuchsia_sdk) {
libs +=
[ "${fuchsia_sdk_path}/arch/${target_cpu}/sysroot/lib/libzircon.so" ]
}
cflags_objcc = [ "-fobjc-arc" ]
} # test_lib("gpu_tool_utils")
test_lib("flags") {
@ -2192,7 +2183,7 @@ if (skia_enable_tools) {
libs = [ "android" ]
}
}
if (is_android && skia_use_gl) {
if (is_android && skia_enable_gpu) {
test_app("skottie_android") {
is_shared_library = true
@ -2237,12 +2228,18 @@ if (skia_enable_tools) {
]
sources = [
"tools/sk_app/CommandSet.cpp",
"tools/sk_app/GLWindowContext.cpp",
"tools/sk_app/Window.cpp",
]
libs = []
if (skia_use_dawn) {
sources += [ "tools/sk_app/DawnWindowContext.cpp" ]
}
if (is_android) {
sources += [
"tools/sk_app/android/GLWindowContext_android.cpp",
"tools/sk_app/android/RasterWindowContext_android.cpp",
"tools/sk_app/android/Window_android.cpp",
"tools/sk_app/android/main_android.cpp",
@ -2251,27 +2248,50 @@ if (skia_enable_tools) {
libs += [ "android" ]
} else if (is_linux) {
sources += [
"tools/sk_app/unix/GLWindowContext_unix.cpp",
"tools/sk_app/unix/RasterWindowContext_unix.cpp",
"tools/sk_app/unix/Window_unix.cpp",
"tools/sk_app/unix/keysym2ucs.c",
"tools/sk_app/unix/main_unix.cpp",
]
if (skia_use_dawn) {
if (dawn_enable_vulkan) {
sources += [ "tools/sk_app/unix/DawnVulkanWindowContext_unix.cpp" ]
defines = [ "VK_USE_PLATFORM_XCB_KHR" ]
libs += [ "X11-xcb" ]
}
}
libs += [
"GL", # Used by raster window context, so cannot be behind skia_use_gl.
"GL",
"X11",
]
} else if (is_win) {
sources += [
"tools/sk_app/win/GLWindowContext_win.cpp",
"tools/sk_app/win/RasterWindowContext_win.cpp",
"tools/sk_app/win/Window_win.cpp",
"tools/sk_app/win/main_win.cpp",
]
if (skia_use_angle) {
sources += [ "tools/sk_app/win/ANGLEWindowContext_win.cpp" ]
}
if (skia_use_dawn) {
if (dawn_enable_d3d12) {
sources += [ "tools/sk_app/win/DawnD3D12WindowContext_win.cpp" ]
}
}
} else if (is_mac) {
sources += [
"tools/sk_app/mac/GLWindowContext_mac.mm",
"tools/sk_app/mac/RasterWindowContext_mac.mm",
"tools/sk_app/mac/Window_mac.mm",
"tools/sk_app/mac/main_mac.mm",
]
if (skia_use_dawn) {
if (dawn_enable_metal) {
sources += [ "tools/sk_app/mac/DawnMTLWindowContext_mac.mm" ]
}
}
libs += [
"QuartzCore.framework",
"Cocoa.framework",
@ -2279,6 +2299,7 @@ if (skia_enable_tools) {
]
} else if (is_ios) {
sources += [
"tools/sk_app/ios/GLWindowContext_ios.mm",
"tools/sk_app/ios/RasterWindowContext_ios.mm",
"tools/sk_app/ios/Window_ios.mm",
"tools/sk_app/ios/main_ios.mm",
@ -2286,24 +2307,6 @@ if (skia_enable_tools) {
libs += [ "QuartzCore.framework" ]
}
if (skia_use_gl) {
sources += [ "tools/sk_app/GLWindowContext.cpp" ]
if (is_android) {
sources += [ "tools/sk_app/android/GLWindowContext_android.cpp" ]
} else if (is_linux) {
sources += [ "tools/sk_app/unix/GLWindowContext_unix.cpp" ]
} else if (is_win) {
sources += [ "tools/sk_app/win/GLWindowContext_win.cpp" ]
if (skia_use_angle) {
sources += [ "tools/sk_app/win/ANGLEWindowContext_win.cpp" ]
}
} else if (is_mac) {
sources += [ "tools/sk_app/mac/GLWindowContext_mac.mm" ]
} else if (is_ios) {
sources += [ "tools/sk_app/ios/GLWindowContext_ios.mm" ]
}
}
if (skia_use_vulkan) {
sources += [ "tools/sk_app/VulkanWindowContext.cpp" ]
if (is_android) {
@ -2325,32 +2328,13 @@ if (skia_enable_tools) {
}
}
if (skia_use_dawn) {
sources += [ "tools/sk_app/DawnWindowContext.cpp" ]
if (is_linux) {
if (dawn_enable_vulkan) {
sources += [ "tools/sk_app/unix/DawnVulkanWindowContext_unix.cpp" ]
defines = [ "VK_USE_PLATFORM_XCB_KHR" ]
libs += [ "X11-xcb" ]
}
} else if (is_win) {
if (dawn_enable_d3d12) {
sources += [ "tools/sk_app/win/DawnD3D12WindowContext_win.cpp" ]
}
} else if (is_mac) {
if (dawn_enable_metal) {
sources += [ "tools/sk_app/mac/DawnMTLWindowContext_mac.mm" ]
}
}
}
deps = [
":tool_utils",
]
if (is_android) {
deps += [ "//third_party/native_app_glue" ]
}
if (skia_use_gl && skia_use_angle) {
if (skia_use_angle) {
deps += [ "//third_party/angle2" ]
}
}
@ -2376,57 +2360,53 @@ if (skia_enable_tools) {
]
}
}
test_app("viewer") {
is_shared_library = is_android
sources = [
"tools/viewer/AnimTimer.h",
"tools/viewer/BisectSlide.cpp",
"tools/viewer/GMSlide.cpp",
"tools/viewer/ImGuiLayer.cpp",
"tools/viewer/ImageSlide.cpp",
"tools/viewer/ParticlesSlide.cpp",
"tools/viewer/SKPSlide.cpp",
"tools/viewer/SampleSlide.cpp",
"tools/viewer/SkSLSlide.cpp",
"tools/viewer/SkottieSlide.cpp",
"tools/viewer/SlideDir.cpp",
"tools/viewer/StatsLayer.cpp",
"tools/viewer/SvgSlide.cpp",
"tools/viewer/TouchGesture.cpp",
"tools/viewer/TouchGesture.h",
"tools/viewer/Viewer.cpp",
]
libs = []
# sk_app can work without GL but viewer always runs raster through a GL window context.
if (skia_use_gl) {
test_app("viewer") {
is_shared_library = is_android
sources = [
"tools/viewer/AnimTimer.h",
"tools/viewer/BisectSlide.cpp",
"tools/viewer/GMSlide.cpp",
"tools/viewer/ImGuiLayer.cpp",
"tools/viewer/ImageSlide.cpp",
"tools/viewer/ParticlesSlide.cpp",
"tools/viewer/SKPSlide.cpp",
"tools/viewer/SampleSlide.cpp",
"tools/viewer/SkSLSlide.cpp",
"tools/viewer/SkottieSlide.cpp",
"tools/viewer/SlideDir.cpp",
"tools/viewer/StatsLayer.cpp",
"tools/viewer/SvgSlide.cpp",
"tools/viewer/TouchGesture.cpp",
"tools/viewer/TouchGesture.h",
"tools/viewer/Viewer.cpp",
]
libs = []
deps = [
":common_flags_gpu",
":experimental_svg_model",
":flags",
":gm",
":gpu_tool_utils",
":samples",
":sk_app",
":skia",
":tool_utils",
":trace",
"modules/particles",
"modules/skottie",
"modules/skottie:utils",
"modules/sksg",
"modules/sksg:samples",
"//third_party/imgui",
]
if (skia_use_experimental_xform) {
deps += [ ":experimental_xform" ]
sources += [ "gm/xform.cpp" ]
}
deps = [
":common_flags_gpu",
":experimental_svg_model",
":flags",
":gm",
":gpu_tool_utils",
":samples",
":sk_app",
":skia",
":tool_utils",
":trace",
"modules/particles",
"modules/skottie",
"modules/skottie:utils",
"modules/sksg",
"modules/sksg:samples",
"//third_party/imgui",
]
if (skia_use_experimental_xform) {
deps += [ ":experimental_xform" ]
sources += [ "gm/xform.cpp" ]
}
}
if (skia_use_gl && !skia_use_angle && (is_linux || is_win || is_mac)) {
if (!skia_use_angle && (is_linux || is_win || is_mac)) {
test_app("HelloWorld") {
sources = [
"example/HelloWorld.cpp",
@ -2443,8 +2423,8 @@ if (skia_enable_tools) {
}
}
if (skia_use_gl && (is_linux || is_mac || is_ios) &&
target_cpu != "mips64el" && target_cpu != "loongson3a") {
if ((is_linux || is_mac || is_ios) && target_cpu != "mips64el" &&
target_cpu != "loongson3a") {
test_app("SkiaSDLExample") {
sources = [
"example/SkiaSDLExample.cpp",
@ -2559,7 +2539,7 @@ if (skia_enable_tools) {
]
}
if (skia_use_gl && skia_use_icu && skia_use_harfbuzz) {
if (skia_use_icu && skia_use_harfbuzz) {
test_app("editor") {
is_shared_library = is_android
deps = [

View File

@ -7,8 +7,6 @@ This file includes a list of high level updates for each milestone release.
Milestone 83
<Insert new notes here- top is most recent.>
* Made non-GL builds of GPU backend more robust.
https://review.skia.org/277456
*

View File

@ -252,7 +252,6 @@ struct GPUTarget : public Target {
return true;
}
void fillOptions(NanoJSONResultsWriter& log) override {
#ifdef SK_GL
const GrGLubyte* version;
if (this->contextInfo.backend() == GrBackendApi::kOpenGL) {
const GrGLInterface* gl =
@ -270,7 +269,6 @@ struct GPUTarget : public Target {
GR_GL_CALL_RET(gl, version, GetString(GR_GL_SHADING_LANGUAGE_VERSION));
log.appendString("GL_SHADING_LANGUAGE_VERSION", (const char*) version);
}
#endif
}
void dumpStats() override {

View File

@ -46,7 +46,7 @@ python tools/embed_resources.py \
--align 4
GN_GPU_FLAGS="\"-DSK_DISABLE_LEGACY_SHADERCONTEXT\","
WASM_GPU="-lEGL -lGLESv2 -DSK_SUPPORT_GPU=1 -DSK_GL \
WASM_GPU="-lEGL -lGLESv2 -DSK_SUPPORT_GPU=1 \
-DSK_DISABLE_LEGACY_SHADERCONTEXT --pre-js $BASE_DIR/cpu.js --pre-js $BASE_DIR/gpu.js"
# Turn off exiting while we check for ninja (which may not be on PATH)

View File

@ -22,7 +22,7 @@
#include <emscripten.h>
#include <emscripten/bind.h>
#ifdef SK_GL
#if SK_SUPPORT_GPU
#include "include/gpu/GrBackendSurface.h"
#include "include/gpu/GrContext.h"
#include "include/gpu/gl/GrGLInterface.h"
@ -369,7 +369,7 @@ class SkpDebugPlayer {
int fInspectedLayer = -1;
};
#ifdef SK_GL
#if SK_SUPPORT_GPU
sk_sp<GrContext> MakeGrContext(EMSCRIPTEN_WEBGL_CONTEXT_HANDLE context)
{
EMSCRIPTEN_RESULT r = emscripten_webgl_make_context_current(context);
@ -507,7 +507,7 @@ EMSCRIPTEN_BINDINGS(my_module) {
self.clear(SkColor(color));
}));
#ifdef SK_GL
#if SK_SUPPORT_GPU
class_<GrContext>("GrContext")
.smart_ptr<sk_sp<GrContext>>("sk_sp<GrContext>");
function("currentContext", &emscripten_webgl_get_current_context);

View File

@ -48,7 +48,7 @@
#include "src/utils/SkUTF.h"
#include "tools/flags/CommandLineFlags.h"
#ifdef SK_GL
#if SK_SUPPORT_GPU
#include "include/gpu/gl/GrGLFunctions.h"
#include "src/gpu/GrContextPriv.h"
#include "src/gpu/gl/GrGLGpu.h"
@ -1607,7 +1607,7 @@ DEF_FUZZ(SerializedImageFilter, fuzz) {
canvas.restore();
}
#ifdef SK_GL
#if SK_SUPPORT_GPU
static void dump_GPU_info(GrContext* context) {
const GrGLInterface* gl = static_cast<GrGLGpu*>(context->priv().getGpu())

View File

@ -5,11 +5,9 @@
* found in the LICENSE file.
*/
// This test only works with the GL backend.
// This test only works with the GPU backend.
#include "gm/gm.h"
#ifdef SK_GL
#include "include/core/SkBitmap.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColor.h"
@ -272,4 +270,3 @@ private:
DEF_GM(return new RectangleTexture;)
}
#endif

View File

@ -15,7 +15,6 @@ tests_sources = [
"$_tests/ApplyGammaTest.cpp",
"$_tests/ArenaAllocTest.cpp",
"$_tests/AsADashTest.cpp",
"$_tests/BackendAllocationTest.cpp",
"$_tests/BadIcoTest.cpp",
"$_tests/BitSetTest.cpp",
"$_tests/BitmapCopyTest.cpp",
@ -49,7 +48,6 @@ tests_sources = [
"$_tests/ColorPrivTest.cpp",
"$_tests/ColorSpaceTest.cpp",
"$_tests/ColorTest.cpp",
"$_tests/CompressedBackendAllocationTest.cpp",
"$_tests/CopySurfaceTest.cpp",
"$_tests/CubicMapTest.cpp",
"$_tests/DebugLayerManagerTest.cpp",
@ -198,7 +196,6 @@ tests_sources = [
"$_tests/ProgramsTest.cpp",
"$_tests/PromiseImageTest.cpp",
"$_tests/ProxyConversionTest.cpp",
"$_tests/ProxyTest.cpp",
"$_tests/ProxyRefTest.cpp",
"$_tests/QuickRejectTest.cpp",
"$_tests/RRectInPathTest.cpp",
@ -220,7 +217,6 @@ tests_sources = [
"$_tests/RenderTargetContextTest.cpp",
"$_tests/RepeatedClippedBlurTest.cpp",
"$_tests/ResourceAllocatorTest.cpp",
"$_tests/ResourceCacheTest.cpp",
"$_tests/RoundRectTest.cpp",
"$_tests/SRGBReadWritePixelsTest.cpp",
"$_tests/SRGBTest.cpp",
@ -279,7 +275,6 @@ tests_sources = [
"$_tests/StrokerTest.cpp",
"$_tests/SubsetPath.cpp",
"$_tests/SubsetPath.h",
"$_tests/SurfaceSemaphoreTest.cpp",
"$_tests/SurfaceTest.cpp",
"$_tests/SwizzlerTest.cpp",
"$_tests/TArrayTest.cpp",
@ -298,7 +293,6 @@ tests_sources = [
"$_tests/TextureStripAtlasManagerTest.cpp",
"$_tests/Time.cpp",
"$_tests/TopoSortTest.cpp",
"$_tests/TraceMemoryDumpTest.cpp",
"$_tests/TracingTest.cpp",
"$_tests/TransferPixelsTest.cpp",
"$_tests/TypefaceTest.cpp",
@ -321,10 +315,16 @@ tests_sources = [
]
gl_tests_sources = [
"$_tests/BackendAllocationTest.cpp",
"$_tests/CompressedBackendAllocationTest.cpp",
"$_tests/EGLImageTest.cpp",
"$_tests/GrGLExtensionsTest.cpp",
"$_tests/ProxyTest.cpp",
"$_tests/RectangleTextureTest.cpp",
"$_tests/ResourceCacheTest.cpp",
"$_tests/SurfaceSemaphoreTest.cpp",
"$_tests/TextureBindingsResetTest.cpp",
"$_tests/TraceMemoryDumpTest.cpp",
]
metal_tests_sources = [

View File

@ -248,15 +248,9 @@
* and opting in to additional backends. TODO: Require explicit opt in for GL.
*/
#if SK_SUPPORT_GPU
# if !defined(SK_GL) && !defined(SK_VULKAN) && !defined(SK_METAL) && !defined(SK_DAWN) && !defined(SK_DIRECT3D)
# if !defined(SK_GL) && !defined(SK_VULKAN) && !defined(SK_METAL)
# define SK_GL
# endif
#else
# undef SK_GL
# undef SK_VULKAN
# undef SK_METAL
# undef SK_DAWN
# undef SK_DIRECT3D
#endif
#if !defined(SK_SUPPORT_ATLAS_TEXT)

View File

@ -47,7 +47,6 @@ class SkTraceMemoryDump;
class SK_API GrContext : public GrRecordingContext {
public:
#ifdef SK_GL
/**
* Creates a GrContext for a backend context. If no GrGLInterface is provided then the result of
* GrGLMakeNativeInterface() is used if it succeeds.
@ -56,7 +55,6 @@ public:
static sk_sp<GrContext> MakeGL(sk_sp<const GrGLInterface>);
static sk_sp<GrContext> MakeGL(const GrContextOptions&);
static sk_sp<GrContext> MakeGL();
#endif
/**
* The Vulkan context (VkQueue, VkDevice, VkInstance) must be kept alive until the returned

View File

@ -213,7 +213,6 @@ def compile_fn(api, checkout_root, out_dir):
args['is_debug'] = 'false'
if 'Dawn' in extra_tokens:
args['skia_use_dawn'] = 'true'
args['skia_use_gl'] = 'false'
# Dawn imports jinja2, which imports markupsafe. Along with DEPS, make it
# importable.
env['PYTHONPATH'] = api.path.pathsep.join([
@ -271,15 +270,12 @@ def compile_fn(api, checkout_root, out_dir):
if 'Vulkan' in extra_tokens and not 'Android' in extra_tokens:
args['skia_use_vulkan'] = 'true'
args['skia_enable_vulkan_debug_layers'] = 'true'
args['skia_use_gl'] = 'false'
if 'MoltenVK' in extra_tokens:
args['skia_moltenvk_path'] = '"%s"' % moltenvk
if 'Direct3D' in extra_tokens:
args['skia_use_direct3d'] = 'true'
args['skia_use_gl'] = 'false'
if 'Metal' in extra_tokens:
args['skia_use_metal'] = 'true'
args['skia_use_gl'] = 'false'
if 'OpenCL' in extra_tokens:
args['skia_use_opencl'] = 'true'
if api.vars.is_linux:

View File

@ -52,7 +52,7 @@
"[START_DIR]/cache/work/skia/bin/gn",
"gen",
"[START_DIR]/cache/work/skia/out/Build-Debian9-Clang-x86_64-Release-Vulkan/Release",
"--args=cc=\"[START_DIR]/clang_linux/bin/clang\" cc_wrapper=\"[START_DIR]/ccache_linux/bin/ccache\" cxx=\"[START_DIR]/clang_linux/bin/clang++\" extra_cflags=[\"-B[START_DIR]/clang_linux/bin\", \"-DDUMMY_clang_linux_version=42\"] extra_ldflags=[\"-B[START_DIR]/clang_linux/bin\", \"-fuse-ld=lld\", \"-L[START_DIR]/clang_linux/lib\"] is_debug=false skia_enable_vulkan_debug_layers=true skia_use_gl=false skia_use_vulkan=true target_cpu=\"x86_64\" werror=true"
"--args=cc=\"[START_DIR]/clang_linux/bin/clang\" cc_wrapper=\"[START_DIR]/ccache_linux/bin/ccache\" cxx=\"[START_DIR]/clang_linux/bin/clang++\" extra_cflags=[\"-B[START_DIR]/clang_linux/bin\", \"-DDUMMY_clang_linux_version=42\"] extra_ldflags=[\"-B[START_DIR]/clang_linux/bin\", \"-fuse-ld=lld\", \"-L[START_DIR]/clang_linux/lib\"] is_debug=false skia_enable_vulkan_debug_layers=true skia_use_vulkan=true target_cpu=\"x86_64\" werror=true"
],
"cwd": "[START_DIR]/cache/work/skia",
"env": {

View File

@ -70,7 +70,7 @@
"[START_DIR]/cache/work/skia/bin/gn",
"gen",
"[START_DIR]/cache/work/skia/out/Build-Mac-Clang-x86_64-Debug-Metal/Debug",
"--args=cc=\"clang\" cc_wrapper=\"[START_DIR]/ccache_mac/bin/ccache\" cxx=\"clang++\" extra_cflags=[\"-DDUMMY_xcode_build_version=11c29\", \"-O1\"] skia_use_gl=false skia_use_metal=true target_cpu=\"x86_64\" werror=true"
"--args=cc=\"clang\" cc_wrapper=\"[START_DIR]/ccache_mac/bin/ccache\" cxx=\"clang++\" extra_cflags=[\"-DDUMMY_xcode_build_version=11c29\", \"-O1\"] skia_use_metal=true target_cpu=\"x86_64\" werror=true"
],
"cwd": "[START_DIR]/cache/work/skia",
"env": {

View File

@ -70,7 +70,7 @@
"[START_DIR]/cache/work/skia/bin/gn",
"gen",
"[START_DIR]/cache/work/skia/out/Build-Mac-Clang-x86_64-Release-MoltenVK_Vulkan/Release",
"--args=cc=\"clang\" cc_wrapper=\"[START_DIR]/ccache_mac/bin/ccache\" cxx=\"clang++\" extra_cflags=[\"-DDUMMY_xcode_build_version=11c29\"] is_debug=false skia_enable_vulkan_debug_layers=true skia_moltenvk_path=\"[START_DIR]/moltenvk\" skia_use_gl=false skia_use_vulkan=true target_cpu=\"x86_64\" werror=true"
"--args=cc=\"clang\" cc_wrapper=\"[START_DIR]/ccache_mac/bin/ccache\" cxx=\"clang++\" extra_cflags=[\"-DDUMMY_xcode_build_version=11c29\"] is_debug=false skia_enable_vulkan_debug_layers=true skia_moltenvk_path=\"[START_DIR]/moltenvk\" skia_use_vulkan=true target_cpu=\"x86_64\" werror=true"
],
"cwd": "[START_DIR]/cache/work/skia",
"env": {

View File

@ -36,7 +36,7 @@
"[START_DIR]\\cache\\work\\skia\\bin\\gn",
"gen",
"[START_DIR]\\cache\\work\\skia\\out\\Build-Win-Clang-x86_64-Release-Dawn\\Release_x64",
"--args=cc=\"clang\" clang_win=\"[START_DIR]\\clang_win\" cxx=\"clang++\" extra_cflags=[\"-DDUMMY_clang_win_version=42\"] is_debug=false skia_use_dawn=true skia_use_gl=false target_cpu=\"x86_64\" werror=true win_sdk=\"[START_DIR]\\win_toolchain/win_sdk\" win_vc=\"[START_DIR]\\win_toolchain/VC\""
"--args=cc=\"clang\" clang_win=\"[START_DIR]\\clang_win\" cxx=\"clang++\" extra_cflags=[\"-DDUMMY_clang_win_version=42\"] is_debug=false skia_use_dawn=true target_cpu=\"x86_64\" werror=true win_sdk=\"[START_DIR]\\win_toolchain/win_sdk\" win_vc=\"[START_DIR]\\win_toolchain/VC\""
],
"cwd": "[START_DIR]\\cache\\work\\skia",
"env": {

View File

@ -36,7 +36,7 @@
"[START_DIR]\\cache\\work\\skia\\bin\\gn",
"gen",
"[START_DIR]\\cache\\work\\skia\\out\\Build-Win-Clang-x86_64-Release-Direct3D\\Release_x64",
"--args=cc=\"clang\" clang_win=\"[START_DIR]\\clang_win\" cxx=\"clang++\" extra_cflags=[\"-DDUMMY_clang_win_version=42\"] is_debug=false skia_use_direct3d=true skia_use_gl=false target_cpu=\"x86_64\" werror=true win_sdk=\"[START_DIR]\\win_toolchain/win_sdk\" win_vc=\"[START_DIR]\\win_toolchain/VC\""
"--args=cc=\"clang\" clang_win=\"[START_DIR]\\clang_win\" cxx=\"clang++\" extra_cflags=[\"-DDUMMY_clang_win_version=42\"] is_debug=false skia_use_direct3d=true target_cpu=\"x86_64\" werror=true win_sdk=\"[START_DIR]\\win_toolchain/win_sdk\" win_vc=\"[START_DIR]\\win_toolchain/VC\""
],
"cwd": "[START_DIR]\\cache\\work\\skia",
"env": {

View File

@ -36,7 +36,7 @@
"[START_DIR]\\cache\\work\\skia\\bin\\gn",
"gen",
"[START_DIR]\\cache\\work\\skia\\out\\Build-Win-Clang-x86_64-Release-Vulkan\\Release_x64",
"--args=cc=\"clang\" clang_win=\"[START_DIR]\\clang_win\" cxx=\"clang++\" extra_cflags=[\"-DDUMMY_clang_win_version=42\"] is_debug=false skia_enable_vulkan_debug_layers=true skia_use_gl=false skia_use_vulkan=true target_cpu=\"x86_64\" werror=true win_sdk=\"[START_DIR]\\win_toolchain/win_sdk\" win_vc=\"[START_DIR]\\win_toolchain/VC\""
"--args=cc=\"clang\" clang_win=\"[START_DIR]\\clang_win\" cxx=\"clang++\" extra_cflags=[\"-DDUMMY_clang_win_version=42\"] is_debug=false skia_enable_vulkan_debug_layers=true skia_use_vulkan=true target_cpu=\"x86_64\" werror=true win_sdk=\"[START_DIR]\\win_toolchain/win_sdk\" win_vc=\"[START_DIR]\\win_toolchain/VC\""
],
"cwd": "[START_DIR]\\cache\\work\\skia",
"env": {

View File

@ -59,7 +59,7 @@
#include <emscripten.h>
#include <emscripten/bind.h>
#ifdef SK_GL
#if SK_SUPPORT_GPU
#include "include/gpu/GrBackendSurface.h"
#include "include/gpu/GrContext.h"
#include "include/gpu/gl/GrGLInterface.h"
@ -147,7 +147,7 @@ SkImageInfo toSkImageInfo(const SimpleImageInfo& sii) {
return SkImageInfo::Make(sii.width, sii.height, sii.colorType, sii.alphaType);
}
#ifdef SK_GL
#if SK_SUPPORT_GPU
sk_sp<GrContext> MakeGrContext(EMSCRIPTEN_WEBGL_CONTEXT_HANDLE context)
{
EMSCRIPTEN_RESULT r = emscripten_webgl_make_context_current(context);
@ -722,7 +722,7 @@ namespace emscripten {
// types Pi, Pf"). But, we can just pretend they are numbers and cast them to be pointers and
// the compiler is happy.
EMSCRIPTEN_BINDINGS(Skia) {
#ifdef SK_GL
#if SK_SUPPORT_GPU
function("currentContext", &emscripten_webgl_get_current_context);
function("setCurrentContext", &emscripten_webgl_make_context_current);
function("MakeGrContext", &MakeGrContext);
@ -918,7 +918,7 @@ EMSCRIPTEN_BINDINGS(Skia) {
flags, &localMatrix);
}), allow_raw_pointers());
#ifdef SK_GL
#if SK_SUPPORT_GPU
class_<GrContext>("GrContext")
.smart_ptr<sk_sp<GrContext>>("sk_sp<GrContext>")
.function("getResourceCacheLimitBytes", optional_override([](GrContext& self)->size_t {

View File

@ -57,7 +57,7 @@ rm -f $BUILD_DIR/*.a
GN_GPU="skia_enable_gpu=true skia_gl_standard = \"webgl\""
GN_GPU_FLAGS="\"-DSK_DISABLE_LEGACY_SHADERCONTEXT\","
WASM_GPU="-lEGL -lGLESv2 -DSK_SUPPORT_GPU=1 -DSK_GL \
WASM_GPU="-lEGL -lGLESv2 -DSK_SUPPORT_GPU=1 \
-DSK_DISABLE_LEGACY_SHADERCONTEXT --pre-js $BASE_DIR/cpu.js --pre-js $BASE_DIR/gpu.js\
-s USE_WEBGL2=1"
if [[ $@ == *cpu* ]]; then

View File

@ -16,7 +16,6 @@
#include "src/core/SkRectPriv.h"
#include "src/gpu/GrClip.h"
#include "src/gpu/GrContextPriv.h"
#include "src/gpu/GrGpu.h"
#include "src/gpu/GrMemoryPool.h"
#include "src/gpu/GrRenderTargetContext.h"
#include "src/gpu/GrRenderTargetContextPriv.h"
@ -27,13 +26,10 @@
#include "src/gpu/ccpr/GrGSCoverageProcessor.h"
#include "src/gpu/ccpr/GrVSCoverageProcessor.h"
#include "src/gpu/geometry/GrPathUtils.h"
#include "src/gpu/gl/GrGLGpu.h"
#include "src/gpu/glsl/GrGLSLFragmentShaderBuilder.h"
#include "src/gpu/ops/GrDrawOp.h"
#ifdef SK_GL
#include "src/gpu/gl/GrGLGpu.h"
#endif
using TriPointInstance = GrCCCoverageProcessor::TriPointInstance;
using QuadPointInstance = GrCCCoverageProcessor::QuadPointInstance;
using PrimitiveType = GrCCCoverageProcessor::PrimitiveType;
@ -329,7 +325,6 @@ void CCPRGeometryView::DrawCoverageCountOp::onExecute(GrOpFlushState* state,
const SkRect& chainBounds) {
GrResourceProvider* rp = state->resourceProvider();
GrContext* context = state->gpu()->getContext();
#ifdef SK_GL
GrGLGpu* glGpu = GrBackendApi::kOpenGL == context->backend()
? static_cast<GrGLGpu*>(state->gpu())
: nullptr;
@ -338,7 +333,6 @@ void CCPRGeometryView::DrawCoverageCountOp::onExecute(GrOpFlushState* state,
// GR_GL_CALL(glGpu->glInterface(), PolygonMode(GR_GL_FRONT_AND_BACK, GR_GL_LINE));
GR_GL_CALL(glGpu->glInterface(), Enable(GR_GL_LINE_SMOOTH));
}
#endif
GrPipeline pipeline(GrScissorTest::kDisabled, SkBlendMode::kPlus,
state->drawOpArgs().outputSwizzle());
@ -401,11 +395,9 @@ void CCPRGeometryView::DrawCoverageCountOp::onExecute(GrOpFlushState* state,
stroker.drawStrokes(state, proc.get(), batchID, ibounds);
}
#ifdef SK_GL
if (glGpu) {
context->resetContext(kMisc_GrGLBackendState);
}
#endif
}
class CCPRGeometryView::Click : public Sample::Click {

View File

@ -92,7 +92,6 @@ GrBackendFormat::GrBackendFormat(GrGLenum format, GrGLenum target)
SK_ABORT("Unexpected texture target");
}
}
#endif
GrGLFormat GrBackendFormat::asGLFormat() const {
if (this->isValid() && GrBackendApi::kOpenGL == fBackend) {
@ -100,6 +99,7 @@ GrGLFormat GrBackendFormat::asGLFormat() const {
}
return GrGLFormat::kUnknown;
}
#endif
GrBackendFormat GrBackendFormat::MakeVk(const GrVkYcbcrConversionInfo& ycbcrInfo) {
SkASSERT(ycbcrInfo.isValid());

View File

@ -45,9 +45,7 @@ public:
virtual bool scaleContentToFit() const { return false; }
enum BackendType {
#ifdef SK_GL
kNativeGL_BackendType,
#endif
#if SK_ANGLE && defined(SK_BUILD_FOR_WIN)
kANGLE_BackendType,
#endif

View File

@ -47,15 +47,11 @@ bool Window_android::attach(BackendType attachType) {
void Window_android::initDisplay(ANativeWindow* window) {
SkASSERT(window);
switch (fBackendType) {
#ifdef SK_GL
case kNativeGL_BackendType:
default:
fWindowContext =
window_context_factory::MakeGLForAndroid(window, fRequestedDisplayParams);
break;
#else
default:
#endif
case kRaster_BackendType:
fWindowContext =
window_context_factory::MakeRasterForAndroid(window, fRequestedDisplayParams);

View File

@ -80,22 +80,18 @@ bool Window_ios::attach(BackendType attachType) {
info.fWindow = this;
info.fViewController = fWindow.rootViewController;
switch (attachType) {
case kRaster_BackendType:
fWindowContext = MakeRasterForIOS(info, fRequestedDisplayParams);
break;
#ifdef SK_METAL
case kMetal_BackendType:
fWindowContext = MakeMetalForIOS(info, fRequestedDisplayParams);
break;
#endif
#ifdef SK_GL
case kNativeGL_BackendType:
default:
fWindowContext = MakeGLForIOS(info, fRequestedDisplayParams);
break;
#else
default:
#endif
case kRaster_BackendType:
fWindowContext = MakeRasterForIOS(info, fRequestedDisplayParams);
break;
}
this->onBackendCreated();

View File

@ -119,6 +119,9 @@ bool Window_mac::attach(BackendType attachType) {
window_context_factory::MacWindowInfo info;
info.fMainView = [fWindow contentView];
switch (attachType) {
case kRaster_BackendType:
fWindowContext = MakeRasterForMac(info, fRequestedDisplayParams);
break;
#ifdef SK_DAWN
case kDawn_BackendType:
fWindowContext = MakeDawnMTLForMac(info, fRequestedDisplayParams);
@ -134,17 +137,10 @@ bool Window_mac::attach(BackendType attachType) {
fWindowContext = MakeMetalForMac(info, fRequestedDisplayParams);
break;
#endif
#ifdef SK_GL
case kNativeGL_BackendType:
default:
fWindowContext = MakeGLForMac(info, fRequestedDisplayParams);
break;
#else
default:
#endif
case kRaster_BackendType:
fWindowContext = MakeRasterForMac(info, fRequestedDisplayParams);
break;
}
this->onBackendCreated();

View File

@ -370,12 +370,10 @@ bool Window_unix::attach(BackendType attachType) {
window_context_factory::MakeVulkanForXlib(winInfo, fRequestedDisplayParams);
break;
#endif
#ifdef SK_GL
case kNativeGL_BackendType:
fWindowContext =
window_context_factory::MakeGLForXlib(winInfo, fRequestedDisplayParams);
break;
#endif
case kRaster_BackendType:
fWindowContext =
window_context_factory::MakeRasterForXlib(winInfo, fRequestedDisplayParams);

View File

@ -350,11 +350,9 @@ bool Window_win::attach(BackendType attachType) {
fBackend = attachType;
switch (attachType) {
#ifdef SK_GL
case kNativeGL_BackendType:
fWindowContext = window_context_factory::MakeGLForWin(fHWnd, fRequestedDisplayParams);
break;
#endif
#if SK_ANGLE
case kANGLE_BackendType:
fWindowContext =

View File

@ -11,11 +11,9 @@
#include "include/gpu/GrContextOptions.h"
#include "include/gpu/gl/GrGLInterface.h"
#ifdef SK_GL
GrContextHolder SkMakeGLContext() {
return GrContextHolder(GrContext::MakeGL(nullptr, GrContextOptions()).release());
}
#endif
void GrContextRelease::operator()(GrContext* ptr) { SkSafeUnref(ptr); }

View File

@ -131,10 +131,6 @@ static DEFINE_bool(redraw, false, "Toggle continuous redraw.");
static DEFINE_bool(offscreen, false, "Force rendering to an offscreen surface.");
#ifndef SK_GL
static_assert(false, "viewer requires GL backend for raster.")
#endif
const char* kBackendTypeStrings[sk_app::Window::kBackendTypeCount] = {
"OpenGL",
#if SK_ANGLE && defined(SK_BUILD_FOR_WIN)