From 520cf8b33e788268432c6314c52dfcef22e776ae Mon Sep 17 00:00:00 2001 From: "commit-bot@chromium.org" Date: Thu, 20 Mar 2014 20:25:14 +0000 Subject: 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 --- include/core/SkCanvas.h | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'include') 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 fCullStack; + void validateCull(const SkIRect&); void validateClip() const; #else void validateClip() const {} -- cgit v1.2.3