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/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