| 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 "platform/graphics/CompositorMutableState.h" | 5 #include "platform/graphics/CompositorMutableState.h" |
| 6 | 6 |
| 7 #include "cc/layers/layer_impl.h" | 7 #include "cc/layers/layer_impl.h" |
| 8 #include "cc/trees/effect_node.h" |
| 8 #include "cc/trees/layer_tree_impl.h" | 9 #include "cc/trees/layer_tree_impl.h" |
| 10 #include "cc/trees/property_tree.h" |
| 9 #include "platform/graphics/CompositorMutation.h" | 11 #include "platform/graphics/CompositorMutation.h" |
| 10 | 12 |
| 11 namespace blink { | 13 namespace blink { |
| 12 CompositorMutableState::CompositorMutableState(CompositorMutation* mutation, | 14 CompositorMutableState::CompositorMutableState(CompositorMutation* mutation, |
| 13 cc::LayerImpl* main, | 15 cc::LayerImpl* main, |
| 14 cc::LayerImpl* scroll) | 16 cc::LayerImpl* scroll) |
| 15 : mutation_(mutation), main_layer_(main), scroll_layer_(scroll) {} | 17 : mutation_(mutation), main_layer_(main), scroll_layer_(scroll) {} |
| 16 | 18 |
| 17 CompositorMutableState::~CompositorMutableState() {} | 19 CompositorMutableState::~CompositorMutableState() {} |
| 18 | 20 |
| 19 double CompositorMutableState::Opacity() const { | 21 double CompositorMutableState::Opacity() const { |
| 20 return main_layer_->Opacity(); | 22 return main_layer_->layer_tree_impl() |
| 23 ->property_trees() |
| 24 ->effect_tree.Node(main_layer_->effect_tree_index()) |
| 25 ->opacity; |
| 21 } | 26 } |
| 22 | 27 |
| 23 void CompositorMutableState::SetOpacity(double opacity) { | 28 void CompositorMutableState::SetOpacity(double opacity) { |
| 24 if (!main_layer_) | 29 if (!main_layer_) |
| 25 return; | 30 return; |
| 26 main_layer_->layer_tree_impl()->SetOpacityMutated(main_layer_->element_id(), | 31 main_layer_->layer_tree_impl()->SetOpacityMutated(main_layer_->element_id(), |
| 27 opacity); | 32 opacity); |
| 28 mutation_->SetOpacity(opacity); | 33 mutation_->SetOpacity(opacity); |
| 29 } | 34 } |
| 30 | 35 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 offset.set_y(scroll_top); | 74 offset.set_y(scroll_top); |
| 70 scroll_layer_->layer_tree_impl() | 75 scroll_layer_->layer_tree_impl() |
| 71 ->property_trees() | 76 ->property_trees() |
| 72 ->scroll_tree.OnScrollOffsetAnimated( | 77 ->scroll_tree.OnScrollOffsetAnimated( |
| 73 scroll_layer_->id(), scroll_layer_->scroll_tree_index(), offset, | 78 scroll_layer_->id(), scroll_layer_->scroll_tree_index(), offset, |
| 74 scroll_layer_->layer_tree_impl()); | 79 scroll_layer_->layer_tree_impl()); |
| 75 mutation_->SetScrollTop(scroll_top); | 80 mutation_->SetScrollTop(scroll_top); |
| 76 } | 81 } |
| 77 | 82 |
| 78 } // namespace blink | 83 } // namespace blink |
| OLD | NEW |