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

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;
/*
* Write the 'drawType' operation and chunk size to the skp. 'size'
@@ -133,10 +135,8 @@
#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;
@@ -144,10 +144,14 @@
} else {
fWriter.writeInt(PACK_8_24(drawType, *size));
}
-
+ fLastDrawRejected = false;
return offset;
}
+ uint32_t addDrawWithBounds(DrawType drawType, uint32_t* size, const SkPaint* paint,
+ const SkRect* localBounds);
+ bool recordBounds() const { return fRecordFlags & SkPicture::kRecordBounds_RecordingFlag; }
+
void addInt(int value) {
fWriter.writeInt(value);
}
@@ -219,6 +223,7 @@
// Allocated in the constructor and managed by this class.
SkBitmapHeap* fBitmapHeap;
+ bool fLastDrawRejected;
private:
SkChunkFlatController fFlattenableHeap;

Powered by Google App Engine
This is Rietveld 408576698