diff options
author | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-03-20 20:25:14 +0000 |
---|---|---|
committer | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-03-20 20:25:14 +0000 |
commit | 520cf8b33e788268432c6314c52dfcef22e776ae (patch) | |
tree | e7a9800dbd94bf5eaf8b3abd3d1740d4f3c28a0d /include | |
parent | 933e65d914eb86b1fbbf8ea9cf1da58ac7c42500 (diff) |
Fix cull nesting assertion.
Cull rects are in local coordinates and cannot be compared directly.
No wonder it was so hard enforcing this in Blink :o
This moves the validation logic into SkCanvas, using a device-space
cull stack (debug build only).
There are still some Blink bugs causing violations, so for now I'd like
to keep this as an error message only.
R=reed@google.com, robertphillips@google.com
Author: fmalita@chromium.org
Review URL: https://codereview.chromium.org/200923008
git-svn-id: http://skia.googlecode.com/svn/trunk@13885 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include')
-rw-r--r-- | include/core/SkCanvas.h | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h index fa433b38b7..f5d4fe63cf 100644 --- a/include/core/SkCanvas.h +++ b/include/core/SkCanvas.h @@ -1063,20 +1063,13 @@ public: * is not enforced, but the information might be used to quick-reject command blocks, * so an incorrect bounding box may result in incomplete rendering. */ - void pushCull(const SkRect& cullRect) { - ++fCullCount; - this->onPushCull(cullRect); - } + void pushCull(const SkRect& cullRect); /** * Terminates the current culling block, and restores the previous one (if any). */ - void popCull() { - if (fCullCount > 0) { - --fCullCount; - this->onPopCull(); - } - } + void popCull(); + ////////////////////////////////////////////////////////////////////////// /** Get the current bounder object. @@ -1394,6 +1387,9 @@ private: }; #ifdef SK_DEBUG + // The cull stack rects are in device-space + SkTDArray<SkIRect> fCullStack; + void validateCull(const SkIRect&); void validateClip() const; #else void validateClip() const {} |