| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 SkASSERT(kSaveLayerWithBoundsSize == opSize); | 132 SkASSERT(kSaveLayerWithBoundsSize == opSize); |
| 133 return kSaveLayerWithBoundsPaintOffset + overflow; | 133 return kSaveLayerWithBoundsPaintOffset + overflow; |
| 134 } | 134 } |
| 135 } | 135 } |
| 136 | 136 |
| 137 SkASSERT(0 != gPaintOffsets[op]); // really shouldn't be calling this meth
od | 137 SkASSERT(0 != gPaintOffsets[op]); // really shouldn't be calling this meth
od |
| 138 return gPaintOffsets[op] * sizeof(uint32_t) + overflow; | 138 return gPaintOffsets[op] * sizeof(uint32_t) + overflow; |
| 139 } | 139 } |
| 140 | 140 |
| 141 SkDevice* SkPictureRecord::setDevice(SkDevice* device) { | 141 SkDevice* SkPictureRecord::setDevice(SkDevice* device) { |
| 142 SkASSERT(!"eeek, don't try to change the device on a recording canvas"); | 142 SkDEBUGFAIL("eeek, don't try to change the device on a recording canvas"); |
| 143 return this->INHERITED::setDevice(device); | 143 return this->INHERITED::setDevice(device); |
| 144 } | 144 } |
| 145 | 145 |
| 146 int SkPictureRecord::save(SaveFlags flags) { | 146 int SkPictureRecord::save(SaveFlags flags) { |
| 147 // record the offset to us, making it non-positive to distinguish a save | 147 // record the offset to us, making it non-positive to distinguish a save |
| 148 // from a clip entry. | 148 // from a clip entry. |
| 149 fRestoreOffsetStack.push(-(int32_t)fWriter.size()); | 149 fRestoreOffsetStack.push(-(int32_t)fWriter.size()); |
| 150 | 150 |
| 151 // op + flags | 151 // op + flags |
| 152 uint32_t size = kSaveSize; | 152 uint32_t size = kSaveSize; |
| (...skipping 1329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1482 void SkPictureRecord::validateRegions() const { | 1482 void SkPictureRecord::validateRegions() const { |
| 1483 int count = fRegions.count(); | 1483 int count = fRegions.count(); |
| 1484 SkASSERT((unsigned) count < 0x1000); | 1484 SkASSERT((unsigned) count < 0x1000); |
| 1485 for (int index = 0; index < count; index++) { | 1485 for (int index = 0; index < count; index++) { |
| 1486 const SkFlatData* region = fRegions[index]; | 1486 const SkFlatData* region = fRegions[index]; |
| 1487 SkASSERT(region); | 1487 SkASSERT(region); |
| 1488 // region->validate(); | 1488 // region->validate(); |
| 1489 } | 1489 } |
| 1490 } | 1490 } |
| 1491 #endif | 1491 #endif |
| OLD | NEW |