add IRect variant of getBounds()
authorreed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Fri, 16 Mar 2012 14:58:07 +0000 (14:58 +0000)
committerreed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Fri, 16 Mar 2012 14:58:07 +0000 (14:58 +0000)
git-svn-id: http://skia.googlecode.com/svn/trunk@3414 2bbb7eff-a529-9590-31e7-b0007b416f81

include/core/SkBitmap.h
src/core/SkBitmap.cpp

index 7a7f91a..91e3520 100644 (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
index 3d586e4..0a96e9e 100644 (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) {