aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/core/SkBitmap.h3
-rw-r--r--include/core/SkImageInfo.h4
2 files changed, 6 insertions, 1 deletions
diff --git a/include/core/SkBitmap.h b/include/core/SkBitmap.h
index b36a1fd3fd..cefc30ac82 100644
--- a/include/core/SkBitmap.h
+++ b/include/core/SkBitmap.h
@@ -220,6 +220,9 @@ public:
void getBounds(SkRect* bounds) const;
void getBounds(SkIRect* bounds) const;
+ SkIRect bounds() const { return fInfo.bounds(); }
+ SkISize dimensions() const { return fInfo.dimensions(); }
+
bool setInfo(const SkImageInfo&, size_t rowBytes = 0);
/**
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); }
/**