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

Side by Side Diff: src/images/SkImageDecoder.cpp

Issue 399683007: JPEG YUV Decoding (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Update from blink's version of YUV decoding Created 6 years, 2 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
OLDNEW
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698