From 80e1459c32f5f3acbc688ae4f0e046aa283e8c3a Mon Sep 17 00:00:00 2001 From: "reed@google.com" Date: Fri, 16 Mar 2012 14:58:07 +0000 Subject: [PATCH] add IRect variant of getBounds() git-svn-id: http://skia.googlecode.com/svn/trunk@3414 2bbb7eff-a529-9590-31e7-b0007b416f81 --- include/core/SkBitmap.h | 1 + src/core/SkBitmap.cpp | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/include/core/SkBitmap.h b/include/core/SkBitmap.h index 7a7f91a..91e3520 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 3d586e4..0a96e9e 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) { -- 2.7.4