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

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

Issue 334993002: hide virtuals on device for width/height/isopaque (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 6 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
« no previous file with comments | « include/core/SkDevice.h ('k') | include/gpu/SkGpuDevice.h » ('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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 return info; 169 return info;
170 } 170 }
171 171
172 static SkImageInfo MakeUnknown(int width, int height) { 172 static SkImageInfo MakeUnknown(int width, int height) {
173 SkImageInfo info = { 173 SkImageInfo info = {
174 width, height, kUnknown_SkColorType, kIgnore_SkAlphaType 174 width, height, kUnknown_SkColorType, kIgnore_SkAlphaType
175 }; 175 };
176 return info; 176 return info;
177 } 177 }
178 178
179 static SkImageInfo MakeUnknown() {
180 SkImageInfo info = {
181 0, 0, kUnknown_SkColorType, kIgnore_SkAlphaType
182 };
183 return info;
184 }
185
179 int width() const { return fWidth; } 186 int width() const { return fWidth; }
180 int height() const { return fHeight; } 187 int height() const { return fHeight; }
181 SkColorType colorType() const { return fColorType; } 188 SkColorType colorType() const { return fColorType; }
182 SkAlphaType alphaType() const { return fAlphaType; } 189 SkAlphaType alphaType() const { return fAlphaType; }
183 190
184 bool isEmpty() const { return fWidth <= 0 || fHeight <= 0; } 191 bool isEmpty() const { return fWidth <= 0 || fHeight <= 0; }
185 192
186 bool isOpaque() const { 193 bool isOpaque() const {
187 return SkAlphaTypeIsOpaque(fAlphaType); 194 return SkAlphaTypeIsOpaque(fAlphaType);
188 } 195 }
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 239
233 bool validRowBytes(size_t rowBytes) const { 240 bool validRowBytes(size_t rowBytes) const {
234 uint64_t rb = sk_64_mul(fWidth, this->bytesPerPixel()); 241 uint64_t rb = sk_64_mul(fWidth, this->bytesPerPixel());
235 return rowBytes >= rb; 242 return rowBytes >= rb;
236 } 243 }
237 244
238 SkDEBUGCODE(void validate() const;) 245 SkDEBUGCODE(void validate() const;)
239 }; 246 };
240 247
241 #endif 248 #endif
OLDNEW
« no previous file with comments | « include/core/SkDevice.h ('k') | include/gpu/SkGpuDevice.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698