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

Unified Diff: src/core/SkPictureRecord.h

Issue 12545009: Adding option in SkPicture to record device-space bounds of draw commands. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
Index: src/core/SkPictureRecord.h
===================================================================
--- src/core/SkPictureRecord.h (revision 8010)
+++ src/core/SkPictureRecord.h (working copy)
@@ -102,6 +102,7 @@
void beginRecording();
void endRecording();
+ static bool canRecordBounds(DrawType op);
private:
void recordRestoreOffsetPlaceholder(SkRegion::Op);
void fillRestoreOffsetPlaceholdersForCurrentStackLevel(
@@ -110,8 +111,9 @@
SkTDArray<int32_t> fRestoreOffsetStack;
int fFirstSavedLayerIndex;
enum {
- kNoSavedLayerIndex = -1
+ kNoSavedLayerIndex = -1,
};
+ static const uint32_t kInvalidOffset = ~0;
/*
robertphillips 2013/03/07 18:37:40 This comment needs enhancing
* Write the 'drawType' operation and chunk size to the skp. 'size'
@@ -125,29 +127,10 @@
* end of blocks could go unused). Possibly add a second addDraw that
* operates in this manner.
*/
- uint32_t addDraw(DrawType drawType, uint32_t* size) {
- uint32_t offset = fWriter.size();
+ uint32_t addDraw(DrawType drawType, uint32_t* size, const SkPaint* paint = NULL,
+ const SkRect* localBounds = NULL);
+ bool recordBounds() const { return fRecordFlags & SkPicture::kRecordBounds_RecordingFlag; }
- this->predrawNotify();
-
- #ifdef SK_DEBUG_TRACE
- SkDebugf("add %s\n", DrawTypeToString(drawType));
- #endif
-
- SkASSERT(0 != *size);
- SkASSERT(((uint8_t) drawType) == drawType);
-
- if (0 != (*size & ~MASK_24) || *size == MASK_24) {
- fWriter.writeInt(PACK_8_24(drawType, MASK_24));
- *size += 1;
- fWriter.writeInt(*size);
- } else {
- fWriter.writeInt(PACK_8_24(drawType, *size));
- }
-
- return offset;
- }
-
void addInt(int value) {
fWriter.writeInt(value);
}

Powered by Google App Engine
This is Rietveld 408576698