| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/compositor/compositor.h" | 5 #include "ui/compositor/compositor.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <deque> | 10 #include <deque> |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 context_factory_private_->ResizeDisplay(this, size_in_pixel); | 309 context_factory_private_->ResizeDisplay(this, size_in_pixel); |
| 310 } | 310 } |
| 311 if (device_scale_factor_ != scale) { | 311 if (device_scale_factor_ != scale) { |
| 312 device_scale_factor_ = scale; | 312 device_scale_factor_ = scale; |
| 313 host_->SetDeviceScaleFactor(scale); | 313 host_->SetDeviceScaleFactor(scale); |
| 314 if (root_layer_) | 314 if (root_layer_) |
| 315 root_layer_->OnDeviceScaleFactorChanged(scale); | 315 root_layer_->OnDeviceScaleFactorChanged(scale); |
| 316 } | 316 } |
| 317 } | 317 } |
| 318 | 318 |
| 319 void Compositor::SetDisplayColorProfile(const gfx::ICCProfile& icc_profile) { | 319 void Compositor::SetDisplayColorSpace(const gfx::ColorSpace& color_space) { |
| 320 blending_color_space_ = icc_profile.GetColorSpace(); | 320 blending_color_space_ = color_space; |
| 321 output_color_space_ = blending_color_space_; | 321 output_color_space_ = blending_color_space_; |
| 322 if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableHDR)) { | 322 if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableHDR)) { |
| 323 blending_color_space_ = gfx::ColorSpace::CreateExtendedSRGB(); | 323 blending_color_space_ = gfx::ColorSpace::CreateExtendedSRGB(); |
| 324 output_color_space_ = gfx::ColorSpace::CreateSCRGBLinear(); | 324 output_color_space_ = gfx::ColorSpace::CreateSCRGBLinear(); |
| 325 } | 325 } |
| 326 host_->SetRasterColorSpace(icc_profile.GetParametricColorSpace()); | 326 host_->SetRasterColorSpace(color_space.GetParametricApproximation()); |
| 327 // Color space is reset when the output surface is lost, so this must also be | 327 // Color space is reset when the output surface is lost, so this must also be |
| 328 // updated then. | 328 // updated then. |
| 329 // TODO(fsamuel): Get rid of this. | 329 // TODO(fsamuel): Get rid of this. |
| 330 if (context_factory_private_) { | 330 if (context_factory_private_) { |
| 331 context_factory_private_->SetDisplayColorSpace(this, blending_color_space_, | 331 context_factory_private_->SetDisplayColorSpace(this, blending_color_space_, |
| 332 output_color_space_); | 332 output_color_space_); |
| 333 } | 333 } |
| 334 } | 334 } |
| 335 | 335 |
| 336 void Compositor::SetBackgroundColor(SkColor color) { | 336 void Compositor::SetBackgroundColor(SkColor color) { |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 569 void Compositor::TimeoutLocks() { | 569 void Compositor::TimeoutLocks() { |
| 570 // Make a copy, we're going to cause |active_locks_| to become | 570 // Make a copy, we're going to cause |active_locks_| to become |
| 571 // empty. | 571 // empty. |
| 572 std::vector<CompositorLock*> locks = active_locks_; | 572 std::vector<CompositorLock*> locks = active_locks_; |
| 573 for (auto* lock : locks) | 573 for (auto* lock : locks) |
| 574 lock->TimeoutLock(); | 574 lock->TimeoutLock(); |
| 575 DCHECK(active_locks_.empty()); | 575 DCHECK(active_locks_.empty()); |
| 576 } | 576 } |
| 577 | 577 |
| 578 } // namespace ui | 578 } // namespace ui |
| OLD | NEW |