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_TREES_OCCLUSION_TRACKER_H_ | 5 #ifndef CC_TREES_OCCLUSION_TRACKER_H_ |
6 #define CC_TREES_OCCLUSION_TRACKER_H_ | 6 #define CC_TREES_OCCLUSION_TRACKER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 // unoccluded. | 41 // unoccluded. |
42 void EnterLayer(const LayerIteratorPosition<LayerType>& layer_iterator, | 42 void EnterLayer(const LayerIteratorPosition<LayerType>& layer_iterator, |
43 bool prevent_occlusion); | 43 bool prevent_occlusion); |
44 // Called at the end of each step in the LayerIterator's front-to-back | 44 // Called at the end of each step in the LayerIterator's front-to-back |
45 // traversal. | 45 // traversal. |
46 void LeaveLayer(const LayerIteratorPosition<LayerType>& layer_iterator); | 46 void LeaveLayer(const LayerIteratorPosition<LayerType>& layer_iterator); |
47 | 47 |
48 // Returns true if the given rect in content space for a layer is fully | 48 // Returns true if the given rect in content space for a layer is fully |
49 // occluded in either screen space or the layer's target surface. | 49 // occluded in either screen space or the layer's target surface. |
50 // |render_target| is the contributing layer's render target, and | 50 // |render_target| is the contributing layer's render target, and |
51 // |draw_transform|, |transformsToTargetKnown| and |clippedRectInTarget| are | 51 // |draw_transform| and |impl_draw_transform_is_unknown| are relative to that. |
52 // relative to that. | |
53 bool Occluded(const LayerType* render_target, | 52 bool Occluded(const LayerType* render_target, |
54 gfx::Rect content_rect, | 53 gfx::Rect content_rect, |
55 const gfx::Transform& draw_transform, | 54 const gfx::Transform& draw_transform, |
56 bool impl_draw_transform_is_unknown, | 55 bool impl_draw_transform_is_unknown) const; |
57 bool is_clipped, | |
58 gfx::Rect clip_rect_in_target) const; | |
59 | 56 |
60 // Gives an unoccluded sub-rect of |content_rect| in the content space of a | 57 // Gives an unoccluded sub-rect of |content_rect| in the content space of a |
61 // layer. Used when considering occlusion for a layer that paints/draws | 58 // layer. Used when considering occlusion for a layer that paints/draws |
62 // something. |render_target| is the contributing layer's render target, and | 59 // something. |render_target| is the contributing layer's render target, and |
63 // |draw_transform|, |transformsToTargetKnown| and |clippedRectInTarget| are | 60 // |draw_transform| and |impl_draw_transform_is_unknown| are relative to that. |
64 // relative to that. | |
65 gfx::Rect UnoccludedContentRect( | 61 gfx::Rect UnoccludedContentRect( |
66 const LayerType* render_target, | 62 const LayerType* render_target, |
67 gfx::Rect content_rect, | 63 gfx::Rect content_rect, |
68 const gfx::Transform& draw_transform, | 64 const gfx::Transform& draw_transform, |
69 bool impl_draw_transform_is_unknown, | 65 bool impl_draw_transform_is_unknown) const; |
70 bool is_clipped, | |
71 gfx::Rect clip_rect_in_target) const; | |
72 | 66 |
73 // Gives an unoccluded sub-rect of |content_rect| in the content space of the | 67 // Gives an unoccluded sub-rect of |content_rect| in the content space of the |
74 // render_target owned by the layer. Used when considering occlusion for a | 68 // render_target owned by the layer. Used when considering occlusion for a |
75 // contributing surface that is rendering into another target. | 69 // contributing surface that is rendering into another target. |
76 gfx::Rect UnoccludedContributingSurfaceContentRect( | 70 gfx::Rect UnoccludedContributingSurfaceContentRect( |
77 const LayerType* layer, | 71 const LayerType* layer, |
78 bool for_replica, | 72 bool for_replica, |
79 gfx::Rect content_rect) const; | 73 gfx::Rect content_rect) const; |
80 | 74 |
81 // Report operations for recording overdraw metrics. | 75 // Report operations for recording overdraw metrics. |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 typedef OcclusionTrackerBase<Layer, RenderSurface> OcclusionTracker; | 158 typedef OcclusionTrackerBase<Layer, RenderSurface> OcclusionTracker; |
165 typedef OcclusionTrackerBase<LayerImpl, RenderSurfaceImpl> OcclusionTrackerImpl; | 159 typedef OcclusionTrackerBase<LayerImpl, RenderSurfaceImpl> OcclusionTrackerImpl; |
166 #if !defined(COMPILER_MSVC) | 160 #if !defined(COMPILER_MSVC) |
167 extern template class OcclusionTrackerBase<Layer, RenderSurface>; | 161 extern template class OcclusionTrackerBase<Layer, RenderSurface>; |
168 extern template class OcclusionTrackerBase<LayerImpl, RenderSurfaceImpl>; | 162 extern template class OcclusionTrackerBase<LayerImpl, RenderSurfaceImpl>; |
169 #endif | 163 #endif |
170 | 164 |
171 } // namespace cc | 165 } // namespace cc |
172 | 166 |
173 #endif // CC_TREES_OCCLUSION_TRACKER_H_ | 167 #endif // CC_TREES_OCCLUSION_TRACKER_H_ |
OLD | NEW |