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

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

Issue 2250663002: Add alphaType() to SkImage (Closed) Base URL: https://skia.googlesource.com/skia.git@special-image-alpha-type
Patch Set: Remove virtuals from SkImage, slight cleanup Created 4 years, 4 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 | « gm/image.cpp ('k') | src/image/SkImage.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 2012 Google Inc. 2 * Copyright 2012 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 SkImage_DEFINED 8 #ifndef SkImage_DEFINED
9 #define SkImage_DEFINED 9 #define SkImage_DEFINED
10 10
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 159
160 static sk_sp<SkImage> MakeTextureFromPixmap(GrContext*, const SkPixmap&, SkB udgeted budgeted); 160 static sk_sp<SkImage> MakeTextureFromPixmap(GrContext*, const SkPixmap&, SkB udgeted budgeted);
161 161
162 //////////////////////////////////////////////////////////////////////////// /////////////////// 162 //////////////////////////////////////////////////////////////////////////// ///////////////////
163 163
164 int width() const { return fWidth; } 164 int width() const { return fWidth; }
165 int height() const { return fHeight; } 165 int height() const { return fHeight; }
166 SkISize dimensions() const { return SkISize::Make(fWidth, fHeight); } 166 SkISize dimensions() const { return SkISize::Make(fWidth, fHeight); }
167 SkIRect bounds() const { return SkIRect::MakeWH(fWidth, fHeight); } 167 SkIRect bounds() const { return SkIRect::MakeWH(fWidth, fHeight); }
168 uint32_t uniqueID() const { return fUniqueID; } 168 uint32_t uniqueID() const { return fUniqueID; }
169 virtual bool isOpaque() const { return false; } 169 SkAlphaType alphaType() const;
170 bool isOpaque() const { return SkAlphaTypeIsOpaque(this->alphaType()); }
170 171
171 /** 172 /**
172 * Extracts YUV planes from the SkImage and stores them in client-provided m emory. The sizes 173 * Extracts YUV planes from the SkImage and stores them in client-provided m emory. The sizes
173 * planes and rowBytes arrays are ordered [y, u, v]. 174 * planes and rowBytes arrays are ordered [y, u, v].
174 */ 175 */
175 bool readYUV8Planes(const SkISize[3], void* const planes[3], const size_t ro wBytes[3], 176 bool readYUV8Planes(const SkISize[3], void* const planes[3], const size_t ro wBytes[3],
176 SkYUVColorSpace) const; 177 SkYUVColorSpace) const;
177 178
178 #ifdef SK_SUPPORT_LEGACY_CREATESHADER_PTR 179 #ifdef SK_SUPPORT_LEGACY_CREATESHADER_PTR
179 SkShader* newShader(SkShader::TileMode, SkShader::TileMode, 180 SkShader* newShader(SkShader::TileMode, SkShader::TileMode,
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 SkBudgeted); 473 SkBudgeted);
473 474
474 const int fWidth; 475 const int fWidth;
475 const int fHeight; 476 const int fHeight;
476 const uint32_t fUniqueID; 477 const uint32_t fUniqueID;
477 478
478 typedef SkRefCnt INHERITED; 479 typedef SkRefCnt INHERITED;
479 }; 480 };
480 481
481 #endif 482 #endif
OLDNEW
« no previous file with comments | « gm/image.cpp ('k') | src/image/SkImage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698