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

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

Issue 138013009: Culling API (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Updated per comments. Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « src/core/SkPicturePlayback.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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 void fillRestoreOffsetPlaceholdersForCurrentStackLevel(uint32_t restoreOffse t); 113 void fillRestoreOffsetPlaceholdersForCurrentStackLevel(uint32_t restoreOffse t);
114 114
115 #ifndef SK_COLLAPSE_MATRIX_CLIP_STATE 115 #ifndef SK_COLLAPSE_MATRIX_CLIP_STATE
116 SkTDArray<int32_t> fRestoreOffsetStack; 116 SkTDArray<int32_t> fRestoreOffsetStack;
117 int fFirstSavedLayerIndex; 117 int fFirstSavedLayerIndex;
118 enum { 118 enum {
119 kNoSavedLayerIndex = -1 119 kNoSavedLayerIndex = -1
120 }; 120 };
121 #endif 121 #endif
122 122
123 SkTDArray<uint32_t> fCullOffsetStack;
124
123 /* 125 /*
124 * Write the 'drawType' operation and chunk size to the skp. 'size' 126 * Write the 'drawType' operation and chunk size to the skp. 'size'
125 * can potentially be increased if the chunk size needs its own storage 127 * can potentially be increased if the chunk size needs its own storage
126 * location (i.e., it overflows 24 bits). 128 * location (i.e., it overflows 24 bits).
127 * Returns the start offset of the chunk. This is the location at which 129 * Returns the start offset of the chunk. This is the location at which
128 * the opcode & size are stored. 130 * the opcode & size are stored.
129 * TODO: since we are handing the size into here we could call reserve 131 * TODO: since we are handing the size into here we could call reserve
130 * and then return a pointer to the memory storage. This could decrease 132 * and then return a pointer to the memory storage. This could decrease
131 * allocation overhead but could lead to more wasted space (the tail 133 * allocation overhead but could lead to more wasted space (the tail
132 * end of blocks could go unused). Possibly add a second addDraw that 134 * end of blocks could go unused). Possibly add a second addDraw that
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 SkASSERT(fWriter.bytesWritten() == initialOffset + size); 218 SkASSERT(fWriter.bytesWritten() == initialOffset + size);
217 } 219 }
218 #endif 220 #endif
219 221
220 protected: 222 protected:
221 virtual SkSurface* onNewSurface(const SkImageInfo&) SK_OVERRIDE; 223 virtual SkSurface* onNewSurface(const SkImageInfo&) SK_OVERRIDE;
222 const void* onPeekPixels(SkImageInfo*, size_t*) SK_OVERRIDE { 224 const void* onPeekPixels(SkImageInfo*, size_t*) SK_OVERRIDE {
223 return NULL; 225 return NULL;
224 } 226 }
225 virtual void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&) SK _OVERRIDE; 227 virtual void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&) SK _OVERRIDE;
228 virtual void onPushCull(const SkRect&) SK_OVERRIDE;
229 virtual void onPopCull() SK_OVERRIDE;
226 230
227 // Return fontmetrics.fTop,fBottom in topbot[0,1], after they have been 231 // Return fontmetrics.fTop,fBottom in topbot[0,1], after they have been
228 // tweaked by paint.computeFastBounds(). 232 // tweaked by paint.computeFastBounds().
229 static void ComputeFontMetricsTopBottom(const SkPaint& paint, SkScalar topbo t[2]); 233 static void ComputeFontMetricsTopBottom(const SkPaint& paint, SkScalar topbo t[2]);
230 234
231 // Make sure that flat has fTopBot written. 235 // Make sure that flat has fTopBot written.
232 static void WriteTopBot(const SkPaint& paint, const SkFlatData& flat) { 236 static void WriteTopBot(const SkPaint& paint, const SkFlatData& flat) {
233 if (!flat.isTopBotWritten()) { 237 if (!flat.isTopBotWritten()) {
234 ComputeFontMetricsTopBottom(paint, flat.writableTopBot()); 238 ComputeFontMetricsTopBottom(paint, flat.writableTopBot());
235 SkASSERT(flat.isTopBotWritten()); 239 SkASSERT(flat.isTopBotWritten());
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 friend class SkPictureTester; // for unit testing 292 friend class SkPictureTester; // for unit testing
289 293
290 #ifdef SK_COLLAPSE_MATRIX_CLIP_STATE 294 #ifdef SK_COLLAPSE_MATRIX_CLIP_STATE
291 SkMatrixClipStateMgr fMCMgr; 295 SkMatrixClipStateMgr fMCMgr;
292 #endif 296 #endif
293 297
294 typedef SkCanvas INHERITED; 298 typedef SkCanvas INHERITED;
295 }; 299 };
296 300
297 #endif 301 #endif
OLDNEW
« no previous file with comments | « src/core/SkPicturePlayback.cpp ('k') | src/core/SkPictureRecord.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698