diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/core/SkBitmap.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/include/core/SkBitmap.h b/include/core/SkBitmap.h index 4951cf19cf..87d4649228 100644 --- a/include/core/SkBitmap.h +++ b/include/core/SkBitmap.h @@ -80,14 +80,20 @@ public: void swap(SkBitmap& other); /** Return true iff the bitmap has empty dimensions. - */ + * Hey! Before you use this, see if you really want to know drawsNothing() instead. + */ bool empty() const { return 0 == fWidth || 0 == fHeight; } /** Return true iff the bitmap has no pixelref. Note: this can return true even if the - dimensions of the bitmap are > 0 (see empty()). - */ + * dimensions of the bitmap are > 0 (see empty()). + * Hey! Before you use this, see if you really want to know drawsNothing() instead. + */ bool isNull() const { return NULL == fPixelRef; } + /** Return true iff drawing this bitmap has no effect. + */ + bool drawsNothing() const { return this->empty() || this->isNull(); } + /** Return the config for the bitmap. */ Config config() const { return (Config)fConfig; } |