OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
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 | 8 |
9 #include "SkImageDecoder.h" | 9 #include "SkImageDecoder.h" |
10 #include "SkBitmap.h" | 10 #include "SkBitmap.h" |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 | 153 |
154 bool SkImageDecoder::buildTileIndex(SkStreamRewindable* stream, int *width, int
*height) { | 154 bool SkImageDecoder::buildTileIndex(SkStreamRewindable* stream, int *width, int
*height) { |
155 // we reset this to false before calling onBuildTileIndex | 155 // we reset this to false before calling onBuildTileIndex |
156 fShouldCancelDecode = false; | 156 fShouldCancelDecode = false; |
157 | 157 |
158 return this->onBuildTileIndex(stream, width, height); | 158 return this->onBuildTileIndex(stream, width, height); |
159 } | 159 } |
160 | 160 |
161 bool SkImageDecoder::onBuildTileIndex(SkStreamRewindable* stream, int* /*width*/
, | 161 bool SkImageDecoder::onBuildTileIndex(SkStreamRewindable* stream, int* /*width*/
, |
162 int* /*height*/) { | 162 int* /*height*/) { |
163 SkDELETE(stream); | 163 delete stream; |
164 return false; | 164 return false; |
165 } | 165 } |
166 | 166 |
167 | 167 |
168 bool SkImageDecoder::cropBitmap(SkBitmap *dst, SkBitmap *src, int sampleSize, | 168 bool SkImageDecoder::cropBitmap(SkBitmap *dst, SkBitmap *src, int sampleSize, |
169 int dstX, int dstY, int width, int height, | 169 int dstX, int dstY, int width, int height, |
170 int srcX, int srcY) { | 170 int srcX, int srcY) { |
171 int w = width / sampleSize; | 171 int w = width / sampleSize; |
172 int h = height / sampleSize; | 172 int h = height / sampleSize; |
173 if (src->colorType() == kIndex_8_SkColorType) { | 173 if (src->colorType() == kIndex_8_SkColorType) { |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 return success; | 265 return success; |
266 } | 266 } |
267 | 267 |
268 bool SkImageDecoder::decodeYUV8Planes(SkStream* stream, SkISize componentSizes[3
], void* planes[3], | 268 bool SkImageDecoder::decodeYUV8Planes(SkStream* stream, SkISize componentSizes[3
], void* planes[3], |
269 size_t rowBytes[3], SkYUVColorSpace* color
Space) { | 269 size_t rowBytes[3], SkYUVColorSpace* color
Space) { |
270 // we reset this to false before calling onDecodeYUV8Planes | 270 // we reset this to false before calling onDecodeYUV8Planes |
271 fShouldCancelDecode = false; | 271 fShouldCancelDecode = false; |
272 | 272 |
273 return this->onDecodeYUV8Planes(stream, componentSizes, planes, rowBytes, co
lorSpace); | 273 return this->onDecodeYUV8Planes(stream, componentSizes, planes, rowBytes, co
lorSpace); |
274 } | 274 } |
OLD | NEW |