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

Unified Diff: src/gpu/SkGr.cpp

Issue 15035004: SkGpuDevice: Delay locking bitmap pixels until we have a known texture cache miss. (Closed) Base URL: http://skia.googlecode.com/svn/trunk
Patch Set: fix whitespace Created 7 years, 7 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/gpu/SkGpuDevice.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/SkGr.cpp
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp
index d76a34a1cf76660946a89f9f9c927b229447e00b..1a330344a7c5ebe839154633dca443bf130a7ac9 100644
--- a/src/gpu/SkGr.cpp
+++ b/src/gpu/SkGr.cpp
@@ -24,7 +24,7 @@
static void build_compressed_data(void* buffer, const SkBitmap& bitmap) {
SkASSERT(SkBitmap::kIndex8_Config == bitmap.config());
- SkAutoLockPixels apl(bitmap);
+ SkAutoLockPixels alp(bitmap);
if (!bitmap.readyToDraw()) {
SkDEBUGFAIL("bitmap not ready to draw!");
return;
@@ -135,6 +135,10 @@ static GrTexture* sk_gr_create_bitmap_texture(GrContext* ctx,
}
}
+ SkAutoLockPixels alp(*bitmap);
+ if (!bitmap->readyToDraw()) {
+ return NULL;
+ }
if (cache) {
// This texture is likely to be used again so leave it in the cache
GrCacheID cacheID;
« no previous file with comments | « src/gpu/SkGpuDevice.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698