| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/gfx/icc_profile.h" | 5 #include "ui/gfx/icc_profile.h" |
| 6 | 6 |
| 7 #include <list> | 7 #include <list> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/containers/mru_cache.h" | 10 #include "base/containers/mru_cache.h" |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 ICCProfile icc_profile; | 125 ICCProfile icc_profile; |
| 126 std::string value = | 126 std::string value = |
| 127 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 127 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
| 128 switches::kForceColorProfile); | 128 switches::kForceColorProfile); |
| 129 if (value == "srgb") { | 129 if (value == "srgb") { |
| 130 ColorSpace::CreateSRGB().GetICCProfile(&icc_profile); | 130 ColorSpace::CreateSRGB().GetICCProfile(&icc_profile); |
| 131 } else if (value == "generic-rgb") { | 131 } else if (value == "generic-rgb") { |
| 132 ColorSpace generic_rgb_color_space(ColorSpace::PrimaryID::APPLE_GENERIC_RGB, | 132 ColorSpace generic_rgb_color_space(ColorSpace::PrimaryID::APPLE_GENERIC_RGB, |
| 133 ColorSpace::TransferID::GAMMA18); | 133 ColorSpace::TransferID::GAMMA18); |
| 134 generic_rgb_color_space.GetICCProfile(&icc_profile); | 134 generic_rgb_color_space.GetICCProfile(&icc_profile); |
| 135 } else if (value == "bt2020-gamma18") { | 135 } else if (value == "color-spin-gamma24") { |
| 136 ColorSpace generic_rgb_color_space(ColorSpace::PrimaryID::BT2020, | 136 ColorSpace color_spin_color_space( |
| 137 ColorSpace::TransferID::GAMMA18); | 137 ColorSpace::PrimaryID::WIDE_GAMUT_COLOR_SPIN, |
| 138 generic_rgb_color_space.GetICCProfile(&icc_profile); | 138 ColorSpace::TransferID::GAMMA24); |
| 139 color_spin_color_space.GetICCProfile(&icc_profile); |
| 139 } else { | 140 } else { |
| 140 LOG(ERROR) << "Invalid forced color profile"; | 141 LOG(ERROR) << "Invalid forced color profile"; |
| 141 } | 142 } |
| 142 return icc_profile; | 143 return icc_profile; |
| 143 } | 144 } |
| 144 | 145 |
| 145 // static | 146 // static |
| 146 const std::vector<char>& ICCProfile::GetData() const { | 147 const std::vector<char>& ICCProfile::GetData() const { |
| 147 return data_; | 148 return data_; |
| 148 } | 149 } |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 | 284 |
| 284 // Add to the cache. | 285 // Add to the cache. |
| 285 { | 286 { |
| 286 Cache& cache = g_cache.Get(); | 287 Cache& cache = g_cache.Get(); |
| 287 base::AutoLock lock(cache.lock); | 288 base::AutoLock lock(cache.lock); |
| 288 cache.id_to_icc_profile_mru.Put(id_, *this); | 289 cache.id_to_icc_profile_mru.Put(id_, *this); |
| 289 } | 290 } |
| 290 } | 291 } |
| 291 | 292 |
| 292 } // namespace gfx | 293 } // namespace gfx |
| OLD | NEW |