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 |