Merge "deprecate replayClips"
diff --git a/libs/hwui/SkiaCanvas.cpp b/libs/hwui/SkiaCanvas.cpp
index c57b1b3..7cab11a 100644
--- a/libs/hwui/SkiaCanvas.cpp
+++ b/libs/hwui/SkiaCanvas.cpp
@@ -73,24 +73,6 @@
// Canvas state operations: Replace Bitmap
// ----------------------------------------------------------------------------
-class ClipCopier : public SkCanvas::ClipVisitor {
-public:
- explicit ClipCopier(SkCanvas* dstCanvas) : m_dstCanvas(dstCanvas) {}
-
- virtual void clipRect(const SkRect& rect, SkClipOp op, bool antialias) {
- m_dstCanvas->clipRect(rect, op, antialias);
- }
- virtual void clipRRect(const SkRRect& rrect, SkClipOp op, bool antialias) {
- m_dstCanvas->clipRRect(rrect, op, antialias);
- }
- virtual void clipPath(const SkPath& path, SkClipOp op, bool antialias) {
- m_dstCanvas->clipPath(path, op, antialias);
- }
-
-private:
- SkCanvas* m_dstCanvas;
-};
-
void SkiaCanvas::setBitmap(const SkBitmap& bitmap) {
SkCanvas* newCanvas = new SkCanvas(bitmap);
@@ -98,8 +80,9 @@
// Copy the canvas matrix & clip state.
newCanvas->setMatrix(mCanvas->getTotalMatrix());
- ClipCopier copier(newCanvas);
- mCanvas->replayClips(&copier);
+ SkRegion rgn;
+ mCanvas->temporary_internal_getRgnClip(&rgn);
+ newCanvas->clipRegion(rgn, SkClipOp::kIntersect);
}
// deletes the previously owned canvas (if any)