| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CC_LAYERS_DELEGATED_RENDERER_LAYER_IMPL_H_ | 5 #ifndef CC_LAYERS_DELEGATED_RENDERER_LAYER_IMPL_H_ |
| 6 #define CC_LAYERS_DELEGATED_RENDERER_LAYER_IMPL_H_ | 6 #define CC_LAYERS_DELEGATED_RENDERER_LAYER_IMPL_H_ |
| 7 | 7 |
| 8 #include "base/containers/hash_tables.h" | 8 #include "base/containers/hash_tables.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "cc/base/cc_export.h" | 10 #include "cc/base/cc_export.h" |
| 11 #include "cc/base/scoped_ptr_vector.h" | 11 #include "cc/base/scoped_ptr_vector.h" |
| 12 #include "cc/layers/layer_impl.h" | 12 #include "cc/layers/layer_impl.h" |
| 13 | 13 |
| 14 namespace cc { | 14 namespace cc { |
| 15 class DelegatedFrameData; | 15 class DelegatedFrameData; |
| 16 class RenderPassSink; | 16 class RenderPassSink; |
| 17 | 17 |
| 18 class CC_EXPORT DelegatedRendererLayerImpl : public LayerImpl { | 18 class CC_EXPORT DelegatedRendererLayerImpl : public LayerImpl { |
| 19 public: | 19 public: |
| 20 static scoped_ptr<DelegatedRendererLayerImpl> Create( | 20 static scoped_ptr<DelegatedRendererLayerImpl> Create( |
| 21 LayerTreeImpl* tree_impl, int id) { | 21 LayerTreeImpl* tree_impl, int id) { |
| 22 return make_scoped_ptr(new DelegatedRendererLayerImpl(tree_impl, id)); | 22 return make_scoped_ptr(new DelegatedRendererLayerImpl(tree_impl, id)); |
| 23 } | 23 } |
| 24 virtual ~DelegatedRendererLayerImpl(); | 24 virtual ~DelegatedRendererLayerImpl(); |
| 25 | 25 |
| 26 // LayerImpl overrides. | 26 // LayerImpl overrides. |
| 27 virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) | 27 virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) |
| 28 OVERRIDE; | 28 override; |
| 29 virtual bool HasDelegatedContent() const OVERRIDE; | 29 virtual bool HasDelegatedContent() const override; |
| 30 virtual bool HasContributingDelegatedRenderPasses() const OVERRIDE; | 30 virtual bool HasContributingDelegatedRenderPasses() const override; |
| 31 virtual RenderPassId FirstContributingRenderPassId() const OVERRIDE; | 31 virtual RenderPassId FirstContributingRenderPassId() const override; |
| 32 virtual RenderPassId NextContributingRenderPassId( | 32 virtual RenderPassId NextContributingRenderPassId( |
| 33 RenderPassId previous) const OVERRIDE; | 33 RenderPassId previous) const override; |
| 34 virtual void ReleaseResources() OVERRIDE; | 34 virtual void ReleaseResources() override; |
| 35 virtual bool WillDraw(DrawMode draw_mode, | 35 virtual bool WillDraw(DrawMode draw_mode, |
| 36 ResourceProvider* resource_provider) OVERRIDE; | 36 ResourceProvider* resource_provider) override; |
| 37 virtual void AppendQuads(RenderPass* render_pass, | 37 virtual void AppendQuads(RenderPass* render_pass, |
| 38 const OcclusionTracker<LayerImpl>& occlusion_tracker, | 38 const OcclusionTracker<LayerImpl>& occlusion_tracker, |
| 39 AppendQuadsData* append_quads_data) OVERRIDE; | 39 AppendQuadsData* append_quads_data) override; |
| 40 virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE; | 40 virtual void PushPropertiesTo(LayerImpl* layer) override; |
| 41 | 41 |
| 42 void AppendContributingRenderPasses(RenderPassSink* render_pass_sink); | 42 void AppendContributingRenderPasses(RenderPassSink* render_pass_sink); |
| 43 | 43 |
| 44 // Creates an ID with the resource provider for the child renderer | 44 // Creates an ID with the resource provider for the child renderer |
| 45 // that will be sending quads to the layer. Registers the callback to | 45 // that will be sending quads to the layer. Registers the callback to |
| 46 // inform when resources are no longer in use. | 46 // inform when resources are no longer in use. |
| 47 void CreateChildIdIfNeeded(const ReturnCallback& return_callback); | 47 void CreateChildIdIfNeeded(const ReturnCallback& return_callback); |
| 48 | 48 |
| 49 void SetFrameData(const DelegatedFrameData* frame_data, | 49 void SetFrameData(const DelegatedFrameData* frame_data, |
| 50 const gfx::RectF& damage_in_frame); | 50 const gfx::RectF& damage_in_frame); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 79 RenderPassId* output_render_pass_id) const; | 79 RenderPassId* output_render_pass_id) const; |
| 80 | 80 |
| 81 void AppendRenderPassQuads( | 81 void AppendRenderPassQuads( |
| 82 RenderPass* render_pass, | 82 RenderPass* render_pass, |
| 83 const OcclusionTracker<LayerImpl>& occlusion_tracker, | 83 const OcclusionTracker<LayerImpl>& occlusion_tracker, |
| 84 AppendQuadsData* append_quads_data, | 84 AppendQuadsData* append_quads_data, |
| 85 const RenderPass* delegated_render_pass, | 85 const RenderPass* delegated_render_pass, |
| 86 const gfx::Size& frame_size) const; | 86 const gfx::Size& frame_size) const; |
| 87 | 87 |
| 88 // LayerImpl overrides. | 88 // LayerImpl overrides. |
| 89 virtual const char* LayerTypeAsString() const OVERRIDE; | 89 virtual const char* LayerTypeAsString() const override; |
| 90 | 90 |
| 91 bool have_render_passes_to_push_; | 91 bool have_render_passes_to_push_; |
| 92 float inverse_device_scale_factor_; | 92 float inverse_device_scale_factor_; |
| 93 RenderPassList render_passes_in_draw_order_; | 93 RenderPassList render_passes_in_draw_order_; |
| 94 base::hash_map<RenderPassId, int> render_passes_index_by_id_; | 94 base::hash_map<RenderPassId, int> render_passes_index_by_id_; |
| 95 ResourceProvider::ResourceIdArray resources_; | 95 ResourceProvider::ResourceIdArray resources_; |
| 96 | 96 |
| 97 int child_id_; | 97 int child_id_; |
| 98 bool own_child_id_; | 98 bool own_child_id_; |
| 99 | 99 |
| 100 DISALLOW_COPY_AND_ASSIGN(DelegatedRendererLayerImpl); | 100 DISALLOW_COPY_AND_ASSIGN(DelegatedRendererLayerImpl); |
| 101 }; | 101 }; |
| 102 | 102 |
| 103 } // namespace cc | 103 } // namespace cc |
| 104 | 104 |
| 105 #endif // CC_LAYERS_DELEGATED_RENDERER_LAYER_IMPL_H_ | 105 #endif // CC_LAYERS_DELEGATED_RENDERER_LAYER_IMPL_H_ |
| OLD | NEW |