| 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 "SkDevice.h" | 9 #include "SkDevice.h" |
| 10 #include "SkImage_Base.h" | 10 #include "SkImage_Base.h" |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 UNPACK_8_24(peek, op, *size); | 202 UNPACK_8_24(peek, op, *size); |
| 203 if (MASK_24 == *size) { | 203 if (MASK_24 == *size) { |
| 204 // size required its own slot right after the op code | 204 // size required its own slot right after the op code |
| 205 *size = writer->readTAt<uint32_t>(offset + kUInt32Size); | 205 *size = writer->readTAt<uint32_t>(offset + kUInt32Size); |
| 206 } | 206 } |
| 207 return (DrawType) op; | 207 return (DrawType) op; |
| 208 } | 208 } |
| 209 #endif//SK_DEBUG | 209 #endif//SK_DEBUG |
| 210 | 210 |
| 211 void SkPictureRecord::willRestore() { | 211 void SkPictureRecord::willRestore() { |
| 212 // FIXME: SkDeferredCanvas needs to be refactored to respect | |
| 213 // save/restore balancing so that the following test can be | |
| 214 // turned on permanently. | |
| 215 #if 0 | 212 #if 0 |
| 216 SkASSERT(fRestoreOffsetStack.count() > 1); | 213 SkASSERT(fRestoreOffsetStack.count() > 1); |
| 217 #endif | 214 #endif |
| 218 | 215 |
| 219 // check for underflow | 216 // check for underflow |
| 220 if (fRestoreOffsetStack.count() == 0) { | 217 if (fRestoreOffsetStack.count() == 0) { |
| 221 return; | 218 return; |
| 222 } | 219 } |
| 223 | 220 |
| 224 this->recordRestore(); | 221 this->recordRestore(); |
| (...skipping 839 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1064 void SkPictureRecord::addTextBlob(const SkTextBlob *blob) { | 1061 void SkPictureRecord::addTextBlob(const SkTextBlob *blob) { |
| 1065 int index = fTextBlobRefs.count(); | 1062 int index = fTextBlobRefs.count(); |
| 1066 *fTextBlobRefs.append() = blob; | 1063 *fTextBlobRefs.append() = blob; |
| 1067 blob->ref(); | 1064 blob->ref(); |
| 1068 // follow the convention of recording a 1-based index | 1065 // follow the convention of recording a 1-based index |
| 1069 this->addInt(index + 1); | 1066 this->addInt(index + 1); |
| 1070 } | 1067 } |
| 1071 | 1068 |
| 1072 /////////////////////////////////////////////////////////////////////////////// | 1069 /////////////////////////////////////////////////////////////////////////////// |
| 1073 | 1070 |
| OLD | NEW |