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

Unified Diff: third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp

Issue 2749703002: Refactor ImageFrame::setSizeAndColorSpace() (Closed)
Patch Set: Call setHasAlpha(true); from within zeroFillPixelData() Created 3 years, 9 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: third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
diff --git a/third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp b/third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
index 641012756bc353bc3cce7b30e28e29cc6acd17a1..d1d2c6f188502e165070b0b41ad0f1d0d5a8acf5 100644
--- a/third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
+++ b/third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
@@ -937,14 +937,15 @@ bool JPEGImageDecoder::outputScanlines() {
DCHECK_EQ(info->output_height,
static_cast<JDIMENSION>(m_decodedSize.height()));
- if (!buffer.setSizeAndColorSpace(info->output_width, info->output_height,
- colorSpaceForSkImages()))
+ if (!buffer.allocatePixelData(info->output_width, info->output_height,
+ colorSpaceForSkImages()))
return setFailed();
+ buffer.zeroFillPixelData();
+
// The buffer is transparent outside the decoded area while the image is
scroggo_chromium 2017/03/17 14:36:38 This comment seems to apply to the line that you h
cblume 2017/03/17 18:05:45 Done.
// loading. The image will be marked fully opaque in complete().
buffer.setStatus(ImageFrame::FramePartial);
- buffer.setHasAlpha(true);
// For JPEGs, the frame always fills the entire image.
buffer.setOriginalFrameRect(IntRect(IntPoint(), size()));

Powered by Google App Engine
This is Rietveld 408576698