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

Unified Diff: samplecode/SampleAll.cpp

Issue 1817543002: Revert of switch patheffects over to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 | « samplecode/ClockFaceView.cpp ('k') | samplecode/SampleFilterFuzz.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SampleAll.cpp
diff --git a/samplecode/SampleAll.cpp b/samplecode/SampleAll.cpp
index 7c0557fc40e4a61a2a0a97fb1c72dde7736771c5..90fc5bdb166778455109cba722d340e92cde1e2d 100644
--- a/samplecode/SampleAll.cpp
+++ b/samplecode/SampleAll.cpp
@@ -141,7 +141,7 @@
static void r5(SkLayerRasterizer::Builder* rastBuilder, SkPaint& p) {
rastBuilder->addLayer(p);
- p.setPathEffect(SkDiscretePathEffect::Make(SK_Scalar1*4, SK_Scalar1*3));
+ p.setPathEffect(SkDiscretePathEffect::Create(SK_Scalar1*4, SK_Scalar1*3))->unref();
p.setXfermodeMode(SkXfermode::kSrcOut_Mode);
rastBuilder->addLayer(p);
}
@@ -184,7 +184,7 @@
SkMatrix lattice;
lattice.setScale(SK_Scalar1*6, SK_Scalar1*6, 0, 0);
lattice.postSkew(SK_Scalar1/3, 0, 0, 0);
- p.setPathEffect(sk_make_sp<Dot2DPathEffect>(SK_Scalar1*4, lattice));
+ p.setPathEffect(new Dot2DPathEffect(SK_Scalar1*4, lattice))->unref();
rastBuilder->addLayer(p);
}
@@ -194,7 +194,7 @@
SkMatrix lattice;
lattice.setScale(SK_Scalar1*6, SK_Scalar1*6, 0, 0);
lattice.postSkew(SK_Scalar1/3, 0, 0, 0);
- p.setPathEffect(sk_make_sp<Dot2DPathEffect>(SK_Scalar1*2, lattice));
+ p.setPathEffect(new Dot2DPathEffect(SK_Scalar1*2, lattice))->unref();
p.setXfermodeMode(SkXfermode::kClear_Mode);
rastBuilder->addLayer(p);
@@ -211,7 +211,7 @@
SkMatrix lattice;
lattice.setScale(SK_Scalar1, SK_Scalar1*6, 0, 0);
lattice.postRotate(SkIntToScalar(30), 0, 0);
- p.setPathEffect(SkLine2DPathEffect::Make(SK_Scalar1*2, lattice));
+ p.setPathEffect(SkLine2DPathEffect::Create(SK_Scalar1*2, lattice))->unref();
p.setXfermodeMode(SkXfermode::kClear_Mode);
rastBuilder->addLayer(p);
@@ -416,7 +416,7 @@
canvas->translate(SkIntToScalar(50), 0);
paint.setColor(SK_ColorYELLOW);
paint.setShader(linear);
- paint.setPathEffect(pathEffectTest());
+ paint.setPathEffect(pathEffectTest())->unref();
canvas->drawRect(rect, paint);
paint.setPathEffect(nullptr);
@@ -481,7 +481,7 @@
return this->INHERITED::onFindClickHandler(x, y, modi);
}
- sk_sp<SkPathEffect> pathEffectTest() {
+ SkPathEffect* pathEffectTest() {
static const int gXY[] = { 1, 0, 0, -1, 2, -1, 3, 0, 2, 1, 0, 1 };
SkScalar gPhase = 0;
SkPath path;
@@ -490,11 +490,14 @@
path.lineTo(SkIntToScalar(gXY[i]), SkIntToScalar(gXY[i+1]));
path.close();
path.offset(SkIntToScalar(-6), 0);
- auto outer = SkPath1DPathEffect::Make(path, SkIntToScalar(12),
+ SkPathEffect* outer = SkPath1DPathEffect::Create(path, SkIntToScalar(12),
gPhase, SkPath1DPathEffect::kRotate_Style);
- auto inner = SkDiscretePathEffect::Make(SkIntToScalar(2),
+ SkPathEffect* inner = SkDiscretePathEffect::Create(SkIntToScalar(2),
SkIntToScalar(1)/10); // SkCornerPathEffect(SkIntToScalar(2));
- return SkComposePathEffect::Make(outer, inner);
+ SkPathEffect* result = SkComposePathEffect::Create(outer, inner);
+ outer->unref();
+ inner->unref();
+ return result;
}
sk_sp<SkShader> shaderTest() {
« no previous file with comments | « samplecode/ClockFaceView.cpp ('k') | samplecode/SampleFilterFuzz.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698