Chromium Code Reviews| 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); |
| } |