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

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

Issue 2461773002: add isAlphaOnly() query (Closed)
Patch Set: add test Created 4 years, 1 month 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 | « no previous file | 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 SkAlphaType alphaType() const; 169 SkAlphaType alphaType() const;
170
171 /**
robertphillips 2016/10/31 17:18:13 fi ?
172 * Returns true fi the image will be drawn as a mask, with no intrinsic col or of its own.
173 */
174 bool isAlphaOnly() const;
170 bool isOpaque() const { return SkAlphaTypeIsOpaque(this->alphaType()); } 175 bool isOpaque() const { return SkAlphaTypeIsOpaque(this->alphaType()); }
171 176
172 /** 177 /**
173 * Extracts YUV planes from the SkImage and stores them in client-provided m emory. The sizes 178 * Extracts YUV planes from the SkImage and stores them in client-provided m emory. The sizes
174 * planes and rowBytes arrays are ordered [y, u, v]. 179 * planes and rowBytes arrays are ordered [y, u, v].
175 */ 180 */
176 bool readYUV8Planes(const SkISize[3], void* const planes[3], const size_t ro wBytes[3], 181 bool readYUV8Planes(const SkISize[3], void* const planes[3], const size_t ro wBytes[3],
177 SkYUVColorSpace) const; 182 SkYUVColorSpace) const;
178 183
179 sk_sp<SkShader> makeShader(SkShader::TileMode, SkShader::TileMode, 184 sk_sp<SkShader> makeShader(SkShader::TileMode, SkShader::TileMode,
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 SkBudgeted, SkSourceGammaTreatme nt); 477 SkBudgeted, SkSourceGammaTreatme nt);
473 478
474 const int fWidth; 479 const int fWidth;
475 const int fHeight; 480 const int fHeight;
476 const uint32_t fUniqueID; 481 const uint32_t fUniqueID;
477 482
478 typedef SkRefCnt INHERITED; 483 typedef SkRefCnt INHERITED;
479 }; 484 };
480 485
481 #endif 486 #endif
OLDNEW
« no previous file with comments | « no previous file | src/image/SkImage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698