summaryrefslogtreecommitdiffstats
path: root/cc/blink/web_compositor_mutable_state_provider_impl.h
blob: 138103d6df61e8f05863b2bc9d051a4257d9510a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CC_BLINK_WEB_COMPOSITOR_MUTABLE_STATE_PROVIDER_IMPL_H_
#define CC_BLINK_WEB_COMPOSITOR_MUTABLE_STATE_PROVIDER_IMPL_H_

#include "base/compiler_specific.h"
#include "base/containers/hash_tables.h"
#include "cc/animation/layer_tree_mutation.h"
#include "cc/blink/cc_blink_export.h"

#include "third_party/WebKit/public/platform/WebCompositorMutableStateProvider.h"

namespace cc {
class LayerTreeImpl;
}  // namespace cc

namespace cc_blink {

class WebCompositorMutableStateProviderImpl
    : public blink::WebCompositorMutableStateProvider {
 public:
  // TODO(vollick): after slimming paint v2, this will need to operate on
  // property trees, not the layer tree impl.
  //
  // The LayerTreeImpl and the LayerTreeMutationMap are both owned by caller.
  CC_BLINK_EXPORT WebCompositorMutableStateProviderImpl(
      cc::LayerTreeImpl* state,
      cc::LayerTreeMutationMap* mutations);

  CC_BLINK_EXPORT ~WebCompositorMutableStateProviderImpl() override;

  CC_BLINK_EXPORT blink::WebPassOwnPtr<blink::WebCompositorMutableState>
  getMutableStateFor(uint64_t element_id) override WARN_UNUSED_RESULT;

 private:
  cc::LayerTreeImpl* state_;
  cc::LayerTreeMutationMap* mutations_;
};

}  // namespace cc_blink

#endif  // CC_BLINK_WEB_COMPOSITOR_MUTABLE_STATE_PROVIDER_IMPL_H_