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

Unified Diff: Source/platform/graphics/DeferredImageDecoder.cpp

Issue 531883002: use factories instead of manually setting fields (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 3 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 | « no previous file | Source/platform/graphics/ImageFrameGeneratorTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/graphics/DeferredImageDecoder.cpp
diff --git a/Source/platform/graphics/DeferredImageDecoder.cpp b/Source/platform/graphics/DeferredImageDecoder.cpp
index e2710e13c148a6673c2151d9c7eb203fab0cb075..35a511487860226302777731f5d6147c3e29a796 100644
--- a/Source/platform/graphics/DeferredImageDecoder.cpp
+++ b/Source/platform/graphics/DeferredImageDecoder.cpp
@@ -266,15 +266,12 @@ SkBitmap DeferredImageDecoder::createBitmap(size_t index)
ASSERT(decodedSize.width() > 0);
ASSERT(decodedSize.height() > 0);
- SkImageInfo info;
- info.fWidth = decodedSize.width();
- info.fHeight = decodedSize.height();
#if SK_B32_SHIFT // Little-endian RGBA pixels. (Android)
- info.fColorType = kRGBA_8888_SkColorType;
+ const SkColorType colorType = kRGBA_8888_SkColorType;
#else
- info.fColorType = kBGRA_8888_SkColorType;
+ const SkColorType colorType = kBGRA_8888_SkColorType;
#endif
- info.fAlphaType = kPremul_SkAlphaType;
+ const SkImageInfo info = SkImageInfo::Make(decodedSize.width(), decodedSize.height(), colorType, kPremul_SkAlphaType);
SkBitmap bitmap;
DecodingImageGenerator* generator = new DecodingImageGenerator(m_frameGenerator, info, index);
« no previous file with comments | « no previous file | Source/platform/graphics/ImageFrameGeneratorTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698