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

Unified Diff: gm/megalooper.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 | « gm/drawlooper.cpp ('k') | gm/rects.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/megalooper.cpp
diff --git a/gm/megalooper.cpp b/gm/megalooper.cpp
index ae92971982860588b0439606fc5672e1f1a705a8..5fe9af298b0d751eb7966b7ec9f3067ab12490a5 100644
--- a/gm/megalooper.cpp
+++ b/gm/megalooper.cpp
@@ -131,7 +131,7 @@ private:
for (int i = 0; i < 4; ++i) {
SkPaint loopPaint;
- loopPaint.setLooper(create1Looper(-kOffsetToOutsideClip, 0, gColors[i]))->unref();
+ loopPaint.setLooper(create1Looper(-kOffsetToOutsideClip, 0, gColors[i]));
loopPaint.setAntiAlias(true);
SkRect outerClip = {
@@ -161,7 +161,7 @@ private:
}
// Create a 1-tier drawlooper
- SkLayerDrawLooper* create1Looper(SkScalar xOff, SkScalar yOff, SkColor color) {
+ sk_sp<SkDrawLooper> create1Looper(SkScalar xOff, SkScalar yOff, SkColor color) {
SkLayerDrawLooper::Builder looperBuilder;
SkLayerDrawLooper::LayerInfo info;
@@ -178,7 +178,7 @@ private:
SkColorFilter* cf = SkColorFilter::CreateModeFilter(color, SkXfermode::kSrcIn_Mode);
paint->setColorFilter(cf)->unref();
- return looperBuilder.detachLooper();
+ return looperBuilder.detach();
}
void draw1x4(SkCanvas* canvas, SkScalar x, SkScalar y) {
@@ -193,7 +193,7 @@ private:
SkPaint paint;
paint.setAntiAlias(true);
- paint.setLooper(create4Looper(-kOffsetToOutsideClip-kHalfSquareSize, 0))->unref();
+ paint.setLooper(create4Looper(-kOffsetToOutsideClip-kHalfSquareSize, 0));
canvas->save();
canvas->clipRect(outerClip, SkRegion::kIntersect_Op);
@@ -205,7 +205,7 @@ private:
}
// Create a 4-tier draw looper
- SkLayerDrawLooper* create4Looper(SkScalar xOff, SkScalar yOff) {
+ sk_sp<SkDrawLooper> create4Looper(SkScalar xOff, SkScalar yOff) {
SkLayerDrawLooper::Builder looperBuilder;
SkLayerDrawLooper::LayerInfo info;
@@ -226,7 +226,7 @@ private:
paint->setColorFilter(cf)->unref();
}
- return looperBuilder.detachLooper();
+ return looperBuilder.detach();
}
typedef GM INHERITED;
« no previous file with comments | « gm/drawlooper.cpp ('k') | gm/rects.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698