Stop using resourceProvider in GrRenderTargetContext's ctor
Change-Id: Iec4a4f2b6a9c4810e77e81bec6fe43d1afa0950e
Reviewed-on: https://skia-review.googlesource.com/c/193022
Commit-Queue: Greg Daniel <egdaniel@google.com>
Auto-Submit: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
diff --git a/src/gpu/GrBaseContextPriv.h b/src/gpu/GrBaseContextPriv.h
index 61d4a30..31958b3 100644
--- a/src/gpu/GrBaseContextPriv.h
+++ b/src/gpu/GrBaseContextPriv.h
@@ -22,6 +22,10 @@
const GrContextOptions& options() const { return fContext->options(); }
+ bool explicitlyAllocateGPUResources() const {
+ return fContext->explicitlyAllocateGPUResources();
+ }
+
const GrCaps* caps() const { return fContext->caps(); }
sk_sp<const GrCaps> refCaps() const;
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index 5e86602..7f7e4d4 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -116,11 +116,9 @@
}
#endif
- bool explicitlyAllocatingResources = fResourceProvider
- ? fResourceProvider->explicitlyAllocateGPUResources()
- : false;
fDrawingManager.reset(new GrDrawingManager(this, prcOptions, textContextOptions,
- this->singleOwner(), explicitlyAllocatingResources,
+ this->singleOwner(),
+ this->explicitlyAllocateGPUResources(),
this->options().fSortRenderTargets,
this->options().fReduceOpListSplitting));
diff --git a/src/gpu/GrContextPriv.h b/src/gpu/GrContextPriv.h
index 3279420..b6da3e8 100644
--- a/src/gpu/GrContextPriv.h
+++ b/src/gpu/GrContextPriv.h
@@ -36,6 +36,10 @@
const GrContextOptions& options() const { return fContext->options(); }
+ bool explicitlyAllocateGPUResources() const {
+ return fContext->explicitlyAllocateGPUResources();
+ }
+
const GrCaps* caps() const { return fContext->caps(); }
sk_sp<const GrCaps> refCaps() const;
diff --git a/src/gpu/GrImageContextPriv.h b/src/gpu/GrImageContextPriv.h
index c1fca60..1139085 100644
--- a/src/gpu/GrImageContextPriv.h
+++ b/src/gpu/GrImageContextPriv.h
@@ -22,6 +22,10 @@
const GrContextOptions& options() const { return fContext->options(); }
+ bool explicitlyAllocateGPUResources() const {
+ return fContext->explicitlyAllocateGPUResources();
+ }
+
const GrCaps* caps() const { return fContext->caps(); }
sk_sp<const GrCaps> refCaps() const;
diff --git a/src/gpu/GrRecordingContextPriv.h b/src/gpu/GrRecordingContextPriv.h
index 628c248..3c65496 100644
--- a/src/gpu/GrRecordingContextPriv.h
+++ b/src/gpu/GrRecordingContextPriv.h
@@ -22,6 +22,10 @@
const GrContextOptions& options() const { return fContext->options(); }
+ bool explicitlyAllocateGPUResources() const {
+ return fContext->explicitlyAllocateGPUResources();
+ }
+
const GrCaps* caps() const { return fContext->caps(); }
sk_sp<const GrCaps> refCaps() const;
diff --git a/src/gpu/GrRenderTargetContext.cpp b/src/gpu/GrRenderTargetContext.cpp
index 578f77f..700e808 100644
--- a/src/gpu/GrRenderTargetContext.cpp
+++ b/src/gpu/GrRenderTargetContext.cpp
@@ -64,7 +64,7 @@
public:
TextTarget(GrRenderTargetContext* renderTargetContext)
: GrTextTarget(renderTargetContext->width(), renderTargetContext->height(),
- renderTargetContext->colorSpaceInfo())
+ renderTargetContext->colorSpaceInfo())
, fRenderTargetContext(renderTargetContext)
, fGlyphPainter{*renderTargetContext}{}
@@ -170,8 +170,7 @@
, fOpList(sk_ref_sp(fRenderTargetProxy->getLastRenderTargetOpList()))
, fSurfaceProps(SkSurfacePropsCopyOrDefault(surfaceProps))
, fManagedOpList(managedOpList) {
- GrResourceProvider* resourceProvider = context->priv().resourceProvider();
- if (resourceProvider && !resourceProvider->explicitlyAllocateGPUResources()) {
+ if (!context->priv().explicitlyAllocateGPUResources()) {
// MDB TODO: to ensure all resources still get allocated in the correct order in the hybrid
// world we need to get the correct opList here so that it, in turn, can grab and hold
// its rendertarget.