| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 // traversal. | 50 // traversal. |
| 51 void LeaveLayer(const LayerIteratorPosition<LayerType>& layer_iterator); | 51 void LeaveLayer(const LayerIteratorPosition<LayerType>& layer_iterator); |
| 52 | 52 |
| 53 // Gives the region of the screen that is not occluded by something opaque. | 53 // Gives the region of the screen that is not occluded by something opaque. |
| 54 Region ComputeVisibleRegionInScreen() const; | 54 Region ComputeVisibleRegionInScreen() const; |
| 55 | 55 |
| 56 void set_minimum_tracking_size(const gfx::Size& size) { | 56 void set_minimum_tracking_size(const gfx::Size& size) { |
| 57 minimum_tracking_size_ = size; | 57 minimum_tracking_size_ = size; |
| 58 } | 58 } |
| 59 | 59 |
| 60 // The following is used for visualization purposes. | |
| 61 void set_occluding_screen_space_rects_container( | |
| 62 std::vector<gfx::Rect>* rects) { | |
| 63 occluding_screen_space_rects_ = rects; | |
| 64 } | |
| 65 void set_non_occluding_screen_space_rects_container( | |
| 66 std::vector<gfx::Rect>* rects) { | |
| 67 non_occluding_screen_space_rects_ = rects; | |
| 68 } | |
| 69 | |
| 70 protected: | 60 protected: |
| 71 struct StackObject { | 61 struct StackObject { |
| 72 StackObject() : target(0) {} | 62 StackObject() : target(0) {} |
| 73 explicit StackObject(const LayerType* target) : target(target) {} | 63 explicit StackObject(const LayerType* target) : target(target) {} |
| 74 const LayerType* target; | 64 const LayerType* target; |
| 75 SimpleEnclosedRegion occlusion_from_outside_target; | 65 SimpleEnclosedRegion occlusion_from_outside_target; |
| 76 SimpleEnclosedRegion occlusion_from_inside_target; | 66 SimpleEnclosedRegion occlusion_from_inside_target; |
| 77 }; | 67 }; |
| 78 | 68 |
| 79 // The stack holds occluded regions for subtrees in the | 69 // The stack holds occluded regions for subtrees in the |
| (...skipping 28 matching lines...) Expand all Loading... |
| 108 // one. We then perform any operations required for merging results from the | 98 // one. We then perform any operations required for merging results from the |
| 109 // child subtree into its parent. | 99 // child subtree into its parent. |
| 110 void LeaveToRenderTarget(const LayerType* new_target); | 100 void LeaveToRenderTarget(const LayerType* new_target); |
| 111 | 101 |
| 112 // Add the layer's occlusion to the tracked state. | 102 // Add the layer's occlusion to the tracked state. |
| 113 void MarkOccludedBehindLayer(const LayerType* layer); | 103 void MarkOccludedBehindLayer(const LayerType* layer); |
| 114 | 104 |
| 115 gfx::Rect screen_space_clip_rect_; | 105 gfx::Rect screen_space_clip_rect_; |
| 116 gfx::Size minimum_tracking_size_; | 106 gfx::Size minimum_tracking_size_; |
| 117 | 107 |
| 118 // This is used for visualizing the occlusion tracking process. | |
| 119 std::vector<gfx::Rect>* occluding_screen_space_rects_; | |
| 120 std::vector<gfx::Rect>* non_occluding_screen_space_rects_; | |
| 121 | |
| 122 DISALLOW_COPY_AND_ASSIGN(OcclusionTracker); | 108 DISALLOW_COPY_AND_ASSIGN(OcclusionTracker); |
| 123 }; | 109 }; |
| 124 | 110 |
| 125 #if !defined(COMPILER_MSVC) | 111 #if !defined(COMPILER_MSVC) |
| 126 extern template class OcclusionTracker<Layer>; | 112 extern template class OcclusionTracker<Layer>; |
| 127 extern template class OcclusionTracker<LayerImpl>; | 113 extern template class OcclusionTracker<LayerImpl>; |
| 128 #endif | 114 #endif |
| 129 | 115 |
| 130 } // namespace cc | 116 } // namespace cc |
| 131 | 117 |
| 132 #endif // CC_TREES_OCCLUSION_TRACKER_H_ | 118 #endif // CC_TREES_OCCLUSION_TRACKER_H_ |
| OLD | NEW |