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

Unified Diff: src/image/SkSurface.cpp

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 | « src/image/SkImage_Raster.cpp ('k') | src/image/SkSurface_Raster.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/image/SkSurface.cpp
diff --git a/src/image/SkSurface.cpp b/src/image/SkSurface.cpp
index dca4ce771c923047c270f057177a8edd49aa6db0..6fd40c10af809be81658f0983a7b1ba00eb2fbf3 100644
--- a/src/image/SkSurface.cpp
+++ b/src/image/SkSurface.cpp
@@ -123,16 +123,16 @@ static SkSurface_Base* asSB(SkSurface* surface) {
SkSurface::SkSurface(int width, int height, const SkSurfaceProps* props)
: fProps(SkSurfacePropsCopyOrDefault(props)), fWidth(width), fHeight(height)
{
- SkASSERT(fWidth >= 0);
- SkASSERT(fHeight >= 0);
+ SkASSERT(fWidth > 0);
+ SkASSERT(fHeight > 0);
fGenerationID = 0;
}
SkSurface::SkSurface(const SkImageInfo& info, const SkSurfaceProps* props)
: fProps(SkSurfacePropsCopyOrDefault(props)), fWidth(info.width()), fHeight(info.height())
{
- SkASSERT(fWidth >= 0);
- SkASSERT(fHeight >= 0);
+ SkASSERT(fWidth > 0);
+ SkASSERT(fHeight > 0);
fGenerationID = 0;
}
« no previous file with comments | « src/image/SkImage_Raster.cpp ('k') | src/image/SkSurface_Raster.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698