Chromium Code Reviews| 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 <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 240 // the layer is destroyed. To enforce this, any class that overrides | 240 // the layer is destroyed. To enforce this, any class that overrides |
| 241 // WillDraw/DidDraw must call the base class version only if WillDraw | 241 // WillDraw/DidDraw must call the base class version only if WillDraw |
| 242 // returns true. | 242 // returns true. |
| 243 virtual bool WillDraw(DrawMode draw_mode, | 243 virtual bool WillDraw(DrawMode draw_mode, |
| 244 ResourceProvider* resource_provider); | 244 ResourceProvider* resource_provider); |
| 245 virtual void AppendQuads(RenderPass* render_pass, | 245 virtual void AppendQuads(RenderPass* render_pass, |
| 246 AppendQuadsData* append_quads_data) {} | 246 AppendQuadsData* append_quads_data) {} |
| 247 virtual void DidDraw(ResourceProvider* resource_provider); | 247 virtual void DidDraw(ResourceProvider* resource_provider); |
| 248 | 248 |
| 249 // Verify that the resource ids in the quad are valid. | 249 // Verify that the resource ids in the quad are valid. |
| 250 void ValidateQuadResources(DrawQuad* quad) const { | 250 void ValidateQuadResources(DrawQuad* quad) const; |
| 251 #if DCHECK_IS_ON() | |
|
danakj
2015/05/28 17:10:05
The idea here is that the function is a no-op in t
vmpstr
2015/05/28 18:38:45
OK. I'm not too sure how much of an impact this ma
| |
| 252 ValidateQuadResourcesInternal(quad); | |
| 253 #endif | |
| 254 } | |
| 255 | 251 |
| 256 virtual void GetContentsResourceId(ResourceId* resource_id, | 252 virtual void GetContentsResourceId(ResourceId* resource_id, |
| 257 gfx::Size* resource_size) const; | 253 gfx::Size* resource_size) const; |
| 258 | 254 |
| 259 virtual bool HasDelegatedContent() const; | 255 virtual bool HasDelegatedContent() const; |
| 260 virtual bool HasContributingDelegatedRenderPasses() const; | 256 virtual bool HasContributingDelegatedRenderPasses() const; |
| 261 virtual RenderPassId FirstContributingRenderPassId() const; | 257 virtual RenderPassId FirstContributingRenderPassId() const; |
| 262 virtual RenderPassId NextContributingRenderPassId(RenderPassId id) const; | 258 virtual RenderPassId NextContributingRenderPassId(RenderPassId id) const; |
| 263 | 259 |
| 264 virtual void NotifyTileStateChanged(const Tile* tile) {} | 260 virtual void NotifyTileStateChanged(const Tile* tile) {} |
| (...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 684 | 680 |
| 685 void NoteLayerPropertyChanged(); | 681 void NoteLayerPropertyChanged(); |
| 686 void NoteLayerPropertyChangedForSubtree(); | 682 void NoteLayerPropertyChangedForSubtree(); |
| 687 | 683 |
| 688 // Note carefully this does not affect the current layer. | 684 // Note carefully this does not affect the current layer. |
| 689 void NoteLayerPropertyChangedForDescendants(); | 685 void NoteLayerPropertyChangedForDescendants(); |
| 690 | 686 |
| 691 gfx::Rect GetScaledEnclosingRectInTargetSpace(float scale) const; | 687 gfx::Rect GetScaledEnclosingRectInTargetSpace(float scale) const; |
| 692 | 688 |
| 693 private: | 689 private: |
| 694 void ValidateQuadResourcesInternal(DrawQuad* quad) const; | |
| 695 | |
| 696 void PushScrollOffset(const gfx::ScrollOffset* scroll_offset); | 690 void PushScrollOffset(const gfx::ScrollOffset* scroll_offset); |
| 697 // If the new scroll offset is assigned from the root scroll offset delegate, | 691 // If the new scroll offset is assigned from the root scroll offset delegate, |
| 698 // LayerImpl won't inform the root scroll offset delegate about the scroll | 692 // LayerImpl won't inform the root scroll offset delegate about the scroll |
| 699 // change to avoid feedback. | 693 // change to avoid feedback. |
| 700 void DidUpdateScrollOffset(bool is_from_root_delegate); | 694 void DidUpdateScrollOffset(bool is_from_root_delegate); |
| 701 void NoteLayerPropertyChangedForDescendantsInternal(); | 695 void NoteLayerPropertyChangedForDescendantsInternal(); |
| 702 | 696 |
| 703 virtual const char* LayerTypeAsString() const; | 697 virtual const char* LayerTypeAsString() const; |
| 704 | 698 |
| 705 // Properties internal to LayerImpl | 699 // Properties internal to LayerImpl |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 847 bool visited_; | 841 bool visited_; |
| 848 bool layer_or_descendant_is_drawn_; | 842 bool layer_or_descendant_is_drawn_; |
| 849 bool sorted_for_recursion_; | 843 bool sorted_for_recursion_; |
| 850 | 844 |
| 851 DISALLOW_COPY_AND_ASSIGN(LayerImpl); | 845 DISALLOW_COPY_AND_ASSIGN(LayerImpl); |
| 852 }; | 846 }; |
| 853 | 847 |
| 854 } // namespace cc | 848 } // namespace cc |
| 855 | 849 |
| 856 #endif // CC_LAYERS_LAYER_IMPL_H_ | 850 #endif // CC_LAYERS_LAYER_IMPL_H_ |
| OLD | NEW |