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

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

Issue 2462803002: Plumb color space to DecodingImageGenerator and ImageFrameGenerator (Closed)
Patch Set: Incorporate review feedback Created 4 years, 1 month 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 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(

Powered by Google App Engine
This is Rietveld 408576698