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

Unified Diff: include/core/SkImage.h

Issue 830033003: change API contract: disallow zero-sized images or surfaces (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 12 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 | include/core/SkSurface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkImage.h
diff --git a/include/core/SkImage.h b/include/core/SkImage.h
index 6070b6bf6bfefdd50ba5bc07ca8e118f54ef9165..4cff5db4c9192884b4b6faa1cf6014a8dccc8074 100644
--- a/include/core/SkImage.h
+++ b/include/core/SkImage.h
@@ -32,6 +32,10 @@ class GrTexture;
* The content of SkImage is always immutable, though the actual storage may
* change, if for example that image can be re-created via encoded data or
* other means.
+ *
+ * SkImage always has a non-zero dimensions. If there is a request to create a new image, either
+ * directly or via SkSurface, and either of the requested dimensions are zero, then NULL will be
+ * returned.
*/
class SK_API SkImage : public SkRefCnt {
public:
@@ -130,8 +134,8 @@ protected:
fHeight(height),
fUniqueID(NextUniqueID()) {
- SkASSERT(width >= 0);
- SkASSERT(height >= 0);
+ SkASSERT(width > 0);
+ SkASSERT(height > 0);
}
private:
« no previous file with comments | « no previous file | include/core/SkSurface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698