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

Unified Diff: src/gpu/SkGpuDevice.cpp

Issue 1918003003: Bring sk_sp to GrDrawContext (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update Created 4 years, 8 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/SkGpuDevice.cpp
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index f6137de56ec7c90de029305f8f27aee91c80f4bf..c30571f6d39dc13c025b384c8d93c422ce8b04d2 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -171,7 +171,7 @@ SkGpuDevice::SkGpuDevice(GrRenderTarget* rt, int width, int height,
fLegacyBitmap.setInfo(info);
fLegacyBitmap.setPixelRef(pr)->unref();
- fDrawContext.reset(this->context()->drawContext(rt, &this->surfaceProps()));
+ fDrawContext = this->context()->drawContext(sk_ref_sp(rt), &this->surfaceProps());
if (flags & kNeedClear_Flag) {
this->clearAll();
}
@@ -384,7 +384,8 @@ void SkGpuDevice::replaceRenderTarget(bool shouldRetainContent) {
SkPixelRef* pr = new SkGrPixelRef(fLegacyBitmap.info(), fRenderTarget);
fLegacyBitmap.setPixelRef(pr)->unref();
- fDrawContext.reset(this->context()->drawContext(fRenderTarget, &this->surfaceProps()));
+ fDrawContext = this->context()->drawContext(sk_ref_sp(fRenderTarget.get()),
+ &this->surfaceProps());
}
///////////////////////////////////////////////////////////////////////////////
@@ -512,7 +513,7 @@ void SkGpuDevice::drawRect(const SkDraw& draw, const SkRect& rect, const SkPaint
SkPath path;
path.setIsVolatile(true);
path.addRect(rect);
- GrBlurUtils::drawPathWithMaskFilter(fContext, fDrawContext,
+ GrBlurUtils::drawPathWithMaskFilter(fContext, fDrawContext.get(),
fClip, path, paint,
*draw.fMatrix, nullptr,
draw.fClip->getBounds(), true);
@@ -563,7 +564,7 @@ void SkGpuDevice::drawRRect(const SkDraw& draw, const SkRRect& rect,
return;
}
if (paint.getMaskFilter()->directFilterRRectMaskGPU(fContext->textureProvider(),
- fDrawContext,
+ fDrawContext.get(),
&grPaint,
fClip,
*draw.fMatrix,
@@ -584,7 +585,7 @@ void SkGpuDevice::drawRRect(const SkDraw& draw, const SkRRect& rect,
SkPath path;
path.setIsVolatile(true);
path.addRRect(rect);
- GrBlurUtils::drawPathWithMaskFilter(fContext, fDrawContext,
+ GrBlurUtils::drawPathWithMaskFilter(fContext, fDrawContext.get(),
fClip, path, paint,
*draw.fMatrix, nullptr,
draw.fClip->getBounds(), true);
@@ -630,7 +631,7 @@ void SkGpuDevice::drawDRRect(const SkDraw& draw, const SkRRect& outer,
path.addRRect(inner);
path.setFillType(SkPath::kEvenOdd_FillType);
- GrBlurUtils::drawPathWithMaskFilter(fContext, fDrawContext,
+ GrBlurUtils::drawPathWithMaskFilter(fContext, fDrawContext.get(),
fClip, path, paint,
*draw.fMatrix, nullptr,
draw.fClip->getBounds(), true);
@@ -700,7 +701,7 @@ void SkGpuDevice::drawPath(const SkDraw& draw, const SkPath& origSrcPath,
CHECK_SHOULD_DRAW(draw);
GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "drawPath", fContext);
- GrBlurUtils::drawPathWithMaskFilter(fContext, fDrawContext,
+ GrBlurUtils::drawPathWithMaskFilter(fContext, fDrawContext.get(),
fClip, origSrcPath, paint,
*draw.fMatrix, prePathMatrix,
draw.fClip->getBounds(), pathIsMutable);

Powered by Google App Engine
This is Rietveld 408576698