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

Unified Diff: third_party/WebKit/Source/platform/graphics/test/MockImageDecoder.h

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/graphics/test/MockImageDecoder.h
diff --git a/third_party/WebKit/Source/platform/graphics/test/MockImageDecoder.h b/third_party/WebKit/Source/platform/graphics/test/MockImageDecoder.h
index a99bb4680551e26e4936133969e7c44900430368..c4ef7da4e722d494d33e86a8fc2d74c8972b06da 100644
--- a/third_party/WebKit/Source/platform/graphics/test/MockImageDecoder.h
+++ b/third_party/WebKit/Source/platform/graphics/test/MockImageDecoder.h
@@ -111,8 +111,9 @@ class MockImageDecoder : public ImageDecoder {
}
void initializeNewFrame(size_t index) override {
- m_frameBufferCache[index].setSizeAndColorSpace(
- size().width(), size().height(), colorSpaceForSkImages());
+ if (m_frameBufferCache[index].allocatePixelData(
+ size().width(), size().height(), colorSpaceForSkImages()))
+ m_frameBufferCache[index].zeroFillPixelData();
m_frameBufferCache[index].setHasAlpha(false);
}

Powered by Google App Engine
This is Rietveld 408576698