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

Unified Diff: src/effects/SkLayerRasterizer.cpp

Issue 1821533002: guard rasterizer and drawlooper setters (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: guard google3 Created 4 years, 9 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
« no previous file with comments | « src/effects/SkLayerDrawLooper.cpp ('k') | tests/BlurTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkLayerRasterizer.cpp
diff --git a/src/effects/SkLayerRasterizer.cpp b/src/effects/SkLayerRasterizer.cpp
index 6c08afc6f5c164022c03ac3a1ce6977a2089ebfc..351265c46e178b0f901a1107d9bb3bf37afd1e82 100644
--- a/src/effects/SkLayerRasterizer.cpp
+++ b/src/effects/SkLayerRasterizer.cpp
@@ -196,7 +196,7 @@ void SkLayerRasterizer::Builder::addLayer(const SkPaint& paint, SkScalar dx,
rec->fOffset.set(dx, dy);
}
-SkLayerRasterizer* SkLayerRasterizer::Builder::detachRasterizer() {
+sk_sp<SkLayerRasterizer> SkLayerRasterizer::Builder::detach() {
SkLayerRasterizer* rasterizer;
if (0 == fLayers->count()) {
rasterizer = nullptr;
@@ -205,10 +205,10 @@ SkLayerRasterizer* SkLayerRasterizer::Builder::detachRasterizer() {
rasterizer = new SkLayerRasterizer(fLayers);
}
fLayers = nullptr;
- return rasterizer;
+ return sk_sp<SkLayerRasterizer>(rasterizer);
}
-SkLayerRasterizer* SkLayerRasterizer::Builder::snapshotRasterizer() const {
+sk_sp<SkLayerRasterizer> SkLayerRasterizer::Builder::snapshot() const {
if (0 == fLayers->count()) {
return nullptr;
}
@@ -224,6 +224,5 @@ SkLayerRasterizer* SkLayerRasterizer::Builder::snapshotRasterizer() const {
}
SkASSERT(fLayers->count() == count);
SkASSERT(layers->count() == count);
- SkLayerRasterizer* rasterizer = new SkLayerRasterizer(layers);
- return rasterizer;
+ return sk_sp<SkLayerRasterizer>(new SkLayerRasterizer(layers));
}
« no previous file with comments | « src/effects/SkLayerDrawLooper.cpp ('k') | tests/BlurTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698