Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(96)

Side by Side Diff: src/core/SkPictureRecord.h

Issue 435093003: Keep track of the number of skia operations (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fixed the return type of numOperations Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/core/SkPictureData.cpp ('k') | src/core/SkPictureRecord.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/core/SkPictureData.cpp ('k') | src/core/SkPictureRecord.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698