Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1284)

Unified Diff: src/gpu/GrContext.cpp

Issue 2215323003: Start using RenderTargetProxy (omnibus) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrClipStackClip.cpp ('k') | src/gpu/GrDrawingManager.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(
« no previous file with comments | « src/gpu/GrClipStackClip.cpp ('k') | src/gpu/GrDrawingManager.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698