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

Unified Diff: third_party/WebKit/Source/platform/image-decoders/ImageDecoder.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
Index: third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp
diff --git a/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp b/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp
index 9ba0e090c3f7083e5863746294ba12dce12f38a6..39d8801761def994a3eba646da768f34d5b7e54b 100644
--- a/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp
+++ b/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp
@@ -354,10 +354,11 @@ bool ImageDecoder::initFrameBuffer(size_t frameIndex) {
size_t requiredPreviousFrameIndex = buffer->requiredPreviousFrameIndex();
if (requiredPreviousFrameIndex == kNotFound) {
// This frame doesn't rely on any previous data.
- if (!buffer->setSizeAndColorSpace(size().width(), size().height(),
- colorSpaceForSkImages())) {
+ if (!buffer->allocatePixelData(size().width(), size().height(),
+ colorSpaceForSkImages())) {
return false;
}
+ buffer->zeroFillPixelData();
} else {
ImageFrame* const prevBuffer =
&m_frameBufferCache[requiredPreviousFrameIndex];

Powered by Google App Engine
This is Rietveld 408576698