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

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

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.h
diff --git a/third_party/WebKit/Source/platform/image-decoders/ImageFrame.h b/third_party/WebKit/Source/platform/image-decoders/ImageFrame.h
index bdbf82e0d6e86e5c512dc7ee0d5d18c9a73915fc..9c5615bfd8ad515126a9c1561ad7764344606de5 100644
--- a/third_party/WebKit/Source/platform/image-decoders/ImageFrame.h
+++ b/third_party/WebKit/Source/platform/image-decoders/ImageFrame.h
@@ -119,8 +119,9 @@ class PLATFORM_EXPORT ImageFrame final {
}
// Allocates space for the pixel data. Must be called before any pixels
- // are written. Must only be called once. Returns whether allocation
- // succeeded.
+ // are written. Must only be called once. The specified color space may
+ // be nullptr if and only if color correct rendering is enabled. Returns
+ // whether allocation succeeded.
bool setSizeAndColorSpace(int newWidth, int newHeight, sk_sp<SkColorSpace>);
bool hasAlpha() const;
@@ -245,6 +246,10 @@ class PLATFORM_EXPORT ImageFrame final {
// True if the pixels changed, but the bitmap has not yet been notified.
bool m_pixelsChanged;
+ // The color space of the image. This will never be null. If a color profile
+ // was not embedded in the image, this will be set to sRGB.
+ sk_sp<SkColorSpace> m_colorSpace;
+
// The frame that must be decoded before this frame can be decoded.
// WTF::kNotFound if this frame doesn't require any previous frame.
// This is used by ImageDecoder::clearCacheExceptFrame(), and will never

Powered by Google App Engine
This is Rietveld 408576698