Index: src/core/SkPictureRecord.cpp |
=================================================================== |
--- src/core/SkPictureRecord.cpp (revision 14172) |
+++ src/core/SkPictureRecord.cpp (working copy) |
@@ -11,7 +11,6 @@ |
#include "SkRRect.h" |
#include "SkBBoxHierarchy.h" |
#include "SkDevice.h" |
-#include "SkOffsetTable.h" |
#include "SkPictureStateTree.h" |
#define HEAP_BLOCK_SIZE 4096 |
@@ -1098,11 +1097,10 @@ |
size_t initialOffset = this->addDraw(DRAW_BITMAP, &size); |
SkASSERT(initialOffset+getPaintOffset(DRAW_BITMAP, size) == fWriter.bytesWritten()); |
this->addPaintPtr(paint); |
- int bitmapID = this->addBitmap(bitmap); |
+ this->addBitmap(bitmap); |
this->addScalar(left); |
this->addScalar(top); |
this->validate(initialOffset, size); |
- this->trackBitmapUse(bitmapID, initialOffset); |
} |
void SkPictureRecord::drawBitmapRectToRect(const SkBitmap& bitmap, const SkRect* src, |
@@ -1126,12 +1124,11 @@ |
SkASSERT(initialOffset+getPaintOffset(DRAW_BITMAP_RECT_TO_RECT, size) |
== fWriter.bytesWritten()); |
this->addPaintPtr(paint); |
- int bitmapID = this->addBitmap(bitmap); |
+ this->addBitmap(bitmap); |
this->addRectPtr(src); // may be null |
this->addRect(dst); |
this->addInt(flags); |
this->validate(initialOffset, size); |
- this->trackBitmapUse(bitmapID, initialOffset); |
} |
void SkPictureRecord::drawBitmapMatrix(const SkBitmap& bitmap, const SkMatrix& matrix, |
@@ -1149,10 +1146,9 @@ |
size_t initialOffset = this->addDraw(DRAW_BITMAP_MATRIX, &size); |
SkASSERT(initialOffset+getPaintOffset(DRAW_BITMAP_MATRIX, size) == fWriter.bytesWritten()); |
this->addPaintPtr(paint); |
- int bitmapID = this->addBitmap(bitmap); |
+ this->addBitmap(bitmap); |
this->addMatrix(matrix); |
this->validate(initialOffset, size); |
- this->trackBitmapUse(bitmapID, initialOffset); |
} |
void SkPictureRecord::drawBitmapNine(const SkBitmap& bitmap, const SkIRect& center, |
@@ -1170,11 +1166,10 @@ |
size_t initialOffset = this->addDraw(DRAW_BITMAP_NINE, &size); |
SkASSERT(initialOffset+getPaintOffset(DRAW_BITMAP_NINE, size) == fWriter.bytesWritten()); |
this->addPaintPtr(paint); |
- int bitmapID = this->addBitmap(bitmap); |
+ this->addBitmap(bitmap); |
this->addIRect(center); |
this->addRect(dst); |
this->validate(initialOffset, size); |
- this->trackBitmapUse(bitmapID, initialOffset); |
} |
void SkPictureRecord::drawSprite(const SkBitmap& bitmap, int left, int top, |
@@ -1192,11 +1187,10 @@ |
size_t initialOffset = this->addDraw(DRAW_SPRITE, &size); |
SkASSERT(initialOffset+getPaintOffset(DRAW_SPRITE, size) == fWriter.bytesWritten()); |
this->addPaintPtr(paint); |
- int bitmapID = this->addBitmap(bitmap); |
+ this->addBitmap(bitmap); |
this->addInt(left); |
this->addInt(top); |
this->validate(initialOffset, size); |
- this->trackBitmapUse(bitmapID, initialOffset); |
} |
void SkPictureRecord::ComputeFontMetricsTopBottom(const SkPaint& paint, SkScalar topbot[2]) { |
@@ -1573,26 +1567,6 @@ |
return NULL; |
} |
-void SkPictureRecord::trackBitmapUse(int bitmapID, size_t offset) { |
-#ifndef SK_ALLOW_BITMAP_TRACKING |
- return; |
-#endif |
- |
- if (!(fRecordFlags & SkPicture::kOptimizeForClippedPlayback_RecordingFlag)) { |
- return; |
- } |
- |
- if (SkBitmapHeap::INVALID_SLOT == bitmapID) { |
- return; |
- } |
- |
- if (NULL == fBitmapUseOffsets) { |
- fBitmapUseOffsets.reset(SkNEW(SkOffsetTable)); |
- } |
- |
- fBitmapUseOffsets->add(bitmapID, offset); |
-} |
- |
int SkPictureRecord::addBitmap(const SkBitmap& bitmap) { |
const int index = fBitmapHeap->insert(bitmap); |
// In debug builds, a bad return value from insert() will crash, allowing for debugging. In |