| 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 9d0791f64778280dbc797795ed0a02a0bf8a3686..ff9dcc19a1943ceeba1aa8da674303226fe872c8 100644
|
| --- a/third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp
|
| +++ b/third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp
|
| @@ -106,15 +106,19 @@ bool ImageFrame::takeBitmapDataIfWritable(ImageFrame* other) {
|
| bool ImageFrame::setSizeAndColorSpace(int newWidth,
|
| int newHeight,
|
| sk_sp<SkColorSpace> colorSpace) {
|
| - // setSizeAndColorProfile() should only be called once, it leaks memory
|
| + // setSizeAndColorSpace() should only be called once, it leaks memory
|
| // otherwise.
|
| - ASSERT(!width() && !height());
|
| + DCHECK(!width() && !height());
|
|
|
| + // The image must specify a color space.
|
| + // TODO(ccameron): This should be set unconditionally, but specifying a
|
| + // non-renderable SkColorSpace results in errors.
|
| + // https://bugs.chromium.org/p/skia/issues/detail?id=5907
|
| if (RuntimeEnabledFeatures::colorCorrectRenderingEnabled()) {
|
| - if (!colorSpace)
|
| - colorSpace = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named);
|
| + DCHECK(colorSpace);
|
| + m_colorSpace = std::move(colorSpace);
|
| } else {
|
| - colorSpace = nullptr;
|
| + DCHECK(!colorSpace);
|
| }
|
|
|
| m_bitmap.setInfo(SkImageInfo::MakeN32(
|
|
|