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 <robertphillips@google.com>
> > > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > > Commit-Queue: Adlai Holler <adlai@google.com>
> >
> > 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 <adlai@google.com>
> > Commit-Queue: Adlai Holler <adlai@google.com>
>
> 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 <adlai@google.com>
> Reviewed-by: Adlai Holler <adlai@google.com>

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 <adlai@google.com>
Reviewed-by: Adlai Holler <adlai@google.com>
diff --git a/experimental/skottiekit/skottiekit_bindings.cpp b/experimental/skottiekit/skottiekit_bindings.cpp
index a8f5807..b115fc3 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 @@
 }
 
 #ifdef SK_GL
-// TODO: Migrate this to GrDirectContext.
 sk_sp<GrContext> MakeGrContext(EMSCRIPTEN_WEBGL_CONTEXT_HANDLE context)
 {
     EMSCRIPTEN_RESULT r = emscripten_webgl_make_context_current(context);
@@ -222,10 +221,10 @@
         printf("failed to make webgl context current %d\n", r);
         return nullptr;
     }
-    // setup GrDirectContext
+    // setup GrContext
     auto interface = GrGLMakeNativeInterface();
     // setup contexts
-    sk_sp<GrContext> grContext(GrDirectContext::MakeGL(interface));
+    sk_sp<GrContext> 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 f64d4a1..2f751c6 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 @@
         return nullptr;
     }
     // setup contexts
-    sk_sp<GrContext> grContext(GrDirectContext::MakeGL(interface));
+    sk_sp<GrContext> grContext(GrContext::MakeGL(interface));
     return grContext;
 }
 
diff --git a/gn/gpu.gni b/gn/gpu.gni
index b18518d..4f9d3b0 100644
--- a/gn/gpu.gni
+++ b/gn/gpu.gni
@@ -13,6 +13,7 @@
   "$_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 @@
   "$_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 93%
rename from include/private/GrContext.h
rename to include/gpu/GrContext.h
index d645b60..0a96abc 100644
--- a/include/private/GrContext.h
+++ b/include/gpu/GrContext.h
@@ -49,6 +49,62 @@
 
 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<GrContext> MakeGL(sk_sp<const GrGLInterface>, const GrContextOptions&);
+    static sk_sp<GrContext> MakeGL(sk_sp<const GrGLInterface>);
+    static sk_sp<GrContext> MakeGL(const GrContextOptions&);
+    static sk_sp<GrContext> 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<GrContext> MakeVulkan(const GrVkBackendContext&, const GrContextOptions&);
+    static sk_sp<GrContext> 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<GrContext> MakeMetal(void* device, void* queue, const GrContextOptions& options);
+    static sk_sp<GrContext> 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<GrContext> MakeDirect3D(const GrD3DBackendContext&,
+                                         const GrContextOptions& options);
+    static sk_sp<GrContext> MakeDirect3D(const GrD3DBackendContext&);
+#endif
+
+#ifdef SK_DAWN
+    static sk_sp<GrContext> MakeDawn(const wgpu::Device& device, const GrContextOptions& options);
+    static sk_sp<GrContext> MakeDawn(const wgpu::Device& device);
+#endif
+
+    static sk_sp<GrContext> MakeMock(const GrMockOptions*, const GrContextOptions&);
+    static sk_sp<GrContext> 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 ccaa2fc..a37bf0b 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 6535f1b..5df3eed 100644
--- a/modules/canvaskit/canvaskit_bindings.cpp
+++ b/modules/canvaskit/canvaskit_bindings.cpp
@@ -150,21 +150,21 @@
     GrGLenum pixFormat;
 };
 
-sk_sp<GrDirectContext> MakeGrContext(EMSCRIPTEN_WEBGL_CONTEXT_HANDLE context)
+sk_sp<GrContext> 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<GrDirectContext> dContext(GrDirectContext::MakeGL(interface));
-    return dContext;
+    sk_sp<GrContext> grContext(GrContext::MakeGL(interface));
+    return grContext;
 }
 
