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

Side by Side Diff: include/core/SkImageInfo.h

Issue 173893002: use colortype instead of config (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/core/SkBitmapFilter.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef SkImageInfo_DEFINED 8 #ifndef SkImageInfo_DEFINED
9 #define SkImageInfo_DEFINED 9 #define SkImageInfo_DEFINED
10 10
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 return MakeN32Premul(size.width(), size.height()); 158 return MakeN32Premul(size.width(), size.height());
159 } 159 }
160 160
161 static SkImageInfo MakeA8(int width, int height) { 161 static SkImageInfo MakeA8(int width, int height) {
162 SkImageInfo info = { 162 SkImageInfo info = {
163 width, height, kAlpha_8_SkColorType, kPremul_SkAlphaType 163 width, height, kAlpha_8_SkColorType, kPremul_SkAlphaType
164 }; 164 };
165 return info; 165 return info;
166 } 166 }
167 167
168 static SkImageInfo MakeUnknown(int width, int height) {
169 SkImageInfo info = {
170 width, height, kUnknown_SkColorType, kIgnore_SkAlphaType
171 };
172 return info;
173 }
174
168 int width() const { return fWidth; } 175 int width() const { return fWidth; }
169 int height() const { return fHeight; } 176 int height() const { return fHeight; }
170 SkColorType colorType() const { return fColorType; } 177 SkColorType colorType() const { return fColorType; }
171 SkAlphaType alphaType() const { return fAlphaType; } 178 SkAlphaType alphaType() const { return fAlphaType; }
172 179
173 bool isEmpty() const { return fWidth <= 0 || fHeight <= 0; } 180 bool isEmpty() const { return fWidth <= 0 || fHeight <= 0; }
174 181
175 bool isOpaque() const { 182 bool isOpaque() const {
176 return SkAlphaTypeIsOpaque(fAlphaType); 183 return SkAlphaTypeIsOpaque(fAlphaType);
177 } 184 }
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 220
214 bool validRowBytes(size_t rowBytes) const { 221 bool validRowBytes(size_t rowBytes) const {
215 uint64_t rb = sk_64_mul(fWidth, this->bytesPerPixel()); 222 uint64_t rb = sk_64_mul(fWidth, this->bytesPerPixel());
216 return rowBytes >= rb; 223 return rowBytes >= rb;
217 } 224 }
218 225
219 SkDEBUGCODE(void validate() const;) 226 SkDEBUGCODE(void validate() const;)
220 }; 227 };
221 228
222 #endif 229 #endif
OLDNEW
« no previous file with comments | « no previous file | src/core/SkBitmapFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698