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

Unified Diff: src/image/SkImage_Gpu.cpp

Issue 869743002: more reinforcement that images never have zero width or height (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 11 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/image/SkImage_Raster.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/image/SkImage_Gpu.cpp
diff --git a/src/image/SkImage_Gpu.cpp b/src/image/SkImage_Gpu.cpp
index 350a1e88dec2ca37fafaa75463c27d72b7dc0272..8169b2a131b90f88911beccbffcbf6f6bc060f31 100644
--- a/src/image/SkImage_Gpu.cpp
+++ b/src/image/SkImage_Gpu.cpp
@@ -89,7 +89,7 @@ bool SkImage_Gpu::isOpaque() const {
///////////////////////////////////////////////////////////////////////////////
SkImage* SkNewImageFromBitmapTexture(const SkBitmap& bitmap, int sampleCountForNewSurfaces) {
- if (NULL == bitmap.getTexture()) {
+ if (0 == bitmap.width() || 0 == bitmap.height() || NULL == bitmap.getTexture()) {
return NULL;
}
return SkNEW_ARGS(SkImage_Gpu, (bitmap, sampleCountForNewSurfaces));
« no previous file with comments | « no previous file | src/image/SkImage_Raster.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698