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 "cc/trees/layer_tree.h" | 5 #include "cc/trees/layer_tree.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
9 #include "cc/animation/animation_host.h" | 9 #include "cc/animation/animation_host.h" |
10 #include "cc/input/page_scale_animation.h" | 10 #include "cc/input/page_scale_animation.h" |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 } | 222 } |
223 | 223 |
224 void LayerTree::SetPaintedDeviceScaleFactor(float painted_device_scale_factor) { | 224 void LayerTree::SetPaintedDeviceScaleFactor(float painted_device_scale_factor) { |
225 if (inputs_.painted_device_scale_factor == painted_device_scale_factor) | 225 if (inputs_.painted_device_scale_factor == painted_device_scale_factor) |
226 return; | 226 return; |
227 inputs_.painted_device_scale_factor = painted_device_scale_factor; | 227 inputs_.painted_device_scale_factor = painted_device_scale_factor; |
228 | 228 |
229 SetNeedsCommit(); | 229 SetNeedsCommit(); |
230 } | 230 } |
231 | 231 |
| 232 void LayerTree::SetDeviceColorSpace(const gfx::ColorSpace& device_color_space) { |
| 233 if (inputs_.device_color_space == device_color_space) |
| 234 return; |
| 235 inputs_.device_color_space = device_color_space; |
| 236 |
| 237 SetNeedsCommit(); |
| 238 } |
| 239 |
232 void LayerTree::RegisterLayer(Layer* layer) { | 240 void LayerTree::RegisterLayer(Layer* layer) { |
233 DCHECK(!LayerById(layer->id())); | 241 DCHECK(!LayerById(layer->id())); |
234 DCHECK(!in_paint_layer_contents_); | 242 DCHECK(!in_paint_layer_contents_); |
235 layer_id_map_[layer->id()] = layer; | 243 layer_id_map_[layer->id()] = layer; |
236 if (layer->element_id()) { | 244 if (layer->element_id()) { |
237 animation_host_->RegisterElement(layer->element_id(), | 245 animation_host_->RegisterElement(layer->element_id(), |
238 ElementListType::ACTIVE); | 246 ElementListType::ACTIVE); |
239 } | 247 } |
240 } | 248 } |
241 | 249 |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 tree_impl->set_top_controls_height(inputs_.top_controls_height); | 404 tree_impl->set_top_controls_height(inputs_.top_controls_height); |
397 tree_impl->set_bottom_controls_height(inputs_.bottom_controls_height); | 405 tree_impl->set_bottom_controls_height(inputs_.bottom_controls_height); |
398 tree_impl->PushTopControlsFromMainThread(inputs_.top_controls_shown_ratio); | 406 tree_impl->PushTopControlsFromMainThread(inputs_.top_controls_shown_ratio); |
399 tree_impl->elastic_overscroll()->PushFromMainThread(elastic_overscroll_); | 407 tree_impl->elastic_overscroll()->PushFromMainThread(elastic_overscroll_); |
400 if (tree_impl->IsActiveTree()) | 408 if (tree_impl->IsActiveTree()) |
401 tree_impl->elastic_overscroll()->PushPendingToActive(); | 409 tree_impl->elastic_overscroll()->PushPendingToActive(); |
402 | 410 |
403 tree_impl->set_painted_device_scale_factor( | 411 tree_impl->set_painted_device_scale_factor( |
404 inputs_.painted_device_scale_factor); | 412 inputs_.painted_device_scale_factor); |
405 | 413 |
| 414 tree_impl->SetDeviceColorSpace(inputs_.device_color_space); |
| 415 |
406 if (inputs_.pending_page_scale_animation) { | 416 if (inputs_.pending_page_scale_animation) { |
407 tree_impl->SetPendingPageScaleAnimation( | 417 tree_impl->SetPendingPageScaleAnimation( |
408 std::move(inputs_.pending_page_scale_animation)); | 418 std::move(inputs_.pending_page_scale_animation)); |
409 } | 419 } |
410 | 420 |
411 DCHECK(!tree_impl->ViewportSizeInvalid()); | 421 DCHECK(!tree_impl->ViewportSizeInvalid()); |
412 | 422 |
413 tree_impl->set_has_ever_been_drawn(false); | 423 tree_impl->set_has_ever_been_drawn(false); |
414 } | 424 } |
415 | 425 |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
722 | 732 |
723 UIResourceManager* LayerTree::GetUIResourceManager() const { | 733 UIResourceManager* LayerTree::GetUIResourceManager() const { |
724 return layer_tree_host_->GetUIResourceManager(); | 734 return layer_tree_host_->GetUIResourceManager(); |
725 } | 735 } |
726 | 736 |
727 const LayerTreeSettings& LayerTree::GetSettings() const { | 737 const LayerTreeSettings& LayerTree::GetSettings() const { |
728 return layer_tree_host_->GetSettings(); | 738 return layer_tree_host_->GetSettings(); |
729 } | 739 } |
730 | 740 |
731 } // namespace cc | 741 } // namespace cc |
OLD | NEW |