Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(185)

Side by Side Diff: cc/layers/layer_impl.h

Issue 1096703006: cc: Some more cleanup and removing TODOs for validating resources. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cleanup2: const Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/layers/io_surface_layer_impl.cc ('k') | cc/layers/layer_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
240 // DidDraw is guaranteed to be called before another WillDraw or before 240 // DidDraw is guaranteed to be called before another WillDraw or before
241 // the layer is destroyed. To enforce this, any class that overrides 241 // the layer is destroyed. To enforce this, any class that overrides
242 // WillDraw/DidDraw must call the base class version only if WillDraw 242 // WillDraw/DidDraw must call the base class version only if WillDraw
243 // returns true. 243 // returns true.
244 virtual bool WillDraw(DrawMode draw_mode, 244 virtual bool WillDraw(DrawMode draw_mode,
245 ResourceProvider* resource_provider); 245 ResourceProvider* resource_provider);
246 virtual void AppendQuads(RenderPass* render_pass, 246 virtual void AppendQuads(RenderPass* render_pass,
247 AppendQuadsData* append_quads_data) {} 247 AppendQuadsData* append_quads_data) {}
248 virtual void DidDraw(ResourceProvider* resource_provider); 248 virtual void DidDraw(ResourceProvider* resource_provider);
249 249
250 // Verify that the resource ids in the quad are valid.
251 void ValidateQuadResources(DrawQuad* quad) const {
252 #if DCHECK_IS_ON()
253 ValidateQuadResourcesInternal(quad);
254 #endif
255 }
256
250 virtual void GetContentsResourceId(ResourceProvider::ResourceId* resource_id, 257 virtual void GetContentsResourceId(ResourceProvider::ResourceId* resource_id,
251 gfx::Size* resource_size) const; 258 gfx::Size* resource_size) const;
252 259
253 virtual bool HasDelegatedContent() const; 260 virtual bool HasDelegatedContent() const;
254 virtual bool HasContributingDelegatedRenderPasses() const; 261 virtual bool HasContributingDelegatedRenderPasses() const;
255 virtual RenderPassId FirstContributingRenderPassId() const; 262 virtual RenderPassId FirstContributingRenderPassId() const;
256 virtual RenderPassId NextContributingRenderPassId(RenderPassId id) const; 263 virtual RenderPassId NextContributingRenderPassId(RenderPassId id) const;
257 264
258 virtual void NotifyTileStateChanged(const Tile* tile) {} 265 virtual void NotifyTileStateChanged(const Tile* tile) {}
259 266
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
662 669
663 void NoteLayerPropertyChanged(); 670 void NoteLayerPropertyChanged();
664 void NoteLayerPropertyChangedForSubtree(); 671 void NoteLayerPropertyChangedForSubtree();
665 672
666 // Note carefully this does not affect the current layer. 673 // Note carefully this does not affect the current layer.
667 void NoteLayerPropertyChangedForDescendants(); 674 void NoteLayerPropertyChangedForDescendants();
668 675
669 gfx::Rect GetScaledEnclosingRectInTargetSpace(float scale) const; 676 gfx::Rect GetScaledEnclosingRectInTargetSpace(float scale) const;
670 677
671 private: 678 private:
679 void ValidateQuadResourcesInternal(DrawQuad* quad) const;
680
672 void PushScrollOffset(const gfx::ScrollOffset* scroll_offset); 681 void PushScrollOffset(const gfx::ScrollOffset* scroll_offset);
673 // If the new scroll offset is assigned from the root scroll offset delegate, 682 // If the new scroll offset is assigned from the root scroll offset delegate,
674 // LayerImpl won't inform the root scroll offset delegate about the scroll 683 // LayerImpl won't inform the root scroll offset delegate about the scroll
675 // change to avoid feedback. 684 // change to avoid feedback.
676 void DidUpdateScrollOffset(bool is_from_root_delegate); 685 void DidUpdateScrollOffset(bool is_from_root_delegate);
677 void NoteLayerPropertyChangedForDescendantsInternal(); 686 void NoteLayerPropertyChangedForDescendantsInternal();
678 687
679 virtual const char* LayerTypeAsString() const; 688 virtual const char* LayerTypeAsString() const;
680 689
681 // Properties internal to LayerImpl 690 // Properties internal to LayerImpl
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
820 829
821 std::vector<FrameTimingRequest> frame_timing_requests_; 830 std::vector<FrameTimingRequest> frame_timing_requests_;
822 bool frame_timing_requests_dirty_; 831 bool frame_timing_requests_dirty_;
823 832
824 DISALLOW_COPY_AND_ASSIGN(LayerImpl); 833 DISALLOW_COPY_AND_ASSIGN(LayerImpl);
825 }; 834 };
826 835
827 } // namespace cc 836 } // namespace cc
828 837
829 #endif // CC_LAYERS_LAYER_IMPL_H_ 838 #endif // CC_LAYERS_LAYER_IMPL_H_
OLDNEW
« no previous file with comments | « cc/layers/io_surface_layer_impl.cc ('k') | cc/layers/layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698