OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 static PassRefPtr<ImageFrameGenerator> create( | 66 static PassRefPtr<ImageFrameGenerator> create( |
67 const SkISize& fullSize, | 67 const SkISize& fullSize, |
68 bool isMultiFrame, | 68 bool isMultiFrame, |
69 const ColorBehavior& colorBehavior) { | 69 const ColorBehavior& colorBehavior) { |
70 return adoptRef( | 70 return adoptRef( |
71 new ImageFrameGenerator(fullSize, isMultiFrame, colorBehavior)); | 71 new ImageFrameGenerator(fullSize, isMultiFrame, colorBehavior)); |
72 } | 72 } |
73 | 73 |
74 ~ImageFrameGenerator(); | 74 ~ImageFrameGenerator(); |
75 | 75 |
76 // Decodes and scales the specified frame at |index|. The dimensions and | 76 // Decodes and scales the specified frame at |index|. The dimensions and |
77 // output format are given in SkImageInfo. Decoded pixels are written into | 77 // output format are given in SkImageInfo. Decoded pixels are scaled if |
| 78 // necessary, applying the specified filter-quality, and then written into |
78 // |pixels| with a stride of |rowBytes|. Returns true if decoding was | 79 // |pixels| with a stride of |rowBytes|. Returns true if decoding was |
79 // successful. | 80 // successful. |
80 bool decodeAndScale(SegmentReader*, | 81 bool decodeAndScale(SegmentReader*, |
81 bool allDataReceived, | 82 bool allDataReceived, |
82 size_t index, | 83 size_t index, |
83 const SkImageInfo&, | 84 const SkImageInfo&, |
84 void* pixels, | 85 void* pixels, |
85 size_t rowBytes); | 86 size_t rowBytes, |
| 87 SkFilterQuality = kLow_SkFilterQuality); |
86 | 88 |
87 // Decodes YUV components directly into the provided memory planes. Must not | 89 // Decodes YUV components directly into the provided memory planes. Must not |
88 // be called unless getYUVComponentSizes has been called and returned true. | 90 // be called unless getYUVComponentSizes has been called and returned true. |
89 // YUV decoding does not currently support progressive decoding. In order to | 91 // YUV decoding does not currently support progressive decoding. In order to |
90 // support it, ImageDecoder needs something analagous to its ImageFrame cache | 92 // support it, ImageDecoder needs something analagous to its ImageFrame cache |
91 // to hold partial planes, and the GPU code needs to handle them. | 93 // to hold partial planes, and the GPU code needs to handle them. |
92 bool decodeToYUV(SegmentReader*, | 94 bool decodeToYUV(SegmentReader*, |
93 size_t index, | 95 size_t index, |
94 const SkISize componentSizes[3], | 96 const SkISize componentSizes[3], |
95 void* planes[3], | 97 void* planes[3], |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 // Prevents multiple decode operations on the same data. | 153 // Prevents multiple decode operations on the same data. |
152 Mutex m_decodeMutex; | 154 Mutex m_decodeMutex; |
153 | 155 |
154 // Protect concurrent access to m_hasAlpha. | 156 // Protect concurrent access to m_hasAlpha. |
155 Mutex m_alphaMutex; | 157 Mutex m_alphaMutex; |
156 }; | 158 }; |
157 | 159 |
158 } // namespace blink | 160 } // namespace blink |
159 | 161 |
160 #endif | 162 #endif |
OLD | NEW |