diff options
author | 2017-03-03 13:58:10 -0500 | |
---|---|---|
committer | 2017-03-03 19:39:43 +0000 | |
commit | cfaa63237b152ae216f1351207bce3ea9808814c (patch) | |
tree | 4812b9bc5f6c8908ec2de778ef31c1447bc181a6 /src/utils | |
parent | b7115c68baef47b88f70b14d408e6cf5fab523f7 (diff) |
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 <bsalomon@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'src/utils')
-rw-r--r-- | src/utils/SkCanvasStateUtils.cpp | 30 |
1 files changed, 4 insertions, 26 deletions
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++; } |