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

Unified Diff: src/core/SkImageCacherator.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 | « src/core/SkBitmapCache.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkImageCacherator.cpp
diff --git a/src/core/SkImageCacherator.cpp b/src/core/SkImageCacherator.cpp
index bdcd64f56ddedd896ea6d3f5a66274d6f2468b0f..9b7cf25bf42f28c45241612c4cb5c8682adf8b52 100644
--- a/src/core/SkImageCacherator.cpp
+++ b/src/core/SkImageCacherator.cpp
@@ -70,6 +70,9 @@ static bool check_output_bitmap(const SkBitmap& bitmap, uint32_t expectedID) {
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()
tomhudson 2015/09/14 17:31:45 Is there some way we could change the names of the
+//
bool SkImageCacherator::generateBitmap(SkBitmap* bitmap) {
ScopedGenerator generator(this);
const SkImageInfo& genInfo = generator->getInfo();
@@ -256,7 +259,7 @@ GrTexture* SkImageCacherator::lockAsTexture(GrContext* ctx, SkImageUsageType usa
// 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
« no previous file with comments | « src/core/SkBitmapCache.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698