Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(317)

Unified Diff: include/core/SkImageInfo.h

Issue 646213003: Add `SkIRect bounds()` convenience method to SkImageInfo and SkBitmap. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: reed nits Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/core/SkBitmap.h ('k') | src/core/SkCanvas.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkImageInfo.h
diff --git a/include/core/SkImageInfo.h b/include/core/SkImageInfo.h
index 7fedfa1a4ae17205f51c3e37930faa64e39beac7..6fbaf6bbce19b4039683e75f90d123176398d1ab 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); }
/**
« no previous file with comments | « include/core/SkBitmap.h ('k') | src/core/SkCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698