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

Unified Diff: third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.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/webp/WEBPImageDecoder.cpp
diff --git a/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp b/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp
index 8a3b219e91213d6ac4c1ec1b2f7388b898b32ba3..f1bbef96ff542b5e4a04df08a2ca0809580a28a5 100644
--- a/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp
+++ b/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp
@@ -457,14 +457,14 @@ bool WEBPImageDecoder::decodeSingleFrame(const uint8_t* dataBytes,
DCHECK_NE(buffer.getStatus(), ImageFrame::FrameComplete);
if (buffer.getStatus() == ImageFrame::FrameEmpty) {
- if (!buffer.setSizeAndColorSpace(size().width(), size().height(),
- colorSpaceForSkImages()))
+ if (!buffer.allocatePixelData(size().width(), size().height(),
+ colorSpaceForSkImages()))
return setFailed();
- buffer.setStatus(ImageFrame::FramePartial);
+ buffer.zeroFillPixelData();
// The buffer is transparent outside the decoded area while the image is
scroggo_chromium 2017/03/17 14:36:38 Similarly, this comment seems to apply to the line
cblume 2017/03/17 18:05:46 Done.
// loading. The correct alpha value for the frame will be set when it is
// fully decoded.
- buffer.setHasAlpha(true);
+ buffer.setStatus(ImageFrame::FramePartial);
buffer.setOriginalFrameRect(IntRect(IntPoint(), size()));
}

Powered by Google App Engine
This is Rietveld 408576698