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

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

Issue 2749703002: Refactor ImageFrame::setSizeAndColorSpace() (Closed)
Patch Set: Forgot to update the call sites 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 27757d089441b3ae6fd6878105736ce47dd26946..0429c6e95cc2538d1dc701401a1648ac283247b3 100644
--- a/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp
+++ b/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp
@@ -454,9 +454,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(),
+ if (!buffer.allocateBackingStore(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

Powered by Google App Engine
This is Rietveld 408576698