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

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

Issue 2512683003: Create ImageDecoder target color space (Closed)
Patch Set: Fix mid-air collision with https://codereview.chromium.org/2483243003 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 05197ff5a7f3971d5c9433248f39137f41d47dd1..b8b87a52a3eed2acce651642937d42664e2d7cf9 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>&);
+ 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
@@ -378,8 +380,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
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698