aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkPictureRecord.cpp
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-03-20 20:25:14 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-03-20 20:25:14 +0000
commit520cf8b33e788268432c6314c52dfcef22e776ae (patch)
treee7a9800dbd94bf5eaf8b3abd3d1740d4f3c28a0d /src/core/SkPictureRecord.cpp
parent933e65d914eb86b1fbbf8ea9cf1da58ac7c42500 (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 'src/core/SkPictureRecord.cpp')
-rw-r--r--src/core/SkPictureRecord.cpp17
1 files changed, 0 insertions, 17 deletions
diff --git a/src/core/SkPictureRecord.cpp b/src/core/SkPictureRecord.cpp
index 55670baa73..ce21d955dd 100644
--- a/src/core/SkPictureRecord.cpp
+++ b/src/core/SkPictureRecord.cpp
@@ -1559,18 +1559,6 @@ void SkPictureRecord::endCommentGroup() {
// [op/size] [rect] [skip offset]
static const uint32_t kPushCullOpSize = 2 * kUInt32Size + sizeof(SkRect);
void SkPictureRecord::onPushCull(const SkRect& cullRect) {
- // Skip identical cull rects.
- if (!fCullOffsetStack.isEmpty()) {
- const SkRect& prevCull = fWriter.readTAt<SkRect>(fCullOffsetStack.top() - sizeof(SkRect));
- if (prevCull == cullRect) {
- // Skipped culls are tracked on the stack, but they point to the previous offset.
- fCullOffsetStack.push(fCullOffsetStack.top());
- return;
- }
-
- SkASSERT(prevCull.contains(cullRect));
- }
-
uint32_t size = kPushCullOpSize;
size_t initialOffset = this->addDraw(PUSH_CULL, &size);
// PUSH_CULL's size should stay constant (used to rewind).
@@ -1588,11 +1576,6 @@ void SkPictureRecord::onPopCull() {
uint32_t cullSkipOffset = fCullOffsetStack.top();
fCullOffsetStack.pop();
- // Skipped push, do the same for pop.
- if (!fCullOffsetStack.isEmpty() && cullSkipOffset == fCullOffsetStack.top()) {
- return;
- }
-
// Collapse empty push/pop pairs.
if ((size_t)(cullSkipOffset + kUInt32Size) == fWriter.bytesWritten()) {
SkASSERT(fWriter.bytesWritten() >= kPushCullOpSize);