Revert "Move resourceProvider accessor to GrContextPriv"

This reverts commit 1f9ed8501b0007846b3032f4bfc38aee98c175a1.

Reason for revert: 
 1. breaking android roll 
 2. breaking Build-Debian9-Clang-arm-Release-Android_API26



Original change's description:
> Move resourceProvider accessor to GrContextPriv
> 
> Change-Id: I5cddd620a7ec4b006b7359864ede58e9d4dd684e
> Reviewed-on: https://skia-review.googlesource.com/94340
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

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

Change-Id: I20b2d267c0925f20453b635663654967199a1197
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/94964
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
diff --git a/src/gpu/GrBackendTextureImageGenerator.cpp b/src/gpu/GrBackendTextureImageGenerator.cpp
index 36dc139..5dc2396 100644
--- a/src/gpu/GrBackendTextureImageGenerator.cpp
+++ b/src/gpu/GrBackendTextureImageGenerator.cpp
@@ -43,7 +43,7 @@
     // Attach our texture to this context's resource cache. This ensures that deletion will happen
     // in the correct thread/context. This adds the only ref to the texture that will persist from
     // this point. That ref will be released when the generator's RefHelper is freed.
-    context->contextPriv().getResourceCache()->insertCrossContextGpuResource(texture.get());
+    context->getResourceCache()->insertCrossContextGpuResource(texture.get());
 
     GrBackendTexture backendTexture = texture->getBackendTexture();
 
@@ -115,8 +115,8 @@
         // always make a wrapped copy, where the release proc informs us that the context is done
         // with it. This is unfortunate - we'll have two texture objects referencing the same GPU
         // object. However, no client can ever see the original texture, so this should be safe.
-        tex = context->contextPriv().resourceProvider()->wrapBackendTexture(
-                                fBackendTexture, kBorrow_GrWrapOwnership);
+        tex = context->resourceProvider()->wrapBackendTexture(fBackendTexture,
+                                                              kBorrow_GrWrapOwnership);
         if (!tex) {
             return nullptr;
         }
diff --git a/src/gpu/GrBufferAllocPool.cpp b/src/gpu/GrBufferAllocPool.cpp
index fc5fb66..13ae404 100644
--- a/src/gpu/GrBufferAllocPool.cpp
+++ b/src/gpu/GrBufferAllocPool.cpp
@@ -10,7 +10,6 @@
 #include "GrBuffer.h"
 #include "GrCaps.h"
 #include "GrContext.h"
-#include "GrContextPriv.h"
 #include "GrGpu.h"
 #include "GrResourceProvider.h"
 #include "GrTypes.h"
