OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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_LAYER_IMPL_H_ | 5 #ifndef CC_LAYERS_LAYER_IMPL_H_ |
6 #define CC_LAYERS_LAYER_IMPL_H_ | 6 #define CC_LAYERS_LAYER_IMPL_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 30 matching lines...) Expand all Loading... |
41 } | 41 } |
42 | 42 |
43 class DictionaryValue; | 43 class DictionaryValue; |
44 } | 44 } |
45 | 45 |
46 namespace cc { | 46 namespace cc { |
47 | 47 |
48 class LayerTreeHostImpl; | 48 class LayerTreeHostImpl; |
49 class LayerTreeImpl; | 49 class LayerTreeImpl; |
50 class MicroBenchmarkImpl; | 50 class MicroBenchmarkImpl; |
51 class QuadSink; | 51 template <typename LayerType> |
| 52 class OcclusionTracker; |
52 class Renderer; | 53 class Renderer; |
53 class ScrollbarAnimationController; | 54 class ScrollbarAnimationController; |
54 class ScrollbarLayerImplBase; | 55 class ScrollbarLayerImplBase; |
55 class Tile; | 56 class Tile; |
56 | 57 |
57 struct AppendQuadsData; | 58 struct AppendQuadsData; |
58 | 59 |
59 enum DrawMode { | 60 enum DrawMode { |
60 DRAW_MODE_NONE, | 61 DRAW_MODE_NONE, |
61 DRAW_MODE_HARDWARE, | 62 DRAW_MODE_HARDWARE, |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 | 171 |
171 void PopulateSharedQuadState(SharedQuadState* state) const; | 172 void PopulateSharedQuadState(SharedQuadState* state) const; |
172 // WillDraw must be called before AppendQuads. If WillDraw returns false, | 173 // WillDraw must be called before AppendQuads. If WillDraw returns false, |
173 // AppendQuads and DidDraw will not be called. If WillDraw returns true, | 174 // AppendQuads and DidDraw will not be called. If WillDraw returns true, |
174 // DidDraw is guaranteed to be called before another WillDraw or before | 175 // DidDraw is guaranteed to be called before another WillDraw or before |
175 // the layer is destroyed. To enforce this, any class that overrides | 176 // the layer is destroyed. To enforce this, any class that overrides |
176 // WillDraw/DidDraw must call the base class version only if WillDraw | 177 // WillDraw/DidDraw must call the base class version only if WillDraw |
177 // returns true. | 178 // returns true. |
178 virtual bool WillDraw(DrawMode draw_mode, | 179 virtual bool WillDraw(DrawMode draw_mode, |
179 ResourceProvider* resource_provider); | 180 ResourceProvider* resource_provider); |
180 virtual void AppendQuads(QuadSink* quad_sink, | 181 virtual void AppendQuads(RenderPass* render_pass, |
| 182 const OcclusionTracker<LayerImpl>& occlusion_tracker, |
181 AppendQuadsData* append_quads_data) {} | 183 AppendQuadsData* append_quads_data) {} |
182 virtual void DidDraw(ResourceProvider* resource_provider); | 184 virtual void DidDraw(ResourceProvider* resource_provider); |
183 | 185 |
184 virtual ResourceProvider::ResourceId ContentsResourceId() const; | 186 virtual ResourceProvider::ResourceId ContentsResourceId() const; |
185 | 187 |
186 virtual bool HasDelegatedContent() const; | 188 virtual bool HasDelegatedContent() const; |
187 virtual bool HasContributingDelegatedRenderPasses() const; | 189 virtual bool HasContributingDelegatedRenderPasses() const; |
188 virtual RenderPass::Id FirstContributingRenderPassId() const; | 190 virtual RenderPass::Id FirstContributingRenderPassId() const; |
189 virtual RenderPass::Id NextContributingRenderPassId(RenderPass::Id id) const; | 191 virtual RenderPass::Id NextContributingRenderPassId(RenderPass::Id id) const; |
190 | 192 |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
532 | 534 |
533 void Set3dSortingContextId(int id); | 535 void Set3dSortingContextId(int id); |
534 int sorting_context_id() { return sorting_context_id_; } | 536 int sorting_context_id() { return sorting_context_id_; } |
535 | 537 |
536 protected: | 538 protected: |
537 LayerImpl(LayerTreeImpl* layer_impl, int id); | 539 LayerImpl(LayerTreeImpl* layer_impl, int id); |
538 | 540 |
539 // Get the color and size of the layer's debug border. | 541 // Get the color and size of the layer's debug border. |
540 virtual void GetDebugBorderProperties(SkColor* color, float* width) const; | 542 virtual void GetDebugBorderProperties(SkColor* color, float* width) const; |
541 | 543 |
542 void AppendDebugBorderQuad(QuadSink* quad_sink, | 544 void AppendDebugBorderQuad(RenderPass* render_pass, |
543 const gfx::Size& content_bounds, | 545 const gfx::Size& content_bounds, |
544 const SharedQuadState* shared_quad_state, | 546 const SharedQuadState* shared_quad_state, |
545 AppendQuadsData* append_quads_data) const; | 547 AppendQuadsData* append_quads_data) const; |
546 void AppendDebugBorderQuad(QuadSink* quad_sink, | 548 void AppendDebugBorderQuad(RenderPass* render_pass, |
547 const gfx::Size& content_bounds, | 549 const gfx::Size& content_bounds, |
548 const SharedQuadState* shared_quad_state, | 550 const SharedQuadState* shared_quad_state, |
549 AppendQuadsData* append_quads_data, | 551 AppendQuadsData* append_quads_data, |
550 SkColor color, | 552 SkColor color, |
551 float width) const; | 553 float width) const; |
552 | 554 |
553 virtual void AsValueInto(base::DictionaryValue* dict) const; | 555 virtual void AsValueInto(base::DictionaryValue* dict) const; |
554 | 556 |
555 void NoteLayerPropertyChanged(); | 557 void NoteLayerPropertyChanged(); |
556 void NoteLayerPropertyChangedForSubtree(); | 558 void NoteLayerPropertyChangedForSubtree(); |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
687 DrawProperties<LayerImpl> draw_properties_; | 689 DrawProperties<LayerImpl> draw_properties_; |
688 | 690 |
689 scoped_refptr<base::debug::ConvertableToTraceFormat> debug_info_; | 691 scoped_refptr<base::debug::ConvertableToTraceFormat> debug_info_; |
690 | 692 |
691 DISALLOW_COPY_AND_ASSIGN(LayerImpl); | 693 DISALLOW_COPY_AND_ASSIGN(LayerImpl); |
692 }; | 694 }; |
693 | 695 |
694 } // namespace cc | 696 } // namespace cc |
695 | 697 |
696 #endif // CC_LAYERS_LAYER_IMPL_H_ | 698 #endif // CC_LAYERS_LAYER_IMPL_H_ |
OLD | NEW |