Move GrContextOptions to GrContext_Base and make GrContextThreadSafeProxy be derived from GrContext_Base

The main thrust of this CL is to bring the GrContextThreadSafeProxy into the fold.

Change-Id: I8f457d5b75c69f89beac3a0035b1c05ba5d3b931
Reviewed-on: https://skia-review.googlesource.com/c/188622
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/GrBaseContextPriv.h b/src/gpu/GrBaseContextPriv.h
index cea4436..4b44d37 100644
--- a/src/gpu/GrBaseContextPriv.h
+++ b/src/gpu/GrBaseContextPriv.h
@@ -18,6 +18,8 @@
     // from GrContext_Base
     uint32_t contextID() const { return fContext->contextID(); }
 
+    const GrContextOptions& options() const { return fContext->options(); }
+
 private:
     explicit GrBaseContextPriv(GrContext_Base* context) : fContext(context) {}
     GrBaseContextPriv(const GrBaseContextPriv&); // unimpl
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index 57103af..8410b40 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -59,15 +59,15 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 
-GrContext::GrContext(GrBackendApi backend, int32_t id)
-        : INHERITED(backend, id) {
+GrContext::GrContext(GrBackendApi backend, const GrContextOptions& options, int32_t id)
+        : INHERITED(backend, options, id) {
     fResourceCache = nullptr;
     fResourceProvider = nullptr;
     fProxyProvider = nullptr;
     fGlyphCache = nullptr;
 }
 
-bool GrContext::initCommon(const GrContextOptions& options) {
+bool GrContext::initCommon() {
     ASSERT_SINGLE_OWNER
     SkASSERT(fCaps);  // needs to have been initialized by derived classes
     SkASSERT(fThreadSafeProxy); // needs to have been initialized by derived classes
@@ -76,7 +76,7 @@
         fCaps = fGpu->refCaps();
         fResourceCache = new GrResourceCache(fCaps.get(), &fSingleOwner, this->contextID());
         fResourceProvider = new GrResourceProvider(fGpu.get(), fResourceCache, &fSingleOwner,
-                                                   options.fExplicitlyAllocateGPUResources);
+                                                   this->options().fExplicitlyAllocateGPUResources);
         fProxyProvider =
                 new GrProxyProvider(fResourceProvider, fResourceCache, fCaps, &fSingleOwner);
     } else {
@@ -87,19 +87,17 @@
         fResourceCache->setProxyProvider(fProxyProvider);
     }
 
-    fDisableGpuYUVConversion = options.fDisableGpuYUVConversion;
-    fSharpenMipmappedTextures = options.fSharpenMipmappedTextures;
     fDidTestPMConversions = false;
 
     GrPathRendererChain::Options prcOptions;
-    prcOptions.fAllowPathMaskCaching = options.fAllowPathMaskCaching;
+    prcOptions.fAllowPathMaskCaching = this->options().fAllowPathMaskCaching;
 #if GR_TEST_UTILS
-    prcOptions.fGpuPathRenderers = options.fGpuPathRenderers;
+    prcOptions.fGpuPathRenderers = this->options().fGpuPathRenderers;
 #endif
-    if (options.fDisableCoverageCountingPaths) {
+    if (this->options().fDisableCoverageCountingPaths) {
         prcOptions.fGpuPathRenderers &= ~GpuPathRenderers::kCoverageCounting;
     }
-    if (options.fDisableDistanceFieldPaths) {
+    if (this->options().fDisableDistanceFieldPaths) {
         prcOptions.fGpuPathRenderers &= ~GpuPathRenderers::kSmall;
     }
 
@@ -112,11 +110,11 @@
     }
 
     GrTextContext::Options textContextOptions;
-    textContextOptions.fMaxDistanceFieldFontSize = options.fGlyphsAsPathsFontSize;
-    textContextOptions.fMinDistanceFieldFontSize = options.fMinDistanceFieldFontSize;
+    textContextOptions.fMaxDistanceFieldFontSize = this->options().fGlyphsAsPathsFontSize;
+    textContextOptions.fMinDistanceFieldFontSize = this->options().fMinDistanceFieldFontSize;
     textContextOptions.fDistanceFieldVerticesAlwaysHaveW = false;
 #if SK_SUPPORT_ATLAS_TEXT
-    if (GrContextOptions::Enable::kYes == options.fDistanceFieldGlyphVerticesAlwaysHaveW) {
+    if (GrContextOptions::Enable::kYes == this->options().fDistanceFieldGlyphVerticesAlwaysHaveW) {
         textContextOptions.fDistanceFieldVerticesAlwaysHaveW = true;
     }
 #endif
@@ -126,20 +124,20 @@
                                             : false;
     fDrawingManager.reset(new GrDrawingManager(this, prcOptions, textContextOptions,
                                                &fSingleOwner, explicitlyAllocatingResources,
-                                               options.fSortRenderTargets,
-                                               options.fReduceOpListSplitting));
+                                               this->options().fSortRenderTargets,
+                                               this->options().fReduceOpListSplitting));
 
-    fGlyphCache = new GrStrikeCache(fCaps.get(), options.fGlyphCacheTextureMaximumBytes);
+    fGlyphCache = new GrStrikeCache(fCaps.get(), this->options().fGlyphCacheTextureMaximumBytes);
 
     fTextBlobCache.reset(new GrTextBlobCache(TextBlobCacheOverBudgetCB, this, this->contextID()));
 
     // DDL TODO: we need to think through how the task group & persistent cache
     // get passed on to/shared between all the DDLRecorders created with this context.
-    if (options.fExecutor) {
-        fTaskGroup = skstd::make_unique<SkTaskGroup>(*options.fExecutor);
+    if (this->options().fExecutor) {
+        fTaskGroup = skstd::make_unique<SkTaskGroup>(*this->options().fExecutor);
     }
 
-    fPersistentCache = options.fPersistentCache;
+    fPersistentCache = this->options().fPersistentCache;
 
     return true;
 }
diff --git a/src/gpu/GrContextPriv.h b/src/gpu/GrContextPriv.h
index 65054bb..123745e 100644
--- a/src/gpu/GrContextPriv.h
+++ b/src/gpu/GrContextPriv.h
@@ -32,6 +32,8 @@
     // from GrContext_Base
     uint32_t contextID() const { return fContext->contextID(); }
 
+    const GrContextOptions& options() const { return fContext->options(); }
+
     // from GrImageContext
 
     // from GrRecordingContext
@@ -88,9 +90,6 @@
     sk_sp<GrRenderTargetContext> makeVulkanSecondaryCBRenderTargetContext(
             const SkImageInfo&, const GrVkDrawableInfo&, const SkSurfaceProps* = nullptr);
 
-    bool disableGpuYUVConversion() const { return fContext->fDisableGpuYUVConversion; }
-    bool sharpenMipmappedTextures() const { return fContext->fSharpenMipmappedTextures; }
-
     /**
      * Call to ensure all drawing to the context has been issued to the
      * underlying 3D API.
diff --git a/src/gpu/GrContextThreadSafeProxy.cpp b/src/gpu/GrContextThreadSafeProxy.cpp
index 4412c40..bb70cf6 100644
--- a/src/gpu/GrContextThreadSafeProxy.cpp
+++ b/src/gpu/GrContextThreadSafeProxy.cpp
@@ -19,16 +19,14 @@
                                                    GrBackendApi backend,
                                                    const GrContextOptions& options,
                                                    sk_sp<GrSkSLFPFactoryCache> cache)
-        : fCaps(std::move(caps))
-        , fContextID(contextID)
-        , fBackend(backend)
-        , fOptions(options)
+        : INHERITED(backend, options, contextID)
+        , fCaps(std::move(caps))
         , fFPFactoryCache(std::move(cache)) {}
 
 GrContextThreadSafeProxy::~GrContextThreadSafeProxy() = default;
 
 bool GrContextThreadSafeProxy::matches(GrContext_Base* context) const {
-    return context->priv().contextID() == fContextID;
+    return context->priv().contextID() == this->contextID();
 }
 
 SkSurfaceCharacterization GrContextThreadSafeProxy::createCharacterization(
diff --git a/src/gpu/GrContextThreadSafeProxyPriv.h b/src/gpu/GrContextThreadSafeProxyPriv.h
index 16132b5..63920aa 100644
--- a/src/gpu/GrContextThreadSafeProxyPriv.h
+++ b/src/gpu/GrContextThreadSafeProxyPriv.h
@@ -17,12 +17,15 @@
  */
 class GrContextThreadSafeProxyPriv {
 public:
-    const GrContextOptions& contextOptions() { return fProxy->fOptions; }
+    // from GrContext_Base
+    uint32_t contextID() const { return fProxy->contextID(); }
 
+    const GrContextOptions& options() const { return fProxy->options(); }
+
+    //
     const GrCaps* caps() const { return fProxy->fCaps.get(); }
     sk_sp<const GrCaps> refCaps() const { return fProxy->fCaps; }
-    uint32_t contextID() const { return fProxy->fContextID; }
-    GrBackendApi backend() const { return fProxy->fBackend; }
+
     sk_sp<GrSkSLFPFactoryCache> fpFactoryCache() const;
 
 private:
diff --git a/src/gpu/GrContext_Base.cpp b/src/gpu/GrContext_Base.cpp
index 582f89a..684f0b6 100644
--- a/src/gpu/GrContext_Base.cpp
+++ b/src/gpu/GrContext_Base.cpp
@@ -17,12 +17,13 @@
 }
 
 GrContext_Base::GrContext_Base(GrBackendApi backend,
+                               const GrContextOptions& options,
                                uint32_t contextID)
         : fBackend(backend)
+        , fOptions(options)
         , fContextID(SK_InvalidGenID == contextID ? next_id() : contextID) {
 }
 
-GrContext_Base::~GrContext_Base() {
-}
+GrContext_Base::~GrContext_Base() { }
 
 
diff --git a/src/gpu/GrDDLContext.cpp b/src/gpu/GrDDLContext.cpp
index c590f79..462c48b 100644
--- a/src/gpu/GrDDLContext.cpp
+++ b/src/gpu/GrDDLContext.cpp
@@ -18,16 +18,14 @@
 class SK_API GrDDLContext : public GrContext {
 public:
     GrDDLContext(sk_sp<GrContextThreadSafeProxy> proxy)
-            : INHERITED(proxy->priv().backend(), proxy->priv().contextID()) {
+            : INHERITED(proxy->backend(), proxy->priv().options(), proxy->priv().contextID()) {
         fCaps = proxy->priv().refCaps();
         fFPFactoryCache = proxy->priv().fpFactoryCache();
         SkASSERT(fFPFactoryCache);
         fThreadSafeProxy = std::move(proxy);
     }
 
-    ~GrDDLContext() override {
-        // The GrDDLContext doesn't actually own the fRestrictedAtlasManager so don't delete it
-    }
+    ~GrDDLContext() override { }
 
     void abandonContext() override {
         SkASSERT(0); // abandoning in a DDL Recorder doesn't make a whole lot of sense
@@ -45,11 +43,11 @@
     }
 
 protected:
-    bool init(const GrContextOptions& options) override {
+    bool init() override {
         SkASSERT(fCaps);  // should've been set in ctor
         SkASSERT(fThreadSafeProxy); // should've been set in the ctor
 
-        if (!INHERITED::initCommon(options)) {
+        if (!INHERITED::initCommon()) {
             return false;
         }
 
@@ -70,7 +68,7 @@
 
     // Note: we aren't creating a Gpu here. This causes the resource provider & cache to
     // also not be created
-    if (!context->init(proxy->priv().contextOptions())) {
+    if (!context->init()) {
         return nullptr;
     }
     return context;
diff --git a/src/gpu/GrDirectContext.cpp b/src/gpu/GrDirectContext.cpp
index af0f1b9..47d226c 100644
--- a/src/gpu/GrDirectContext.cpp
+++ b/src/gpu/GrDirectContext.cpp
@@ -25,8 +25,8 @@
 
 class SK_API GrDirectContext : public GrContext {
 public:
-    GrDirectContext(GrBackendApi backend)
-            : INHERITED(backend)
+    GrDirectContext(GrBackendApi backend, const GrContextOptions& options)
+            : INHERITED(backend, options)
             , fAtlasManager(nullptr) {
     }
 
@@ -58,21 +58,21 @@
     }
 
 protected:
-    bool init(const GrContextOptions& options) override {
+    bool init() override {
         SkASSERT(fCaps);  // should've been set in ctor
         SkASSERT(!fThreadSafeProxy);
         SkASSERT(!fFPFactoryCache);
         fFPFactoryCache.reset(new GrSkSLFPFactoryCache());
         fThreadSafeProxy.reset(new GrContextThreadSafeProxy(fCaps, this->contextID(),
                                                             this->backend(),
-                                                            options, fFPFactoryCache));
+                                                            this->options(), fFPFactoryCache));
 
-        if (!INHERITED::initCommon(options)) {
+        if (!INHERITED::initCommon()) {
             return false;
         }
 
         GrDrawOpAtlas::AllowMultitexturing allowMultitexturing;
-        if (GrContextOptions::Enable::kNo == options.fAllowMultipleGlyphCacheTextures ||
+        if (GrContextOptions::Enable::kNo == this->options().fAllowMultipleGlyphCacheTextures ||
             // multitexturing supported only if range can represent the index + texcoords fully
             !(fCaps->shaderCaps()->floatIs32Bits() || fCaps->shaderCaps()->integerSupport())) {
             allowMultitexturing = GrDrawOpAtlas::AllowMultitexturing::kNo;
@@ -84,7 +84,7 @@
         GrProxyProvider* proxyProvider = this->contextPriv().proxyProvider();
 
         fAtlasManager = new GrAtlasManager(proxyProvider, glyphCache,
-                                           options.fGlyphCacheTextureMaximumBytes,
+                                           this->options().fGlyphCacheTextureMaximumBytes,
                                            allowMultitexturing);
         this->contextPriv().addOnFlushCallbackObject(fAtlasManager);
 
@@ -115,7 +115,7 @@
 
 sk_sp<GrContext> GrContext::MakeGL(sk_sp<const GrGLInterface> interface,
                                    const GrContextOptions& options) {
-    sk_sp<GrContext> context(new GrDirectContext(GrBackendApi::kOpenGL));
+    sk_sp<GrContext> context(new GrDirectContext(GrBackendApi::kOpenGL, options));
 
     context->fGpu = GrGLGpu::Make(std::move(interface), options, context.get());
     if (!context->fGpu) {
@@ -123,7 +123,7 @@
     }
 
     context->fCaps = context->fGpu->refCaps();
-    if (!context->init(options)) {
+    if (!context->init()) {
         return nullptr;
     }
     return context;
@@ -136,7 +136,7 @@
 
 sk_sp<GrContext> GrContext::MakeMock(const GrMockOptions* mockOptions,
                                      const GrContextOptions& options) {
-    sk_sp<GrContext> context(new GrDirectContext(GrBackendApi::kMock));
+    sk_sp<GrContext> context(new GrDirectContext(GrBackendApi::kMock, options));
 
     context->fGpu = GrMockGpu::Make(mockOptions, options, context.get());
     if (!context->fGpu) {
@@ -144,7 +144,7 @@
     }
 
     context->fCaps = context->fGpu->refCaps();
-    if (!context->init(options)) {
+    if (!context->init()) {
         return nullptr;
     }
     return context;
@@ -163,7 +163,7 @@
                                        const GrContextOptions& options) {
 #ifdef SK_VULKAN
     GrContextOptions defaultOptions;
-    sk_sp<GrContext> context(new GrDirectContext(GrBackendApi::kVulkan));
+    sk_sp<GrContext> context(new GrDirectContext(GrBackendApi::kVulkan, options));
 
     context->fGpu = GrVkGpu::Make(backendContext, options, context.get());
     if (!context->fGpu) {
@@ -171,7 +171,7 @@
     }
 
     context->fCaps = context->fGpu->refCaps();
-    if (!context->init(options)) {
+    if (!context->init()) {
         return nullptr;
     }
     return context;
@@ -187,7 +187,7 @@
 }
 
 sk_sp<GrContext> GrContext::MakeMetal(void* device, void* queue, const GrContextOptions& options) {
-    sk_sp<GrContext> context(new GrDirectContext(GrBackendApi::kMetal));
+    sk_sp<GrContext> context(new GrDirectContext(GrBackendApi::kMetal, options));
 
     context->fGpu = GrMtlTrampoline::MakeGpu(context.get(), options, device, queue);
     if (!context->fGpu) {
@@ -195,7 +195,7 @@
     }
 
     context->fCaps = context->fGpu->refCaps();
-    if (!context->init(options)) {
+    if (!context->init()) {
         return nullptr;
     }
     return context;
diff --git a/src/gpu/GrImageContext.cpp b/src/gpu/GrImageContext.cpp
index 2b7c5b1..6adf700 100644
--- a/src/gpu/GrImageContext.cpp
+++ b/src/gpu/GrImageContext.cpp
@@ -7,8 +7,10 @@
 
 #include "GrImageContext.h"
 
-GrImageContext::GrImageContext(GrBackendApi backend, uint32_t uniqueID)
-            : INHERITED(backend, uniqueID) {
+GrImageContext::GrImageContext(GrBackendApi backend,
+                               const GrContextOptions& options,
+                               uint32_t uniqueID)
+            : INHERITED(backend, options, uniqueID) {
 }
 
 GrImageContext::~GrImageContext() {}
diff --git a/src/gpu/GrImageContextPriv.h b/src/gpu/GrImageContextPriv.h
index c00f6df..3247f10 100644
--- a/src/gpu/GrImageContextPriv.h
+++ b/src/gpu/GrImageContextPriv.h
@@ -18,6 +18,8 @@
     // from GrContext_Base
     uint32_t contextID() const { return fContext->contextID(); }
 
+    const GrContextOptions& options() const { return fContext->options(); }
+
     // from GrImageContext
 
 private:
diff --git a/src/gpu/GrRecordingContext.cpp b/src/gpu/GrRecordingContext.cpp
index 9c8f7a4..ca19782 100644
--- a/src/gpu/GrRecordingContext.cpp
+++ b/src/gpu/GrRecordingContext.cpp
@@ -7,8 +7,10 @@
 
 #include "GrRecordingContext.h"
 
-GrRecordingContext::GrRecordingContext(GrBackendApi backend, uint32_t uniqueID)
-        : INHERITED(backend, uniqueID) {
+GrRecordingContext::GrRecordingContext(GrBackendApi backend,
+                                       const GrContextOptions& options,
+                                       uint32_t uniqueID)
+        : INHERITED(backend, options, uniqueID) {
 }
 
 GrRecordingContext::~GrRecordingContext() { }
diff --git a/src/gpu/GrRecordingContextPriv.h b/src/gpu/GrRecordingContextPriv.h
index 1990594..c5b27bc 100644
--- a/src/gpu/GrRecordingContextPriv.h
+++ b/src/gpu/GrRecordingContextPriv.h
@@ -18,6 +18,8 @@
     // from GrContext_Base
     uint32_t contextID() const { return fContext->contextID(); }
 
+    const GrContextOptions& options() const { return fContext->options(); }
+
     // from GrImageContext
 
     // from GrRecordingContext
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 6d2721b..cb9718e 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -769,8 +769,8 @@
     GrSamplerState samplerState;
     bool doBicubic;
     GrSamplerState::Filter textureFilterMode = GrSkFilterQualityToGrFilterMode(
-            quality, viewMatrix, srcToDstRect, fContext->contextPriv().sharpenMipmappedTextures(),
-            &doBicubic);
+            quality, viewMatrix, srcToDstRect,
+            fContext->contextPriv().options().fSharpenMipmappedTextures, &doBicubic);
 
     int tileFilterPad;
     if (doBicubic) {
@@ -821,7 +821,7 @@
         bool doBicubic;
         GrSamplerState::Filter textureFilterMode = GrSkFilterQualityToGrFilterMode(
                 paint.getFilterQuality(), viewMatrix, SkMatrix::I(),
-                fContext->contextPriv().sharpenMipmappedTextures(), &doBicubic);
+                fContext->contextPriv().options().fSharpenMipmappedTextures, &doBicubic);
 
         int tileFilterPad;
 
@@ -1180,7 +1180,7 @@
         bool doBicubic;
         GrSamplerState::Filter textureFilterMode = GrSkFilterQualityToGrFilterMode(
                 paint.getFilterQuality(), this->ctm(), srcToDstMatrix,
-                fContext->contextPriv().sharpenMipmappedTextures(), &doBicubic);
+                fContext->contextPriv().options().fSharpenMipmappedTextures, &doBicubic);
 
         int tileFilterPad;
 
diff --git a/src/gpu/SkGpuDevice_drawTexture.cpp b/src/gpu/SkGpuDevice_drawTexture.cpp
index a891c03..2ce46ec 100644
--- a/src/gpu/SkGpuDevice_drawTexture.cpp
+++ b/src/gpu/SkGpuDevice_drawTexture.cpp
@@ -251,7 +251,7 @@
     bool doBicubic;
     GrSamplerState::Filter fm = GrSkFilterQualityToGrFilterMode(
             paint.getFilterQuality(), viewMatrix, srcToDstMatrix,
-            fContext->contextPriv().sharpenMipmappedTextures(), &doBicubic);
+            fContext->contextPriv().options().fSharpenMipmappedTextures, &doBicubic);
     const GrSamplerState::Filter* filterMode = doBicubic ? nullptr : &fm;
 
     GrTextureProducer::FilterConstraint constraintMode;
diff --git a/src/gpu/gl/builders/GrGLProgramBuilder.cpp b/src/gpu/gl/builders/GrGLProgramBuilder.cpp
index 49b73b5..acf7d99 100644
--- a/src/gpu/gl/builders/GrGLProgramBuilder.cpp
+++ b/src/gpu/gl/builders/GrGLProgramBuilder.cpp
@@ -231,7 +231,8 @@
     SkSL::Program::Settings settings;
     settings.fCaps = this->gpu()->glCaps().shaderCaps();
     settings.fFlipY = this->origin() != kTopLeft_GrSurfaceOrigin;
-    settings.fSharpenTextures = this->gpu()->getContext()->contextPriv().sharpenMipmappedTextures();
+    settings.fSharpenTextures =
+                    this->gpu()->getContext()->contextPriv().options().fSharpenMipmappedTextures;
     settings.fFragColorIsInOut = this->fragColorIsInOut();
 
     SkSL::Program::Inputs inputs;
diff --git a/src/gpu/mtl/GrMtlPipelineStateBuilder.mm b/src/gpu/mtl/GrMtlPipelineStateBuilder.mm
index 168a05f..d95684c 100644
--- a/src/gpu/mtl/GrMtlPipelineStateBuilder.mm
+++ b/src/gpu/mtl/GrMtlPipelineStateBuilder.mm
@@ -319,7 +319,8 @@
     SkSL::Program::Settings settings;
     settings.fCaps = this->caps()->shaderCaps();
     settings.fFlipY = this->origin() != kTopLeft_GrSurfaceOrigin;
-    settings.fSharpenTextures = fGpu->getContext()->contextPriv().sharpenMipmappedTextures();
+    settings.fSharpenTextures =
+                        fGpu->getContext()->contextPriv().options().fSharpenMipmappedTextures;
     SkASSERT(!this->fragColorIsInOut());
 
     id<MTLLibrary> vertexLibrary = nil;
diff --git a/src/gpu/vk/GrVkPipelineStateBuilder.cpp b/src/gpu/vk/GrVkPipelineStateBuilder.cpp
index c3d8fe3..b6097df 100644
--- a/src/gpu/vk/GrVkPipelineStateBuilder.cpp
+++ b/src/gpu/vk/GrVkPipelineStateBuilder.cpp
@@ -276,7 +276,8 @@
     SkSL::Program::Settings settings;
     settings.fCaps = this->caps()->shaderCaps();
     settings.fFlipY = this->origin() != kTopLeft_GrSurfaceOrigin;
-    settings.fSharpenTextures = this->gpu()->getContext()->contextPriv().sharpenMipmappedTextures();
+    settings.fSharpenTextures =
+                    this->gpu()->getContext()->contextPriv().options().fSharpenMipmappedTextures;
     SkASSERT(!this->fragColorIsInOut());
 
     sk_sp<SkData> cached;
diff --git a/src/image/SkImage_Lazy.cpp b/src/image/SkImage_Lazy.cpp
index 0788d21..682db3a 100644
--- a/src/image/SkImage_Lazy.cpp
+++ b/src/image/SkImage_Lazy.cpp
@@ -425,7 +425,7 @@
 
     // 3. Ask the generator to return YUV planes, which the GPU can convert. If we will be mipping
     //    the texture we fall through here and have the CPU generate the mip maps for us.
-    if (!proxy && !willBeMipped && !ctx->contextPriv().disableGpuYUVConversion()) {
+    if (!proxy && !willBeMipped && !ctx->contextPriv().options().fDisableGpuYUVConversion) {
         const GrSurfaceDesc desc = GrImageInfoToSurfaceDesc(fInfo);
 
         SkColorType colorType = fInfo.colorType();
diff --git a/src/shaders/SkImageShader.cpp b/src/shaders/SkImageShader.cpp
index ebf0c72..bb56061 100644
--- a/src/shaders/SkImageShader.cpp
+++ b/src/shaders/SkImageShader.cpp
@@ -214,7 +214,7 @@
     bool doBicubic;
     GrSamplerState::Filter textureFilterMode = GrSkFilterQualityToGrFilterMode(
             args.fFilterQuality, *args.fViewMatrix, *lm,
-            args.fContext->contextPriv().sharpenMipmappedTextures(), &doBicubic);
+            args.fContext->contextPriv().options().fSharpenMipmappedTextures, &doBicubic);
     GrSamplerState samplerState(wrapModes, textureFilterMode);
     SkScalar scaleAdjust[2] = { 1.0f, 1.0f };
     sk_sp<GrTextureProxy> proxy(as_IB(fImage)->asTextureProxyRef(args.fContext, samplerState,