@@ -369,11 +368,11 @@
 
 GrBuffer* GrBufferAllocPool::getBuffer(size_t size) {
 
-    auto resourceProvider = fGpu->getContext()->contextPriv().resourceProvider();
+    GrResourceProvider* rp = fGpu->getContext()->resourceProvider();
 
     // Shouldn't have to use this flag (https://bug.skia.org/4156)
     static const uint32_t kFlags = GrResourceProvider::kNoPendingIO_Flag;
-    return resourceProvider->createBuffer(size, fBufferType, kDynamic_GrAccessPattern, kFlags);
+    return rp->createBuffer(size, fBufferType, kDynamic_GrAccessPattern, kFlags);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index c13cd53..95d2344 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -484,7 +484,7 @@
     ASSERT_OWNED_PROXY_PRIV(dst->asSurfaceProxy());
     GR_CREATE_TRACE_MARKER_CONTEXT("GrContextPriv", "writeSurfacePixels", fContext);
 
-    if (!dst->asSurfaceProxy()->instantiate(this->resourceProvider())) {
+    if (!dst->asSurfaceProxy()->instantiate(fContext->resourceProvider())) {
         return false;
     }
 
@@ -563,7 +563,7 @@
             return false;
         }
 
-        if (!tempProxy->instantiate(this->resourceProvider())) {
+        if (!tempProxy->instantiate(fContext->resourceProvider())) {
             return false;
         }
         GrTexture* texture = tempProxy->priv().peekTexture();
@@ -616,7 +616,7 @@
     GR_CREATE_TRACE_MARKER_CONTEXT("GrContextPriv", "readSurfacePixels", fContext);
 
     // MDB TODO: delay this instantiation until later in the method
-    if (!src->asSurfaceProxy()->instantiate(this->resourceProvider())) {
+    if (!src->asSurfaceProxy()->instantiate(fContext->resourceProvider())) {
         return false;
     }
 
@@ -724,7 +724,7 @@
         configToRead = tempDrawInfo.fReadConfig;
     }
 
-    if (!proxyToRead->instantiate(this->resourceProvider())) {
+    if (!proxyToRead->instantiate(fContext->resourceProvider())) {
         return false;
     }
 
diff --git a/src/gpu/GrContextPriv.h b/src/gpu/GrContextPriv.h
index bbf67a5..2da8f34 100644
--- a/src/gpu/GrContextPriv.h
+++ b/src/gpu/GrContextPriv.h
@@ -170,11 +170,6 @@
     GrProxyProvider* proxyProvider() { return fContext->fProxyProvider; }
     const GrProxyProvider* proxyProvider() const { return fContext->fProxyProvider; }
 
-    GrResourceProvider* resourceProvider() { return fContext->fResourceProvider; }
-    const GrResourceProvider* resourceProvider() const { return fContext->fResourceProvider; }
-
-    GrResourceCache* getResourceCache() { return fContext->fResourceCache; }
-
 private:
     explicit GrContextPriv(GrContext* context) : fContext(context) {}
     GrContextPriv(const GrContextPriv&); // unimpl
diff --git a/src/gpu/GrDrawOpAtlas.cpp b/src/gpu/GrDrawOpAtlas.cpp
index 24e19f5..0ba9dec 100644
--- a/src/gpu/GrDrawOpAtlas.cpp
+++ b/src/gpu/GrDrawOpAtlas.cpp
@@ -188,7 +188,7 @@
 
         // MDB TODO: this is currently fine since the atlas' proxy is always pre-instantiated.
         // Once it is deferred more care must be taken upon instantiation failure.
-        if (!fProxies[pageIdx]->instantiate(fContext->contextPriv().resourceProvider())) {
+        if (!fProxies[pageIdx]->instantiate(fContext->resourceProvider())) {
             return false;
         }
 
@@ -309,7 +309,7 @@
     sk_sp<Plot> plotsp(SkRef(newPlot.get()));
     // MDB TODO: this is currently fine since the atlas' proxy is always pre-instantiated.
     // Once it is deferred more care must be taken upon instantiation failure.
-    if (!fProxies[pageIdx]->instantiate(fContext->contextPriv().resourceProvider())) {
+    if (!fProxies[pageIdx]->instantiate(fContext->resourceProvider())) {
         return false;
     }
     GrTextureProxy* proxy = fProxies[pageIdx].get();
diff --git a/src/gpu/GrDrawingManager.cpp b/src/gpu/GrDrawingManager.cpp
index e60468b..7a7e0a3 100644
--- a/src/gpu/GrDrawingManager.cpp
+++ b/src/gpu/GrDrawingManager.cpp
@@ -168,7 +168,7 @@
     bool flushed = false;
 
     {
-        GrResourceAllocator alloc(fContext->contextPriv().resourceProvider());
+        GrResourceAllocator alloc(fContext->resourceProvider());
         for (int i = 0; i < fOpLists.count(); ++i) {
             fOpLists[i]->gatherProxyIntervals(&alloc);
             alloc.markEndOfOpList(i);
@@ -194,7 +194,7 @@
 
     // We always have to notify the cache when it requested a flush so it can reset its state.
     if (flushed || type == GrResourceCache::FlushType::kCacheRequested) {
-        fContext->contextPriv().getResourceCache()->notifyFlushOccurred(type);
+        fContext->getResourceCache()->notifyFlushOccurred(type);
     }
     for (GrOnFlushCallbackObject* onFlushCBObject : fOnFlushCBObjects) {
         onFlushCBObject->postFlush(fFlushState.nextTokenToFlush(), fFlushingOpListIDs.begin(),
@@ -217,7 +217,7 @@
         }
 
 #ifdef SK_DISABLE_EXPLICIT_GPU_RESOURCE_ALLOCATION
-        if (!fOpLists[i]->instantiate(fContext->contextPriv().resourceProvider())) {
+        if (!fOpLists[i]->instantiate(fContext->resourceProvider())) {
             SkDebugf("OpList failed to instantiate.\n");
             fOpLists[i] = nullptr;
             continue;
@@ -228,7 +228,7 @@
 
         // TODO: handle this instantiation via lazy surface proxies?
         // Instantiate all deferred proxies (being built on worker threads) so we can upload them
-        fOpLists[i]->instantiateDeferredProxies(fContext->contextPriv().resourceProvider());
+        fOpLists[i]->instantiateDeferredProxies(fContext->resourceProvider());
         fOpLists[i]->prepare(flushState);
     }
 
@@ -291,7 +291,7 @@
         result = this->flush(proxy, numSemaphores, backendSemaphores);
     }
 
-    if (!proxy->instantiate(fContext->contextPriv().resourceProvider())) {
+    if (!proxy->instantiate(fContext->resourceProvider())) {
         return result;
     }
 
@@ -340,7 +340,7 @@
         fOpLists.back()->makeClosed(*fContext->caps());
     }
 
-    sk_sp<GrTextureOpList> opList(new GrTextureOpList(fContext->contextPriv().resourceProvider(),
+    sk_sp<GrTextureOpList> opList(new GrTextureOpList(fContext->resourceProvider(),
                                                       textureProxy,
                                                       fContext->getAuditTrail()));
 
diff --git a/src/gpu/GrDrawingManager.h b/src/gpu/GrDrawingManager.h
index 0162b4b..cbb28c4 100644
--- a/src/gpu/GrDrawingManager.h
+++ b/src/gpu/GrDrawingManager.h
@@ -65,7 +65,7 @@
     GrCoverageCountingPathRenderer* getCoverageCountingPathRenderer();
 
     void flushIfNecessary() {
-        if (fContext->contextPriv().getResourceCache()->requestsFlush()) {
+        if (fContext->getResourceCache()->requestsFlush()) {
             this->internalFlush(nullptr, GrResourceCache::kCacheRequested, 0, nullptr);
         }
     }
@@ -92,7 +92,7 @@
             , fAtlasTextContext(nullptr)
             , fPathRendererChain(nullptr)
             , fSoftwarePathRenderer(nullptr)
-            , fFlushState(context->getGpu(), context->contextPriv().resourceProvider())
+            , fFlushState(context->getGpu(), context->resourceProvider())
             , fFlushing(false) {}
 
     void abandon();
diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp
index 93f719a..3a09551 100644
--- a/src/gpu/GrGpu.cpp
+++ b/src/gpu/GrGpu.cpp
@@ -13,7 +13,6 @@
 #include "GrBuffer.h"
 #include "GrCaps.h"
 #include "GrContext.h"
-#include "GrContextPriv.h"
 #include "GrGpuResourcePriv.h"
 #include "GrMesh.h"
 #include "GrPathRendering.h"
@@ -484,17 +483,15 @@
 
 GrSemaphoresSubmitted GrGpu::finishFlush(int numSemaphores,
                                          GrBackendSemaphore backendSemaphores[]) {
-    GrResourceProvider* resourceProvider = fContext->contextPriv().resourceProvider();
-
     if (this->caps()->fenceSyncSupport()) {
         for (int i = 0; i < numSemaphores; ++i) {
             sk_sp<GrSemaphore> semaphore;
             if (backendSemaphores[i].isInitialized()) {
-                semaphore = resourceProvider->wrapBackendSemaphore(
+                semaphore = fContext->resourceProvider()->wrapBackendSemaphore(
                         backendSemaphores[i], GrResourceProvider::SemaphoreWrapType::kWillSignal,
                         kBorrow_GrWrapOwnership);
             } else {
-                semaphore = resourceProvider->makeSemaphore(false);
+                semaphore = fContext->resourceProvider()->makeSemaphore(false);
             }
             this->insertSemaphore(semaphore, false);
 
diff --git a/src/gpu/GrGpuCommandBuffer.cpp b/src/gpu/GrGpuCommandBuffer.cpp
index 096c3c4..1dc16c1 100644
--- a/src/gpu/GrGpuCommandBuffer.cpp
+++ b/src/gpu/GrGpuCommandBuffer.cpp
@@ -46,9 +46,8 @@
         SkASSERT(primProc.hasInstanceAttribs() == meshes[i].isInstanced());
     }
 #endif
-    auto resourceProvider = this->gpu()->getContext()->contextPriv().resourceProvider();
 
-    if (pipeline.isBad() || !primProc.instantiate(resourceProvider)) {
+    if (pipeline.isBad() || !primProc.instantiate(this->gpu()->getContext()->resourceProvider())) {
         return false;
     }
 
diff --git a/src/gpu/GrGpuResource.cpp b/src/gpu/GrGpuResource.cpp
index 3d3c88b..df8e72c 100644
--- a/src/gpu/GrGpuResource.cpp
+++ b/src/gpu/GrGpuResource.cpp
@@ -7,7 +7,6 @@
 
 #include "GrGpuResource.h"
 #include "GrContext.h"
-#include "GrContextPriv.h"
 #include "GrResourceCache.h"
 #include "GrGpu.h"
 #include "GrGpuResourcePriv.h"
@@ -16,8 +15,8 @@
 static inline GrResourceCache* get_resource_cache(GrGpu* gpu) {
     SkASSERT(gpu);
     SkASSERT(gpu->getContext());
-    SkASSERT(gpu->getContext()->contextPriv().getResourceCache());
-    return gpu->getContext()->contextPriv().getResourceCache();
+    SkASSERT(gpu->getContext()->getResourceCache());
+    return gpu->getContext()->getResourceCache();
 }
 
 GrGpuResource::GrGpuResource(GrGpu* gpu)
diff --git a/src/gpu/GrOnFlushResourceProvider.cpp b/src/gpu/GrOnFlushResourceProvider.cpp
index 8de827c..7fcd30f 100644
--- a/src/gpu/GrOnFlushResourceProvider.cpp
+++ b/src/gpu/GrOnFlushResourceProvider.cpp
@@ -19,12 +19,10 @@
     GrSurfaceDesc tmpDesc = desc;
     tmpDesc.fFlags |= kRenderTarget_GrSurfaceFlag;
 
-    auto proxyProvider = fDrawingMgr->getContext()->contextPriv().proxyProvider();
-    auto resourceProvider = fDrawingMgr->getContext()->contextPriv().resourceProvider();
-
     // Because this is being allocated at the start of a flush we must ensure the proxy
     // will, when instantiated, have no pending IO.
     // TODO: fold the kNoPendingIO_Flag into GrSurfaceFlags?
+    GrProxyProvider* proxyProvider = fDrawingMgr->getContext()->contextPriv().proxyProvider();
     sk_sp<GrSurfaceProxy> proxy = proxyProvider->createProxy(tmpDesc, SkBackingFit::kExact,
                                                              SkBudgeted::kYes,
                                                              GrResourceProvider::kNoPendingIO_Flag);
@@ -44,7 +42,8 @@
     // Since this is at flush time and these won't be allocated for us by the GrResourceAllocator
     // we have to manually ensure it is allocated here. The proxy had best have been created
     // with the kNoPendingIO flag!
-    if (!renderTargetContext->asSurfaceProxy()->instantiate(resourceProvider)) {
+    if (!renderTargetContext->asSurfaceProxy()->instantiate(
+                                                fDrawingMgr->getContext()->resourceProvider())) {
         return nullptr;
     }
 
@@ -68,12 +67,11 @@
         return nullptr;
     }
 
-    auto resourceProvider = fDrawingMgr->getContext()->contextPriv().resourceProvider();
-
     // Since this is at flush time and these won't be allocated for us by the GrResourceAllocator
     // we have to manually ensure it is allocated here. The proxy had best have been created
     // with the kNoPendingIO flag!
-    if (!renderTargetContext->asSurfaceProxy()->instantiate(resourceProvider)) {
+    if (!renderTargetContext->asSurfaceProxy()->instantiate(
+                                                fDrawingMgr->getContext()->resourceProvider())) {
         return nullptr;
     }
 
@@ -84,20 +82,18 @@
 
 sk_sp<GrBuffer> GrOnFlushResourceProvider::makeBuffer(GrBufferType intendedType, size_t size,
                                                       const void* data) {
-    auto resourceProvider = fDrawingMgr->getContext()->contextPriv().resourceProvider();
-    return sk_sp<GrBuffer>(resourceProvider->createBuffer(size, intendedType,
-                                                          kDynamic_GrAccessPattern,
-                                                          GrResourceProvider::kNoPendingIO_Flag,
-                                                          data));
+    GrResourceProvider* rp = fDrawingMgr->getContext()->resourceProvider();
+    return sk_sp<GrBuffer>(rp->createBuffer(size, intendedType, kDynamic_GrAccessPattern,
+                                            GrResourceProvider::kNoPendingIO_Flag,
+                                            data));
 }
 
 sk_sp<const GrBuffer> GrOnFlushResourceProvider::findOrMakeStaticBuffer(GrBufferType intendedType,
                                                                         size_t size,
                                                                         const void* data,
                                                                         const GrUniqueKey& key) {
-    auto resourceProvider = fDrawingMgr->getContext()->contextPriv().resourceProvider();
-    sk_sp<const GrBuffer> buffer = resourceProvider->findOrMakeStaticBuffer(intendedType, size,
-                                                                            data, key);
+    GrResourceProvider* rp = fDrawingMgr->getContext()->resourceProvider();
+    sk_sp<const GrBuffer> buffer = rp->findOrMakeStaticBuffer(intendedType, size, data, key);
     // Static buffers should never have pending IO.
     SkASSERT(!buffer->resourcePriv().hasPendingIO_debugOnly());
     return buffer;
diff --git a/src/gpu/GrPathRendererChain.cpp b/src/gpu/GrPathRendererChain.cpp
index 1e1d87a..393823c 100644
--- a/src/gpu/GrPathRendererChain.cpp
+++ b/src/gpu/GrPathRendererChain.cpp
@@ -34,7 +34,7 @@
     }
     if (options.fGpuPathRenderers & GpuPathRenderers::kStencilAndCover) {
         sk_sp<GrPathRenderer> pr(
-           GrStencilAndCoverPathRenderer::Create(context->contextPriv().resourceProvider(), caps));
+            GrStencilAndCoverPathRenderer::Create(context->resourceProvider(), caps));
         if (pr) {
             fChain.push_back(std::move(pr));
         }
diff --git a/src/gpu/GrProcessor.cpp b/src/gpu/GrProcessor.cpp
index 2b02b8d..96cbca4 100644
--- a/src/gpu/GrProcessor.cpp
+++ b/src/gpu/GrProcessor.cpp
@@ -18,7 +18,7 @@
 #if GR_TEST_UTILS
 
 GrResourceProvider* GrProcessorTestData::resourceProvider() {
-    return fContext->contextPriv().resourceProvider();
+    return fContext->resourceProvider();
 }
 
 GrProxyProvider* GrProcessorTestData::proxyProvider() {
diff --git a/src/gpu/GrRenderTargetContext.cpp b/src/gpu/GrRenderTargetContext.cpp
index 42a4fdd..19540eb 100644
--- a/src/gpu/GrRenderTargetContext.cpp
+++ b/src/gpu/GrRenderTargetContext.cpp
@@ -1425,11 +1425,9 @@
         return false;
     }
 
-    auto resourceProvider = fContext->contextPriv().resourceProvider();
-
     SkTArray<sk_sp<GrSemaphore>> semaphores(numSemaphores);
     for (int i = 0; i < numSemaphores; ++i) {
-        sk_sp<GrSemaphore> sema = resourceProvider->wrapBackendSemaphore(
+        sk_sp<GrSemaphore> sema = fContext->resourceProvider()->wrapBackendSemaphore(
                 waitSemaphores[i], GrResourceProvider::SemaphoreWrapType::kWillWait,
                 kAdopt_GrWrapOwnership);
         std::unique_ptr<GrOp> waitOp(GrSemaphoreOp::MakeWait(sema, fRenderTargetProxy.get()));
diff --git a/src/gpu/GrRenderTargetContext.h b/src/gpu/GrRenderTargetContext.h
index 47cd922..2ae52b9 100644
--- a/src/gpu/GrRenderTargetContext.h
+++ b/src/gpu/GrRenderTargetContext.h
@@ -11,7 +11,6 @@
 #include "../private/GrRenderTargetProxy.h"
 #include "GrColor.h"
 #include "GrContext.h"
-#include "GrContextPriv.h"
 #include "GrPaint.h"
 #include "GrSurfaceContext.h"
 #include "GrTypesPriv.h"
@@ -350,7 +349,7 @@
     GrRenderTarget* accessRenderTarget() {
         // TODO: usage of this entry point needs to be reduced and potentially eliminated
         // since it ends the deferral of the GrRenderTarget's allocation
-        if (!fRenderTargetProxy->instantiate(fContext->contextPriv().resourceProvider())) {
+        if (!fRenderTargetProxy->instantiate(fContext->resourceProvider())) {
             return nullptr;
         }
         return fRenderTargetProxy->priv().peekRenderTarget();
diff --git a/src/gpu/GrRenderTargetOpList.cpp b/src/gpu/GrRenderTargetOpList.cpp
index 0f62bc6..09ce760 100644
--- a/src/gpu/GrRenderTargetOpList.cpp
+++ b/src/gpu/GrRenderTargetOpList.cpp
@@ -26,7 +26,7 @@
 
 GrRenderTargetOpList::GrRenderTargetOpList(GrRenderTargetProxy* proxy, GrGpu* gpu,
                                            GrAuditTrail* auditTrail)
-        : INHERITED(gpu->getContext()->contextPriv().resourceProvider(), proxy, auditTrail)
+        : INHERITED(gpu->getContext()->resourceProvider(), proxy, auditTrail)
         , fLastClipStackGenID(SK_InvalidUniqueID)
         SkDEBUGCODE(, fNumClips(0)) {
 }
diff --git a/src/gpu/gl/builders/GrGLProgramBuilder.cpp b/src/gpu/gl/builders/GrGLProgramBuilder.cpp
index f906773..0e6eee4 100644
--- a/src/gpu/gl/builders/GrGLProgramBuilder.cpp
+++ b/src/gpu/gl/builders/GrGLProgramBuilder.cpp
@@ -9,7 +9,6 @@
 
 #include "GrAutoLocaleSetter.h"
 #include "GrContext.h"
-#include "GrContextPriv.h"
 #include "GrCoordTransform.h"
 #include "GrGLProgramBuilder.h"
 #include "GrProgramDesc.h"
@@ -33,11 +32,7 @@
                                                const GrPrimitiveProcessor& primProc,
                                                GrProgramDesc* desc,
                                                GrGLGpu* gpu) {
-#ifdef SK_DEBUG
-    GrResourceProvider* resourceProvider = gpu->getContext()->contextPriv().resourceProvider();
-
-    SkASSERT(!pipeline.isBad() && primProc.instantiate(resourceProvider));
-#endif
+    SkASSERT(!pipeline.isBad() && primProc.instantiate(gpu->getContext()->resourceProvider()));
 
     ATRACE_ANDROID_FRAMEWORK("Shader Compile");
     GrAutoLocaleSetter als("C");
diff --git a/src/gpu/text/GrStencilAndCoverTextContext.cpp b/src/gpu/text/GrStencilAndCoverTextContext.cpp
index b2dfa6c..86e5732 100644
--- a/src/gpu/text/GrStencilAndCoverTextContext.cpp
+++ b/src/gpu/text/GrStencilAndCoverTextContext.cpp
@@ -560,7 +560,7 @@
     SkASSERT(fInstanceData);
 
     if (fInstanceData->count()) {
-        sk_sp<GrPathRange> glyphs(this->createGlyphs(ctx->contextPriv().resourceProvider()));
+        sk_sp<GrPathRange> glyphs(this->createGlyphs(ctx->resourceProvider()));
         if (fLastDrawnGlyphsID != glyphs->uniqueID()) {
             // Either this is the first draw or the glyphs object was purged since last draw.
             glyphs->loadPathsIfNeeded(fInstanceData->indices(), fInstanceData->count());
diff --git a/src/gpu/vk/GrVkPipelineState.cpp b/src/gpu/vk/GrVkPipelineState.cpp
index 10e757e..1dbc490 100644
--- a/src/gpu/vk/GrVkPipelineState.cpp
+++ b/src/gpu/vk/GrVkPipelineState.cpp
@@ -8,7 +8,6 @@
 #include "GrVkPipelineState.h"
 
 #include "GrContext.h"
-#include "GrContextPriv.h"
 #include "GrPipeline.h"
 #include "GrTexturePriv.h"
 #include "GrVkBufferView.h"
@@ -264,12 +263,10 @@
         fXferProcessor->setData(fDataManager, pipeline.getXferProcessor(), dstTexture, offset);
     }
 
-    GrResourceProvider* resourceProvider = gpu->getContext()->contextPriv().resourceProvider();
-
     GrResourceIOProcessor::TextureSampler dstTextureSampler;
     if (GrTextureProxy* dstTextureProxy = pipeline.dstTextureProxy()) {
         dstTextureSampler.reset(sk_ref_sp(dstTextureProxy));
-        SkAssertResult(dstTextureSampler.instantiate(resourceProvider));
+        SkAssertResult(dstTextureSampler.instantiate(gpu->getContext()->resourceProvider()));
         textureBindings.push_back(&dstTextureSampler);
     }
 
diff --git a/src/image/SkImage_Gpu.cpp b/src/image/SkImage_Gpu.cpp
index d08f0a4..20e8349 100644
--- a/src/image/SkImage_Gpu.cpp
+++ b/src/image/SkImage_Gpu.cpp
@@ -156,7 +156,7 @@
                                                 GrSurfaceOrigin* origin) const {
     SkASSERT(fProxy);
 
-    if (!fProxy->instantiate(fContext->contextPriv().resourceProvider())) {
+    if (!fProxy->instantiate(fContext->resourceProvider())) {
         return 0;
     }
 
@@ -180,7 +180,7 @@
         return nullptr;
     }
 
-    if (!proxy->instantiate(fContext->contextPriv().resourceProvider())) {
+    if (!proxy->instantiate(fContext->resourceProvider())) {
         return nullptr;
     }
 
@@ -284,9 +284,7 @@
         return nullptr;
     }
 
-    GrResourceProvider* resourceProvider = ctx->contextPriv().resourceProvider();
-
-    sk_sp<GrTexture> tex = resourceProvider->wrapBackendTexture(backendTex, ownership);
+    sk_sp<GrTexture> tex = ctx->resourceProvider()->wrapBackendTexture(backendTex, ownership);
     if (!tex) {
         return nullptr;
     }
@@ -587,7 +585,7 @@
         return codecImage;
     }
 
-    if (!proxy->instantiate(context->contextPriv().resourceProvider())) {
+    if (!proxy->instantiate(context->resourceProvider())) {
         return codecImage;
     }
     sk_sp<GrTexture> texture = sk_ref_sp(proxy->priv().peekTexture());