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

Unified Diff: Source/platform/graphics/ImageFrameGenerator.cpp

Issue 544323002: Non DCTSIZE multiple width support for JPEG YUV decoding (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: Source/platform/graphics/ImageFrameGenerator.cpp
diff --git a/Source/platform/graphics/ImageFrameGenerator.cpp b/Source/platform/graphics/ImageFrameGenerator.cpp
index b046744b31c76ce29b836f7269f4531d654130a3..a870fc1937d8dd358b9b7780122abe3492088cf6 100644
--- a/Source/platform/graphics/ImageFrameGenerator.cpp
+++ b/Source/platform/graphics/ImageFrameGenerator.cpp
@@ -133,7 +133,7 @@ bool ImageFrameGenerator::decodeAndScale(const SkImageInfo& info, size_t index,
return result;
}
-bool ImageFrameGenerator::decodeToYUV(void* planes[3], size_t rowBytes[3])
+bool ImageFrameGenerator::decodeToYUV(SkISize componentSizes[3], void* planes[3], size_t rowBytes[3])
{
// This method is called to populate a discardable memory owned by Skia.
@@ -165,6 +165,8 @@ bool ImageFrameGenerator::decodeToYUV(void* planes[3], size_t rowBytes[3])
OwnPtr<ImagePlanes> imagePlanes = adoptPtr(new ImagePlanes(planes, rowBytes));
decoder->setImagePlanes(imagePlanes.release());
+ if (decoder->isSizeAvailable())
Noel Gordon 2014/09/08 16:13:32 ASSERT this?
sugoi1 2014/09/09 15:08:15 isSizeAvailable() has to actually get called, beca
+ getYUVComponentSizes(decoder.get(), componentSizes, false); // Update component sizes with real size
bool yuvDecoded = decoder->decodeToYUV();
if (yuvDecoded)
setHasAlpha(0, false); // YUV is always opaque
@@ -319,13 +321,18 @@ bool ImageFrameGenerator::getYUVComponentSizes(SkISize componentSizes[3])
if (!decoder->isSizeAvailable() || !decoder->canDecodeToYUV())
return false;
- IntSize size = decoder->decodedYUVSize(0);
+ getYUVComponentSizes(decoder.get(), componentSizes, true);
+ return true;
+}
+
+void ImageFrameGenerator::getYUVComponentSizes(const ImageDecoder* decoder, SkISize componentSizes[3], bool memoryAllocation)
+{
+ IntSize size = decoder->decodedYUVSize(0, memoryAllocation);
componentSizes[0].set(size.width(), size.height());
- size = decoder->decodedYUVSize(1);
+ size = decoder->decodedYUVSize(1, memoryAllocation);
componentSizes[1].set(size.width(), size.height());
- size = decoder->decodedYUVSize(2);
+ size = decoder->decodedYUVSize(2, memoryAllocation);
componentSizes[2].set(size.width(), size.height());
- return true;
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698