Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(252)

Side by Side Diff: cc/blink/web_compositor_mutable_state_provider_impl.cc

Issue 1447893002: compositor-worker: Introduce WebCompositorMutableState (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698