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

Unified Diff: src/gpu/GrDrawingManager.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/GrDrawingManager.cpp
diff --git a/src/gpu/GrDrawingManager.cpp b/src/gpu/GrDrawingManager.cpp
index 976fbb62a49e0c8ec499ce7f0a66fb6afa295cca..4b035bc8638e0e5d7857f905b795bcdbd19b8170 100644
--- a/src/gpu/GrDrawingManager.cpp
+++ b/src/gpu/GrDrawingManager.cpp
@@ -159,8 +159,8 @@ GrPathRenderer* GrDrawingManager::getPathRenderer(const GrPathRenderer::CanDrawP
return pr;
}
-GrDrawContext* GrDrawingManager::drawContext(GrRenderTarget* rt,
- const SkSurfaceProps* surfaceProps) {
+sk_sp<GrDrawContext> GrDrawingManager::drawContext(sk_sp<GrRenderTarget> rt,
+ const SkSurfaceProps* surfaceProps) {
if (this->abandoned()) {
return nullptr;
}
@@ -173,13 +173,16 @@ GrDrawContext* GrDrawingManager::drawContext(GrRenderTarget* rt,
if (useDIF && fContext->caps()->shaderCaps()->pathRenderingSupport() &&
rt->isStencilBufferMultisampled()) {
- GrStencilAttachment* sb = fContext->resourceProvider()->attachStencilAttachment(rt);
+ GrStencilAttachment* sb = fContext->resourceProvider()->attachStencilAttachment(rt.get());
if (sb) {
- return new GrPathRenderingDrawContext(fContext, this, rt, surfaceProps,
- fContext->getAuditTrail(), fSingleOwner);
+ return sk_sp<GrDrawContext>(new GrPathRenderingDrawContext(
+ fContext, this, std::move(rt),
+ surfaceProps,
+ fContext->getAuditTrail(), fSingleOwner));
}
}
- return new GrDrawContext(fContext, this, rt, surfaceProps, fContext->getAuditTrail(),
- fSingleOwner);
+ return sk_sp<GrDrawContext>(new GrDrawContext(fContext, this, std::move(rt), surfaceProps,
+ fContext->getAuditTrail(),
+ fSingleOwner));
}
« gm/beziereffects.cpp ('K') | « src/gpu/GrDrawingManager.h ('k') | src/gpu/GrLayerCache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698