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

Side by Side Diff: include/codec/SkAndroidCodec.h

Issue 1557403002: Delete reallyHasAlpha() from SkCodec (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase Created 4 years, 11 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 | « no previous file | include/codec/SkCodec.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 2015 Google Inc. 2 * Copyright 2015 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 SkAndroidCodec_DEFINED 8 #ifndef SkAndroidCodec_DEFINED
9 #define SkAndroidCodec_DEFINED 9 #define SkAndroidCodec_DEFINED
10 10
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 const AndroidOptions* options); 219 const AndroidOptions* options);
220 220
221 /** 221 /**
222 * Simplified version of getAndroidPixels() where we supply the default And roidOptions. 222 * Simplified version of getAndroidPixels() where we supply the default And roidOptions.
223 * 223 *
224 * This will return an error if the info is kIndex_8_SkColorType and also w ill not perform 224 * This will return an error if the info is kIndex_8_SkColorType and also w ill not perform
225 * any scaling or subsetting. 225 * any scaling or subsetting.
226 */ 226 */
227 SkCodec::Result getAndroidPixels(const SkImageInfo& info, void* pixels, size _t rowBytes); 227 SkCodec::Result getAndroidPixels(const SkImageInfo& info, void* pixels, size _t rowBytes);
228 228
229 /**
230 * Some images may initially report that they have alpha due to the format
231 * of the encoded data, but then never use any colors which have alpha
232 * less than 100%. This function can be called *after* decoding to
233 * determine if such an image truly had alpha. Calling it before decoding
234 * is undefined.
235 * FIXME: see skbug.com/3582.
236 */
237 bool reallyHasAlpha() const {
238 return fCodec->reallyHasAlpha();
239 }
240
241 protected: 229 protected:
242 230
243 SkAndroidCodec(SkCodec*); 231 SkAndroidCodec(SkCodec*);
244 232
245 SkCodec* codec() const { return fCodec.get(); } 233 SkCodec* codec() const { return fCodec.get(); }
246 234
247 virtual SkISize onGetSampledDimensions(int sampleSize) const = 0; 235 virtual SkISize onGetSampledDimensions(int sampleSize) const = 0;
248 236
249 virtual bool onGetSupportedSubset(SkIRect* desiredSubset) const = 0; 237 virtual bool onGetSupportedSubset(SkIRect* desiredSubset) const = 0;
250 238
251 virtual SkCodec::Result onGetAndroidPixels(const SkImageInfo& info, void* pi xels, 239 virtual SkCodec::Result onGetAndroidPixels(const SkImageInfo& info, void* pi xels,
252 size_t rowBytes, const AndroidOptions& options) = 0; 240 size_t rowBytes, const AndroidOptions& options) = 0;
253 241
254 private: 242 private:
255 243
256 // This will always be a reference to the info that is contained by the 244 // This will always be a reference to the info that is contained by the
257 // embedded SkCodec. 245 // embedded SkCodec.
258 const SkImageInfo& fInfo; 246 const SkImageInfo& fInfo;
259 247
260 SkAutoTDelete<SkCodec> fCodec; 248 SkAutoTDelete<SkCodec> fCodec;
261 }; 249 };
262 #endif // SkAndroidCodec_DEFINED 250 #endif // SkAndroidCodec_DEFINED
OLDNEW
« no previous file with comments | « no previous file | include/codec/SkCodec.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698