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; |
} |