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/blink/web_compositor_mutable_state_impl.h" |
| 8 #include "cc/layers/layer_impl.h" |
| 9 #include "cc/trees/layer_tree_impl.h" |
| 10 |
| 11 namespace cc_blink { |
| 12 |
| 13 WebCompositorMutableStateProviderImpl::WebCompositorMutableStateProviderImpl( |
| 14 cc::LayerTreeImpl* state, |
| 15 cc::LayerTreeMutationMap* mutations) |
| 16 : state_(state), mutations_(mutations) {} |
| 17 |
| 18 WebCompositorMutableStateProviderImpl:: |
| 19 ~WebCompositorMutableStateProviderImpl() {} |
| 20 |
| 21 blink::WebPassOwnPtr<blink::WebCompositorMutableState> |
| 22 WebCompositorMutableStateProviderImpl::getMutableStateFor(uint64_t element_id) { |
| 23 cc::LayerTreeImpl::ElementLayers layers = |
| 24 state_->GetMutableLayers(element_id); |
| 25 |
| 26 if (!layers.main && !layers.scroll) |
| 27 return nullptr; |
| 28 |
| 29 return blink::adoptWebPtr<blink::WebCompositorMutableState>( |
| 30 new WebCompositorMutableStateImpl(&(*mutations_)[element_id], layers.main, |
| 31 layers.scroll)); |
| 32 } |
| 33 |
| 34 } // namespace cc_blink |
OLD | NEW |