Chromium Code Reviews| Index: ui/gfx/color_space.h |
| diff --git a/ui/gfx/color_space.h b/ui/gfx/color_space.h |
| index 164ca0037d29d611fb1cc6b409ddea98a1ba81ed..ef8c6405f3ae852101b587eecd49ed0fae0e2ebb 100644 |
| --- a/ui/gfx/color_space.h |
| +++ b/ui/gfx/color_space.h |
| @@ -5,17 +5,12 @@ |
| #ifndef UI_GFX_COLOR_SPACE_H_ |
| #define UI_GFX_COLOR_SPACE_H_ |
| -#include <vector> |
| +#include <stdint.h> |
| #include "base/macros.h" |
| -#include "base/memory/ref_counted.h" |
| #include "build/build_config.h" |
| #include "ui/gfx/gfx_export.h" |
| -#if defined(OS_MACOSX) |
| -#include <CoreGraphics/CGColorSpace.h> |
| -#endif |
| - |
| namespace IPC { |
| template <class P> |
| struct ParamTraits; |
| @@ -23,55 +18,27 @@ struct ParamTraits; |
| namespace gfx { |
| +class ICCProfile; |
| + |
| +enum class ColorTransferFunction { UNSUPPORTED, LAST = UNSUPPORTED }; |
| + |
| +// Used to represet a color space for the purpose of color conversion. |
|
enne (OOO)
2016/07/21 22:22:53
typo
|
| class GFX_EXPORT ColorSpace { |
| public: |
| ColorSpace(); |
| - ColorSpace(ColorSpace&& other); |
| - ColorSpace(const ColorSpace& other); |
| - ColorSpace& operator=(const ColorSpace& other); |
| - ~ColorSpace(); |
| bool operator==(const ColorSpace& other) const; |
| - bool operator<(const ColorSpace& other) const; |
| - |
| - // Returns the color profile of the monitor that can best represent color. |
| - // This profile should be used for creating content that does not know on |
| - // which monitor it will be displayed. |
| - static ColorSpace FromBestMonitor(); |
| - static ColorSpace FromICCProfile(const std::vector<char>& icc_profile); |
| -#if defined(OS_MACOSX) |
| - static ColorSpace FromCGColorSpace(CGColorSpaceRef cg_color_space); |
| -#endif |
| - |
| - const std::vector<char>& GetICCProfile() const; |
| - |
| -#if defined(OS_WIN) |
| - // This will read monitor ICC profiles from disk and cache the results for the |
| - // other functions to read. This should not be called on the UI or IO thread. |
| - static void UpdateCachedProfilesOnBackgroundThread(); |
| - static bool CachedProfilesNeedUpdate(); |
| -#endif |
| - |
| - static bool IsValidProfileLength(size_t length); |
| private: |
| - struct Key; |
| - class GlobalData; |
| - enum class Type { |
| - UNDEFINED, |
| - ICC_PROFILE, |
| - LAST = ICC_PROFILE |
| - }; |
| - Type type_ = Type::UNDEFINED; |
| - |
| - // GlobalData stores large or expensive-to-compute data about a color space |
| - // (e.g, ICC profile). This structure is shared by all identical ColorSpace |
| - // objects in the process. It is lazily initialized for named color spaces. |
| - mutable scoped_refptr<GlobalData> global_data_; |
| - |
| - friend struct Key; |
| - friend class GlobalData; |
| + bool valid_ = false; |
| + ColorTransferFunction transfer_function_ = ColorTransferFunction::UNSUPPORTED; |
| + // 3x4 affine transformation matrix in row-major order. |
| + float xyz_d50_matrix_[12]; |
| + // This is used to look up the ICCProfile from which this ColorSpace was |
| + // created, if possible. |
| + uint64_t icc_profile_id_ = 0; |
| + |
| + friend class ICCProfile; |
| friend struct IPC::ParamTraits<gfx::ColorSpace>; |
| - friend struct IPC::ParamTraits<gfx::ColorSpace::Type>; |
| }; |
| } // namespace gfx |