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/macros.h" | 10 #include "base/macros.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 const gfx::Transform& draw_transform) const; | 41 const gfx::Transform& draw_transform) const; |
42 | 42 |
43 // Called at the beginning of each step in the LayerIterator's front-to-back | 43 // Called at the beginning of each step in the LayerIterator's front-to-back |
44 // traversal. | 44 // traversal. |
45 void EnterLayer(const LayerIteratorPosition& layer_iterator); | 45 void EnterLayer(const LayerIteratorPosition& layer_iterator); |
46 // Called at the end of each step in the LayerIterator's front-to-back | 46 // Called at the end of each step in the LayerIterator's front-to-back |
47 // traversal. | 47 // traversal. |
48 void LeaveLayer(const LayerIteratorPosition& layer_iterator); | 48 void LeaveLayer(const LayerIteratorPosition& layer_iterator); |
49 | 49 |
50 // Gives the region of the screen that is not occluded by something opaque. | 50 // Gives the region of the screen that is not occluded by something opaque. |
51 Region ComputeVisibleRegionInScreen() const; | 51 Region ComputeVisibleRegionInScreen(const LayerTreeImpl* layer_tree) const; |
52 | 52 |
53 void set_minimum_tracking_size(const gfx::Size& size) { | 53 void set_minimum_tracking_size(const gfx::Size& size) { |
54 minimum_tracking_size_ = size; | 54 minimum_tracking_size_ = size; |
55 } | 55 } |
56 | 56 |
57 protected: | 57 protected: |
58 struct StackObject { | 58 struct StackObject { |
59 StackObject() : target(0) {} | 59 StackObject() : target(0) {} |
60 explicit StackObject(const LayerImpl* target) : target(target) {} | 60 explicit StackObject(const RenderSurfaceImpl* target) : target(target) {} |
61 const LayerImpl* target; | 61 const RenderSurfaceImpl* target; |
62 SimpleEnclosedRegion occlusion_from_outside_target; | 62 SimpleEnclosedRegion occlusion_from_outside_target; |
63 SimpleEnclosedRegion occlusion_from_inside_target; | 63 SimpleEnclosedRegion occlusion_from_inside_target; |
64 }; | 64 }; |
65 | 65 |
66 // The stack holds occluded regions for subtrees in the | 66 // The stack holds occluded regions for subtrees in the |
67 // RenderSurfaceImpl-Layer tree, so that when we leave a subtree we may apply | 67 // RenderSurfaceImpl-Layer tree, so that when we leave a subtree we may apply |
68 // a mask to it, but not to the parts outside the subtree. | 68 // a mask to it, but not to the parts outside the subtree. |
69 // - The first time we see a new subtree under a target, we add that target to | 69 // - The first time we see a new subtree under a target, we add that target to |
70 // the top of the stack. This can happen as a layer representing itself, or as | 70 // the top of the stack. This can happen as a layer representing itself, or as |
71 // a target surface. | 71 // a target surface. |
(...skipping 29 matching lines...) Expand all Loading... |
101 | 101 |
102 gfx::Rect screen_space_clip_rect_; | 102 gfx::Rect screen_space_clip_rect_; |
103 gfx::Size minimum_tracking_size_; | 103 gfx::Size minimum_tracking_size_; |
104 | 104 |
105 DISALLOW_COPY_AND_ASSIGN(OcclusionTracker); | 105 DISALLOW_COPY_AND_ASSIGN(OcclusionTracker); |
106 }; | 106 }; |
107 | 107 |
108 } // namespace cc | 108 } // namespace cc |
109 | 109 |
110 #endif // CC_TREES_OCCLUSION_TRACKER_H_ | 110 #endif // CC_TREES_OCCLUSION_TRACKER_H_ |
OLD | NEW |