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

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

Issue 2454123002: Refactor image decoders to use 'colorSpace' instead of 'colorProfile' (Closed)
Patch Set: Created 4 years, 2 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 a62866e9a8cdac6513f7bedca484daa3b5dd073a..164aa83ca256995d3632d3d85f4b8ad8461813c3 100644
--- a/third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp
+++ b/third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp
@@ -103,27 +103,22 @@ bool ImageFrame::takeBitmapDataIfWritable(ImageFrame* other) {
return true;
}
-bool ImageFrame::setSizeAndColorProfile(int newWidth,
- int newHeight,
- const ICCProfile& newIccProfile) {
+bool ImageFrame::setSizeAndColorSpace(int newWidth,
+ int newHeight,
+ sk_sp<SkColorSpace> colorSpace) {
// setSizeAndColorProfile() should only be called once, it leaks memory
// otherwise.
ASSERT(!width() && !height());
- sk_sp<SkColorSpace> colorSpace;
if (RuntimeEnabledFeatures::colorCorrectRenderingEnabled()) {
- if (newIccProfile.isEmpty())
+ if (!colorSpace)
colorSpace = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named);
- else
- colorSpace =
- SkColorSpace::NewICC(newIccProfile.data(), newIccProfile.size());
- DCHECK(colorSpace);
msarett 2016/10/27 15:43:22 We lose the debug check for icc profiles that we f
ccameron 2016/10/27 22:36:11 This doesn't worry me ATM -- indeed we may want to
}
m_bitmap.setInfo(SkImageInfo::MakeN32(
newWidth, newHeight,
m_premultiplyAlpha ? kPremul_SkAlphaType : kUnpremul_SkAlphaType,
- colorSpace));
+ std::move(colorSpace)));
if (!m_bitmap.tryAllocPixels(m_allocator, 0))
return false;

Powered by Google App Engine
This is Rietveld 408576698