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

Unified Diff: src/gpu/GrContext.cpp

Issue 1413673002: Remove DrawingMgr shims from GrContext (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Remove abandon, reset & flush from public DrawingMgr API 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
Index: src/gpu/GrContext.cpp
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index a691da7de326360c8c69dd2f81c6c0b68d38235c..c6a45fa99cf3568592388b787dcd614e0b679b36 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -152,12 +152,12 @@ GrDrawTarget* GrContext::DrawingMgr::newDrawTarget(GrRenderTarget* rt) {
}
GrDrawContext* GrContext::DrawingMgr::drawContext(GrRenderTarget* rt,
- const SkSurfaceProps* surfaceProps) {
+ const SkSurfaceProps* surfaceProps) const {
if (this->abandoned()) {
return nullptr;
}
- return new GrDrawContext(fContext, rt, surfaceProps);
+ return new GrDrawContext(const_cast<DrawingMgr*>(this), rt, surfaceProps);
}
////////////////////////////////////////////////////////////////////////////////
@@ -456,7 +456,7 @@ bool GrContext::writeSurfacePixels(GrSurface* surface,
}
SkMatrix matrix;
matrix.setTranslate(SkIntToScalar(left), SkIntToScalar(top));
- SkAutoTUnref<GrDrawContext> drawContext(this->drawContext(renderTarget));
+ SkAutoTUnref<GrDrawContext> drawContext(fDrawingMgr.drawContext(renderTarget));
if (!drawContext) {
return false;
}
@@ -568,7 +568,8 @@ bool GrContext::readSurfacePixels(GrSurface* src,
if (fp) {
paint.addColorFragmentProcessor(fp);
SkRect rect = SkRect::MakeWH(SkIntToScalar(width), SkIntToScalar(height));
- SkAutoTUnref<GrDrawContext> drawContext(this->drawContext(temp->asRenderTarget()));
+ SkAutoTUnref<GrDrawContext> drawContext(
+ fDrawingMgr.drawContext(temp->asRenderTarget()));
drawContext->drawRect(GrClip::WideOpen(), paint, SkMatrix::I(), rect, nullptr);
surfaceToRead.reset(SkRef(temp.get()));
left = 0;
@@ -643,7 +644,7 @@ void GrContext::copySurface(GrSurface* dst, GrSurface* src, const SkIRect& srcRe
return;
}
- SkAutoTUnref<GrDrawContext> drawContext(this->drawContext(dst->asRenderTarget()));
+ SkAutoTUnref<GrDrawContext> drawContext(fDrawingMgr.drawContext(dst->asRenderTarget()));
if (!drawContext) {
return;
}

Powered by Google App Engine
This is Rietveld 408576698