diff options
author | junov@chromium.org <junov@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-12-13 16:30:39 +0000 |
---|---|---|
committer | junov@chromium.org <junov@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-12-13 16:30:39 +0000 |
commit | 8f0ca06ef44f7b94da549fbb0c5fab27092c5116 (patch) | |
tree | 7a1692d8a09170aaa07e42806ecec3776dc332ee /src/utils | |
parent | 9973a8a396957afb66c9ba5ee40f829770619ce3 (diff) |
Fixing clip region test in deferred canvas, used to determine whether a draw operation occludes the entire canvas.
BUG=http://code.google.com/p/chromium/issues/detail?id=164580
TEST=unit test DeferredCanvas/TestDeferredCanvasFreshFrame
Review URL: https://codereview.appspot.com/6934045
git-svn-id: http://skia.googlecode.com/svn/trunk@6780 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/utils')
-rw-r--r-- | src/utils/SkDeferredCanvas.cpp | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/src/utils/SkDeferredCanvas.cpp b/src/utils/SkDeferredCanvas.cpp index b0033dfd09..a1e32bc373 100644 --- a/src/utils/SkDeferredCanvas.cpp +++ b/src/utils/SkDeferredCanvas.cpp @@ -684,25 +684,8 @@ bool SkDeferredCanvas::isFullFrame(const SkRect* rect, } } - switch (canvas->getClipType()) { - case SkCanvas::kRect_ClipType : - { - SkIRect bounds; - canvas->getClipDeviceBounds(&bounds); - if (bounds.fLeft > 0 || bounds.fTop > 0 || - bounds.fRight < canvasSize.fWidth || - bounds.fBottom < canvasSize.fHeight) - return false; - } - break; - case SkCanvas::kComplex_ClipType : - return false; // conservative - case SkCanvas::kEmpty_ClipType: - default: - break; - }; - - return true; + return this->getClipStack()->quickContains(SkRect::MakeXYWH(0, 0, + SkIntToScalar(canvasSize.fWidth), SkIntToScalar(canvasSize.fHeight))); } int SkDeferredCanvas::save(SaveFlags flags) { |