aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkImageInfo.h
diff options
context:
space:
mode:
authorGravatar halcanary <halcanary@google.com>2014-10-24 12:54:53 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-10-24 12:54:53 -0700
commitf622a6c8fd176acf9944de8df00d7f0bb56b67d3 (patch)
tree11a136e816a7dfd26804f199c5d123a28e70c896 /include/core/SkImageInfo.h
parent87ab51862731ab0cd017e63d828fef31a193be40 (diff)
Add `SkIRect bounds()` convenience method to SkImageInfo and SkBitmap.
Diffstat (limited to 'include/core/SkImageInfo.h')
-rw-r--r--include/core/SkImageInfo.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/core/SkImageInfo.h b/include/core/SkImageInfo.h
index 7fedfa1a4a..6fbaf6bbce 100644
--- a/include/core/SkImageInfo.h
+++ b/include/core/SkImageInfo.h
@@ -9,10 +9,11 @@
#define SkImageInfo_DEFINED
#include "SkMath.h"
+#include "SkRect.h"
#include "SkSize.h"
-class SkWriteBuffer;
class SkReadBuffer;
+class SkWriteBuffer;
/**
* Describes how to interpret the alpha compoent of a pixel.
@@ -207,6 +208,7 @@ public:
return SkAlphaTypeIsOpaque(fAlphaType);
}
+ SkIRect bounds() const { return SkIRect::MakeWH(fWidth, fHeight); }
SkISize dimensions() const { return SkISize::Make(fWidth, fHeight); }
/**