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

Unified Diff: src/gpu/SkGr.cpp

Issue 55023005: Partial fix for Skia issue 1769: GenerateGMs crashing (out of memory) (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 2 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 | 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 18c54ef3c251175ba7a9769035b32259c65d770c..c7ae0c8f36684f398043329a4b75e2f0b1bf9e72 100644
--- a/src/gpu/SkGr.cpp
+++ b/src/gpu/SkGr.cpp
@@ -141,7 +141,9 @@ static GrTexture* sk_gr_create_bitmap_texture(GrContext* ctx,
GrResourceKey key;
GrTexture* result = ctx->createTexture(params, desc, cacheID,
storage.get(), bitmap->width(), &key);
- add_genID_listener(key, origBitmap.pixelRef());
+ if (NULL != result) {
+ add_genID_listener(key, origBitmap.pixelRef());
+ }
return result;
} else {
GrTexture* result = ctx->lockAndRefScratchTexture(desc,
@@ -171,7 +173,9 @@ static GrTexture* sk_gr_create_bitmap_texture(GrContext* ctx,
GrResourceKey key;
GrTexture* result = ctx->createTexture(params, desc, cacheID,
bitmap->getPixels(), bitmap->rowBytes(), &key);
- add_genID_listener(key, origBitmap.pixelRef());
+ if (NULL != result) {
+ add_genID_listener(key, origBitmap.pixelRef());
+ }
return result;
} else {
// This texture is unlikely to be used again (in its present form) so
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698