From cf43fc676856c4db0122ff3bcb49d90b0e7b1115 Mon Sep 17 00:00:00 2001 From: Adlai Holler Date: Thu, 24 Sep 2020 11:42:38 +0000 Subject: [PATCH] Revert "Reland "Take GrContext private, GrDDLContext inherit from GrRecordingContext"" This reverts commit ff13ffbeacec5335cfdb84c8a9d20bb78e10da58. Reason for revert: Blink in g3 Original change's description: > Reland "Take GrContext private, GrDDLContext inherit from GrRecordingContext" > > This reverts commit 89bdc90ac877dc8cd49c86c35a20d9df0d3b9016. > > Reason for revert: Fix metal > > Original change's description: > > Revert "Take GrContext private, GrDDLContext inherit from GrRecordingContext" > > > > This reverts commit d2daa94edeca88281796524fae45f38f11a7bef2. > > > > Reason for revert: Metaru > > > > Original change's description: > > > Take GrContext private, GrDDLContext inherit from GrRecordingContext > > > > > > Woo! > > > > > > Change-Id: I8d201b709343dc18cad31ea740575285dd035f35 > > > Docs-Preview: https://skia.org/?cl=317436 > > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317436 > > > Reviewed-by: Robert Phillips > > > Reviewed-by: Brian Salomon > > > Commit-Queue: Adlai Holler > > > > TBR=bsalomon@google.com,robertphillips@google.com,adlai@google.com > > > > Change-Id: I9b58dee285fbdc49ebc8e76df5da0fe224cf9787 > > No-Presubmit: true > > No-Tree-Checks: true > > No-Try: true > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318758 > > Reviewed-by: Adlai Holler > > Commit-Queue: Adlai Holler > > TBR=bsalomon@google.com,robertphillips@google.com,adlai@google.com > > > Change-Id: Id4b10795193a904cd4ed8c36e60e74abe3b6702a > Docs-Preview: https://skia.org/?cl=318759 > Cq-Include-Trybots: luci.skia.skia.primary:Build-Mac10.15.5-Clang-arm64-Debug-iOS_Metal,Build-Mac-Clang-x86_64-Debug-Metal > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318759 > Commit-Queue: Adlai Holler > Reviewed-by: Adlai Holler TBR=bsalomon@google.com,robertphillips@google.com,adlai@google.com Change-Id: Ib20fe933120d56b72efaec73a0bedec60bc28def No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319184 Commit-Queue: Adlai Holler Reviewed-by: Adlai Holler --- .../skottiekit/skottiekit_bindings.cpp | 7 +- .../wasm-skp-debugger/debugger_bindings.cpp | 4 +- gn/gpu.gni | 2 +- include/{private => gpu}/GrContext.h | 56 ++++++++++++ include/gpu/GrDirectContext.h | 2 +- modules/canvaskit/canvaskit_bindings.cpp | 42 ++++----- modules/canvaskit/viewer_bindings.cpp | 1 + site/user/api/skcanvas_creation.md | 2 +- src/gpu/GrDDLContext.cpp | 30 ++++++- src/gpu/GrDirectContext.cpp | 89 +++++++++++++++++++ tools/fiddle/fiddle_main.h | 2 +- 11 files changed, 201 insertions(+), 36 deletions(-) rename include/{private => gpu}/GrContext.h (94%) diff --git a/experimental/skottiekit/skottiekit_bindings.cpp b/experimental/skottiekit/skottiekit_bindings.cpp index a8f5807585025..b115fc3f42c57 100644 --- a/experimental/skottiekit/skottiekit_bindings.cpp +++ b/experimental/skottiekit/skottiekit_bindings.cpp @@ -31,7 +31,7 @@ #ifdef SK_GL #include "include/core/SkImageInfo.h" #include "include/gpu/GrBackendSurface.h" -#include "include/gpu/GrDirectContext.h" +#include "include/gpu/GrContext.h" #include "include/gpu/gl/GrGLInterface.h" #include "include/gpu/gl/GrGLTypes.h" @@ -214,7 +214,6 @@ SkImageInfo toSkImageInfo(const SimpleImageInfo& sii) { } #ifdef SK_GL -// TODO: Migrate this to GrDirectContext. sk_sp MakeGrContext(EMSCRIPTEN_WEBGL_CONTEXT_HANDLE context) { EMSCRIPTEN_RESULT r = emscripten_webgl_make_context_current(context); @@ -222,10 +221,10 @@ sk_sp MakeGrContext(EMSCRIPTEN_WEBGL_CONTEXT_HANDLE context) printf("failed to make webgl context current %d\n", r); return nullptr; } - // setup GrDirectContext + // setup GrContext auto interface = GrGLMakeNativeInterface(); // setup contexts - sk_sp grContext(GrDirectContext::MakeGL(interface)); + sk_sp grContext(GrContext::MakeGL(interface)); return grContext; } diff --git a/experimental/wasm-skp-debugger/debugger_bindings.cpp b/experimental/wasm-skp-debugger/debugger_bindings.cpp index f64d4a1e68b8b..2f751c69b521a 100644 --- a/experimental/wasm-skp-debugger/debugger_bindings.cpp +++ b/experimental/wasm-skp-debugger/debugger_bindings.cpp @@ -33,7 +33,7 @@ #ifdef SK_GL #include "include/gpu/GrBackendSurface.h" -#include "include/gpu/GrDirectContext.h" +#include "include/gpu/GrContext.h" #include "include/gpu/gl/GrGLInterface.h" #include "include/gpu/gl/GrGLTypes.h" @@ -436,7 +436,7 @@ sk_sp MakeGrContext(EMSCRIPTEN_WEBGL_CONTEXT_HANDLE context) return nullptr; } // setup contexts - sk_sp grContext(GrDirectContext::MakeGL(interface)); + sk_sp grContext(GrContext::MakeGL(interface)); return grContext; } diff --git a/gn/gpu.gni b/gn/gpu.gni index b18518db007a0..4f9d3b0aa7a94 100644 --- a/gn/gpu.gni +++ b/gn/gpu.gni @@ -13,6 +13,7 @@ skia_gpu_sources = [ "$_include/gpu/GrBackendSurface.h", "$_include/gpu/GrBackendSurfaceMutableState.h", "$_include/gpu/GrConfig.h", + "$_include/gpu/GrContext.h", "$_include/gpu/GrContextOptions.h", "$_include/gpu/GrContextThreadSafeProxy.h", "$_include/gpu/GrDirectContext.h", @@ -21,7 +22,6 @@ skia_gpu_sources = [ "$_include/gpu/GrTypes.h", # Private includes - "$_include/private/GrContext.h", "$_include/private/GrContext_Base.h", "$_include/private/GrGLTypesPriv.h", "$_include/private/GrImageContext.h", diff --git a/include/private/GrContext.h b/include/gpu/GrContext.h similarity index 94% rename from include/private/GrContext.h rename to include/gpu/GrContext.h index d645b60290780..0a96abc8a6f6e 100644 --- a/include/private/GrContext.h +++ b/include/gpu/GrContext.h @@ -49,6 +49,62 @@ class SkTraceMemoryDump; class SK_API GrContext : public GrRecordingContext { public: +#ifndef SK_DISABLE_LEGACY_CONTEXT_FACTORIES + +#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. + */ + static sk_sp MakeGL(sk_sp, const GrContextOptions&); + static sk_sp MakeGL(sk_sp); + static sk_sp MakeGL(const GrContextOptions&); + static sk_sp MakeGL(); +#endif + +#ifdef SK_VULKAN + /** + * The Vulkan context (VkQueue, VkDevice, VkInstance) must be kept alive until the returned + * GrContext is destroyed. This also means that any objects created with this GrContext (e.g. + * SkSurfaces, SkImages, etc.) must also be released as they may hold refs on the GrContext. + * Once all these objects and the GrContext are released, then it is safe to delete the vulkan + * objects. + */ + static sk_sp MakeVulkan(const GrVkBackendContext&, const GrContextOptions&); + static sk_sp MakeVulkan(const GrVkBackendContext&); +#endif + +#ifdef SK_METAL + /** + * Makes a GrContext which uses Metal as the backend. The device parameter is an MTLDevice + * and queue is an MTLCommandQueue which should be used by the backend. These objects must + * have a ref on them which can be transferred to Ganesh which will release the ref when the + * GrContext is destroyed. + */ + static sk_sp MakeMetal(void* device, void* queue, const GrContextOptions& options); + static sk_sp MakeMetal(void* device, void* queue); +#endif + +#ifdef SK_DIRECT3D + /** + * Makes a GrContext which uses Direct3D as the backend. The Direct3D context + * must be kept alive until the returned GrContext is first destroyed or abandoned. + */ + static sk_sp MakeDirect3D(const GrD3DBackendContext&, + const GrContextOptions& options); + static sk_sp MakeDirect3D(const GrD3DBackendContext&); +#endif + +#ifdef SK_DAWN + static sk_sp MakeDawn(const wgpu::Device& device, const GrContextOptions& options); + static sk_sp MakeDawn(const wgpu::Device& device); +#endif + + static sk_sp MakeMock(const GrMockOptions*, const GrContextOptions&); + static sk_sp MakeMock(const GrMockOptions*); + +#endif // SK_DISABLE_LEGACY_CONTEXT_FACTORIES + ~GrContext() override; // TODO: Remove this from public after migrating Chrome. diff --git a/include/gpu/GrDirectContext.h b/include/gpu/GrDirectContext.h index ccaa2fc6d23d2..a37bf0b7d8d0c 100644 --- a/include/gpu/GrDirectContext.h +++ b/include/gpu/GrDirectContext.h @@ -8,7 +8,7 @@ #ifndef GrDirectContext_DEFINED #define GrDirectContext_DEFINED -#include "include/private/GrContext.h" +#include "include/gpu/GrContext.h" class GrAtlasManager; class GrSmallPathAtlasMgr; diff --git a/modules/canvaskit/canvaskit_bindings.cpp b/modules/canvaskit/canvaskit_bindings.cpp index 6535f1ba0b95d..5df3eed4b2fd1 100644 --- a/modules/canvaskit/canvaskit_bindings.cpp +++ b/modules/canvaskit/canvaskit_bindings.cpp @@ -150,21 +150,21 @@ struct ColorSettings { GrGLenum pixFormat; }; -sk_sp MakeGrContext(EMSCRIPTEN_WEBGL_CONTEXT_HANDLE context) +sk_sp MakeGrContext(EMSCRIPTEN_WEBGL_CONTEXT_HANDLE context) { EMSCRIPTEN_RESULT r = emscripten_webgl_make_context_current(context); if (r < 0) { printf("failed to make webgl context current %d\n", r); return nullptr; } - // setup GrDirectContext + // setup GrContext auto interface = GrGLMakeNativeInterface(); // setup contexts - sk_sp dContext(GrDirectContext::MakeGL(interface)); - return dContext; + sk_sp grContext(GrContext::MakeGL(interface)); + return grContext; } -sk_sp MakeOnScreenGLSurface(sk_sp dContext, int width, int height, +sk_sp MakeOnScreenGLSurface(sk_sp grContext, int width, int height, sk_sp colorSpace) { // WebGL should already be clearing the color and stencil buffers, but do it again here to // ensure Skia receives them in the expected state. @@ -172,7 +172,7 @@ sk_sp MakeOnScreenGLSurface(sk_sp dContext, int widt glClearColor(0, 0, 0, 0); glClearStencil(0); glClear(GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); - dContext->resetContext(kRenderTarget_GrGLBackendState | kMisc_GrGLBackendState); + grContext->resetContext(kRenderTarget_GrGLBackendState | kMisc_GrGLBackendState); // The on-screen canvas is FBO 0. Wrap it in a Skia render target so Skia can render to it. GrGLFramebufferInfo info; @@ -187,15 +187,15 @@ sk_sp MakeOnScreenGLSurface(sk_sp dContext, int widt const auto colorSettings = ColorSettings(colorSpace); info.fFormat = colorSettings.pixFormat; GrBackendRenderTarget target(width, height, sampleCnt, stencil, info); - sk_sp surface(SkSurface::MakeFromBackendRenderTarget(dContext.get(), target, + sk_sp surface(SkSurface::MakeFromBackendRenderTarget(grContext.get(), target, kBottomLeft_GrSurfaceOrigin, colorSettings.colorType, colorSpace, nullptr)); return surface; } -sk_sp MakeRenderTarget(sk_sp dContext, int width, int height) { +sk_sp MakeRenderTarget(sk_sp grContext, int width, int height) { SkImageInfo info = SkImageInfo::MakeN32(width, height, SkAlphaType::kPremul_SkAlphaType); - sk_sp surface(SkSurface::MakeRenderTarget(dContext.get(), + sk_sp surface(SkSurface::MakeRenderTarget(grContext.get(), SkBudgeted::kYes, info, 0, kBottomLeft_GrSurfaceOrigin, @@ -203,8 +203,8 @@ sk_sp MakeRenderTarget(sk_sp dContext, int width, in return surface; } -sk_sp MakeRenderTarget(sk_sp dContext, SimpleImageInfo sii) { - sk_sp surface(SkSurface::MakeRenderTarget(dContext.get(), +sk_sp MakeRenderTarget(sk_sp grContext, SimpleImageInfo sii) { + sk_sp surface(SkSurface::MakeRenderTarget(grContext.get(), SkBudgeted::kYes, toSkImageInfo(sii), 0, kBottomLeft_GrSurfaceOrigin, @@ -736,8 +736,8 @@ EMSCRIPTEN_BINDINGS(Skia) { function("setCurrentContext", &emscripten_webgl_make_context_current); function("MakeGrContext", &MakeGrContext); function("MakeOnScreenGLSurface", &MakeOnScreenGLSurface); - function("MakeRenderTarget", select_overload(sk_sp, int, int)>(&MakeRenderTarget)); - function("MakeRenderTarget", select_overload(sk_sp, SimpleImageInfo)>(&MakeRenderTarget)); + function("MakeRenderTarget", select_overload(sk_sp, int, int)>(&MakeRenderTarget)); + function("MakeRenderTarget", select_overload(sk_sp, SimpleImageInfo)>(&MakeRenderTarget)); constant("gpu", true); #endif @@ -908,26 +908,22 @@ EMSCRIPTEN_BINDINGS(Skia) { }), allow_raw_pointers()); #ifdef SK_GL - class_("GrDirectContext") - .smart_ptr>("sk_sp") - .function("getResourceCacheLimitBytes", - optional_override([](GrDirectContext& self)->size_t { + class_("GrContext") + .smart_ptr>("sk_sp") + .function("getResourceCacheLimitBytes", optional_override([](GrContext& self)->size_t { int maxResources = 0;// ignored size_t currMax = 0; self.getResourceCacheLimits(&maxResources, &currMax); return currMax; })) - .function("getResourceCacheUsageBytes", - optional_override([](GrDirectContext& self)->size_t { + .function("getResourceCacheUsageBytes", optional_override([](GrContext& self)->size_t { int usedResources = 0;// ignored size_t currUsage = 0; self.getResourceCacheUsage(&usedResources, &currUsage); return currUsage; })) - .function("releaseResourcesAndAbandonContext", - &GrDirectContext::releaseResourcesAndAbandonContext) - .function("setResourceCacheLimitBytes", - optional_override([](GrDirectContext& self, size_t maxResourceBytes)->void { + .function("releaseResourcesAndAbandonContext", &GrContext::releaseResourcesAndAbandonContext) + .function("setResourceCacheLimitBytes", optional_override([](GrContext& self, size_t maxResourceBytes)->void { int maxResources = 0; size_t currMax = 0; // ignored self.getResourceCacheLimits(&maxResources, &currMax); diff --git a/modules/canvaskit/viewer_bindings.cpp b/modules/canvaskit/viewer_bindings.cpp index 02e020611cfbf..c73408e47f5d8 100644 --- a/modules/canvaskit/viewer_bindings.cpp +++ b/modules/canvaskit/viewer_bindings.cpp @@ -9,6 +9,7 @@ #include #include "include/core/SkCanvas.h" #include "include/core/SkSurface.h" +#include "include/gpu/GrContext.h" #include "tools/skui/InputState.h" #include "tools/skui/ModifierKey.h" #include "tools/viewer/SKPSlide.h" diff --git a/site/user/api/skcanvas_creation.md b/site/user/api/skcanvas_creation.md index 769fba98b3de5..8a6cdfcdf3a66 100644 --- a/site/user/api/skcanvas_creation.md +++ b/site/user/api/skcanvas_creation.md @@ -84,7 +84,7 @@ has been made current to the current thread when Skia calls are made. - #include "GrDirectContext.h" + #include "GrContext.h" #include "gl/GrGLInterface.h" #include "SkData.h" #include "SkImage.h" diff --git a/src/gpu/GrDDLContext.cpp b/src/gpu/GrDDLContext.cpp index 183bc8fa4d88d..2eb46979d09b0 100644 --- a/src/gpu/GrDDLContext.cpp +++ b/src/gpu/GrDDLContext.cpp @@ -5,7 +5,7 @@ * found in the LICENSE file. */ -#include "include/gpu/GrRecordingContext.h" +#include "include/gpu/GrContext.h" #include "src/core/SkLRUCache.h" #include "src/gpu/GrCaps.h" #include "src/gpu/GrContextThreadSafeProxyPriv.h" @@ -18,7 +18,7 @@ * The DDL Context is the one in effect during DDL Recording. It isn't backed by a GrGPU and * cannot allocate any GPU resources. */ -class GrDDLContext final : public GrRecordingContext { +class GrDDLContext final : public GrContext { public: GrDDLContext(sk_sp proxy) : INHERITED(std::move(proxy)) { @@ -31,7 +31,21 @@ class GrDDLContext final : public GrRecordingContext { INHERITED::abandonContext(); } + void releaseResourcesAndAbandonContext() override { + SkASSERT(0); // abandoning in a DDL Recorder doesn't make a whole lot of sense + INHERITED::releaseResourcesAndAbandonContext(); + } + + void freeGpuResources() override { + // freeing resources in a DDL Recorder doesn't make a whole lot of sense but some of + // our tests do it anyways + } + private: + // TODO: Here we're pretending this isn't derived from GrContext. Switch this to be derived from + // GrRecordingContext! + GrDirectContext* asDirectContext() override { return nullptr; } + bool init() override { if (!INHERITED::init()) { return false; @@ -44,6 +58,16 @@ class GrDDLContext final : public GrRecordingContext { return true; } + GrAtlasManager* onGetAtlasManager() override { + SkASSERT(0); // the DDL Recorders should never invoke this + return nullptr; + } + + GrSmallPathAtlasMgr* onGetSmallPathAtlasMgr() override { + SkASSERT(0); // DDL recorders should never invoke this + return nullptr; + } + // Add to the set of unique program infos required by this DDL void recordProgramInfo(const GrProgramInfo* programInfo) final { if (!programInfo) { @@ -125,7 +149,7 @@ class GrDDLContext final : public GrRecordingContext { ProgramInfoMap fProgramInfoMap; - using INHERITED = GrRecordingContext; + using INHERITED = GrContext; }; sk_sp GrRecordingContextPriv::MakeDDL(sk_sp proxy) { diff --git a/src/gpu/GrDirectContext.cpp b/src/gpu/GrDirectContext.cpp index 84b6c597e6d57..6f04a5fc7b529 100644 --- a/src/gpu/GrDirectContext.cpp +++ b/src/gpu/GrDirectContext.cpp @@ -138,6 +138,27 @@ GrSmallPathAtlasMgr* GrDirectContext::onGetSmallPathAtlasMgr() { } #ifdef SK_GL +/*************************************************************************************************/ +#ifndef SK_DISABLE_LEGACY_CONTEXT_FACTORIES + +sk_sp GrContext::MakeGL(sk_sp glInterface) { + return GrDirectContext::MakeGL(std::move(glInterface)); +} + +sk_sp GrContext::MakeGL(const GrContextOptions& options) { + return GrDirectContext::MakeGL(options); +} + +sk_sp GrContext::MakeGL() { + return GrDirectContext::MakeGL(); +} + +sk_sp GrContext::MakeGL(sk_sp glInterface, + const GrContextOptions& options) { + return GrDirectContext::MakeGL(std::move(glInterface), options); +} + +#endif /*************************************************************************************************/ sk_sp GrDirectContext::MakeGL(sk_sp glInterface) { @@ -206,6 +227,20 @@ sk_sp GrDirectContext::MakeGL(sk_sp glInte } #endif +/*************************************************************************************************/ +#ifndef SK_DISABLE_LEGACY_CONTEXT_FACTORIES + +sk_sp GrContext::MakeMock(const GrMockOptions* mockOptions) { + return GrDirectContext::MakeMock(mockOptions); +} + +sk_sp GrContext::MakeMock(const GrMockOptions* mockOptions, + const GrContextOptions& options) { + return GrDirectContext::MakeMock(mockOptions, options); +} + +#endif + /*************************************************************************************************/ sk_sp GrDirectContext::MakeMock(const GrMockOptions* mockOptions) { GrContextOptions defaultOptions; @@ -225,6 +260,20 @@ sk_sp GrDirectContext::MakeMock(const GrMockOptions* mockOption } #ifdef SK_VULKAN +/*************************************************************************************************/ +#ifndef SK_DISABLE_LEGACY_CONTEXT_FACTORIES + +sk_sp GrContext::MakeVulkan(const GrVkBackendContext& backendContext) { + return GrDirectContext::MakeVulkan(backendContext); +} + +sk_sp GrContext::MakeVulkan(const GrVkBackendContext& backendContext, + const GrContextOptions& options) { + return GrDirectContext::MakeVulkan(backendContext, options); +} + +#endif + /*************************************************************************************************/ sk_sp GrDirectContext::MakeVulkan(const GrVkBackendContext& backendContext) { GrContextOptions defaultOptions; @@ -245,6 +294,19 @@ sk_sp GrDirectContext::MakeVulkan(const GrVkBackendContext& bac #endif #ifdef SK_METAL +/*************************************************************************************************/ +#ifndef SK_DISABLE_LEGACY_CONTEXT_FACTORIES + +sk_sp GrContext::MakeMetal(void* device, void* queue) { + return GrDirectContext::MakeMetal(device, queue); +} + +sk_sp GrContext::MakeMetal(void* device, void* queue, const GrContextOptions& options) { + return GrDirectContext::MakeMetal(device, queue, options); +} + +#endif + /*************************************************************************************************/ sk_sp GrDirectContext::MakeMetal(void* device, void* queue) { GrContextOptions defaultOptions; @@ -265,6 +327,20 @@ sk_sp GrDirectContext::MakeMetal(void* device, void* queue, #endif #ifdef SK_DIRECT3D +/*************************************************************************************************/ +#ifndef SK_DISABLE_LEGACY_CONTEXT_FACTORIES + +sk_sp GrContext::MakeDirect3D(const GrD3DBackendContext& backendContext) { + return GrDirectContext::MakeDirect3D(backendContext); +} + +sk_sp GrContext::MakeDirect3D(const GrD3DBackendContext& backendContext, + const GrContextOptions& options) { + return GrDirectContext::MakeDirect3D(backendContext, options); +} + +#endif + /*************************************************************************************************/ sk_sp GrDirectContext::MakeDirect3D(const GrD3DBackendContext& backendContext) { GrContextOptions defaultOptions; @@ -285,6 +361,19 @@ sk_sp GrDirectContext::MakeDirect3D(const GrD3DBackendContext& #endif #ifdef SK_DAWN +/*************************************************************************************************/ +#ifndef SK_DISABLE_LEGACY_CONTEXT_FACTORIES + +sk_sp GrContext::MakeDawn(const wgpu::Device& device) { + return GrDirectContext::MakeDawn(device); +} + +sk_sp GrContext::MakeDawn(const wgpu::Device& device, const GrContextOptions& options) { + return GrDirectContext::MakeDawn(device, options); +} + +#endif + /*************************************************************************************************/ sk_sp GrDirectContext::MakeDawn(const wgpu::Device& device) { GrContextOptions defaultOptions; diff --git a/tools/fiddle/fiddle_main.h b/tools/fiddle/fiddle_main.h index d80e8661d3840..4f94cea6f6655 100644 --- a/tools/fiddle/fiddle_main.h +++ b/tools/fiddle/fiddle_main.h @@ -13,7 +13,7 @@ #include "include/core/SkPictureRecorder.h" #include "include/core/SkStream.h" #include "include/core/SkSurface.h" - #include "include/gpu/GrDirectContext.h" + #include "include/gpu/GrContext.h" #include "include/gpu/gl/GrGLAssembleInterface.h" #include "include/gpu/gl/GrGLInterface.h" #else