Index: src/gpu/GrContext.cpp |
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp |
index 13d1f3d11934a0923f73c39af7054d44e2ae8f7b..d45949d2f4e502cb44ab8344bf54a5b7324a37de 100644 |
--- a/src/gpu/GrContext.cpp |
+++ b/src/gpu/GrContext.cpp |
@@ -12,6 +12,7 @@ |
#include "GrRenderTargetContext.h" |
#include "GrResourceCache.h" |
#include "GrResourceProvider.h" |
+#include "GrRenderTarget.h" |
#include "GrRenderTargetProxy.h" |
#include "GrSoftwarePathRenderer.h" |
#include "GrSurfacePriv.h" |
@@ -478,7 +479,8 @@ bool GrContext::readSurfacePixels(GrSurface* src, |
paint.setAllowSRGBInputs(true); |
SkRect rect = SkRect::MakeWH(SkIntToScalar(width), SkIntToScalar(height)); |
tempRTC->drawRect(GrNoClip(), paint, SkMatrix::I(), rect, nullptr); |
- surfaceToRead.reset(tempRTC->asTexture().release()); |
+ GrRenderTarget* tempRT = tempRTC->instantiate(); |
+ surfaceToRead.reset(tempRT->asTexture()); // .release()); |
left = 0; |
top = 0; |
didTempDraw = true; |
@@ -749,7 +751,7 @@ sk_sp<GrRenderTargetContext> GrContext::makeRenderTargetContext(SkBackingFit fit |
desc.fHeight = height; |
desc.fConfig = config; |
desc.fSampleCnt = sampleCnt; |
- |
+ |
sk_sp<GrTexture> tex; |
if (SkBackingFit::kExact == fit) { |
tex.reset(this->textureProvider()->createTexture(desc, budgeted)); |
@@ -760,14 +762,10 @@ sk_sp<GrRenderTargetContext> GrContext::makeRenderTargetContext(SkBackingFit fit |
return nullptr; |
} |
- sk_sp<GrRenderTargetContext> renderTargetContext( |
- this->contextPriv().makeWrappedRenderTargetContext(sk_ref_sp(tex->asRenderTarget()), |
- std::move(colorSpace), surfaceProps)); |
- if (!renderTargetContext) { |
- return nullptr; |
- } |
+ sk_sp<GrRenderTargetProxy> rtp(GrRenderTargetProxy::Make(sk_ref_sp(tex->asRenderTarget()))); |
- return renderTargetContext; |
+ return fDrawingManager->makeRenderTargetContext(std::move(rtp), |
+ std::move(colorSpace), surfaceProps); |
} |
sk_sp<GrRenderTargetContext> GrContext::makeDeferredRenderTargetContext( |