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

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

Issue 1513023002: Make BitmapRegionDecoder succeed on invalid requests (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years 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/android/SkBitmapRegionCanvas.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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 46
47 47
48 const SkImageInfo& getInfo() const { return fInfo; } 48 const SkImageInfo& getInfo() const { return fInfo; }
49 49
50 /** 50 /**
51 * Format of the encoded data. 51 * Format of the encoded data.
52 */ 52 */
53 SkEncodedFormat getEncodedFormat() const { return this->onGetEncodedFormat() ; } 53 SkEncodedFormat getEncodedFormat() const { return this->onGetEncodedFormat() ; }
54 54
55 /** 55 /**
56 * @param requestedColorType Color type requested by the client
djsollen 2015/12/11 13:49:25 When doxygen formats this comment this won't look
msarett 2015/12/11 14:17:53 Done. Also changing the comment to reflect that w
57 *
58 * @return If it is possible to decode to requestedColorType, this returns
59 * requestedColorType. Otherwise, this returns kN32_SkColorType.
60 */
61 SkColorType computeOutputColorType(SkColorType requestedColorType);
62
63 /**
64 * @param requestedUnpremul Indicates if the client requested
65 * unpremultiplied output
66 *
67 * @return Returns the appropriate alpha type to decode to. If the image
68 * has alpha, the value of requestedUnpremul will be honored.
69 */
70 SkAlphaType computeOutputAlphaType(bool requestedUnpremul);
71
72 /**
56 * Returns the dimensions of the scaled output image, for an input 73 * Returns the dimensions of the scaled output image, for an input
57 * sampleSize. 74 * sampleSize.
58 * 75 *
59 * When the sample size divides evenly into the original dimensions, the 76 * When the sample size divides evenly into the original dimensions, the
60 * scaled output dimensions will simply be equal to the original 77 * scaled output dimensions will simply be equal to the original
61 * dimensions divided by the sample size. 78 * dimensions divided by the sample size.
62 * 79 *
63 * When the sample size does not divide even into the original 80 * When the sample size does not divide even into the original
64 * dimensions, the codec may round up or down, depending on what is most 81 * dimensions, the codec may round up or down, depending on what is most
65 * efficient to decode. 82 * efficient to decode.
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 virtual SkCodec::Result onGetAndroidPixels(const SkImageInfo& info, void* pi xels, 238 virtual SkCodec::Result onGetAndroidPixels(const SkImageInfo& info, void* pi xels,
222 size_t rowBytes, const AndroidOptions& options) = 0; 239 size_t rowBytes, const AndroidOptions& options) = 0;
223 240
224 private: 241 private:
225 242
226 // This will always be a reference to the info that is contained by the 243 // This will always be a reference to the info that is contained by the
227 // embedded SkCodec. 244 // embedded SkCodec.
228 const SkImageInfo& fInfo; 245 const SkImageInfo& fInfo;
229 }; 246 };
230 #endif // SkAndroidCodec_DEFINED 247 #endif // SkAndroidCodec_DEFINED
OLDNEW
« no previous file with comments | « no previous file | src/android/SkBitmapRegionCanvas.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698