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

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

Issue 2436223002: Revert of Use SkColorSpaceXform to handle color conversions in decoders (Closed)
Patch Set: Created 4 years, 2 months 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 a3d9cd2426df51296997e2106f15777cc03e488e..ced7fa20be5d37b52973e14a9092060ed589e8f5 100644
--- a/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h
+++ b/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h
@@ -42,23 +42,23 @@
#include "wtf/text/WTFString.h"
#include <memory>
-#if USE(SKCOLORXFORM)
-#include "SkColorSpaceXform.h"
+#if USE(QCMSLIB)
+#include "qcms.h"
#endif
namespace blink {
-#if USE(SKCOLORXFORM)
-#if SK_B32_SHIFT
-inline SkColorSpaceXform::ColorFormat xformColorFormat() {
- return SkColorSpaceXform::kRGBA_8888_ColorFormat;
-}
-#else
-inline SkColorSpaceXform::ColorFormat xformColorFormat() {
- return SkColorSpaceXform::kBGRA_8888_ColorFormat;
-}
-#endif
-#endif // USE(SKCOLORXFORM)
+#if USE(QCMSLIB)
+struct QCMSTransformDeleter {
+ void operator()(qcms_transform* transform) {
+ if (transform)
+ qcms_transform_release(transform);
+ }
+};
+
+using QCMSTransformUniquePtr =
+ std::unique_ptr<qcms_transform, QCMSTransformDeleter>;
+#endif // USE(QCMSLIB)
// ImagePlanes can be used to decode color components into provided buffers
// instead of using an ImageFrame.
@@ -224,13 +224,15 @@
// embedded color profile, and is independent of whether or not that
// profile's transform has been baked into the pixel values.
bool hasColorProfile() const { return m_hasColorProfile; }
- void setColorSpaceAndComputeTransform(const char* iccData,
- unsigned iccLength,
- bool useSRGB);
-
-#if USE(SKCOLORXFORM)
- // Transformation from encoded color space to target color space.
- SkColorSpaceXform* colorTransform() {
+ void setColorProfileAndComputeTransform(const char* iccData,
+ unsigned iccLength,
+ bool hasAlpha,
+ bool useSRGB);
+
+#if USE(QCMSLIB)
+ // In contrast with hasColorProfile, this refers to the transform that has
+ // been baked into the pixels.
+ qcms_transform* colorTransform() {
return m_sourceToOutputDeviceColorTransform.get();
}
#endif
@@ -359,8 +361,8 @@
bool m_hasColorProfile = false;
ImageFrame::ICCProfile m_colorProfile;
-#if USE(SKCOLORXFORM)
- std::unique_ptr<SkColorSpaceXform> m_sourceToOutputDeviceColorTransform;
+#if USE(QCMSLIB)
+ QCMSTransformUniquePtr m_sourceToOutputDeviceColorTransform;
#endif
};

Powered by Google App Engine
This is Rietveld 408576698