Factory methods for heap-allocated SkPathEffect and SkXfermode objects.

This is part of an effort to ensure that all SkPaint effects can only be
allocated on the heap.

This patch makes the constructors of SkPathEffect, SkXfermode and
their subclasses non-public and instead provides factory methods for
creating these objects on the heap. We temporarily keep the constructors
of the following classes public to not break Chrome/Blink:

SkXfermode
SkCornerPathEffect
SkDashPathEffect

BUG=skia:2187
R=scroggo@google.com, reed@google.com, mtklein@google.com, bungeman@google.com

Author: dominikg@chromium.org

Review URL: https://codereview.chromium.org/166583002

git-svn-id: http://skia.googlecode.com/svn/trunk@13519 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/include/effects/Sk1DPathEffect.h b/include/effects/Sk1DPathEffect.h
index 4ac8f73..ce49460 100644
--- a/include/effects/Sk1DPathEffect.h
+++ b/include/effects/Sk1DPathEffect.h
@@ -52,7 +52,10 @@
         @param style how to transform path at each point (based on the current
                      position and tangent)
     */
-    SkPath1DPathEffect(const SkPath& path, SkScalar advance, SkScalar phase, Style);
+    static SkPath1DPathEffect* Create(const SkPath& path, SkScalar advance, SkScalar phase,
+                                      Style style) {
+        return SkNEW_ARGS(SkPath1DPathEffect, (path, advance, phase, style));
+    }
 
     virtual bool filterPath(SkPath*, const SkPath&,
                             SkStrokeRec*, const SkRect*) const SK_OVERRIDE;
@@ -67,6 +70,11 @@
     virtual SkScalar begin(SkScalar contourLength) const SK_OVERRIDE;
     virtual SkScalar next(SkPath*, SkScalar, SkPathMeasure&) const SK_OVERRIDE;
 
+#ifdef SK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS
+public:
+#endif
+    SkPath1DPathEffect(const SkPath& path, SkScalar advance, SkScalar phase, Style);
+
 private:
     SkPath      fPath;          // copied from constructor
     SkScalar    fAdvance;       // copied from constructor