diff options
| author | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-02-26 13:27:37 +0000 |
|---|---|---|
| committer | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-02-26 13:27:37 +0000 |
| commit | f792a1b20747f769b28906a4b00fd67691ce8d0b (patch) | |
| tree | 4c953a1345dbea2eb0ea01f85f6c1ae93ab86636 /samplecode/SamplePathEffects.cpp | |
| parent | e600c3268e6f21545a3be4964e23c056e00ffb2f (diff) | |
Builder class for SkLayerRasterizer.
Provide builder class to make SkLayerRasterizer immutable. We have to keep the
addLayer() methods for now because they are used in Chrome. They will be removed
once this changed has been rolled into Chrome.
An added benefit of this is that this class can only be allocated on the heap.
BUG=skia:2187
R=reed@google.com, scroggo@google.com, mtklein@google.com
Author: dominikg@chromium.org
Review URL: https://codereview.chromium.org/176873004
git-svn-id: http://skia.googlecode.com/svn/trunk@13590 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'samplecode/SamplePathEffects.cpp')
| -rw-r--r-- | samplecode/SamplePathEffects.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/samplecode/SamplePathEffects.cpp b/samplecode/SamplePathEffects.cpp index 2a1a49b949..9af0abb59a 100644 --- a/samplecode/SamplePathEffects.cpp +++ b/samplecode/SamplePathEffects.cpp @@ -74,9 +74,9 @@ static SkPathEffect* make_warp_pe() { #include "SkColorFilter.h" #include "SkLayerRasterizer.h" -class testrast : public SkLayerRasterizer { +class TestRastBuilder : public SkLayerRasterizer::Builder { public: - testrast() { + TestRastBuilder() { SkPaint paint; paint.setAntiAlias(true); @@ -177,7 +177,8 @@ protected: paint.setARGB(0xFF, 0, 0, 0); paint.setPathEffect(make_warp_pe())->unref(); - paint.setRasterizer(new testrast)->unref(); + TestRastBuilder testRastBuilder; + paint.setRasterizer(testRastBuilder.detachRasterizer())->unref(); canvas->drawPath(fPath, paint); } |
