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 #ifndef SkPictureRecord_DEFINED | 8 #ifndef SkPictureRecord_DEFINED |
9 #define SkPictureRecord_DEFINED | 9 #define SkPictureRecord_DEFINED |
10 | 10 |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 * TODO: since we are handing the size into here we could call reserve | 138 * TODO: since we are handing the size into here we could call reserve |
139 * and then return a pointer to the memory storage. This could decrease | 139 * and then return a pointer to the memory storage. This could decrease |
140 * allocation overhead but could lead to more wasted space (the tail | 140 * allocation overhead but could lead to more wasted space (the tail |
141 * end of blocks could go unused). Possibly add a second addDraw that | 141 * end of blocks could go unused). Possibly add a second addDraw that |
142 * operates in this manner. | 142 * operates in this manner. |
143 */ | 143 */ |
144 size_t addDraw(DrawType drawType, size_t* size) { | 144 size_t addDraw(DrawType drawType, size_t* size) { |
145 size_t offset = fWriter.bytesWritten(); | 145 size_t offset = fWriter.bytesWritten(); |
146 | 146 |
147 this->predrawNotify(); | 147 this->predrawNotify(); |
| 148 fContentInfo.addOperation(); |
148 | 149 |
149 #ifdef SK_DEBUG_TRACE | 150 #ifdef SK_DEBUG_TRACE |
150 SkDebugf("add %s\n", DrawTypeToString(drawType)); | 151 SkDebugf("add %s\n", DrawTypeToString(drawType)); |
151 #endif | 152 #endif |
152 | 153 |
153 SkASSERT(0 != *size); | 154 SkASSERT(0 != *size); |
154 SkASSERT(((uint8_t) drawType) == drawType); | 155 SkASSERT(((uint8_t) drawType) == drawType); |
155 | 156 |
156 if (0 != (*size & ~MASK_24) || *size == MASK_24) { | 157 if (0 != (*size & ~MASK_24) || *size == MASK_24) { |
157 fWriter.writeInt(PACK_8_24(drawType, MASK_24)); | 158 fWriter.writeInt(PACK_8_24(drawType, MASK_24)); |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 friend class SkPictureTester; // for unit testing | 330 friend class SkPictureTester; // for unit testing |
330 | 331 |
331 #ifdef SK_COLLAPSE_MATRIX_CLIP_STATE | 332 #ifdef SK_COLLAPSE_MATRIX_CLIP_STATE |
332 SkMatrixClipStateMgr fMCMgr; | 333 SkMatrixClipStateMgr fMCMgr; |
333 #endif | 334 #endif |
334 | 335 |
335 typedef SkCanvas INHERITED; | 336 typedef SkCanvas INHERITED; |
336 }; | 337 }; |
337 | 338 |
338 #endif | 339 #endif |
OLD | NEW |