From cfaa63237b152ae216f1351207bce3ea9808814c Mon Sep 17 00:00:00 2001 From: Mike Reed Date: Fri, 3 Mar 2017 13:58:10 -0500 Subject: Revert[2] "Remove SkDraw from device-draw methods, and enable device-centric clipping."" passes new (augmented) CanvasClipType unittest fixed rasterclipstack::setnewsize This reverts commit ea5e676a7b75600edcde3912886486004ccd7626. BUG=skia: Change-Id: I004653e0f4d01454662f8516fccab0046486f273 Reviewed-on: https://skia-review.googlesource.com/9185 Reviewed-by: Brian Salomon Commit-Queue: Mike Reed --- src/utils/SkCanvasStateUtils.cpp | 30 ++++-------------------------- 1 file changed, 4 insertions(+), 26 deletions(-) (limited to 'src/utils') diff --git a/src/utils/SkCanvasStateUtils.cpp b/src/utils/SkCanvasStateUtils.cpp index a78f3435a4..0c50bad0f6 100644 --- a/src/utils/SkCanvasStateUtils.cpp +++ b/src/utils/SkCanvasStateUtils.cpp @@ -130,28 +130,6 @@ private: //////////////////////////////////////////////////////////////////////////////// -class ClipValidator : public SkCanvas::ClipVisitor { -public: - ClipValidator() : fFailed(false) {} - bool failed() { return fFailed; } - - // ClipVisitor - void clipRect(const SkRect& rect, SkClipOp op, bool antialias) override { - fFailed |= antialias; - } - - void clipRRect(const SkRRect& rrect, SkClipOp op, bool antialias) override { - fFailed |= antialias; - } - - void clipPath(const SkPath&, SkClipOp, bool antialias) override { - fFailed |= antialias; - } - -private: - bool fFailed; -}; - static void setup_MC_state(SkMCState* state, const SkMatrix& matrix, const SkRegion& clip) { // initialize the struct state->clipRectCount = 0; @@ -193,9 +171,7 @@ SkCanvasState* SkCanvasStateUtils::CaptureCanvasState(SkCanvas* canvas) { SkASSERT(canvas); // Check the clip can be decomposed into rectangles (i.e. no soft clips). - ClipValidator validator; - canvas->replayClips(&validator); - if (validator.failed()) { + if (canvas->androidFramework_isClipAA()) { return nullptr; } @@ -246,7 +222,9 @@ SkCanvasState* SkCanvasStateUtils::CaptureCanvasState(SkCanvas* canvas) { layerState->raster.rowBytes = pmap.rowBytes(); layerState->raster.pixels = pmap.writable_addr(); - setup_MC_state(&layerState->mcState, layer.matrix(), layer.clip().bwRgn()); + SkRegion rgn; + layer.clip(&rgn); + setup_MC_state(&layerState->mcState, layer.matrix(), rgn); layerCount++; } -- cgit v1.2.3