diff options
author | darin@google.com <darin@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-03 06:39:53 +0000 |
---|---|---|
committer | darin@google.com <darin@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-03 06:39:53 +0000 |
commit | ae624c0805eac0bc664890c1b998e4281fb2bad4 (patch) | |
tree | 9b1b07675730613f44fe4de593b292d90aac3d05 /skia | |
parent | ac1293c00113fd7b034161e8903f25f98d7a22d4 (diff) | |
download | chromium_src-ae624c0805eac0bc664890c1b998e4281fb2bad4.zip chromium_src-ae624c0805eac0bc664890c1b998e4281fb2bad4.tar.gz chromium_src-ae624c0805eac0bc664890c1b998e4281fb2bad4.tar.bz2 |
A null CGImageRef should be treated as a "null" SkBitmap,
one in which isNull() returns true.
This assertion was being tripped as a result of some
recent changes I made to expose a CGImageRef as the basis
or a WebKit::WebImage. I think it makes sense to put
this null check in CGImageToSkBitmap instead of at each
callsite.
TEST=covered by mac ui tests
BUG=none
TBR=mark
Review URL: http://codereview.chromium.org/149173
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19900 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'skia')
-rw-r--r-- | skia/ext/skia_utils_mac.mm | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/skia/ext/skia_utils_mac.mm b/skia/ext/skia_utils_mac.mm index 5da38df..07d9f0c 100644 --- a/skia/ext/skia_utils_mac.mm +++ b/skia/ext/skia_utils_mac.mm @@ -84,7 +84,8 @@ CGColorRef SkColorToCGColorRef(SkColor color) { } SkBitmap CGImageToSkBitmap(CGImageRef image) { - DCHECK(image != NULL); + if (!image) + return SkBitmap(); int width = CGImageGetWidth(image); int height = CGImageGetHeight(image); |