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

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

Issue 2749703002: Refactor ImageFrame::setSizeAndColorSpace() (Closed)
Patch Set: Fix alloc returned value flipped 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/ImageFrame.cpp
diff --git a/third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp b/third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp
index 40952951b85fb16987b40f5a4ab85f7c284ea00a..3b6666bcece569e77b8e6acaffe1b37290f08ea1 100644
--- a/third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp
+++ b/third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp
@@ -114,11 +114,7 @@ bool ImageFrame::setSizeAndColorSpace(int newWidth,
newWidth, newHeight,
m_premultiplyAlpha ? kPremul_SkAlphaType : kUnpremul_SkAlphaType,
std::move(colorSpace)));
- if (!m_bitmap.tryAllocPixels(m_allocator, 0))
- return false;
-
- zeroFillPixelData();
- return true;
+ return m_bitmap.tryAllocPixels(m_allocator, 0);
}
bool ImageFrame::hasAlpha() const {

Powered by Google App Engine
This is Rietveld 408576698