aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/utils
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2017-03-02 11:23:46 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-03-02 18:57:45 +0000
commitc77e33f73d3e86cfabf925d6f2e1166f81022575 (patch)
tree8830c10ea1e9f3295ae9116b90120b3d811290ff /src/utils
parent8e8e817cbf6c6e3df744dbaa070564c453b70a62 (diff)
Remove SkDraw from device-draw methods, and enable device-centric clipping.
BUG=skia:6214 Change-Id: I593900724310d09133ae4791ef68d38c43762fc2 Reviewed-on: https://skia-review.googlesource.com/8806 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.cpp30
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++;
}