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

Unified Diff: third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp

Issue 2749703002: Refactor ImageFrame::setSizeAndColorSpace() (Closed)
Patch Set: Moving to another CR the separation of zeroing pixel data from setting alpha 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
« no previous file with comments | « third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..ca2cd692b0f94e0a8bf5520646f1c2c9d6c9ced7 100644
--- a/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp
+++ b/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp
@@ -457,9 +457,10 @@ 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.zeroFillPixelData();
buffer.setStatus(ImageFrame::FramePartial);
// The buffer is transparent outside the decoded area while the image is
// loading. The correct alpha value for the frame will be set when it is
« no previous file with comments | « third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698