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

Unified Diff: src/gpu/GrContext.cpp

Issue 1404823005: GrDrawContext now holds GrRenderTarget pointer (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix overlength line Created 5 years, 2 months 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/GrBlurUtils.cpp ('k') | src/gpu/GrDrawContext.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 d402604198f3693b18bd95fb00344b2686a7e801..82550d0d297d3c8be9ab2d72ba6c4c25790ca948 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -125,12 +125,13 @@ GrTextContext* GrContext::DrawingMgr::textContext(const SkSurfaceProps& props,
return fTextContexts[props.pixelGeometry()][useDIF];
}
-GrDrawContext* GrContext::DrawingMgr::drawContext(const SkSurfaceProps* surfaceProps) {
+GrDrawContext* GrContext::DrawingMgr::drawContext(GrRenderTarget* rt,
+ const SkSurfaceProps* surfaceProps) {
if (this->abandoned()) {
return nullptr;
}
- return new GrDrawContext(fContext, fDrawTarget, surfaceProps);
+ return new GrDrawContext(fContext, rt, fDrawTarget, surfaceProps);
}
////////////////////////////////////////////////////////////////////////////////
@@ -429,13 +430,13 @@ bool GrContext::writeSurfacePixels(GrSurface* surface,
}
SkMatrix matrix;
matrix.setTranslate(SkIntToScalar(left), SkIntToScalar(top));
- SkAutoTUnref<GrDrawContext> drawContext(this->drawContext());
+ SkAutoTUnref<GrDrawContext> drawContext(this->drawContext(renderTarget));
if (!drawContext) {
return false;
}
paint.addColorFragmentProcessor(fp);
SkRect rect = SkRect::MakeWH(SkIntToScalar(width), SkIntToScalar(height));
- drawContext->drawRect(renderTarget, GrClip::WideOpen(), paint, matrix, rect, nullptr);
+ drawContext->drawRect(GrClip::WideOpen(), paint, matrix, rect, nullptr);
if (kFlushWrites_PixelOp & pixelOpsFlags) {
this->flushSurfaceWrites(surface);
@@ -541,9 +542,8 @@ bool GrContext::readSurfacePixels(GrSurface* src,
if (fp) {
paint.addColorFragmentProcessor(fp);
SkRect rect = SkRect::MakeWH(SkIntToScalar(width), SkIntToScalar(height));
- SkAutoTUnref<GrDrawContext> drawContext(this->drawContext());
- drawContext->drawRect(temp->asRenderTarget(), GrClip::WideOpen(), paint,
- SkMatrix::I(), rect, nullptr);
+ SkAutoTUnref<GrDrawContext> drawContext(this->drawContext(temp->asRenderTarget()));
+ drawContext->drawRect(GrClip::WideOpen(), paint, SkMatrix::I(), rect, nullptr);
surfaceToRead.reset(SkRef(temp.get()));
left = 0;
top = 0;
@@ -617,12 +617,12 @@ void GrContext::copySurface(GrSurface* dst, GrSurface* src, const SkIRect& srcRe
return;
}
- SkAutoTUnref<GrDrawContext> drawContext(this->drawContext());
+ SkAutoTUnref<GrDrawContext> drawContext(this->drawContext(dst->asRenderTarget()));
if (!drawContext) {
return;
}
- drawContext->copySurface(dst->asRenderTarget(), src, srcRect, dstPoint);
+ drawContext->copySurface(src, srcRect, dstPoint);
if (kFlushWrites_PixelOp & pixelOpsFlags) {
this->flush();
« no previous file with comments | « src/gpu/GrBlurUtils.cpp ('k') | src/gpu/GrDrawContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698