| 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 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 } | 333 } |
| 334 if (device_scale_factor_ != scale) { | 334 if (device_scale_factor_ != scale) { |
| 335 device_scale_factor_ = scale; | 335 device_scale_factor_ = scale; |
| 336 host_->GetLayerTree()->SetDeviceScaleFactor(scale); | 336 host_->GetLayerTree()->SetDeviceScaleFactor(scale); |
| 337 if (root_layer_) | 337 if (root_layer_) |
| 338 root_layer_->OnDeviceScaleFactorChanged(scale); | 338 root_layer_->OnDeviceScaleFactorChanged(scale); |
| 339 } | 339 } |
| 340 } | 340 } |
| 341 | 341 |
| 342 void Compositor::SetDisplayColorSpace(const gfx::ColorSpace& color_space) { | 342 void Compositor::SetDisplayColorSpace(const gfx::ColorSpace& color_space) { |
| 343 host_->GetLayerTree()->SetDeviceColorSpace(color_space); |
| 343 color_space_ = color_space; | 344 color_space_ = color_space; |
| 344 // Color space is reset when the output surface is lost, so this must also be | 345 // Color space is reset when the output surface is lost, so this must also be |
| 345 // updated then. | 346 // updated then. |
| 346 context_factory_->SetDisplayColorSpace(this, color_space_); | 347 context_factory_->SetDisplayColorSpace(this, color_space_); |
| 347 } | 348 } |
| 348 | 349 |
| 349 void Compositor::SetBackgroundColor(SkColor color) { | 350 void Compositor::SetBackgroundColor(SkColor color) { |
| 350 host_->GetLayerTree()->set_background_color(color); | 351 host_->GetLayerTree()->set_background_color(color); |
| 351 ScheduleDraw(); | 352 ScheduleDraw(); |
| 352 } | 353 } |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 551 observer_list_, | 552 observer_list_, |
| 552 OnCompositingLockStateChanged(this)); | 553 OnCompositingLockStateChanged(this)); |
| 553 } | 554 } |
| 554 | 555 |
| 555 void Compositor::CancelCompositorLock() { | 556 void Compositor::CancelCompositorLock() { |
| 556 if (compositor_lock_) | 557 if (compositor_lock_) |
| 557 compositor_lock_->CancelLock(); | 558 compositor_lock_->CancelLock(); |
| 558 } | 559 } |
| 559 | 560 |
| 560 } // namespace ui | 561 } // namespace ui |
| OLD | NEW |