Chromium Code Reviews| Index: third_party/WebKit/Source/platform/graphics/DecodingImageGenerator.cpp |
| diff --git a/third_party/WebKit/Source/platform/graphics/DecodingImageGenerator.cpp b/third_party/WebKit/Source/platform/graphics/DecodingImageGenerator.cpp |
| index 64d6223d6af84d4c2aaed13b95cd5ae9f5164a10..d8656bc9344c56ab7eff6d0d54e882565ae4bb25 100644 |
| --- a/third_party/WebKit/Source/platform/graphics/DecodingImageGenerator.cpp |
| +++ b/third_party/WebKit/Source/platform/graphics/DecodingImageGenerator.cpp |
| @@ -75,23 +75,27 @@ bool DecodingImageGenerator::onGetPixels(const SkImageInfo& info, void* pixels, |
| return decoded; |
| } |
| -bool DecodingImageGenerator::onGetYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowBytes[3], SkYUVColorSpace* colorSpace) |
| +bool DecodingImageGenerator::onQueryYUV8(SkYUVSizeInfo* sizeInfo, SkYUVColorSpace* colorSpace) const |
| { |
| if (!m_canYUVDecode) |
| return false; |
| - bool requestingYUVSizes = !planes || !planes[0]; |
| - |
| - TRACE_EVENT1("blink", "DecodingImageGenerator::getYUV8Planes", requestingYUVSizes ? "sizes" : "frame index", static_cast<int>(m_frameIndex)); |
| - |
| - if (requestingYUVSizes) |
| - return m_frameGenerator->getYUVComponentSizes(sizes); |
| + TRACE_EVENT1("blink", "DecodingImageGenerator::getYUV8Planes", "sizes", static_cast<int>(m_frameIndex)); |
|
Noel Gordon
2016/03/01 02:27:48
DecodingImageGenerator::getYUV8Planes -> DecodingI
msarett
2016/03/01 18:00:37
Yes nice catch!
|
| if (colorSpace) |
| *colorSpace = kJPEG_SkYUVColorSpace; |
| + return m_frameGenerator->getYUVComponentSizes(sizeInfo); |
| +} |
| + |
| +bool DecodingImageGenerator::onGetYUV8Planes(const SkYUVSizeInfo& sizeInfo, void* planes[3]) |
| +{ |
| + ASSERT(m_canYUVDecode); |
| + |
| + TRACE_EVENT1("blink", "DecodingImageGenerator::getYUV8Planes", "frame index", static_cast<int>(m_frameIndex)); |
| + |
| PlatformInstrumentation::willDecodeLazyPixelRef(m_generationId); |
| - bool decoded = m_frameGenerator->decodeToYUV(m_frameIndex, sizes, planes, rowBytes); |
| + bool decoded = m_frameGenerator->decodeToYUV(m_frameIndex, sizeInfo.fSizes, planes, sizeInfo.fWidthBytes); |
| PlatformInstrumentation::didDecodeLazyPixelRef(); |
| return decoded; |