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

Side by Side Diff: cc/occlusion_tracker.h

Issue 11377122: cc: Visualize non-occluding rects in composited layers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 8 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « cc/layer_tree_host_impl.cc ('k') | cc/occlusion_tracker.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 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_OCCLUSION_TRACKER_H_ 5 #ifndef CC_OCCLUSION_TRACKER_H_
6 #define CC_OCCLUSION_TRACKER_H_ 6 #define CC_OCCLUSION_TRACKER_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "cc/cc_export.h" 9 #include "cc/cc_export.h"
10 #include "cc/layer_iterator.h" 10 #include "cc/layer_iterator.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 // Report operations for recording overdraw metrics. 46 // Report operations for recording overdraw metrics.
47 OverdrawMetrics& overdrawMetrics() const { return *m_overdrawMetrics.get(); } 47 OverdrawMetrics& overdrawMetrics() const { return *m_overdrawMetrics.get(); }
48 48
49 // Gives the region of the screen that is not occluded by something opaque. 49 // Gives the region of the screen that is not occluded by something opaque.
50 Region computeVisibleRegionInScreen() const { return SubtractRegions(m_rootT argetRect, m_stack.back().occlusionInScreen); } 50 Region computeVisibleRegionInScreen() const { return SubtractRegions(m_rootT argetRect, m_stack.back().occlusionInScreen); }
51 51
52 void setMinimumTrackingSize(const gfx::Size& size) { m_minimumTrackingSize = size; } 52 void setMinimumTrackingSize(const gfx::Size& size) { m_minimumTrackingSize = size; }
53 53
54 // The following is used for visualization purposes. 54 // The following is used for visualization purposes.
55 void setOccludingScreenSpaceRectsContainer(std::vector<gfx::Rect>* rects) { m_occludingScreenSpaceRects = rects; } 55 void setOccludingScreenSpaceRectsContainer(std::vector<gfx::Rect>* rects) { m_occludingScreenSpaceRects = rects; }
56 void setNonOccludingScreenSpaceRectsContainer(std::vector<gfx::Rect>* rects) { m_nonOccludingScreenSpaceRects = rects; }
56 57
57 protected: 58 protected:
58 struct StackObject { 59 struct StackObject {
59 StackObject() : target(0) { } 60 StackObject() : target(0) { }
60 StackObject(const LayerType* target) : target(target) { } 61 StackObject(const LayerType* target) : target(target) { }
61 const LayerType* target; 62 const LayerType* target;
62 Region occlusionInScreen; 63 Region occlusionInScreen;
63 Region occlusionInTarget; 64 Region occlusionInTarget;
64 }; 65 };
65 66
(...skipping 23 matching lines...) Expand all
89 90
90 // Add the layer's occlusion to the tracked state. 91 // Add the layer's occlusion to the tracked state.
91 void markOccludedBehindLayer(const LayerType*); 92 void markOccludedBehindLayer(const LayerType*);
92 93
93 gfx::Rect m_rootTargetRect; 94 gfx::Rect m_rootTargetRect;
94 scoped_ptr<OverdrawMetrics> m_overdrawMetrics; 95 scoped_ptr<OverdrawMetrics> m_overdrawMetrics;
95 gfx::Size m_minimumTrackingSize; 96 gfx::Size m_minimumTrackingSize;
96 97
97 // This is used for visualizing the occlusion tracking process. 98 // This is used for visualizing the occlusion tracking process.
98 std::vector<gfx::Rect>* m_occludingScreenSpaceRects; 99 std::vector<gfx::Rect>* m_occludingScreenSpaceRects;
100 std::vector<gfx::Rect>* m_nonOccludingScreenSpaceRects;
99 101
100 DISALLOW_COPY_AND_ASSIGN(OcclusionTrackerBase); 102 DISALLOW_COPY_AND_ASSIGN(OcclusionTrackerBase);
101 }; 103 };
102 104
103 typedef OcclusionTrackerBase<Layer, RenderSurface> OcclusionTracker; 105 typedef OcclusionTrackerBase<Layer, RenderSurface> OcclusionTracker;
104 typedef OcclusionTrackerBase<LayerImpl, RenderSurfaceImpl> OcclusionTrackerImpl; 106 typedef OcclusionTrackerBase<LayerImpl, RenderSurfaceImpl> OcclusionTrackerImpl;
105 #if !defined(COMPILER_MSVC) 107 #if !defined(COMPILER_MSVC)
106 extern template class OcclusionTrackerBase<Layer, RenderSurface>; 108 extern template class OcclusionTrackerBase<Layer, RenderSurface>;
107 extern template class OcclusionTrackerBase<LayerImpl, RenderSurfaceImpl>; 109 extern template class OcclusionTrackerBase<LayerImpl, RenderSurfaceImpl>;
108 #endif 110 #endif
109 111
110 } // namespace cc 112 } // namespace cc
111 113
112 #endif // CC_OCCLUSION_TRACKER_H_ 114 #endif // CC_OCCLUSION_TRACKER_H_
OLDNEW
« no previous file with comments | « cc/layer_tree_host_impl.cc ('k') | cc/occlusion_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698