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

Unified Diff: include/core/SkImageInfo.h

Issue 301233011: use colortype instead of config (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 7 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 | « no previous file | src/effects/SkAlphaThresholdFilter.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 83919549d53e17f68856c5244ce26569dc7ddc9c..d66158d02c56506cd4b72f8286aea0be8a2678cc 100644
--- a/include/core/SkImageInfo.h
+++ b/include/core/SkImageInfo.h
@@ -189,6 +189,14 @@ struct SkImageInfo {
SkISize dimensions() const { return SkISize::Make(fWidth, fHeight); }
+ /**
+ * Return a new ImageInfo with the same colortype and alphatype as this info,
+ * but with the specified width and height.
+ */
+ SkImageInfo makeWH(int newWidth, int newHeight) const {
+ return SkImageInfo::Make(newWidth, newHeight, fColorType, fAlphaType);
+ }
+
int bytesPerPixel() const {
return SkColorTypeBytesPerPixel(fColorType);
}
« no previous file with comments | « no previous file | src/effects/SkAlphaThresholdFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698