Update mojo surfaces bindings and mojo/cc/ glue
[chromium-blink-merge.git] / cc / layers / delegated_renderer_layer.h
blob0e4b95810dc9bad5558fd25f16b7d33a4a20bd0d
1 // Copyright 2012 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.
5 #ifndef CC_LAYERS_DELEGATED_RENDERER_LAYER_H_
6 #define CC_LAYERS_DELEGATED_RENDERER_LAYER_H_
8 #include "base/containers/hash_tables.h"
9 #include "base/memory/ref_counted.h"
10 #include "base/memory/weak_ptr.h"
11 #include "base/synchronization/lock.h"
12 #include "cc/base/cc_export.h"
13 #include "cc/layers/delegated_frame_provider.h"
14 #include "cc/layers/layer.h"
15 #include "cc/resources/returned_resource.h"
17 namespace cc {
18 class BlockingTaskRunner;
20 class CC_EXPORT DelegatedRendererLayer : public Layer {
21 public:
22 static scoped_refptr<DelegatedRendererLayer> Create(
23 const scoped_refptr<DelegatedFrameProvider>& frame_provider);
25 virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl)
26 OVERRIDE;
27 virtual void SetLayerTreeHost(LayerTreeHost* host) OVERRIDE;
28 virtual bool Update(ResourceUpdateQueue* queue,
29 const OcclusionTracker<Layer>* occlusion) OVERRIDE;
30 virtual void PushPropertiesTo(LayerImpl* impl) OVERRIDE;
32 // Called by the DelegatedFrameProvider when a new frame is available to be
33 // picked up.
34 void ProviderHasNewFrame();
35 virtual bool HasDelegatedContent() const OVERRIDE;
37 protected:
38 DelegatedRendererLayer(
39 const scoped_refptr<DelegatedFrameProvider>& frame_provider);
40 virtual ~DelegatedRendererLayer();
42 private:
43 scoped_refptr<DelegatedFrameProvider> frame_provider_;
45 bool should_collect_new_frame_;
47 DelegatedFrameData* frame_data_;
48 gfx::RectF frame_damage_;
50 scoped_refptr<BlockingTaskRunner> main_thread_runner_;
51 base::WeakPtrFactory<DelegatedRendererLayer> weak_ptrs_;
53 DISALLOW_COPY_AND_ASSIGN(DelegatedRendererLayer);
56 } // namespace cc
58 #endif // CC_LAYERS_DELEGATED_RENDERER_LAYER_H_