Chromium Code Reviews| 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; |