| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "SkPictureRecord.h" | 8 #include "SkPictureRecord.h" |
| 9 #include "SkTSearch.h" | 9 #include "SkTSearch.h" |
| 10 #include "SkPixelRef.h" | 10 #include "SkPixelRef.h" |
| (...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 591 // turned on permanently. | 591 // turned on permanently. |
| 592 #if 0 | 592 #if 0 |
| 593 SkASSERT(fRestoreOffsetStack.count() > 1); | 593 SkASSERT(fRestoreOffsetStack.count() > 1); |
| 594 #endif | 594 #endif |
| 595 | 595 |
| 596 #ifdef SK_COLLAPSE_MATRIX_CLIP_STATE | 596 #ifdef SK_COLLAPSE_MATRIX_CLIP_STATE |
| 597 if (fMCMgr.getSaveCount() == 1) { | 597 if (fMCMgr.getSaveCount() == 1) { |
| 598 return; | 598 return; |
| 599 } | 599 } |
| 600 | 600 |
| 601 // TODO: don't write the restore to the op stream for normal saves | |
| 602 fMCMgr.restore(); | 601 fMCMgr.restore(); |
| 603 #else | 602 #else |
| 604 // check for underflow | 603 // check for underflow |
| 605 if (fRestoreOffsetStack.count() == 0) { | 604 if (fRestoreOffsetStack.count() == 0) { |
| 606 return; | 605 return; |
| 607 } | 606 } |
| 608 | 607 |
| 609 if (fRestoreOffsetStack.count() == fFirstSavedLayerIndex) { | 608 if (fRestoreOffsetStack.count() == fFirstSavedLayerIndex) { |
| 610 fFirstSavedLayerIndex = kNoSavedLayerIndex; | 609 fFirstSavedLayerIndex = kNoSavedLayerIndex; |
| 611 } | 610 } |
| (...skipping 1161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1773 void SkPictureRecord::validateRegions() const { | 1772 void SkPictureRecord::validateRegions() const { |
| 1774 int count = fRegions.count(); | 1773 int count = fRegions.count(); |
| 1775 SkASSERT((unsigned) count < 0x1000); | 1774 SkASSERT((unsigned) count < 0x1000); |
| 1776 for (int index = 0; index < count; index++) { | 1775 for (int index = 0; index < count; index++) { |
| 1777 const SkFlatData* region = fRegions[index]; | 1776 const SkFlatData* region = fRegions[index]; |
| 1778 SkASSERT(region); | 1777 SkASSERT(region); |
| 1779 // region->validate(); | 1778 // region->validate(); |
| 1780 } | 1779 } |
| 1781 } | 1780 } |
| 1782 #endif | 1781 #endif |
| OLD | NEW |