sizeof(fGenID) + sizeof(fWidth) + sizeof(fHeight) + sizeof(fBounds));
}
+ void dump() const {
+ SkDebugf("-- add [%d %d] %d [%d %d %d %d]\n", fWidth, fHeight, fGenID,
+ fBounds.x(), fBounds.y(), fBounds.width(), fBounds.height());
+ }
+
const uint32_t fGenID;
const int fWidth;
const int fHeight;
const SkBitmap& result)
: fKey(genID, width, height, bounds)
, fBitmap(result)
- {}
+ {
+#ifdef TRACE_NEW_BITMAP_CACHE_RECS
+ fKey.dump();
+#endif
+ }
const Key& getKey() const override { return fKey; }
size_t bytesUsed() const override { return sizeof(fKey) + fBitmap.getSize(); }
return true;
}
+// Note, this returns a new, mutable, bitmap, with a new genID.
+// If you want the immutable bitmap with the same ID as our cacherator, call tryLockAsBitmap()
+//
bool SkImageCacherator::generateBitmap(SkBitmap* bitmap) {
ScopedGenerator generator(this);
const SkImageInfo& genInfo = generator->getInfo();
// 5. Ask the generator to return RGB(A) data, which the GPU can convert
SkBitmap bitmap;
- if (this->generateBitmap(&bitmap)) {
+ if (this->tryLockAsBitmap(&bitmap)) {
return GrRefCachedBitmapTexture(ctx, bitmap, usage);
}
#endif