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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
97 size = decoder->decodedYUVSize(1); | 97 size = decoder->decodedYUVSize(1); |
98 componentSizes[1].set(size.width(), size.height()); | 98 componentSizes[1].set(size.width(), size.height()); |
99 componentWidthBytes[1] = decoder->decodedYUVWidthBytes(1); | 99 componentWidthBytes[1] = decoder->decodedYUVWidthBytes(1); |
100 size = decoder->decodedYUVSize(2); | 100 size = decoder->decodedYUVSize(2); |
101 componentSizes[2].set(size.width(), size.height()); | 101 componentSizes[2].set(size.width(), size.height()); |
102 componentWidthBytes[2] = decoder->decodedYUVWidthBytes(2); | 102 componentWidthBytes[2] = decoder->decodedYUVWidthBytes(2); |
103 return true; | 103 return true; |
104 } | 104 } |
105 | 105 |
106 ImageFrameGenerator::ImageFrameGenerator(const SkISize& fullSize, | 106 ImageFrameGenerator::ImageFrameGenerator(const SkISize& fullSize, |
107 sk_sp<SkColorSpace> colorSpace, | |
107 bool isMultiFrame) | 108 bool isMultiFrame) |
108 : m_fullSize(fullSize), | 109 : m_fullSize(fullSize), |
110 m_colorSpace(colorSpace), | |
Justin Novosad
2016/10/31 14:55:13
std::move
ccameron
2016/10/31 18:10:17
Done.
| |
109 m_isMultiFrame(isMultiFrame), | 111 m_isMultiFrame(isMultiFrame), |
110 m_decodeFailed(false), | 112 m_decodeFailed(false), |
111 m_yuvDecodingFailed(false), | 113 m_yuvDecodingFailed(false), |
112 m_frameCount(0) {} | 114 m_frameCount(0) {} |
113 | 115 |
114 ImageFrameGenerator::~ImageFrameGenerator() { | 116 ImageFrameGenerator::~ImageFrameGenerator() { |
115 ImageDecodingStore::instance().removeCacheIndexedByGenerator(this); | 117 ImageDecodingStore::instance().removeCacheIndexedByGenerator(this); |
116 } | 118 } |
117 | 119 |
118 bool ImageFrameGenerator::decodeAndScale(SegmentReader* data, | 120 bool ImageFrameGenerator::decodeAndScale(SegmentReader* data, |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
373 // Setting a dummy ImagePlanes object signals to the decoder that we want to | 375 // Setting a dummy ImagePlanes object signals to the decoder that we want to |
374 // do YUV decoding. | 376 // do YUV decoding. |
375 std::unique_ptr<ImagePlanes> dummyImagePlanes = wrapUnique(new ImagePlanes); | 377 std::unique_ptr<ImagePlanes> dummyImagePlanes = wrapUnique(new ImagePlanes); |
376 decoder->setImagePlanes(std::move(dummyImagePlanes)); | 378 decoder->setImagePlanes(std::move(dummyImagePlanes)); |
377 | 379 |
378 return updateYUVComponentSizes(decoder.get(), sizeInfo->fSizes, | 380 return updateYUVComponentSizes(decoder.get(), sizeInfo->fSizes, |
379 sizeInfo->fWidthBytes); | 381 sizeInfo->fWidthBytes); |
380 } | 382 } |
381 | 383 |
382 } // namespace blink | 384 } // namespace blink |
OLD | NEW |