Remove use of SK_SUPPORT_LEGACY_LAYERRASTERIZER_API.
authordominikg <dominikg@chromium.org>
Mon, 21 Jul 2014 09:43:20 +0000 (02:43 -0700)
committerCommit bot <commit-bot@chromium.org>
Mon, 21 Jul 2014 09:43:20 +0000 (02:43 -0700)
Mozilla have removed any uses of the legacy API from their Moz2D code.
Since they were the last users we know of, we can remove the legacy API.

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

Author: dominikg@chromium.org

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

include/effects/SkLayerRasterizer.h
src/core/SkPaintPriv.cpp
src/effects/SkLayerRasterizer.cpp

index 9d4c823..44cbfa0 100644 (file)
@@ -64,22 +64,10 @@ public:
         SkDeque* fLayers;
     };
 
-#ifdef SK_SUPPORT_LEGACY_LAYERRASTERIZER_API
-    void addLayer(const SkPaint& paint) {
-        this->addLayer(paint, 0, 0);
-    }
-
-    /**    Add a new layer (above any previous layers) to the rasterizer.
-        The layer will extract those fields that affect the mask from
-        the specified paint, but will not retain a reference to the paint
-        object itself, so it may be reused without danger of side-effects.
-    */
-    void addLayer(const SkPaint& paint, SkScalar dx, SkScalar dy);
-#endif
-
     SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkLayerRasterizer)
 
 protected:
+    SkLayerRasterizer();
     SkLayerRasterizer(SkDeque* layers);
     SkLayerRasterizer(SkReadBuffer&);
     virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
@@ -89,17 +77,8 @@ protected:
                              const SkIRect* clipBounds,
                              SkMask* mask, SkMask::CreateMode mode) const;
 
-#ifdef SK_SUPPORT_LEGACY_LAYERRASTERIZER_API
-public:
-#endif
-    SkLayerRasterizer();
-
 private:
-#ifdef SK_SUPPORT_LEGACY_LAYERRASTERIZER_API
-    SkDeque* fLayers;
-#else
     const SkDeque* const fLayers;
-#endif
 
     static SkDeque* ReadLayers(SkReadBuffer& buffer);
 
index 10ff95c..d7b3032 100644 (file)
@@ -85,10 +85,5 @@ bool NeedsDeepCopy(const SkPaint& paint) {
      *  Eventually we hope this list will be empty, and we can always return
      *  false.
      */
-    return false
-#ifdef SK_SUPPORT_LEGACY_LAYERRASTERIZER_API
-           || paint.getRasterizer()
-#endif
-           || paint.getImageFilter()
-           ;
+    return paint.getImageFilter();
 }
index 90fd59b..9b7bdca 100644 (file)
@@ -50,17 +50,6 @@ SkLayerRasterizer::~SkLayerRasterizer() {
     clean_up_layers(const_cast<SkDeque*>(fLayers));
 }
 
-#ifdef SK_SUPPORT_LEGACY_LAYERRASTERIZER_API
-void SkLayerRasterizer::addLayer(const SkPaint& paint, SkScalar dx,
-                                 SkScalar dy) {
-    SkASSERT(fLayers);
-    SkLayerRasterizer_Rec* rec = (SkLayerRasterizer_Rec*)fLayers->push_back();
-
-    SkNEW_PLACEMENT_ARGS(&rec->fPaint, SkPaint, (paint));
-    rec->fOffset.set(dx, dy);
-}
-#endif
-
 static bool compute_bounds(const SkDeque& layers, const SkPath& path,
                            const SkMatrix& matrix,
                            const SkIRect* clipBounds, SkIRect* bounds) {