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 9d4c8239f2fc8da3613e63036ab23b72c846173e..44cbfa0b1d6dd760351c56db119a3798b4f9de4f 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 10ff95cee6edd42af014f2d38a6b9a3b74a6f843..d7b3032227dd94698236876dfb43e767ca3566d6 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 90fd59b585b6d9acde121aa18c714f313d795a2c..9b7bdca3f4b7fb198ff0d4ec1949144d17aac055 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) {