Revert "Migrate SkImage::MakeFromTexture to GrRecordingContext"

This reverts commit daa9e7455d4f0f54dc07f405becba5d0c5964847.

Reason for revert: Broke Build-Debian9-Clang-arm-Release-Flutter_Android_Docker

Original change's description:
> Migrate SkImage::MakeFromTexture to GrRecordingContext
> 
> Android migration landed in Android CL 12234077
> Chrome migration is landing in Chrome CL 2335812
> 
> Note: makeFromCompressedTexture is not used by Chrome.
> 
> Bug: skia:104662
> Change-Id: Ibbe6d412cf22e87188926383d10b21f780208e48
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/305102
> Commit-Queue: Adlai Holler <adlai@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Auto-Submit: Adlai Holler <adlai@google.com>

TBR=bsalomon@google.com,robertphillips@google.com,adlai@google.com

Change-Id: I570945521c6cd78dfeea81e492b7e2b31dd0e6f5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:104662
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/308505
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
diff --git a/docs/examples/Image_MakeBackendTextureFromSkImage.cpp b/docs/examples/Image_MakeBackendTextureFromSkImage.cpp
index 450c1b4..aabdaaf 100644
--- a/docs/examples/Image_MakeBackendTextureFromSkImage.cpp
+++ b/docs/examples/Image_MakeBackendTextureFromSkImage.cpp
@@ -3,9 +3,9 @@
 #include "tools/fiddle/examples.h"
 // HASH=06aeb3cf63ffccf7b49fe556e5def351
 REG_FIDDLE(Image_MakeBackendTextureFromSkImage, 256, 64, false, 0) {
-static sk_sp<SkImage> create_gpu_image(GrRecordingContext* rContext) {
+static sk_sp<SkImage> create_gpu_image(GrContext* grContext) {
     const SkImageInfo info = SkImageInfo::MakeN32(20, 20, kOpaque_SkAlphaType);
-    auto surface(SkSurface::MakeRenderTarget(rContext, SkBudgeted::kNo, info));
+    auto surface(SkSurface::MakeRenderTarget(grContext, SkBudgeted::kNo, info));
     SkCanvas* canvas = surface->getCanvas();
     canvas->clear(SK_ColorWHITE);
     SkPaint paint;
@@ -15,19 +15,19 @@
 }
 
 void draw(SkCanvas* canvas) {
-    auto dContext = GrAsDirectContext(canvas->recordingContext());
-    if (!dContext) {
+    GrContext* grContext = canvas->getGrContext();
+    if (!grContext) {
         return;
     }
-    sk_sp<SkImage> backEndImage = create_gpu_image(dContext);
+    sk_sp<SkImage> backEndImage = create_gpu_image(grContext);
     canvas->drawImage(backEndImage, 0, 0);
     GrBackendTexture texture;
     SkImage::BackendTextureReleaseProc proc;
-    if (!SkImage::MakeBackendTextureFromSkImage(dContext, std::move(backEndImage),
+    if (!SkImage::MakeBackendTextureFromSkImage(grContext, std::move(backEndImage),
             &texture, &proc)) {
         return;
     }
-    sk_sp<SkImage> i2 = SkImage::MakeFromTexture(dContext, texture, kTopLeft_GrSurfaceOrigin,
+    sk_sp<SkImage> i2 = SkImage::MakeFromTexture(grContext, texture, kTopLeft_GrSurfaceOrigin,
             kN32_SkColorType, kOpaque_SkAlphaType, nullptr);
     canvas->drawImage(i2, 30, 30);
 }
diff --git a/docs/examples/Image_MakeFromTexture.cpp b/docs/examples/Image_MakeFromTexture.cpp
index 34f5583..ea7c1c1 100644
--- a/docs/examples/Image_MakeFromTexture.cpp
+++ b/docs/examples/Image_MakeFromTexture.cpp
@@ -4,14 +4,14 @@
 // HASH=94e9296c53bad074bf2a48ff885dac13
 REG_FIDDLE(Image_MakeFromTexture, 256, 128, false, 3) {
 void draw(SkCanvas* canvas) {
-    auto dContext = GrAsDirectContext(canvas->recordingContext());
-    if (!dContext) {
+    GrContext* context = canvas->getGrContext();
+    if (!context) {
        return;
     }
     canvas->scale(.25f, .25f);
     int x = 0;
     for (auto origin : { kBottomLeft_GrSurfaceOrigin, kTopLeft_GrSurfaceOrigin } ) {
-        sk_sp<SkImage> image = SkImage::MakeFromTexture(dContext, backEndTexture,
+        sk_sp<SkImage> image = SkImage::MakeFromTexture(context, backEndTexture,
                origin, kRGBA_8888_SkColorType, kOpaque_SkAlphaType, nullptr);
         canvas->drawImage(image, x, 0);
     x += 512;
diff --git a/docs/examples/Image_MakeFromTexture_2.cpp b/docs/examples/Image_MakeFromTexture_2.cpp
index 06ae193..46f684b 100644
--- a/docs/examples/Image_MakeFromTexture_2.cpp
+++ b/docs/examples/Image_MakeFromTexture_2.cpp
@@ -4,8 +4,8 @@
 // HASH=2b1e46354d823dbb53fa6af570135329
 REG_FIDDLE(Image_MakeFromTexture_2, 256, 256, false, 4) {
 void draw(SkCanvas* canvas) {
-    auto dContext = GrAsDirectContext(canvas->recordingContext());
-    if (!dContext) {
+    GrContext* context = canvas->getGrContext();
+    if (!context) {
        return;
     }
     auto debugster = [](SkImage::ReleaseContext releaseContext) -> void {
@@ -13,7 +13,7 @@
     };
     int x = 0, y = 0;
     for (auto origin : { kBottomLeft_GrSurfaceOrigin, kTopLeft_GrSurfaceOrigin } ) {
-        sk_sp<SkImage> image = SkImage::MakeFromTexture(dContext, backEndTexture,
+        sk_sp<SkImage> image = SkImage::MakeFromTexture(context, backEndTexture,
                origin, kRGBA_8888_SkColorType, kOpaque_SkAlphaType, nullptr, debugster, &x);
         canvas->drawImage(image, x, y);
         y += 128;
diff --git a/docs/examples/Image_isValid.cpp b/docs/examples/Image_isValid.cpp
index 1fde4c3..ae30b2a 100644
--- a/docs/examples/Image_isValid.cpp
+++ b/docs/examples/Image_isValid.cpp
@@ -4,10 +4,6 @@
 // HASH=afc62f38aebc56af8e425297ec67dd37
 REG_FIDDLE(Image_isValid, 256, 256, false, 5) {
 void draw(SkCanvas* canvas) {
-    auto dContext = GrAsDirectContext(canvas->recordingContext());
-    if (!dContext) {
-        return;
-    }
     auto drawImage = [=](sk_sp<SkImage> image, const char* label) -> void {
         if (nullptr == image) {
             return;
@@ -17,19 +13,20 @@
         paint.setAntiAlias(true);
         canvas->drawImage(image, 0, 0);
         canvas->drawString(label, image->width() / 2, image->height() / 4, font, paint);
-        if (dContext) {
-            const char* msg = image->isValid(dContext) ? "is valid on GPU"
-                                                       : "not valid on GPU";
+        if (canvas->recordingContext()) {
+            const char* msg = image->isValid(canvas->recordingContext()) ? "is valid on GPU"
+                                                                         : "not valid on GPU";
             canvas->drawString(msg, 20, image->height() * 5 / 8, font, paint);
         }
 
-        const char* msg = image->isValid(nullptr) ? "is valid on CPU"
-                                                  : "not valid on CPU";
+        // CONTEXT TODO: Once GrContext is gone, remove this cast
+        const char* msg = image->isValid((GrRecordingContext*) nullptr) ? "is valid on CPU"
+                                                                        : "not valid on CPU";
 
         canvas->drawString(msg, 20, image->height() * 7 / 8, font, paint);
     };
     sk_sp<SkImage> bitmapImage(SkImage::MakeFromBitmap(source));
-    sk_sp<SkImage> textureImage(SkImage::MakeFromTexture(dContext, backEndTexture,
+    sk_sp<SkImage> textureImage(SkImage::MakeFromTexture(canvas->getGrContext(), backEndTexture,
                                 kTopLeft_GrSurfaceOrigin, kRGBA_8888_SkColorType,
                                 kOpaque_SkAlphaType, nullptr));
     drawImage(image, "image");
diff --git a/gm/wacky_yuv_formats.cpp b/gm/wacky_yuv_formats.cpp
index 63fc3ee..4235019 100644
--- a/gm/wacky_yuv_formats.cpp
+++ b/gm/wacky_yuv_formats.cpp
@@ -1191,9 +1191,7 @@
                                                                   kTopLeft_GrSurfaceOrigin,
                                                                   ct,
                                                                   kPremul_SkAlphaType,
-                                                                  nullptr /* colorSpace */,
-                                                                  nullptr /* releaseProc */,
-                                                                  nullptr /* releaseContext */);
+                                                                  nullptr);
 
             GrBackendTexture tmp = dContext->createBackendTexture(shrunkPlaneSize.width(),
                                                                   shrunkPlaneSize.height(),
diff --git a/include/core/SkImage.h b/include/core/SkImage.h
index 7764998..635f6cf 100644
--- a/include/core/SkImage.h
+++ b/include/core/SkImage.h
@@ -278,6 +278,27 @@
     */
     typedef void (*TextureReleaseProc)(ReleaseContext releaseContext);
 
+    /** Creates SkImage from GPU texture associated with context. Caller is responsible for
+        managing the lifetime of GPU texture.
+
+        SkImage is returned if format of backendTexture is recognized and supported.
+        Recognized formats vary by GPU back-end.
+
+        @param context         GPU context
+        @param backendTexture  texture residing on GPU
+        @param colorSpace      range of colors; may be nullptr
+        @return                created SkImage, or nullptr
+    */
+    static sk_sp<SkImage> MakeFromTexture(GrContext* context,
+                                          const GrBackendTexture& backendTexture,
+                                          GrSurfaceOrigin origin,
+                                          SkColorType colorType,
+                                          SkAlphaType alphaType,
+                                          sk_sp<SkColorSpace> colorSpace) {
+        return MakeFromTexture(context, backendTexture, origin, colorType, alphaType, colorSpace,
+                               nullptr, nullptr);
+    }
+
     /** Creates SkImage from GPU texture associated with context. GPU texture must stay
         valid and unchanged until textureReleaseProc is called. textureReleaseProc is
         passed releaseContext when SkImage is deleted or no longer refers to texture.
@@ -285,9 +306,6 @@
         SkImage is returned if format of backendTexture is recognized and supported.
         Recognized formats vary by GPU back-end.
 
-        @note When using a DDL recording context, textureReleaseProc will be called on the
-        GPU thread after the DDL is played back on the direct context.
-
         @param context             GPU context
         @param backendTexture      texture residing on GPU
         @param colorSpace          This describes the color space of this image's contents, as
@@ -301,14 +319,14 @@
         @param releaseContext      state passed to textureReleaseProc
         @return                    created SkImage, or nullptr
     */
-    static sk_sp<SkImage> MakeFromTexture(GrRecordingContext* context,
+    static sk_sp<SkImage> MakeFromTexture(GrContext* context,
                                           const GrBackendTexture& backendTexture,
                                           GrSurfaceOrigin origin,
                                           SkColorType colorType,
                                           SkAlphaType alphaType,
                                           sk_sp<SkColorSpace> colorSpace,
-                                          TextureReleaseProc textureReleaseProc = nullptr,
-                                          ReleaseContext releaseContext = nullptr);
+                                          TextureReleaseProc textureReleaseProc,
+                                          ReleaseContext releaseContext);
 
     /** Creates an SkImage from a GPU backend texture. The backend texture must stay
         valid and unchanged until textureReleaseProc is called. The textureReleaseProc is
@@ -318,9 +336,6 @@
         An SkImage is returned if the format of backendTexture is recognized and supported.
         Recognized formats vary by GPU back-end.
 
-        @note When using a DDL recording context, textureReleaseProc will be called on the
-        GPU thread after the DDL is played back on the direct context.
-
         @param context             the GPU context
         @param backendTexture      a texture already allocated by the GPU
         @param alphaType           This characterizes the nature of the alpha values in the
@@ -337,7 +352,7 @@
         @param releaseContext      state passed to textureReleaseProc
         @return                    created SkImage, or nullptr
     */
-    static sk_sp<SkImage> MakeFromCompressedTexture(GrRecordingContext* context,
+    static sk_sp<SkImage> MakeFromCompressedTexture(GrContext* context,
                                                     const GrBackendTexture& backendTexture,
                                                     GrSurfaceOrigin origin,
                                                     SkAlphaType alphaType,
diff --git a/src/image/SkImage.cpp b/src/image/SkImage.cpp
index 9a1e05a..e89df7d 100644
--- a/src/image/SkImage.cpp
+++ b/src/image/SkImage.cpp
@@ -505,20 +505,20 @@
 
 #if !SK_SUPPORT_GPU
 
-sk_sp<SkImage> SkImage::MakeFromTexture(GrRecordingContext*,
-                                        const GrBackendTexture&, GrSurfaceOrigin,
-                                        SkColorType, SkAlphaType, sk_sp<SkColorSpace>,
-                                        TextureReleaseProc, ReleaseContext) {
+sk_sp<SkImage> SkImage::MakeFromTexture(GrContext* ctx,
+                                        const GrBackendTexture& tex, GrSurfaceOrigin origin,
+                                        SkColorType ct, SkAlphaType at, sk_sp<SkColorSpace> cs,
+                                        TextureReleaseProc releaseP, ReleaseContext releaseC) {
     return nullptr;
 }
 
-sk_sp<SkImage> SkImage::MakeFromCompressedTexture(GrRecordingContext*,
-                                                  const GrBackendTexture&,
-                                                  GrSurfaceOrigin,
-                                                  SkAlphaType,
-                                                  sk_sp<SkColorSpace>,
-                                                  TextureReleaseProc,
-                                                  ReleaseContext) {
+sk_sp<SkImage> SkImage::MakeFromCompressedTexture(GrContext* ctx,
+                                                  const GrBackendTexture& tex,
+                                                  GrSurfaceOrigin origin,
+                                                  SkAlphaType at,
+                                                  sk_sp<SkColorSpace> cs,
+                                                  TextureReleaseProc releaseP,
+                                                  ReleaseContext releaseC) {
     return nullptr;
 }
 
@@ -561,14 +561,16 @@
 }
 
 sk_sp<SkImage> SkImage::MakeFromYUVTexturesCopyWithExternalBackend(
-        GrContext*, SkYUVColorSpace, const GrBackendTexture[3], GrSurfaceOrigin,
-        const GrBackendTexture&, sk_sp<SkColorSpace>) {
+        GrContext* context, SkYUVColorSpace yuvColorSpace, const GrBackendTexture yuvTextures[3],
+        GrSurfaceOrigin surfaceOrigin, const GrBackendTexture& backendTexture,
+        sk_sp<SkColorSpace> colorSpace) {
     return nullptr;
 }
 
-sk_sp<SkImage> SkImage::MakeFromNV12TexturesCopy(GrContext*, SkYUVColorSpace,
-                                                 const GrBackendTexture[2],
-                                                 GrSurfaceOrigin, sk_sp<SkColorSpace>) {
+sk_sp<SkImage> SkImage::MakeFromNV12TexturesCopy(GrContext* ctx, SkYUVColorSpace space,
+                                                const GrBackendTexture[2],
+                                                GrSurfaceOrigin origin,
+                                                sk_sp<SkColorSpace> imageColorSpace) {
     return nullptr;
 }
 
@@ -578,8 +580,14 @@
 }
 
 sk_sp<SkImage> SkImage::MakeFromNV12TexturesCopyWithExternalBackend(
-       GrContext*, SkYUVColorSpace, const GrBackendTexture[2], GrSurfaceOrigin,
-       const GrBackendTexture&, sk_sp<SkColorSpace>, TextureReleaseProc, ReleaseContext) {
+                                                           GrContext* context,
+                                                           SkYUVColorSpace yuvColorSpace,
+                                                           const GrBackendTexture nv12Textures[2],
+                                                           GrSurfaceOrigin imageOrigin,
+                                                           const GrBackendTexture& backendTexture,
+                                                           sk_sp<SkColorSpace> imageColorSpace,
+                                                           TextureReleaseProc textureReleaseProc,
+                                                           ReleaseContext releaseContext) {
     return nullptr;
 }
 
diff --git a/src/image/SkImage_Gpu.cpp b/src/image/SkImage_Gpu.cpp
index 12f36b6..532ffa4 100644
--- a/src/image/SkImage_Gpu.cpp
+++ b/src/image/SkImage_Gpu.cpp
@@ -163,7 +163,7 @@
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-static sk_sp<SkImage> new_wrapped_texture_common(GrRecordingContext* rContext,
+static sk_sp<SkImage> new_wrapped_texture_common(GrContext* ctx,
                                                  const GrBackendTexture& backendTex,
                                                  GrColorType colorType, GrSurfaceOrigin origin,
                                                  SkAlphaType at, sk_sp<SkColorSpace> colorSpace,
@@ -173,21 +173,20 @@
         return nullptr;
     }
 
-    GrProxyProvider* proxyProvider = rContext->priv().proxyProvider();
+    GrProxyProvider* proxyProvider = ctx->priv().proxyProvider();
     sk_sp<GrTextureProxy> proxy = proxyProvider->wrapBackendTexture(
             backendTex, ownership, GrWrapCacheable::kNo, kRead_GrIOType, std::move(releaseHelper));
     if (!proxy) {
         return nullptr;
     }
 
-    GrSwizzle swizzle = rContext->priv().caps()->getReadSwizzle(proxy->backendFormat(), colorType);
+    GrSwizzle swizzle = ctx->priv().caps()->getReadSwizzle(proxy->backendFormat(), colorType);
     GrSurfaceProxyView view(std::move(proxy), origin, swizzle);
-    auto grContext = rContext->priv().backdoor();
-    return sk_make_sp<SkImage_Gpu>(sk_ref_sp(grContext), kNeedNewImageUniqueID, std::move(view),
+    return sk_make_sp<SkImage_Gpu>(sk_ref_sp(ctx), kNeedNewImageUniqueID, std::move(view),
                                    GrColorTypeToSkColorType(colorType), at, std::move(colorSpace));
 }
 
-sk_sp<SkImage> SkImage::MakeFromCompressedTexture(GrRecordingContext* rContext,
+sk_sp<SkImage> SkImage::MakeFromCompressedTexture(GrContext* ctx,
                                                   const GrBackendTexture& tex,
                                                   GrSurfaceOrigin origin,
                                                   SkAlphaType at,
@@ -199,17 +198,17 @@
         releaseHelper.reset(new GrRefCntedCallback(releaseP, releaseC));
     }
 
-    if (!rContext) {
+    if (!ctx) {
         return nullptr;
     }
 
-    const GrCaps* caps = rContext->priv().caps();
+    const GrCaps* caps = ctx->priv().caps();
 
     if (!SkImage_GpuBase::ValidateCompressedBackendTexture(caps, tex, at)) {
         return nullptr;
     }
 
-    GrProxyProvider* proxyProvider = rContext->priv().proxyProvider();
+    GrProxyProvider* proxyProvider = ctx->priv().proxyProvider();
     sk_sp<GrTextureProxy> proxy = proxyProvider->wrapCompressedBackendTexture(
             tex, kBorrow_GrWrapOwnership, GrWrapCacheable::kNo, std::move(releaseHelper));
     if (!proxy) {
@@ -220,12 +219,11 @@
     SkColorType ct = GrCompressionTypeToSkColorType(type);
 
     GrSurfaceProxyView view(std::move(proxy), origin, GrSwizzle::RGBA());
-    auto grContext = rContext->priv().backdoor();
-    return sk_make_sp<SkImage_Gpu>(sk_ref_sp(grContext), kNeedNewImageUniqueID,  std::move(view),
-                                   ct, at, std::move(cs));
+    return sk_make_sp<SkImage_Gpu>(sk_ref_sp(ctx), kNeedNewImageUniqueID,  std::move(view), ct, at,
+                                   std::move(cs));
 }
 
-sk_sp<SkImage> SkImage::MakeFromTexture(GrRecordingContext* rContext,
+sk_sp<SkImage> SkImage::MakeFromTexture(GrContext* ctx,
                                         const GrBackendTexture& tex, GrSurfaceOrigin origin,
                                         SkColorType ct, SkAlphaType at, sk_sp<SkColorSpace> cs,
                                         TextureReleaseProc releaseP, ReleaseContext releaseC) {
@@ -234,11 +232,11 @@
         releaseHelper.reset(new GrRefCntedCallback(releaseP, releaseC));
     }
 
-    if (!rContext) {
+    if (!ctx) {
         return nullptr;
     }
 
-    const GrCaps* caps = rContext->priv().caps();
+    const GrCaps* caps = ctx->priv().caps();
 
     GrColorType grColorType = SkColorTypeAndFormatToGrColorType(caps, ct, tex.getBackendFormat());
     if (GrColorType::kUnknown == grColorType) {
@@ -249,7 +247,7 @@
         return nullptr;
     }
 
-    return new_wrapped_texture_common(rContext, tex, grColorType, origin, at, std::move(cs),
+    return new_wrapped_texture_common(ctx, tex, grColorType, origin, at, std::move(cs),
                                       kBorrow_GrWrapOwnership, std::move(releaseHelper));
 }
 
diff --git a/tests/BackendSurfaceMutableStateTest.cpp b/tests/BackendSurfaceMutableStateTest.cpp
index 89b7a19..9576c20 100644
--- a/tests/BackendSurfaceMutableStateTest.cpp
+++ b/tests/BackendSurfaceMutableStateTest.cpp
@@ -20,10 +20,10 @@
 #include "src/gpu/vk/GrVkTexture.h"
 
 DEF_GPUTEST_FOR_VULKAN_CONTEXT(VkBackendSurfaceMutableStateTest, reporter, ctxInfo) {
-    auto dContext = ctxInfo.directContext();
+    auto context = ctxInfo.directContext();
 
     GrBackendFormat format = GrBackendFormat::MakeVk(VK_FORMAT_R8G8B8A8_UNORM);
-    GrBackendTexture backendTex = dContext->createBackendTexture(
+    GrBackendTexture backendTex = context->createBackendTexture(
             32, 32, format, GrMipmapped::kNo, GrRenderable::kNo, GrProtected::kNo);
 
     REPORTER_ASSERT(reporter, backendTex.isValid());
@@ -56,12 +56,12 @@
     // Setting back to the init state since we didn't actually change it
     backendTex.setMutableState(initState);
 
-    sk_sp<SkImage> wrappedImage = SkImage::MakeFromTexture(dContext, backendTex,
+    sk_sp<SkImage> wrappedImage = SkImage::MakeFromTexture(context, backendTex,
                                                            kTopLeft_GrSurfaceOrigin,
                                                            kRGBA_8888_SkColorType,
                                                            kPremul_SkAlphaType, nullptr);
 
-    const GrSurfaceProxyView* view = as_IB(wrappedImage)->view(dContext);
+    const GrSurfaceProxyView* view = as_IB(wrappedImage)->view(context);
     REPORTER_ASSERT(reporter, view);
     REPORTER_ASSERT(reporter, view->proxy()->isInstantiated());
     GrTexture* texture = view->proxy()->peekTexture();
@@ -105,9 +105,9 @@
 
     // Test using the setBackendTextureStateAPI. Unlike the previous test this will actually add
     // real transitions to the image so we need to be careful about doing actual valid transitions.
-    GrVkGpu* gpu = static_cast<GrVkGpu*>(dContext->priv().getGpu());
+    GrVkGpu* gpu = static_cast<GrVkGpu*>(context->priv().getGpu());
 
-    dContext->setBackendTextureState(backendTex, newState);
+    context->setBackendTextureState(backendTex, newState);
 
     REPORTER_ASSERT(reporter, backendTex.getVkImageInfo(&info));
     REPORTER_ASSERT(reporter, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL == info.fImageLayout);
@@ -119,16 +119,16 @@
         GrBackendSurfaceMutableState externalState(VK_IMAGE_LAYOUT_GENERAL,
                                                    VK_QUEUE_FAMILY_EXTERNAL);
 
-        dContext->setBackendTextureState(backendTex, externalState);
+        context->setBackendTextureState(backendTex, externalState);
 
         REPORTER_ASSERT(reporter, backendTex.getVkImageInfo(&info));
         REPORTER_ASSERT(reporter, VK_IMAGE_LAYOUT_GENERAL == info.fImageLayout);
         REPORTER_ASSERT(reporter, VK_QUEUE_FAMILY_EXTERNAL == info.fCurrentQueueFamily);
 
-        dContext->submit();
+        context->submit();
 
         GrBackendSurfaceMutableState externalState2(VK_IMAGE_LAYOUT_GENERAL, initQueue);
-        dContext->setBackendTextureState(backendTex, externalState2);
+        context->setBackendTextureState(backendTex, externalState2);
 
         REPORTER_ASSERT(reporter, backendTex.getVkImageInfo(&info));
         REPORTER_ASSERT(reporter, VK_IMAGE_LAYOUT_GENERAL == info.fImageLayout);
@@ -136,9 +136,9 @@
     }
 
     // We must submit this work before we try to delete the backend texture.
-    dContext->submit(true);
+    context->submit(true);
 
-    dContext->deleteBackendTexture(backendTex);
+    context->deleteBackendTexture(backendTex);
 }
 
 #endif
diff --git a/tests/CompressedBackendAllocationTest.cpp b/tests/CompressedBackendAllocationTest.cpp
index ee9d7c7..7e41871 100644
--- a/tests/CompressedBackendAllocationTest.cpp
+++ b/tests/CompressedBackendAllocationTest.cpp
@@ -36,14 +36,14 @@
 }
 
 // Create an SkImage to wrap 'backendTex'
-sk_sp<SkImage> create_image(GrDirectContext* dContext, const GrBackendTexture& backendTex) {
+sk_sp<SkImage> create_image(GrContext* context, const GrBackendTexture& backendTex) {
     SkImage::CompressionType compression =
             GrBackendFormatToCompressionType(backendTex.getBackendFormat());
 
     SkAlphaType at = SkCompressionTypeIsOpaque(compression) ? kOpaque_SkAlphaType
                                                             : kPremul_SkAlphaType;
 
-    return SkImage::MakeFromCompressedTexture(dContext,
+    return SkImage::MakeFromCompressedTexture(context,
                                               backendTex,
                                               kTopLeft_GrSurfaceOrigin,
                                               at,
diff --git a/tests/DeferredDisplayListTest.cpp b/tests/DeferredDisplayListTest.cpp
index eec118f..2375d51 100644
--- a/tests/DeferredDisplayListTest.cpp
+++ b/tests/DeferredDisplayListTest.cpp
@@ -877,52 +877,57 @@
 
 // This tests the ability to create and use wrapped textures in a DDL world
 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(DDLWrapBackendTest, reporter, ctxInfo) {
-    auto dContext = ctxInfo.directContext();
+    auto context = ctxInfo.directContext();
 
     GrBackendTexture backendTex;
-    CreateBackendTexture(dContext, &backendTex, kSize, kSize, kRGBA_8888_SkColorType,
+    CreateBackendTexture(context, &backendTex, kSize, kSize, kRGBA_8888_SkColorType,
             SkColors::kTransparent, GrMipmapped::kNo, GrRenderable::kNo, GrProtected::kNo);
     if (!backendTex.isValid()) {
         return;
     }
 
-    SurfaceParameters params(dContext);
+    SurfaceParameters params(context);
     GrBackendTexture backend;
 
-    sk_sp<SkSurface> s = params.make(dContext, &backend);
+    sk_sp<SkSurface> s = params.make(context, &backend);
     if (!s) {
-        dContext->deleteBackendTexture(backendTex);
+        context->deleteBackendTexture(backendTex);
         return;
     }
 
     SkSurfaceCharacterization c;
     SkAssertResult(s->characterize(&c));
 
-    SkDeferredDisplayListRecorder recorder(c);
+    std::unique_ptr<SkDeferredDisplayListRecorder> recorder(new SkDeferredDisplayListRecorder(c));
 
-    SkCanvas* canvas = recorder.getCanvas();
-    SkASSERT(canvas);
-
-    auto rContext = canvas->recordingContext();
-    if (!rContext) {
+    SkCanvas* canvas = recorder->getCanvas();
+    if (!canvas) {
         s = nullptr;
-        params.cleanUpBackEnd(dContext, backend);
-        dContext->deleteBackendTexture(backendTex);
+        params.cleanUpBackEnd(context, backend);
+        context->deleteBackendTexture(backendTex);
+        return;
+    }
+
+    GrContext* deferredContext = canvas->getGrContext();
+    if (!deferredContext) {
+        s = nullptr;
+        params.cleanUpBackEnd(context, backend);
+        context->deleteBackendTexture(backendTex);
         return;
     }
 
     // Wrapped Backend Textures are not supported in DDL
     TextureReleaseChecker releaseChecker;
     sk_sp<SkImage> image =
-            SkImage::MakeFromTexture(rContext, backendTex, kTopLeft_GrSurfaceOrigin,
+            SkImage::MakeFromTexture(deferredContext, backendTex, kTopLeft_GrSurfaceOrigin,
                                      kRGBA_8888_SkColorType, kPremul_SkAlphaType, nullptr,
                                      TextureReleaseChecker::Release, &releaseChecker);
     REPORTER_ASSERT(reporter, !image);
 
-    dContext->deleteBackendTexture(backendTex);
+    context->deleteBackendTexture(backendTex);
 
     s = nullptr;
-    params.cleanUpBackEnd(dContext, backend);
+    params.cleanUpBackEnd(context, backend);
 }
 
 static sk_sp<SkPromiseImageTexture> dummy_fulfill_proc(void*) {
diff --git a/tests/GLBackendSurfaceTest.cpp b/tests/GLBackendSurfaceTest.cpp
index 2c1026a..e748292 100644
--- a/tests/GLBackendSurfaceTest.cpp
+++ b/tests/GLBackendSurfaceTest.cpp
@@ -47,9 +47,9 @@
 }
 
 DEF_GPUTEST_FOR_ALL_GL_CONTEXTS(GLTextureParameters, reporter, ctxInfo) {
-    auto dContext = ctxInfo.directContext();
+    auto context = ctxInfo.directContext();
 
-    GrBackendTexture backendTex = dContext->createBackendTexture(
+    GrBackendTexture backendTex = context->createBackendTexture(
             1, 1, kRGBA_8888_SkColorType, GrMipmapped::kNo, GrRenderable::kNo, GrProtected::kNo);
     REPORTER_ASSERT(reporter, backendTex.isValid());
 
@@ -60,11 +60,11 @@
     REPORTER_ASSERT(reporter, backendTexCopy.isSameTexture(backendTex));
 
     sk_sp<SkImage> wrappedImage =
-            SkImage::MakeFromTexture(dContext, backendTex, kTopLeft_GrSurfaceOrigin,
+            SkImage::MakeFromTexture(context, backendTex, kTopLeft_GrSurfaceOrigin,
                                      kRGBA_8888_SkColorType, kPremul_SkAlphaType, nullptr);
     REPORTER_ASSERT(reporter, wrappedImage);
 
-    const GrSurfaceProxyView* view = as_IB(wrappedImage)->view(dContext);
+    const GrSurfaceProxyView* view = as_IB(wrappedImage)->view(context);
     REPORTER_ASSERT(reporter, view);
     REPORTER_ASSERT(reporter, view->proxy()->isInstantiated());
     auto texture = static_cast<GrGLTexture*>(view->proxy()->peekTexture());
@@ -80,13 +80,13 @@
     REPORTER_ASSERT(reporter, params_invalid(*parameters));
 
     auto surf = SkSurface::MakeRenderTarget(
-            dContext, SkBudgeted::kYes,
+            context, SkBudgeted::kYes,
             SkImageInfo::Make(1, 1, kRGBA_8888_SkColorType, kPremul_SkAlphaType), 1, nullptr);
     REPORTER_ASSERT(reporter, surf);
     surf->getCanvas()->drawImage(wrappedImage, 0, 0);
     surf->flushAndSubmit();
 
-    auto caps = static_cast<const GrGLCaps*>(dContext->priv().caps());
+    auto caps = static_cast<const GrGLCaps*>(context->priv().caps());
     // Now the texture should be in a known state.
     REPORTER_ASSERT(reporter, params_valid(*parameters, caps));
 
@@ -127,8 +127,8 @@
     REPORTER_ASSERT(reporter, GrBackendTexture::TestingOnly_Equals(invalidTexture, invalidTexture));
 
     wrappedImage.reset();
-    dContext->flush();
-    dContext->submit(true);
-    dContext->deleteBackendTexture(backendTex);
+    context->flush();
+    context->submit(true);
+    context->deleteBackendTexture(backendTex);
 }
 #endif
diff --git a/tests/GrDDLImageTest.cpp b/tests/GrDDLImageTest.cpp
index 9a9cce5..55da002 100644
--- a/tests/GrDDLImageTest.cpp
+++ b/tests/GrDDLImageTest.cpp
@@ -14,8 +14,8 @@
     sk_gpu_test::GrContextFactory factory(options);
     for (int ct = 0; ct < sk_gpu_test::GrContextFactory::kContextTypeCnt; ++ct) {
         auto contextType = static_cast<sk_gpu_test::GrContextFactory::ContextType>(ct);
-        auto dContext = factory.get(contextType);
-        if (!dContext) {
+        auto direct = factory.get(contextType);
+        if (!direct) {
             continue;
         }
         SkIRect subsetBounds = SkIRect::MakeLTRB(4,4,8,8);
@@ -31,32 +31,32 @@
         REPORTER_ASSERT(reporter, rasterImg->isValid(static_cast<GrRecordingContext*>(nullptr)));
 
         // raster + context:
-        auto subImg1 = rasterImg->makeSubset(subsetBounds, dContext);
-        REPORTER_ASSERT(reporter, subImg1->isValid(dContext));
+        auto subImg1 = rasterImg->makeSubset(subsetBounds, direct);
+        REPORTER_ASSERT(reporter, subImg1->isValid(direct));
 
         // raster + no context:
         auto subImg2 = rasterImg->makeSubset(subsetBounds, nullptr);
         REPORTER_ASSERT(reporter, subImg2->isValid(static_cast<GrRecordingContext*>(nullptr)));
 
         // Texture image:
-        auto surf = SkSurface::MakeRenderTarget(dContext, SkBudgeted::kNo, ii);
+        auto surf = SkSurface::MakeRenderTarget(direct, SkBudgeted::kNo, ii);
         SkSurfaceCharacterization sc;
         REPORTER_ASSERT(reporter, surf->characterize(&sc));
-        GrBackendTexture tex = dContext->createBackendTexture(sc);
-        auto gpuImage = SkImage::MakeFromTexture(dContext, tex, kTopLeft_GrSurfaceOrigin,
+        GrBackendTexture tex = direct->createBackendTexture(sc);
+        auto gpuImage = SkImage::MakeFromTexture(direct, tex, kTopLeft_GrSurfaceOrigin,
                                                  ii.colorType(), ii.alphaType(),
                                                  ii.refColorSpace());
-        REPORTER_ASSERT(reporter, gpuImage->isValid(dContext));
+        REPORTER_ASSERT(reporter, gpuImage->isValid(direct));
 
         // gpu image + context:
-        auto subImg5 = gpuImage->makeSubset(subsetBounds, dContext);
-        REPORTER_ASSERT(reporter, subImg5->isValid(dContext));
+        auto subImg5 = gpuImage->makeSubset(subsetBounds, direct);
+        REPORTER_ASSERT(reporter, subImg5->isValid(direct));
 
         // gpu image + nullptr:
         REPORTER_ASSERT(reporter, !gpuImage->makeSubset(subsetBounds, nullptr));
 
-        dContext->flush();
-        dContext->submit(true);
-        dContext->deleteBackendTexture(tex);
+        direct->flush();
+        direct->submit(true);
+        direct->deleteBackendTexture(tex);
     }
 }
diff --git a/tests/GrMipMappedTest.cpp b/tests/GrMipMappedTest.cpp
index 3902fdc..76be91f 100644
--- a/tests/GrMipMappedTest.cpp
+++ b/tests/GrMipMappedTest.cpp
@@ -34,8 +34,8 @@
 // Test that the correct mip map states are on the GrTextures when wrapping GrBackendTextures in
 // SkImages and SkSurfaces
 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrWrappedMipMappedTest, reporter, ctxInfo) {
-    auto dContext = ctxInfo.directContext();
-    if (!dContext->priv().caps()->mipmapSupport()) {
+    auto context = ctxInfo.directContext();
+    if (!context->priv().caps()->mipmapSupport()) {
         return;
     }
 
@@ -45,14 +45,14 @@
             // so we don't send any. However, we pretend there is data for the checks below which is
             // fine since we are never actually using these textures for any work on the gpu.
             GrBackendTexture backendTex;
-            CreateBackendTexture(dContext, &backendTex, kSize, kSize, kRGBA_8888_SkColorType,
+            CreateBackendTexture(context, &backendTex, kSize, kSize, kRGBA_8888_SkColorType,
                                  SkColors::kTransparent, mipMapped, renderable);
 
             sk_sp<GrTextureProxy> proxy;
             sk_sp<SkImage> image;
             if (GrRenderable::kYes == renderable) {
                 sk_sp<SkSurface> surface = SkSurface::MakeFromBackendTexture(
-                                                                           dContext,
+                                                                           context,
                                                                            backendTex,
                                                                            kTopLeft_GrSurfaceOrigin,
                                                                            0,
@@ -63,22 +63,22 @@
                 SkGpuDevice* device = ((SkSurface_Gpu*)surface.get())->getDevice();
                 proxy = device->accessRenderTargetContext()->asTextureProxyRef();
             } else {
-                image = SkImage::MakeFromTexture(dContext, backendTex,
+                image = SkImage::MakeFromTexture(context, backendTex,
                                                  kTopLeft_GrSurfaceOrigin,
                                                  kRGBA_8888_SkColorType,
                                                  kPremul_SkAlphaType, nullptr,
                                                  nullptr, nullptr);
-                const GrSurfaceProxyView* view = as_IB(image)->view(dContext);
+                const GrSurfaceProxyView* view = as_IB(image)->view(context);
                 REPORTER_ASSERT(reporter, view);
                 if (!view) {
-                    dContext->deleteBackendTexture(backendTex);
+                    context->deleteBackendTexture(backendTex);
                     return;
                 }
                 proxy = view->asTextureProxyRef();
             }
             REPORTER_ASSERT(reporter, proxy);
             if (!proxy) {
-                dContext->deleteBackendTexture(backendTex);
+                context->deleteBackendTexture(backendTex);
                 return;
             }
 
@@ -87,7 +87,7 @@
             GrTexture* texture = proxy->peekTexture();
             REPORTER_ASSERT(reporter, texture);
             if (!texture) {
-                dContext->deleteBackendTexture(backendTex);
+                context->deleteBackendTexture(backendTex);
                 return;
             }
 
@@ -101,7 +101,7 @@
             } else {
                 REPORTER_ASSERT(reporter, GrMipmapped::kNo == texture->mipmapped());
             }
-            dContext->deleteBackendTexture(backendTex);
+            context->deleteBackendTexture(backendTex);
         }
     }
 }
@@ -109,18 +109,18 @@
 // Test that we correctly copy or don't copy GrBackendTextures in the GrBackendTextureImageGenerator
 // based on if we will use mips in the draw and the mip status of the GrBackendTexture.
 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrBackendTextureImageMipMappedTest, reporter, ctxInfo) {
-    auto dContext = ctxInfo.directContext();
-    if (!dContext->priv().caps()->mipmapSupport()) {
+    auto context = ctxInfo.directContext();
+    if (!context->priv().caps()->mipmapSupport()) {
         return;
     }
 
     for (auto betMipMapped : {GrMipmapped::kNo, GrMipmapped::kYes}) {
         for (auto requestMipMapped : {GrMipmapped::kNo, GrMipmapped::kYes}) {
             GrBackendTexture backendTex;
-            CreateBackendTexture(dContext, &backendTex, kSize, kSize, kRGBA_8888_SkColorType,
+            CreateBackendTexture(context, &backendTex, kSize, kSize, kRGBA_8888_SkColorType,
                                  SkColors::kTransparent, betMipMapped, GrRenderable::kNo);
 
-            sk_sp<SkImage> image = SkImage::MakeFromTexture(dContext, backendTex,
+            sk_sp<SkImage> image = SkImage::MakeFromTexture(context, backendTex,
                                                             kTopLeft_GrSurfaceOrigin,
                                                             kRGBA_8888_SkColorType,
                                                             kPremul_SkAlphaType, nullptr,
@@ -129,7 +129,7 @@
             GrTextureProxy* proxy = as_IB(image)->peekProxy();
             REPORTER_ASSERT(reporter, proxy);
             if (!proxy) {
-                dContext->deleteBackendTexture(backendTex);
+                context->deleteBackendTexture(backendTex);
                 return;
             }
 
@@ -138,7 +138,7 @@
             sk_sp<GrTexture> texture = sk_ref_sp(proxy->peekTexture());
             REPORTER_ASSERT(reporter, texture);
             if (!texture) {
-                dContext->deleteBackendTexture(backendTex);
+                context->deleteBackendTexture(backendTex);
                 return;
             }
 
@@ -147,7 +147,7 @@
                     kPremul_SkAlphaType, nullptr);
             REPORTER_ASSERT(reporter, imageGen);
             if (!imageGen) {
-                dContext->deleteBackendTexture(backendTex);
+                context->deleteBackendTexture(backendTex);
                 return;
             }
 
@@ -155,31 +155,31 @@
             SkImageInfo imageInfo = SkImageInfo::Make(kSize, kSize, kRGBA_8888_SkColorType,
                                                       kPremul_SkAlphaType);
             GrSurfaceProxyView genView = imageGen->generateTexture(
-                    dContext, imageInfo, origin, requestMipMapped, GrImageTexGenPolicy::kDraw);
+                    context, imageInfo, origin, requestMipMapped, GrImageTexGenPolicy::kDraw);
             GrSurfaceProxy* genProxy = genView.proxy();
 
             REPORTER_ASSERT(reporter, genProxy);
             if (!genProxy) {
-                dContext->deleteBackendTexture(backendTex);
+                context->deleteBackendTexture(backendTex);
                 return;
             }
 
             if (genProxy->isLazy()) {
-                genProxy->priv().doLazyInstantiation(dContext->priv().resourceProvider());
+                genProxy->priv().doLazyInstantiation(context->priv().resourceProvider());
             } else if (!genProxy->isInstantiated()) {
-                genProxy->instantiate(dContext->priv().resourceProvider());
+                genProxy->instantiate(context->priv().resourceProvider());
             }
 
             REPORTER_ASSERT(reporter, genProxy->isInstantiated());
             if (!genProxy->isInstantiated()) {
-                dContext->deleteBackendTexture(backendTex);
+                context->deleteBackendTexture(backendTex);
                 return;
             }
 
             GrTexture* genTexture = genProxy->peekTexture();
             REPORTER_ASSERT(reporter, genTexture);
             if (!genTexture) {
-                dContext->deleteBackendTexture(backendTex);
+                context->deleteBackendTexture(backendTex);
                 return;
             }
 
@@ -237,11 +237,11 @@
 
             // Must make sure the uses of the backend texture have finished (we possibly have a
             // queued up copy) before we delete the backend texture.
-            dContext->flushAndSubmit();
+            context->flushAndSubmit();
 
-            dContext->priv().getGpu()->testingOnly_flushGpuAndSync();
+            context->priv().getGpu()->testingOnly_flushGpuAndSync();
 
-            dContext->deleteBackendTexture(backendTex);
+            context->deleteBackendTexture(backendTex);
         }
     }
 }
@@ -249,22 +249,22 @@
 // Test that when we call makeImageSnapshot on an SkSurface we retains the same mip status as the
 // resource we took the snapshot of.
 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrImageSnapshotMipMappedTest, reporter, ctxInfo) {
-    auto dContext = ctxInfo.directContext();
-    if (!dContext->priv().caps()->mipmapSupport()) {
+    auto context = ctxInfo.directContext();
+    if (!context->priv().caps()->mipmapSupport()) {
         return;
     }
 
-    auto resourceProvider = dContext->priv().resourceProvider();
+    auto resourceProvider = context->priv().resourceProvider();
 
     for (auto willUseMips : {false, true}) {
         for (auto isWrapped : {false, true}) {
             GrMipmapped mipMapped = willUseMips ? GrMipmapped::kYes : GrMipmapped::kNo;
             sk_sp<SkSurface> surface;
             GrBackendTexture backendTex;
-            CreateBackendTexture(dContext, &backendTex, kSize, kSize, kRGBA_8888_SkColorType,
+            CreateBackendTexture(context, &backendTex, kSize, kSize, kRGBA_8888_SkColorType,
                                  SkColors::kTransparent, mipMapped, GrRenderable::kYes);
             if (isWrapped) {
-                surface = SkSurface::MakeFromBackendTexture(dContext,
+                surface = SkSurface::MakeFromBackendTexture(context,
                                                             backendTex,
                                                             kTopLeft_GrSurfaceOrigin,
                                                             0,
@@ -274,13 +274,13 @@
             } else {
                 SkImageInfo info = SkImageInfo::Make(kSize, kSize, kRGBA_8888_SkColorType,
                                                      kPremul_SkAlphaType);
-                surface = SkSurface::MakeRenderTarget(dContext, SkBudgeted::kYes, info, 0,
+                surface = SkSurface::MakeRenderTarget(context, SkBudgeted::kYes, info, 0,
                                                       kTopLeft_GrSurfaceOrigin, nullptr,
                                                       willUseMips);
             }
             REPORTER_ASSERT(reporter, surface);
             if (!surface) {
-                dContext->deleteBackendTexture(backendTex);
+                context->deleteBackendTexture(backendTex);
             }
             SkGpuDevice* device = ((SkSurface_Gpu*)surface.get())->getDevice();
             GrTextureProxy* texProxy = device->accessRenderTargetContext()->asTextureProxy();
@@ -293,7 +293,7 @@
             sk_sp<SkImage> image = surface->makeImageSnapshot();
             REPORTER_ASSERT(reporter, image);
             if (!image) {
-                dContext->deleteBackendTexture(backendTex);
+                context->deleteBackendTexture(backendTex);
             }
             texProxy = as_IB(image)->peekProxy();
             REPORTER_ASSERT(reporter, mipMapped == texProxy->mipmapped());
@@ -302,11 +302,11 @@
             texture = texProxy->peekTexture();
             REPORTER_ASSERT(reporter, mipMapped == texture->mipmapped());
 
-            // Must flush the dContext to make sure all the cmds (copies, etc.) from above are sent
+            // Must flush the context to make sure all the cmds (copies, etc.) from above are sent
             // to the gpu before we delete the backendHandle.
-            dContext->flushAndSubmit();
-            dContext->priv().getGpu()->testingOnly_flushGpuAndSync();
-            dContext->deleteBackendTexture(backendTex);
+            context->flushAndSubmit();
+            context->priv().getGpu()->testingOnly_flushGpuAndSync();
+            context->deleteBackendTexture(backendTex);
         }
     }
 }
@@ -314,14 +314,14 @@
 // Test that we don't create a mip mapped texture if the size is 1x1 even if the filter mode is set
 // to use mips. This test passes by not crashing or hitting asserts in code.
 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(Gr1x1TextureMipMappedTest, reporter, ctxInfo) {
-    auto dContext = ctxInfo.directContext();
-    if (!dContext->priv().caps()->mipmapSupport()) {
+    auto context = ctxInfo.directContext();
+    if (!context->priv().caps()->mipmapSupport()) {
         return;
     }
 
     // Make surface to draw into
     SkImageInfo info = SkImageInfo::MakeN32(16, 16, kPremul_SkAlphaType);
-    sk_sp<SkSurface> surface = SkSurface::MakeRenderTarget(dContext, SkBudgeted::kNo, info);
+    sk_sp<SkSurface> surface = SkSurface::MakeRenderTarget(context, SkBudgeted::kNo, info);
 
     // Make 1x1 raster bitmap
     SkBitmap bmp;
@@ -349,12 +349,12 @@
 
 // Create a new render target and draw 'mipmapView' into it using the provided 'filter'.
 static std::unique_ptr<GrRenderTargetContext> draw_mipmap_into_new_render_target(
-        GrRecordingContext* rContext,
+        GrRecordingContext* context,
+        GrProxyProvider* proxyProvider,
         GrColorType colorType,
         SkAlphaType alphaType,
         GrSurfaceProxyView mipmapView,
         GrSamplerState::MipmapMode mm) {
-    auto proxyProvider = rContext->priv().proxyProvider();
     sk_sp<GrSurfaceProxy> renderTarget =
             proxyProvider->createProxy(mipmapView.proxy()->backendFormat(),
                                        {1, 1},
@@ -365,7 +365,7 @@
                                        SkBudgeted::kYes,
                                        GrProtected::kNo);
 
-    auto rtc = GrRenderTargetContext::Make(rContext,
+    auto rtc = GrRenderTargetContext::Make(context,
                                            colorType,
                                            nullptr,
                                            std::move(renderTarget),
@@ -399,22 +399,22 @@
         mockOptions.fMipmapSupport = true;
         GrContextOptions ctxOptions;
         ctxOptions.fReduceOpsTaskSplitting = enableSortingAndReduction;
-        sk_sp<GrDirectContext> dContext = GrDirectContext::MakeMock(&mockOptions, ctxOptions);
-        GrDrawingManager* drawingManager = dContext->priv().drawingManager();
-        if (!dContext) {
-            ERRORF(reporter, "could not create mock dContext with fReduceOpsTaskSplitting %s.",
+        sk_sp<GrDirectContext> context = GrDirectContext::MakeMock(&mockOptions, ctxOptions);
+        GrDrawingManager* drawingManager = context->priv().drawingManager();
+        if (!context) {
+            ERRORF(reporter, "could not create mock context with fReduceOpsTaskSplitting %s.",
                    (Enable::kYes == enableSortingAndReduction) ? "enabled" : "disabled");
             continue;
         }
 
-        SkASSERT(dContext->priv().caps()->mipmapSupport());
+        SkASSERT(context->priv().caps()->mipmapSupport());
 
-        GrBackendFormat format = dContext->defaultBackendFormat(
+        GrBackendFormat format = context->defaultBackendFormat(
                 kRGBA_8888_SkColorType, GrRenderable::kYes);
         GrColorType colorType = GrColorType::kRGBA_8888;
         SkAlphaType alphaType = kPremul_SkAlphaType;
 
-        GrProxyProvider* proxyProvider = dContext->priv().proxyProvider();
+        GrProxyProvider* proxyProvider = context->priv().proxyProvider();
 
         // Create a mipmapped render target.
 
@@ -427,7 +427,7 @@
         mipmapProxy->markMipmapsClean();
 
         auto mipmapRTC = GrRenderTargetContext::Make(
-            dContext.get(), colorType, nullptr, mipmapProxy, kTopLeft_GrSurfaceOrigin, nullptr);
+            context.get(), colorType, nullptr, mipmapProxy, kTopLeft_GrSurfaceOrigin, nullptr);
 
         mipmapRTC->clear({.1f,.2f,.3f,.4f});
         REPORTER_ASSERT(reporter, drawingManager->getLastRenderTask(mipmapProxy.get()));
@@ -439,12 +439,12 @@
         // Mipmaps don't get marked dirty until makeClosed().
         REPORTER_ASSERT(reporter, !mipmapProxy->mipmapsAreDirty());
 
-        GrSwizzle swizzle = dContext->priv().caps()->getReadSwizzle(format, colorType);
+        GrSwizzle swizzle = context->priv().caps()->getReadSwizzle(format, colorType);
         GrSurfaceProxyView mipmapView(mipmapProxy, kTopLeft_GrSurfaceOrigin, swizzle);
 
         // Draw the dirty mipmap texture into a render target.
-        auto rtc1 = draw_mipmap_into_new_render_target(dContext.get(), colorType, alphaType,
-                                                       mipmapView, MipmapMode::kLinear);
+        auto rtc1 = draw_mipmap_into_new_render_target(context.get(), proxyProvider, colorType,
+                                                       alphaType, mipmapView, MipmapMode::kLinear);
         auto rtc1Task = sk_ref_sp(rtc1->testingOnly_PeekLastOpsTask());
 
         // Mipmaps should have gotten marked dirty during makeClosed, then marked clean again as
@@ -458,8 +458,8 @@
         REPORTER_ASSERT(reporter, !mipmapProxy->mipmapsAreDirty());
 
         // Draw the now-clean mipmap texture into a second target.
-        auto rtc2 = draw_mipmap_into_new_render_target(dContext.get(), colorType, alphaType,
-                                                       mipmapView, MipmapMode::kLinear);
+        auto rtc2 = draw_mipmap_into_new_render_target(context.get(), proxyProvider, colorType,
+                                                       alphaType, mipmapView, MipmapMode::kLinear);
         auto rtc2Task = sk_ref_sp(rtc2->testingOnly_PeekLastOpsTask());
 
         // Make sure the mipmap texture still has the same regen task.
@@ -468,7 +468,7 @@
         SkASSERT(!mipmapProxy->mipmapsAreDirty());
 
         // Reset everything so we can go again, this time with the first draw not mipmapped.
-        dContext->flushAndSubmit();
+        context->flushAndSubmit();
 
         // Mip regen tasks don't get added as dependencies until makeClosed().
         REPORTER_ASSERT(reporter, rtc1Task->dependsOn(initialMipmapRegenTask));
@@ -487,8 +487,8 @@
         REPORTER_ASSERT(reporter, !mipmapProxy->mipmapsAreDirty());
 
         // Draw the dirty mipmap texture into a render target, but don't do mipmap filtering.
-        rtc1 = draw_mipmap_into_new_render_target(dContext.get(), colorType, alphaType,
-                                                  mipmapView, MipmapMode::kNone);
+        rtc1 = draw_mipmap_into_new_render_target(context.get(), proxyProvider, colorType,
+                                                  alphaType, mipmapView, MipmapMode::kNone);
 
         // Mipmaps should have gotten marked dirty during makeClosed() when adding the dependency.
         // Since the last draw did not use mips, they will not have been regenerated and should
@@ -500,8 +500,9 @@
                     mipmapRTCTask.get() == drawingManager->getLastRenderTask(mipmapProxy.get()));
 
         // Draw the stil-dirty mipmap texture into a second target with mipmap filtering.
-        rtc2 = draw_mipmap_into_new_render_target(dContext.get(), colorType, alphaType,
-                                                  std::move(mipmapView), MipmapMode::kLinear);
+        rtc2 = draw_mipmap_into_new_render_target(context.get(), proxyProvider, colorType,
+                                                  alphaType, std::move(mipmapView),
+                                                  MipmapMode::kLinear);
         rtc2Task = sk_ref_sp(rtc2->testingOnly_PeekLastOpsTask());
 
         // Make sure the mipmap texture now has a new last render task that regenerates the mips,
@@ -512,7 +513,7 @@
         SkASSERT(!mipmapProxy->mipmapsAreDirty());
 
         // Mip regen tasks don't get added as dependencies until makeClosed().
-        dContext->flushAndSubmit();
+        context->flushAndSubmit();
         REPORTER_ASSERT(reporter, rtc2Task->dependsOn(mipRegenTask2));
     }
 }
diff --git a/tests/GrTextureMipMapInvalidationTest.cpp b/tests/GrTextureMipMapInvalidationTest.cpp
index f041e84..3aea5bf 100644
--- a/tests/GrTextureMipMapInvalidationTest.cpp
+++ b/tests/GrTextureMipMapInvalidationTest.cpp
@@ -65,13 +65,13 @@
 }
 
 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ReimportImageTextureWithMipLevels, reporter, ctxInfo) {
-    auto dContext = ctxInfo.directContext();
-    if (!dContext->priv().caps()->mipmapSupport()) {
+    auto ctx = ctxInfo.directContext();
+    if (!ctx->priv().caps()->mipmapSupport()) {
         return;
     }
     static constexpr auto kCreateWithMipMaps = true;
     auto surf = SkSurface::MakeRenderTarget(
-            dContext, SkBudgeted::kYes,
+            ctx, SkBudgeted::kYes,
             SkImageInfo::Make(100, 100, kRGBA_8888_SkColorType, kPremul_SkAlphaType), 1,
             kTopLeft_GrSurfaceOrigin, nullptr, kCreateWithMipMaps);
     if (!surf) {
@@ -85,7 +85,7 @@
     surf.reset();
     GrBackendTexture btex;
     SkImage::BackendTextureReleaseProc texRelease;
-    if (!SkImage::MakeBackendTextureFromSkImage(dContext, std::move(img), &btex, &texRelease)) {
+    if (!SkImage::MakeBackendTextureFromSkImage(ctx, std::move(img), &btex, &texRelease)) {
         // Not all backends support stealing textures yet.
         // ERRORF(reporter, "Could not turn image into texture");
         return;
@@ -93,11 +93,11 @@
     REPORTER_ASSERT(reporter, btex.hasMipmaps());
     // Reimport the texture as an image and perform a downsampling draw with medium quality which
     // should use the upper MIP levels.
-    img = SkImage::MakeFromTexture(dContext, btex, kTopLeft_GrSurfaceOrigin, kRGBA_8888_SkColorType,
+    img = SkImage::MakeFromTexture(ctx, btex, kTopLeft_GrSurfaceOrigin, kRGBA_8888_SkColorType,
                                    kPremul_SkAlphaType, nullptr);
     const auto singlePixelInfo =
             SkImageInfo::Make(1, 1, kRGBA_8888_SkColorType, kPremul_SkAlphaType, nullptr);
-    surf = SkSurface::MakeRenderTarget(dContext, SkBudgeted::kYes, singlePixelInfo, 1,
+    surf = SkSurface::MakeRenderTarget(ctx, SkBudgeted::kYes, singlePixelInfo, 1,
                                        kTopLeft_GrSurfaceOrigin, nullptr);
     SkPaint paint;
     paint.setFilterQuality(kMedium_SkFilterQuality);
diff --git a/tests/ImageFilterCacheTest.cpp b/tests/ImageFilterCacheTest.cpp
index 3af8b76..c57cf85 100644
--- a/tests/ImageFilterCacheTest.cpp
+++ b/tests/ImageFilterCacheTest.cpp
@@ -207,9 +207,9 @@
 #include "src/gpu/GrTexture.h"
 #include "src/gpu/GrTextureProxy.h"
 
-static GrSurfaceProxyView create_proxy_view(GrRecordingContext* rContext) {
+static GrSurfaceProxyView create_proxy_view(GrRecordingContext* context) {
     SkBitmap srcBM = create_bm();
-    GrBitmapTextureMaker maker(rContext, srcBM, GrImageTexGenPolicy::kNew_Uncached_Budgeted);
+    GrBitmapTextureMaker maker(context, srcBM, GrImageTexGenPolicy::kNew_Uncached_Budgeted);
     return maker.view(GrMipmapped::kNo);
 }
 
@@ -255,9 +255,9 @@
 }
 
 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ImageFilterCache_GPUBacked, reporter, ctxInfo) {
-    auto dContext = ctxInfo.directContext();
+    auto context = ctxInfo.directContext();
 
-    GrSurfaceProxyView srcView = create_proxy_view(dContext);
+    GrSurfaceProxyView srcView = create_proxy_view(context);
     if (!srcView.proxy()) {
         return;
     }
@@ -265,7 +265,7 @@
     const SkIRect& full = SkIRect::MakeWH(kFullSize, kFullSize);
 
     sk_sp<SkSpecialImage> fullImg(SkSpecialImage::MakeDeferredFromGpu(
-                                                              dContext, full,
+                                                              context, full,
                                                               kNeedNewImageUniqueID_SpecialImage,
                                                               srcView,
                                                               GrColorType::kRGBA_8888, nullptr));
@@ -273,7 +273,7 @@
     const SkIRect& subset = SkIRect::MakeXYWH(kPad, kPad, kSmallerSize, kSmallerSize);
 
     sk_sp<SkSpecialImage> subsetImg(SkSpecialImage::MakeDeferredFromGpu(
-                                                                dContext, subset,
+                                                                context, subset,
                                                                 kNeedNewImageUniqueID_SpecialImage,
                                                                 std::move(srcView),
                                                                 GrColorType::kRGBA_8888, nullptr));
diff --git a/tests/ImageTest.cpp b/tests/ImageTest.cpp
index 9729cc7..1340d64 100644
--- a/tests/ImageTest.cpp
+++ b/tests/ImageTest.cpp
@@ -476,27 +476,27 @@
 }
 
 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrContext_colorTypeSupportedAsImage, reporter, ctxInfo) {
-    auto dContext = ctxInfo.directContext();
+    auto context = ctxInfo.directContext();
 
     static constexpr int kSize = 10;
 
     for (int ct = 0; ct < kLastEnum_SkColorType; ++ct) {
         SkColorType colorType = static_cast<SkColorType>(ct);
-        bool can = dContext->colorTypeSupportedAsImage(colorType);
+        bool can = context->colorTypeSupportedAsImage(colorType);
 
         GrBackendTexture backendTex;
-        CreateBackendTexture(dContext, &backendTex, kSize, kSize, colorType, SkColors::kTransparent,
+        CreateBackendTexture(context, &backendTex, kSize, kSize, colorType, SkColors::kTransparent,
                              GrMipmapped::kNo, GrRenderable::kNo, GrProtected::kNo);
 
-        auto img = SkImage::MakeFromTexture(dContext, backendTex, kTopLeft_GrSurfaceOrigin,
+        auto img = SkImage::MakeFromTexture(context, backendTex, kTopLeft_GrSurfaceOrigin,
                                             colorType, kOpaque_SkAlphaType, nullptr);
         REPORTER_ASSERT(reporter, can == SkToBool(img),
                         "colorTypeSupportedAsImage:%d, actual:%d, ct:%d", can, SkToBool(img),
                         colorType);
 
         img.reset();
-        dContext->flushAndSubmit();
-        dContext->deleteBackendTexture(backendTex);
+        context->flushAndSubmit();
+        context->deleteBackendTexture(backendTex);
     }
 }
 
@@ -818,12 +818,12 @@
     const int kWidth = 10;
     const int kHeight = 10;
 
-    auto dContext = ctxInfo.directContext();
+    auto ctx = ctxInfo.directContext();
 
     SkImageInfo ii = SkImageInfo::Make(kWidth, kHeight, SkColorType::kRGBA_8888_SkColorType,
                                        kPremul_SkAlphaType);
     GrBackendTexture backendTex;
-    if (!CreateBackendTexture(dContext, &backendTex, ii, SkColors::kRed, GrMipmapped::kNo,
+    if (!CreateBackendTexture(ctx, &backendTex, ii, SkColors::kRed, GrMipmapped::kNo,
                               GrRenderable::kNo)) {
         ERRORF(reporter, "couldn't create backend texture\n");
     }
@@ -831,7 +831,7 @@
     TextureReleaseChecker releaseChecker;
     GrSurfaceOrigin texOrigin = kBottomLeft_GrSurfaceOrigin;
     sk_sp<SkImage> refImg(
-        SkImage::MakeFromTexture(dContext, backendTex, texOrigin, kRGBA_8888_SkColorType,
+        SkImage::MakeFromTexture(ctx, backendTex, texOrigin, kRGBA_8888_SkColorType,
                                  kPremul_SkAlphaType, nullptr,
                                  TextureReleaseChecker::Release, &releaseChecker));
 
@@ -851,7 +851,7 @@
     refImg.reset(nullptr); // force a release of the image
     REPORTER_ASSERT(reporter, 1 == releaseChecker.fReleaseCount);
 
-    DeleteBackendTexture(dContext, backendTex);
+    DeleteBackendTexture(ctx, backendTex);
 }
 
 static void test_cross_context_image(skiatest::Reporter* reporter, const GrContextOptions& options,
diff --git a/tests/SurfaceSemaphoreTest.cpp b/tests/SurfaceSemaphoreTest.cpp
index e1509cd..990e078 100644
--- a/tests/SurfaceSemaphoreTest.cpp
+++ b/tests/SurfaceSemaphoreTest.cpp
@@ -72,12 +72,12 @@
     const SkImageInfo childII = SkImageInfo::Make(CHILD_W, CHILD_H, kRGBA_8888_SkColorType,
                                                   kPremul_SkAlphaType);
 
-    auto childDContext = childInfo.directContext();
-    sk_sp<SkSurface> childSurface(SkSurface::MakeRenderTarget(childDContext, SkBudgeted::kNo,
+    auto childCtx = childInfo.directContext();
+    sk_sp<SkSurface> childSurface(SkSurface::MakeRenderTarget(childCtx, SkBudgeted::kNo,
                                                               childII, 0, kTopLeft_GrSurfaceOrigin,
                                                               nullptr));
 
-    sk_sp<SkImage> childImage = SkImage::MakeFromTexture(childDContext,
+    sk_sp<SkImage> childImage = SkImage::MakeFromTexture(childCtx,
                                                          backendTexture,
                                                          kTopLeft_GrSurfaceOrigin,
                                                          kRGBA_8888_SkColorType,
diff --git a/tests/TextureBindingsResetTest.cpp b/tests/TextureBindingsResetTest.cpp
index 6977b29..77dc86c 100644
--- a/tests/TextureBindingsResetTest.cpp
+++ b/tests/TextureBindingsResetTest.cpp
@@ -18,9 +18,9 @@
 DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(TextureBindingsResetTest, reporter, ctxInfo) {
 #define GL(F) GR_GL_CALL(ctxInfo.glContext()->gl(), F)
 
-    auto dContext = ctxInfo.directContext();
-    GrGpu* gpu = dContext->priv().getGpu();
-    GrGLGpu* glGpu = static_cast<GrGLGpu*>(dContext->priv().getGpu());
+    auto context = ctxInfo.directContext();
+    GrGpu* gpu = context->priv().getGpu();
+    GrGLGpu* glGpu = static_cast<GrGLGpu*>(context->priv().getGpu());
 
     struct Target {
         GrGLenum fName;
@@ -69,9 +69,9 @@
     };
 
     // Initialize texture unit/target combo bindings to 0.
-    dContext->flushAndSubmit();
+    context->flushAndSubmit();
     resetBindings();
-    dContext->resetContext();
+    context->resetContext();
 
     // Test creating a texture and then resetting bindings.
     static constexpr SkISize kDims = {10, 10};
@@ -79,15 +79,15 @@
     auto tex = gpu->createTexture(kDims, format, GrRenderable::kNo, 1, GrMipmapped::kNo,
                                   SkBudgeted::kNo, GrProtected::kNo);
     REPORTER_ASSERT(reporter, tex);
-    dContext->resetGLTextureBindings();
+    context->resetGLTextureBindings();
     checkBindings();
     resetBindings();
-    dContext->resetContext();
+    context->resetContext();
 
     // Test drawing and then resetting bindings. This should force a MIP regeneration if MIP
     // maps are supported as well.
     auto info = SkImageInfo::Make(10, 10, kRGBA_8888_SkColorType, kPremul_SkAlphaType);
-    auto surf = SkSurface::MakeRenderTarget(dContext, SkBudgeted::kYes, info, 1, nullptr);
+    auto surf = SkSurface::MakeRenderTarget(context, SkBudgeted::kYes, info, 1, nullptr);
     surf->getCanvas()->clear(0x80FF0000);
     auto img = surf->makeImageSnapshot();
     surf->getCanvas()->clear(SK_ColorBLUE);
@@ -98,13 +98,13 @@
     surf->getCanvas()->drawImage(img, 0, 0, &paint);
     surf->getCanvas()->restore();
     surf->flushAndSubmit();
-    dContext->resetGLTextureBindings();
+    context->resetGLTextureBindings();
     checkBindings();
     resetBindings();
-    dContext->resetContext();
+    context->resetContext();
 
     if (supportExternal) {
-        GrBackendTexture texture2D = dContext->createBackendTexture(
+        GrBackendTexture texture2D = context->createBackendTexture(
                 10, 10, kRGBA_8888_SkColorType,
                 SkColors::kTransparent, GrMipmapped::kNo, GrRenderable::kNo, GrProtected::kNo);
         GrGLTextureInfo info2D;
@@ -119,37 +119,37 @@
         GrBackendTexture backendTexture(10, 10, GrMipmapped::kNo, infoExternal);
         // Above texture creation will have messed with GL state and bindings.
         resetBindings();
-        dContext->resetContext();
-        img = SkImage::MakeFromTexture(dContext, backendTexture, kTopLeft_GrSurfaceOrigin,
+        context->resetContext();
+        img = SkImage::MakeFromTexture(context, backendTexture, kTopLeft_GrSurfaceOrigin,
                                        kRGBA_8888_SkColorType, kPremul_SkAlphaType, nullptr);
         REPORTER_ASSERT(reporter, img);
         surf->getCanvas()->drawImage(img, 0, 0);
         img.reset();
         surf->flushAndSubmit();
-        dContext->resetGLTextureBindings();
+        context->resetGLTextureBindings();
         checkBindings();
         resetBindings();
         GL(DeleteTextures(1, &infoExternal.fID));
         ctxInfo.glContext()->destroyEGLImage(eglImage);
-        dContext->deleteBackendTexture(texture2D);
-        dContext->resetContext();
+        context->deleteBackendTexture(texture2D);
+        context->resetContext();
     }
 
     if (supportRectangle) {
         auto format = GrBackendFormat::MakeGL(GR_GL_RGBA8, GR_GL_TEXTURE_RECTANGLE);
         GrBackendTexture rectangleTexture =
-                dContext->createBackendTexture(10, 10, format, GrMipmapped::kNo, GrRenderable::kNo);
+                context->createBackendTexture(10, 10, format, GrMipmapped::kNo, GrRenderable::kNo);
         if (rectangleTexture.isValid()) {
-            img = SkImage::MakeFromTexture(dContext, rectangleTexture, kTopLeft_GrSurfaceOrigin,
+            img = SkImage::MakeFromTexture(context, rectangleTexture, kTopLeft_GrSurfaceOrigin,
                                            kRGBA_8888_SkColorType, kPremul_SkAlphaType, nullptr);
             REPORTER_ASSERT(reporter, img);
             surf->getCanvas()->drawImage(img, 0, 0);
             img.reset();
             surf->flushAndSubmit();
-            dContext->resetGLTextureBindings();
+            context->resetGLTextureBindings();
             checkBindings();
             resetBindings();
-            dContext->deleteBackendTexture(rectangleTexture);
+            context->deleteBackendTexture(rectangleTexture);
         }
     }
 
diff --git a/tests/VkBackendSurfaceTest.cpp b/tests/VkBackendSurfaceTest.cpp
index dc61c39..9f61610 100644
--- a/tests/VkBackendSurfaceTest.cpp
+++ b/tests/VkBackendSurfaceTest.cpp
@@ -32,12 +32,11 @@
 #include "src/image/SkSurface_Gpu.h"
 
 DEF_GPUTEST_FOR_VULKAN_CONTEXT(VkImageLayoutTest, reporter, ctxInfo) {
-    auto dContext = ctxInfo.directContext();
+    auto context = ctxInfo.directContext();
 
     GrBackendTexture backendTex;
-    CreateBackendTexture(dContext, &backendTex, 1, 1, kRGBA_8888_SkColorType,
-                         SkColors::kTransparent, GrMipmapped::kNo,
-                         GrRenderable::kNo, GrProtected::kNo);
+    CreateBackendTexture(context, &backendTex, 1, 1, kRGBA_8888_SkColorType, SkColors::kTransparent,
+                         GrMipmapped::kNo, GrRenderable::kNo, GrProtected::kNo);
     REPORTER_ASSERT(reporter, backendTex.isValid());
 
     GrVkImageInfo info;
@@ -61,13 +60,13 @@
     // Setting back the layout since we didn't actually change it
     backendTex.setVkImageLayout(initLayout);
 
-    sk_sp<SkImage> wrappedImage = SkImage::MakeFromTexture(dContext, backendTex,
+    sk_sp<SkImage> wrappedImage = SkImage::MakeFromTexture(context, backendTex,
                                                            kTopLeft_GrSurfaceOrigin,
                                                            kRGBA_8888_SkColorType,
                                                            kPremul_SkAlphaType, nullptr);
     REPORTER_ASSERT(reporter, wrappedImage.get());
 
-    const GrSurfaceProxyView* view = as_IB(wrappedImage)->view(dContext);
+    const GrSurfaceProxyView* view = as_IB(wrappedImage)->view(context);
     REPORTER_ASSERT(reporter, view);
     REPORTER_ASSERT(reporter, view->proxy()->isInstantiated());
     GrTexture* texture = view->proxy()->peekTexture();
@@ -121,7 +120,7 @@
     REPORTER_ASSERT(reporter, invalidTexture.isValid());
     REPORTER_ASSERT(reporter, GrBackendTexture::TestingOnly_Equals(invalidTexture, invalidTexture));
 
-    dContext->deleteBackendTexture(backendTex);
+    context->deleteBackendTexture(backendTex);
 }
 
 // This test is disabled because it executes illegal vulkan calls which cause the validations layers
diff --git a/tools/fiddle/draw.cpp b/tools/fiddle/draw.cpp
index 0ff8915..df6aec0 100644
--- a/tools/fiddle/draw.cpp
+++ b/tools/fiddle/draw.cpp
@@ -26,8 +26,9 @@
     canvas->drawPaint(paint);
     SkDebugf("This is text output: %d", 2);
 
-    if (auto dContext = GrAsDirectContext(canvas->recordingContext())) {
-        sk_sp<SkImage> tmp = SkImage::MakeFromTexture(dContext,
+    GrContext* context = canvas->getGrContext();
+    if (context) {
+        sk_sp<SkImage> tmp = SkImage::MakeFromTexture(context,
                                                       backEndTexture,
                                                       kTopLeft_GrSurfaceOrigin,
                                                       kRGBA_8888_SkColorType,
@@ -35,14 +36,14 @@
                                                       nullptr);
 
         // TODO: this sampleCnt parameter here should match that set in the options!
-        sk_sp<SkSurface> tmp2 = SkSurface::MakeFromBackendTexture(dContext,
+        sk_sp<SkSurface> tmp2 = SkSurface::MakeFromBackendTexture(context,
                                                                   backEndTextureRenderTarget,
                                                                   kTopLeft_GrSurfaceOrigin,
                                                                   0, kRGBA_8888_SkColorType,
                                                                   nullptr, nullptr);
 
         // Note: this surface should only be renderable (i.e., not textureable)
-        sk_sp<SkSurface> tmp3 = SkSurface::MakeFromBackendRenderTarget(dContext,
+        sk_sp<SkSurface> tmp3 = SkSurface::MakeFromBackendRenderTarget(context,
                                                                        backEndRenderTarget,
                                                                        kTopLeft_GrSurfaceOrigin,
                                                                        kRGBA_8888_SkColorType,