diff --git a/include/core/SkBitmap.h b/include/core/SkBitmap.h index 7a7f91a63f..91e35208af 100644 --- a/include/core/SkBitmap.h +++ b/include/core/SkBitmap.h @@ -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 diff --git a/src/core/SkBitmap.cpp b/src/core/SkBitmap.cpp index 3d586e40da..0a96e9e597 100644 --- a/src/core/SkBitmap.cpp +++ b/src/core/SkBitmap.cpp @@ -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) {