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

Unified Diff: src/core/SkBitmapCache.cpp

Issue 1338373002: be sure to use cached bitmap when we need to upload something to make a texture (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 3 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
« no previous file with comments | « no previous file | src/core/SkImageCacherator.cpp » ('j') | src/core/SkImageCacherator.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkBitmapCache.cpp
diff --git a/src/core/SkBitmapCache.cpp b/src/core/SkBitmapCache.cpp
index 9f985e5a3edb311f8f190adfb42a6df69660f7b0..dfa387bb3992e351dd5eba4aa1495c075a98ca3d 100644
--- a/src/core/SkBitmapCache.cpp
+++ b/src/core/SkBitmapCache.cpp
@@ -58,6 +58,11 @@ public:
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;
@@ -69,7 +74,11 @@ struct BitmapRec : public SkResourceCache::Rec {
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(); }
« no previous file with comments | « no previous file | src/core/SkImageCacherator.cpp » ('j') | src/core/SkImageCacherator.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698