| Index: ui/gfx/color_space.cc
|
| diff --git a/ui/gfx/color_space.cc b/ui/gfx/color_space.cc
|
| index 7b5421d48bd5835077102e9a5e78022d3d4fa19e..27a0f54364ac73b8e6a28919253bb1cf5f783e99 100644
|
| --- a/ui/gfx/color_space.cc
|
| +++ b/ui/gfx/color_space.cc
|
| @@ -14,7 +14,6 @@
|
| #include "third_party/skia/include/core/SkICC.h"
|
| #include "ui/gfx/icc_profile.h"
|
| #include "ui/gfx/skia_color_space_util.h"
|
| -#include "ui/gfx/transform.h"
|
|
|
| namespace gfx {
|
|
|
| @@ -188,6 +187,11 @@ ColorSpace::ColorSpace(const ColorSpace& other)
|
| sizeof(custom_primary_matrix_));
|
| }
|
| }
|
| +
|
| +ColorSpace::ColorSpace(ColorSpace&& other) = default;
|
| +
|
| +ColorSpace& ColorSpace::operator=(const ColorSpace& other) = default;
|
| +
|
| ColorSpace::~ColorSpace() = default;
|
|
|
| bool ColorSpace::IsValid() const {
|
| @@ -332,6 +336,27 @@ bool ColorSpace::operator<(const ColorSpace& other) const {
|
| return false;
|
| }
|
|
|
| +size_t ColorSpace::GetHash() const {
|
| + size_t result = (static_cast<size_t>(primaries_) << 0) |
|
| + (static_cast<size_t>(transfer_) << 8) |
|
| + (static_cast<size_t>(matrix_) << 16) |
|
| + (static_cast<size_t>(range_) << 24);
|
| + if (primaries_ == PrimaryID::CUSTOM) {
|
| + const uint32_t* params =
|
| + reinterpret_cast<const uint32_t*>(custom_primary_matrix_);
|
| + result ^= params[0];
|
| + result ^= params[4];
|
| + result ^= params[8];
|
| + }
|
| + if (transfer_ == TransferID::CUSTOM) {
|
| + const uint32_t* params =
|
| + reinterpret_cast<const uint32_t*>(custom_transfer_params_);
|
| + result ^= params[3];
|
| + result ^= params[6];
|
| + }
|
| + return result;
|
| +}
|
| +
|
| std::string ColorSpace::ToString() const {
|
| std::stringstream ss;
|
| ss << "{primaries:";
|
|
|