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
diff --git a/samplecode/SamplePathEffects.cpp b/samplecode/SamplePathEffects.cpp
index 2a1a49b..9af0abb 100644
--- a/samplecode/SamplePathEffects.cpp
+++ b/samplecode/SamplePathEffects.cpp
@@ -74,9 +74,9 @@
 #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 @@
 
         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);
     }