OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "cc/blink/web_compositor_mutable_state_provider_impl.h" |
| 6 |
| 7 #include "cc/animation/layer_tree_mutation.h" |
| 8 #include "cc/blink/web_compositor_mutable_state_impl.h" |
| 9 #include "cc/layers/layer_impl.h" |
| 10 #include "cc/trees/layer_tree_impl.h" |
| 11 |
| 12 namespace cc_blink { |
| 13 |
| 14 WebCompositorMutableStateProviderImpl::WebCompositorMutableStateProviderImpl( |
| 15 cc::LayerTreeImpl* state, |
| 16 cc::LayerTreeMutationMap* mutations) |
| 17 : state_(state), mutations_(mutations) {} |
| 18 |
| 19 WebCompositorMutableStateProviderImpl:: |
| 20 ~WebCompositorMutableStateProviderImpl() {} |
| 21 |
| 22 blink::WebCompositorMutableState* |
| 23 WebCompositorMutableStateProviderImpl::getMutableStateFor(uint64_t element_id) { |
| 24 cc::LayerTreeImpl::ElementLayers layers = |
| 25 state_->GetMutableLayers(element_id); |
| 26 |
| 27 if (!layers.main && !layers.scroll) |
| 28 return nullptr; |
| 29 |
| 30 return new WebCompositorMutableStateImpl(&(*mutations_)[element_id], |
| 31 layers.main, layers.scroll); |
| 32 } |
| 33 |
| 34 } // namespace cc_blink |
OLD | NEW |