| Index: src/gpu/GrContext.cpp
|
| diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
|
| index a934501a6c0127a1d8a226ea2d30607b64eac538..ee9942e5391ef91519396c5e442c74db47dec79f 100644
|
| --- a/src/gpu/GrContext.cpp
|
| +++ b/src/gpu/GrContext.cpp
|
| @@ -125,7 +125,8 @@ GrDrawContext* GrContext::DrawingMgr::drawContext(const SkSurfaceProps* surfaceP
|
| new GrDrawContext(fContext, fDrawTarget, props);
|
| }
|
|
|
| - return fDrawContext[props.pixelGeometry()][props.isUseDeviceIndependentFonts()];
|
| + // For now, everyone gets a faux creation ref
|
| + return SkRef(fDrawContext[props.pixelGeometry()][props.isUseDeviceIndependentFonts()]);
|
| }
|
|
|
| ////////////////////////////////////////////////////////////////////////////////
|
| @@ -423,7 +424,7 @@ bool GrContext::writeSurfacePixels(GrSurface* surface,
|
| }
|
| SkMatrix matrix;
|
| matrix.setTranslate(SkIntToScalar(left), SkIntToScalar(top));
|
| - GrDrawContext* drawContext = this->drawContext();
|
| + SkAutoTUnref<GrDrawContext> drawContext(this->drawContext());
|
| if (!drawContext) {
|
| return false;
|
| }
|
| @@ -534,7 +535,7 @@ bool GrContext::readSurfacePixels(GrSurface* src,
|
| if (fp) {
|
| paint.addColorFragmentProcessor(fp);
|
| SkRect rect = SkRect::MakeWH(SkIntToScalar(width), SkIntToScalar(height));
|
| - GrDrawContext* drawContext = this->drawContext();
|
| + SkAutoTUnref<GrDrawContext> drawContext(this->drawContext());
|
| drawContext->drawRect(temp->asRenderTarget(), GrClip::WideOpen(), paint,
|
| SkMatrix::I(), rect, nullptr);
|
| surfaceToRead.reset(SkRef(temp.get()));
|
| @@ -610,7 +611,7 @@ void GrContext::copySurface(GrSurface* dst, GrSurface* src, const SkIRect& srcRe
|
| return;
|
| }
|
|
|
| - GrDrawContext* drawContext = this->drawContext();
|
| + SkAutoTUnref<GrDrawContext> drawContext(this->drawContext());
|
| if (!drawContext) {
|
| return;
|
| }
|
|
|