-sk_sp<SkSurface> MakeOnScreenGLSurface(sk_sp<GrDirectContext> dContext, int width, int height,
+sk_sp<SkSurface> MakeOnScreenGLSurface(sk_sp<GrContext> grContext, int width, int height,
                                        sk_sp<SkColorSpace> 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 @@
     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 @@
     const auto colorSettings = ColorSettings(colorSpace);
     info.fFormat = colorSettings.pixFormat;
     GrBackendRenderTarget target(width, height, sampleCnt, stencil, info);
-    sk_sp<SkSurface> surface(SkSurface::MakeFromBackendRenderTarget(dContext.get(), target,
+    sk_sp<SkSurface> surface(SkSurface::MakeFromBackendRenderTarget(grContext.get(), target,
         kBottomLeft_GrSurfaceOrigin, colorSettings.colorType, colorSpace, nullptr));
     return surface;
 }
 
-sk_sp<SkSurface> MakeRenderTarget(sk_sp<GrDirectContext> dContext, int width, int height) {
+sk_sp<SkSurface> MakeRenderTarget(sk_sp<GrContext> grContext, int width, int height) {
     SkImageInfo info = SkImageInfo::MakeN32(width, height, SkAlphaType::kPremul_SkAlphaType);
 
-    sk_sp<SkSurface> surface(SkSurface::MakeRenderTarget(dContext.get(),
+    sk_sp<SkSurface> surface(SkSurface::MakeRenderTarget(grContext.get(),
                              SkBudgeted::kYes,
                              info, 0,
                              kBottomLeft_GrSurfaceOrigin,
@@ -203,8 +203,8 @@
     return surface;
 }
 
-sk_sp<SkSurface> MakeRenderTarget(sk_sp<GrDirectContext> dContext, SimpleImageInfo sii) {
-    sk_sp<SkSurface> surface(SkSurface::MakeRenderTarget(dContext.get(),
+sk_sp<SkSurface> MakeRenderTarget(sk_sp<GrContext> grContext, SimpleImageInfo sii) {
+    sk_sp<SkSurface> surface(SkSurface::MakeRenderTarget(grContext.get(),
                              SkBudgeted::kYes,
                              toSkImageInfo(sii), 0,
                              kBottomLeft_GrSurfaceOrigin,
@@ -736,8 +736,8 @@
     function("setCurrentContext", &emscripten_webgl_make_context_current);
     function("MakeGrContext", &MakeGrContext);
     function("MakeOnScreenGLSurface", &MakeOnScreenGLSurface);
-    function("MakeRenderTarget", select_overload<sk_sp<SkSurface>(sk_sp<GrDirectContext>, int, int)>(&MakeRenderTarget));
-    function("MakeRenderTarget", select_overload<sk_sp<SkSurface>(sk_sp<GrDirectContext>, SimpleImageInfo)>(&MakeRenderTarget));
+    function("MakeRenderTarget", select_overload<sk_sp<SkSurface>(sk_sp<GrContext>, int, int)>(&MakeRenderTarget));
+    function("MakeRenderTarget", select_overload<sk_sp<SkSurface>(sk_sp<GrContext>, SimpleImageInfo)>(&MakeRenderTarget));
 
     constant("gpu", true);
 #endif
@@ -908,26 +908,22 @@
     }), allow_raw_pointers());
 
 #ifdef SK_GL
-    class_<GrDirectContext>("GrDirectContext")
-        .smart_ptr<sk_sp<GrDirectContext>>("sk_sp<GrDirectContext>")
-        .function("getResourceCacheLimitBytes",
-                optional_override([](GrDirectContext& self)->size_t {
+    class_<GrContext>("GrContext")
+        .smart_ptr<sk_sp<GrContext>>("sk_sp<GrContext>")
+        .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 02e0206..c73408e 100644
--- a/modules/canvaskit/viewer_bindings.cpp
+++ b/modules/canvaskit/viewer_bindings.cpp
@@ -9,6 +9,7 @@
 #include <emscripten/bind.h>
 #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 769fba9..8a6cdfc 100644
--- a/site/user/api/skcanvas_creation.md
+++ b/site/user/api/skcanvas_creation.md
@@ -84,7 +84,7 @@
 
 <!--?prettify lang=cc?-->
 
-    #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 183bc8f..2eb4697 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<GrContextThreadSafeProxy> proxy)
         : INHERITED(std::move(proxy)) {
@@ -31,7 +31,21 @@
         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 @@
         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 @@
 
     ProgramInfoMap fProgramInfoMap;
 
-    using INHERITED = GrRecordingContext;
+    using INHERITED = GrContext;
 };
 
 sk_sp<GrRecordingContext> GrRecordingContextPriv::MakeDDL(sk_sp<GrContextThreadSafeProxy> proxy) {
diff --git a/src/gpu/GrDirectContext.cpp b/src/gpu/GrDirectContext.cpp
index 84b6c59..6f04a5f 100644
--- a/src/gpu/GrDirectContext.cpp
+++ b/src/gpu/GrDirectContext.cpp
@@ -138,6 +138,27 @@
 }
 
 #ifdef SK_GL
+/*************************************************************************************************/
+#ifndef SK_DISABLE_LEGACY_CONTEXT_FACTORIES
+
+sk_sp<GrContext> GrContext::MakeGL(sk_sp<const GrGLInterface> glInterface) {
+    return GrDirectContext::MakeGL(std::move(glInterface));
+}
+
+sk_sp<GrContext> GrContext::MakeGL(const GrContextOptions& options) {
+    return GrDirectContext::MakeGL(options);
+}
+
+sk_sp<GrContext> GrContext::MakeGL() {
+    return GrDirectContext::MakeGL();
+}
+
+sk_sp<GrContext> GrContext::MakeGL(sk_sp<const GrGLInterface> glInterface,
+                                   const GrContextOptions& options) {
+    return GrDirectContext::MakeGL(std::move(glInterface), options);
+}
+
+#endif
 
 /*************************************************************************************************/
 sk_sp<GrDirectContext> GrDirectContext::MakeGL(sk_sp<const GrGLInterface> glInterface) {
@@ -207,6 +228,20 @@
 #endif
 
 /*************************************************************************************************/
+#ifndef SK_DISABLE_LEGACY_CONTEXT_FACTORIES
+
+sk_sp<GrContext> GrContext::MakeMock(const GrMockOptions* mockOptions) {
+    return GrDirectContext::MakeMock(mockOptions);
+}
+
+sk_sp<GrContext> GrContext::MakeMock(const GrMockOptions* mockOptions,
+                                     const GrContextOptions& options) {
+    return GrDirectContext::MakeMock(mockOptions, options);
+}
+
+#endif
+
+/*************************************************************************************************/
 sk_sp<GrDirectContext> GrDirectContext::MakeMock(const GrMockOptions* mockOptions) {
     GrContextOptions defaultOptions;
     return MakeMock(mockOptions, defaultOptions);
@@ -226,6 +261,20 @@
 
 #ifdef SK_VULKAN
 /*************************************************************************************************/
+#ifndef SK_DISABLE_LEGACY_CONTEXT_FACTORIES
+
+sk_sp<GrContext> GrContext::MakeVulkan(const GrVkBackendContext& backendContext) {
+    return GrDirectContext::MakeVulkan(backendContext);
+}
+
+sk_sp<GrContext> GrContext::MakeVulkan(const GrVkBackendContext& backendContext,
+                                       const GrContextOptions& options) {
+    return GrDirectContext::MakeVulkan(backendContext, options);
+}
+
+#endif
+
+/*************************************************************************************************/
 sk_sp<GrDirectContext> GrDirectContext::MakeVulkan(const GrVkBackendContext& backendContext) {
     GrContextOptions defaultOptions;
     return MakeVulkan(backendContext, defaultOptions);
@@ -246,6 +295,19 @@
 
 #ifdef SK_METAL
 /*************************************************************************************************/
+#ifndef SK_DISABLE_LEGACY_CONTEXT_FACTORIES
+
+sk_sp<GrContext> GrContext::MakeMetal(void* device, void* queue) {
+    return GrDirectContext::MakeMetal(device, queue);
+}
+
+sk_sp<GrContext> GrContext::MakeMetal(void* device, void* queue, const GrContextOptions& options) {
+    return GrDirectContext::MakeMetal(device, queue, options);
+}
+
+#endif
+
+/*************************************************************************************************/
 sk_sp<GrDirectContext> GrDirectContext::MakeMetal(void* device, void* queue) {
     GrContextOptions defaultOptions;
     return MakeMetal(device, queue, defaultOptions);
@@ -266,6 +328,20 @@
 
 #ifdef SK_DIRECT3D
 /*************************************************************************************************/
+#ifndef SK_DISABLE_LEGACY_CONTEXT_FACTORIES
+
+sk_sp<GrContext> GrContext::MakeDirect3D(const GrD3DBackendContext& backendContext) {
+    return GrDirectContext::MakeDirect3D(backendContext);
+}
+
+sk_sp<GrContext> GrContext::MakeDirect3D(const GrD3DBackendContext& backendContext,
+                                         const GrContextOptions& options) {
+    return GrDirectContext::MakeDirect3D(backendContext, options);
+}
+
+#endif
+
+/*************************************************************************************************/
 sk_sp<GrDirectContext> GrDirectContext::MakeDirect3D(const GrD3DBackendContext& backendContext) {
     GrContextOptions defaultOptions;
     return MakeDirect3D(backendContext, defaultOptions);
@@ -286,6 +362,19 @@
 
 #ifdef SK_DAWN
 /*************************************************************************************************/
+#ifndef SK_DISABLE_LEGACY_CONTEXT_FACTORIES
+
+sk_sp<GrContext> GrContext::MakeDawn(const wgpu::Device& device) {
+    return GrDirectContext::MakeDawn(device);
+}
+
+sk_sp<GrContext> GrContext::MakeDawn(const wgpu::Device& device, const GrContextOptions& options) {
+    return GrDirectContext::MakeDawn(device, options);
+}
+
+#endif
+
+/*************************************************************************************************/
 sk_sp<GrDirectContext> GrDirectContext::MakeDawn(const wgpu::Device& device) {
     GrContextOptions defaultOptions;
     return MakeDawn(device, defaultOptions);
diff --git a/tools/fiddle/fiddle_main.h b/tools/fiddle/fiddle_main.h
index d80e866..4f94cea 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