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

Unified Diff: samplecode/ClockFaceView.cpp

Issue 176873004: Builder class for SkLayerRasterizer. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Make ReadLayers private Created 6 years, 10 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 | « include/effects/SkLayerRasterizer.h ('k') | samplecode/SampleAll.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/ClockFaceView.cpp
diff --git a/samplecode/ClockFaceView.cpp b/samplecode/ClockFaceView.cpp
index ed0bce9b663ccdfc85064135be1d3cbb9ddefc38..a887cc67fd084774c5129aa7fb20ea1c21f32d67 100644
--- a/samplecode/ClockFaceView.cpp
+++ b/samplecode/ClockFaceView.cpp
@@ -133,15 +133,15 @@ static SkPathEffect* makepe(float interp, SkTDArray<SkPoint>* pts) {
return new Dot2DPathEffect(rad, lattice, pts);
}
-static void r7(SkLayerRasterizer* rast, SkPaint& p, SkScalar interp) {
+static void r7(SkLayerRasterizer::Builder* rastBuilder, SkPaint& p, SkScalar interp) {
p.setPathEffect(makepe(SkScalarToFloat(interp), NULL))->unref();
- rast->addLayer(p);
+ rastBuilder->addLayer(p);
#if 0
p.setPathEffect(new InverseFillPE())->unref();
p.setXfermodeMode(SkXfermode::kSrcIn_Mode);
p.setXfermodeMode(SkXfermode::kClear_Mode);
p.setAlpha((1 - interp) * 255);
- rast->addLayer(p);
+ rastBuilder->addLayer(p);
#endif
}
@@ -152,11 +152,11 @@ typedef void (*raster_proc)(SkLayerRasterizer*, SkPaint&);
static void apply_shader(SkPaint* paint, float scale)
{
SkPaint p;
- SkLayerRasterizer* rast = new SkLayerRasterizer;
+ SkLayerRasterizer::Builder rastBuilder;
p.setAntiAlias(true);
- r7(rast, p, scale);
- paint->setRasterizer(rast)->unref();
+ r7(&rastBuilder, p, scale);
+ paint->setRasterizer(rastBuilder.detachRasterizer())->unref();
paint->setColor(SK_ColorBLUE);
}
« no previous file with comments | « include/effects/SkLayerRasterizer.h ('k') | samplecode/SampleAll.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698