| 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_DEBUG_DEBUG_RECT_HISTORY_H_ | 5 #ifndef CC_DEBUG_DEBUG_RECT_HISTORY_H_ | 
| 6 #define CC_DEBUG_DEBUG_RECT_HISTORY_H_ | 6 #define CC_DEBUG_DEBUG_RECT_HISTORY_H_ | 
| 7 | 7 | 
| 8 #include <vector> | 8 #include <vector> | 
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" | 
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" | 
| (...skipping 16 matching lines...) Expand all  Loading... | 
| 27 // layer's opacity or position changes.) | 27 // layer's opacity or position changes.) | 
| 28 // | 28 // | 
| 29 // - Surface damage rects: the aggregate damage on a target surface that is | 29 // - Surface damage rects: the aggregate damage on a target surface that is | 
| 30 // caused by all layers and surfaces that contribute to it. This includes (1) | 30 // caused by all layers and surfaces that contribute to it. This includes (1) | 
| 31 // paint rects, (2) property- changed rects, and (3) newly exposed areas. | 31 // paint rects, (2) property- changed rects, and (3) newly exposed areas. | 
| 32 // | 32 // | 
| 33 // - Screen space rects: this is the region the contents occupy in screen space. | 33 // - Screen space rects: this is the region the contents occupy in screen space. | 
| 34 // | 34 // | 
| 35 // - Replica screen space rects: this is the region the replica's contents | 35 // - Replica screen space rects: this is the region the replica's contents | 
| 36 // occupy in screen space. | 36 // occupy in screen space. | 
| 37 // |  | 
| 38 // - Occluding rects: these are the regions that contribute to the occluded |  | 
| 39 // region. |  | 
| 40 // |  | 
| 41 // - Non-Occluding rects: these are the regions of composited layers that do not |  | 
| 42 //   contribute to the occluded region. |  | 
| 43 // |  | 
| 44 enum DebugRectType { | 37 enum DebugRectType { | 
| 45   PAINT_RECT_TYPE, | 38   PAINT_RECT_TYPE, | 
| 46   PROPERTY_CHANGED_RECT_TYPE, | 39   PROPERTY_CHANGED_RECT_TYPE, | 
| 47   SURFACE_DAMAGE_RECT_TYPE, | 40   SURFACE_DAMAGE_RECT_TYPE, | 
| 48   SCREEN_SPACE_RECT_TYPE, | 41   SCREEN_SPACE_RECT_TYPE, | 
| 49   REPLICA_SCREEN_SPACE_RECT_TYPE, | 42   REPLICA_SCREEN_SPACE_RECT_TYPE, | 
| 50   OCCLUDING_RECT_TYPE, |  | 
| 51   NONOCCLUDING_RECT_TYPE, |  | 
| 52   TOUCH_EVENT_HANDLER_RECT_TYPE, | 43   TOUCH_EVENT_HANDLER_RECT_TYPE, | 
| 53   WHEEL_EVENT_HANDLER_RECT_TYPE, | 44   WHEEL_EVENT_HANDLER_RECT_TYPE, | 
| 54   SCROLL_EVENT_HANDLER_RECT_TYPE, | 45   SCROLL_EVENT_HANDLER_RECT_TYPE, | 
| 55   NON_FAST_SCROLLABLE_RECT_TYPE, | 46   NON_FAST_SCROLLABLE_RECT_TYPE, | 
| 56   ANIMATION_BOUNDS_RECT_TYPE, | 47   ANIMATION_BOUNDS_RECT_TYPE, | 
| 57 }; | 48 }; | 
| 58 | 49 | 
| 59 struct DebugRect { | 50 struct DebugRect { | 
| 60   DebugRect(DebugRectType new_type, const gfx::Rect& new_rect) | 51   DebugRect(DebugRectType new_type, const gfx::Rect& new_rect) | 
| 61       : type(new_type), rect(new_rect) {} | 52       : type(new_type), rect(new_rect) {} | 
| (...skipping 10 matching lines...) Expand all  Loading... | 
| 72   static scoped_ptr<DebugRectHistory> Create(); | 63   static scoped_ptr<DebugRectHistory> Create(); | 
| 73 | 64 | 
| 74   ~DebugRectHistory(); | 65   ~DebugRectHistory(); | 
| 75 | 66 | 
| 76   // Note: Saving debug rects must happen before layers' change tracking is | 67   // Note: Saving debug rects must happen before layers' change tracking is | 
| 77   // reset. | 68   // reset. | 
| 78   void SaveDebugRectsForCurrentFrame( | 69   void SaveDebugRectsForCurrentFrame( | 
| 79       LayerImpl* root_layer, | 70       LayerImpl* root_layer, | 
| 80       LayerImpl* hud_layer, | 71       LayerImpl* hud_layer, | 
| 81       const LayerImplList& render_surface_layer_list, | 72       const LayerImplList& render_surface_layer_list, | 
| 82       const std::vector<gfx::Rect>& occluding_screen_space_rects, |  | 
| 83       const std::vector<gfx::Rect>& non_occluding_screen_space_rects, |  | 
| 84       const LayerTreeDebugState& debug_state); | 73       const LayerTreeDebugState& debug_state); | 
| 85 | 74 | 
| 86   const std::vector<DebugRect>& debug_rects() { return debug_rects_; } | 75   const std::vector<DebugRect>& debug_rects() { return debug_rects_; } | 
| 87 | 76 | 
| 88  private: | 77  private: | 
| 89   DebugRectHistory(); | 78   DebugRectHistory(); | 
| 90 | 79 | 
| 91   void SavePaintRects(LayerImpl* layer); | 80   void SavePaintRects(LayerImpl* layer); | 
| 92   void SavePropertyChangedRects(const LayerImplList& render_surface_layer_list, | 81   void SavePropertyChangedRects(const LayerImplList& render_surface_layer_list, | 
| 93                                 LayerImpl* hud_layer); | 82                                 LayerImpl* hud_layer); | 
| 94   void SaveSurfaceDamageRects( | 83   void SaveSurfaceDamageRects( | 
| 95       const LayerImplList& render_surface_layer_list); | 84       const LayerImplList& render_surface_layer_list); | 
| 96   void SaveScreenSpaceRects( | 85   void SaveScreenSpaceRects( | 
| 97       const LayerImplList& render_surface_layer_list); | 86       const LayerImplList& render_surface_layer_list); | 
| 98   void SaveOccludingRects( |  | 
| 99       const std::vector<gfx::Rect>& occluding_screen_space_rects); |  | 
| 100   void SaveNonOccludingRects( |  | 
| 101       const std::vector<gfx::Rect>& non_occluding_screen_space_rects); |  | 
| 102   void SaveTouchEventHandlerRects(LayerImpl* layer); | 87   void SaveTouchEventHandlerRects(LayerImpl* layer); | 
| 103   void SaveTouchEventHandlerRectsCallback(LayerImpl* layer); | 88   void SaveTouchEventHandlerRectsCallback(LayerImpl* layer); | 
| 104   void SaveWheelEventHandlerRects(LayerImpl* layer); | 89   void SaveWheelEventHandlerRects(LayerImpl* layer); | 
| 105   void SaveWheelEventHandlerRectsCallback(LayerImpl* layer); | 90   void SaveWheelEventHandlerRectsCallback(LayerImpl* layer); | 
| 106   void SaveScrollEventHandlerRects(LayerImpl* layer); | 91   void SaveScrollEventHandlerRects(LayerImpl* layer); | 
| 107   void SaveScrollEventHandlerRectsCallback(LayerImpl* layer); | 92   void SaveScrollEventHandlerRectsCallback(LayerImpl* layer); | 
| 108   void SaveNonFastScrollableRects(LayerImpl* layer); | 93   void SaveNonFastScrollableRects(LayerImpl* layer); | 
| 109   void SaveNonFastScrollableRectsCallback(LayerImpl* layer); | 94   void SaveNonFastScrollableRectsCallback(LayerImpl* layer); | 
| 110   void SaveLayerAnimationBoundsRects( | 95   void SaveLayerAnimationBoundsRects( | 
| 111       const LayerImplList& render_surface_layer_list); | 96       const LayerImplList& render_surface_layer_list); | 
| 112 | 97 | 
| 113   std::vector<DebugRect> debug_rects_; | 98   std::vector<DebugRect> debug_rects_; | 
| 114 | 99 | 
| 115   DISALLOW_COPY_AND_ASSIGN(DebugRectHistory); | 100   DISALLOW_COPY_AND_ASSIGN(DebugRectHistory); | 
| 116 }; | 101 }; | 
| 117 | 102 | 
| 118 }  // namespace cc | 103 }  // namespace cc | 
| 119 | 104 | 
| 120 #endif  // CC_DEBUG_DEBUG_RECT_HISTORY_H_ | 105 #endif  // CC_DEBUG_DEBUG_RECT_HISTORY_H_ | 
| OLD | NEW | 
|---|