add IRect variant of getBounds()

git-svn-id: http://skia.googlecode.com/svn/trunk@3414 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
reed@google.com 2012-03-16 14:58:07 +00:00
parent 0beaba5b34
commit 80e1459c32
2 changed files with 6 additions and 0 deletions

View File

@ -223,6 +223,7 @@ public:
* Return the bitmap's bounds [0, 0, width, height] as an SkRect
*/
void getBounds(SkRect* bounds) const;
void getBounds(SkIRect* bounds) const;
/** Set the bitmap's config and dimensions. If rowBytes is 0, then
ComputeRowBytes() is called to compute the optimal value. This resets

View File

@ -258,6 +258,11 @@ void SkBitmap::getBounds(SkRect* bounds) const {
SkIntToScalar(fWidth), SkIntToScalar(fHeight));
}
void SkBitmap::getBounds(SkIRect* bounds) const {
SkASSERT(bounds);
bounds->set(0, 0, fWidth, fHeight);
}
///////////////////////////////////////////////////////////////////////////////
void SkBitmap::setConfig(Config c, int width, int height, int rowBytes) {