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

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

Issue 2512683003: Create ImageDecoder target color space (Closed)
Patch Set: 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/ImageDecoder.h
diff --git a/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h b/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h
index cb8ccebc0d91dd6a8319b1342863ece1bd302189..3c76ea08b589610c4e5b976338afd54bf5a9439b 100644
--- a/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h
+++ b/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h
@@ -207,7 +207,12 @@ class PLATFORM_EXPORT ImageDecoder {
ImageOrientation orientation() const { return m_orientation; }
bool ignoresColorSpace() const { return m_ignoreColorSpace; }
- static void setTargetColorProfile(const WebVector<char>&);
+
+ // Set the target color profile into which all images with embedded color
+ // profiles should be converted. Note that only the first call to this
+ // function in this process has any effect.
+ static void setGlobalTargetColorProfile(const WebVector<char>&);
esprehn 2016/11/21 20:19:30 Since this isn't part of the public API we'd norma
ccameron 2016/11/21 22:28:14 I changed the caller to just pass in its WebVector
+ static sk_sp<SkColorSpace> globalTargetColorSpace();
// This returns the color space of this image. If the image had no embedded
// color profile, this will return sRGB. Returns nullptr if color correct
@@ -220,14 +225,11 @@ class PLATFORM_EXPORT ImageDecoder {
bool hasEmbeddedColorSpace() const { return m_embeddedColorSpace.get(); }
// Set the embedded color space directly or via ICC profile.
- void setColorProfileAndComputeTransform(const char* iccData,
- unsigned iccLength);
- void setColorSpaceAndComputeTransform(sk_sp<SkColorSpace> srcSpace);
+ void setEmbeddedColorProfile(const char* iccData, unsigned iccLength);
+ void setEmbeddedColorSpace(sk_sp<SkColorSpace> srcSpace);
- // Transformation from encoded color space to target color space.
- SkColorSpaceXform* colorTransform() {
- return m_sourceToOutputDeviceColorTransform.get();
- }
+ // Transformation from embedded color space to target color space.
+ SkColorSpaceXform* colorTransform();
// Sets the "decode failure" flag. For caller convenience (since so
// many callers want to return false after calling this), returns false
@@ -364,8 +366,10 @@ class PLATFORM_EXPORT ImageDecoder {
bool m_failed = false;
bool m_hasHistogrammedColorSpace = false;
+ sk_sp<SkColorSpace> m_targetColorSpace = nullptr;
sk_sp<SkColorSpace> m_embeddedColorSpace = nullptr;
- std::unique_ptr<SkColorSpaceXform> m_sourceToOutputDeviceColorTransform;
+ bool m_sourceToTargetColorTransformNeedsUpdate = false;
+ std::unique_ptr<SkColorSpaceXform> m_sourceToTargetColorTransform;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698