Chromium Code Reviews| 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 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 278 if (kUnknown_Format == *format) { | 278 if (kUnknown_Format == *format) { |
| 279 if (stream->rewind()) { | 279 if (stream->rewind()) { |
| 280 *format = GetStreamFormat(stream); | 280 *format = GetStreamFormat(stream); |
| 281 } | 281 } |
| 282 } | 282 } |
| 283 } | 283 } |
| 284 delete codec; | 284 delete codec; |
| 285 } | 285 } |
| 286 return success; | 286 return success; |
| 287 } | 287 } |
| 288 | |
| 289 bool SkImageDecoder::getYUVComponentSizes(SkStream* stream, SkISize componentSiz es[3]) { | |
| 290 return this->onDecodeToYUV(stream, componentSizes, NULL); | |
| 291 } | |
| 292 | |
| 293 bool SkImageDecoder::decodeToYUV(SkStream* stream, SkISize componentSizes[3], vo id* planes[3], | |
| 294 size_t rowBytes[3]) { | |
| 295 SkImagePlanes imagePlanes(planes, rowBytes); | |
| 296 return this->onDecodeToYUV(stream, componentSizes, &imagePlanes); | |
| 297 } | |
| 298 | |
| 299 SkImagePlanes::SkImagePlanes() | |
| 300 { | |
|
reed1
2014/10/13 13:15:36
nit: place { on the same lines as the constructor
sugoi1
2014/10/14 15:07:36
Code removed
| |
| 301 for (int i = 0; i < 3; ++i) { | |
| 302 m_planes[i] = 0; | |
|
reed1
2014/10/13 13:15:35
m_planes[i] = NULL;
sugoi1
2014/10/14 15:07:36
Code removed
| |
| 303 m_rowBytes[i] = 0; | |
| 304 } | |
| 305 } | |
| 306 | |
| 307 SkImagePlanes::SkImagePlanes(void* planes[3], size_t rowBytes[3]) | |
| 308 { | |
| 309 for (int i = 0; i < 3; ++i) { | |
| 310 m_planes[i] = planes[i]; | |
| 311 m_rowBytes[i] = rowBytes[i]; | |
| 312 } | |
| 313 } | |
| 314 | |
| 315 void* SkImagePlanes::plane(int i) | |
| 316 { | |
| 317 SkASSERT((i >= 0) && i < 3); | |
| 318 return m_planes[i]; | |
| 319 } | |
| 320 | |
| 321 size_t SkImagePlanes::rowBytes(int i) const | |
| 322 { | |
| 323 SkASSERT((i >= 0) && i < 3); | |
| 324 return m_rowBytes[i]; | |
| 325 } | |
| OLD | NEW |