| Index: cc/debug_rect_history.h
|
| diff --git a/cc/debug_rect_history.h b/cc/debug_rect_history.h
|
| index d4b19799f8ac77ff315d7c0dac11953d4c95f4d6..0092b9dcf1fb960b4512d92ab10d308cb075b637 100644
|
| --- a/cc/debug_rect_history.h
|
| +++ b/cc/debug_rect_history.h
|
| @@ -18,64 +18,85 @@ class LayerTreeDebugState;
|
|
|
| // There are currently six types of debug rects:
|
| //
|
| -// - Paint rects (update rects): regions of a layer that needed to be re-uploaded to the
|
| -// texture resource; in most cases implying that they had to be repainted, too.
|
| +// - Paint rects (update rects): regions of a layer that needed to be
|
| +// re-uploaded to the texture resource; in most cases implying that they had to
|
| +// be repainted, too.
|
| //
|
| -// - Property-changed rects: enclosing bounds of layers that cause changes to the screen
|
| -// even if the layer did not change internally. (For example, if the layer's opacity or
|
| -// position changes.)
|
| +// - Property-changed rects: enclosing bounds of layers that cause changes to
|
| +// the screen even if the layer did not change internally. (For example, if the
|
| +// layer's opacity or position changes.)
|
| //
|
| -// - Surface damage rects: the aggregate damage on a target surface that is caused by all
|
| -// layers and surfaces that contribute to it. This includes (1) paint rects, (2) property-
|
| -// changed rects, and (3) newly exposed areas.
|
| +// - Surface damage rects: the aggregate damage on a target surface that is
|
| +// caused by all layers and surfaces that contribute to it. This includes (1)
|
| +// paint rects, (2) property- changed rects, and (3) newly exposed areas.
|
| //
|
| // - Screen space rects: this is the region the contents occupy in screen space.
|
| //
|
| -// - Replica screen space rects: this is the region the replica's contents occupy in screen space.
|
| +// - Replica screen space rects: this is the region the replica's contents
|
| +// occupy in screen space.
|
| //
|
| -// - Occluding rects: these are the regions that contribute to the occluded region.
|
| +// - Occluding rects: these are the regions that contribute to the occluded
|
| +// region.
|
| //
|
| // - Non-Occluding rects: these are the regions of composited layers that do not
|
| // contribute to the occluded region.
|
| //
|
| -enum DebugRectType { PaintRectType, PropertyChangedRectType, SurfaceDamageRectType, ScreenSpaceRectType, ReplicaScreenSpaceRectType, OccludingRectType, NonOccludingRectType };
|
| +enum DebugRectType {
|
| + PAINT_RECT_TYPE,
|
| + PROPERTY_CHANGED_RECT_TYPE,
|
| + SURFACE_DAMAGE_RECT_TYPE,
|
| + SCREEN_SPACE_RECT_TYPE,
|
| + REPLICA_SCREEN_SPACE_RECT_TYPE,
|
| + OCCLUDING_RECT_TYPE,
|
| + NONOCCLUDING_RECT_TYPE,
|
| +};
|
|
|
| struct DebugRect {
|
| - DebugRect(DebugRectType newType, gfx::RectF newRect)
|
| - : type(newType)
|
| - , rect(newRect) { }
|
| + DebugRect(DebugRectType new_type, gfx::RectF new_rect)
|
| + : type(new_type), rect(new_rect) {}
|
|
|
| - DebugRectType type;
|
| - gfx::RectF rect;
|
| + DebugRectType type;
|
| + gfx::RectF rect;
|
| };
|
|
|
| // This class maintains a history of rects of various types that can be used
|
| // for debugging purposes. The overhead of collecting rects is performed only if
|
| // the appropriate LayerTreeSettings are enabled.
|
| class DebugRectHistory {
|
| -public:
|
| - static scoped_ptr<DebugRectHistory> create();
|
| -
|
| - ~DebugRectHistory();
|
| -
|
| - // Note: Saving debug rects must happen before layers' change tracking is reset.
|
| - void saveDebugRectsForCurrentFrame(LayerImpl* rootLayer, const std::vector<LayerImpl*>& renderSurfaceLayerList, const std::vector<gfx::Rect>& occludingScreenSpaceRects, const std::vector<gfx::Rect>& nonOccludingScreenSpaceRects, const LayerTreeDebugState& debugState);
|
| -
|
| - const std::vector<DebugRect>& debugRects() { return m_debugRects; }
|
| -
|
| -private:
|
| - DebugRectHistory();
|
| -
|
| - void savePaintRects(LayerImpl*);
|
| - void savePropertyChangedRects(const std::vector<LayerImpl*>& renderSurfaceLayerList);
|
| - void saveSurfaceDamageRects(const std::vector<LayerImpl* >& renderSurfaceLayerList);
|
| - void saveScreenSpaceRects(const std::vector<LayerImpl* >& renderSurfaceLayerList);
|
| - void saveOccludingRects(const std::vector<gfx::Rect>& occludingScreenSpaceRects);
|
| - void saveNonOccludingRects(const std::vector<gfx::Rect>& nonOccludingScreenSpaceRects);
|
| -
|
| - std::vector<DebugRect> m_debugRects;
|
| -
|
| - DISALLOW_COPY_AND_ASSIGN(DebugRectHistory);
|
| + public:
|
| + static scoped_ptr<DebugRectHistory> Create();
|
| +
|
| + ~DebugRectHistory();
|
| +
|
| + // Note: Saving debug rects must happen before layers' change tracking is
|
| + // reset.
|
| + void SaveDebugRectsForCurrentFrame(
|
| + LayerImpl* root_layer,
|
| + const std::vector<LayerImpl*>& render_surface_layer_list,
|
| + const std::vector<gfx::Rect>& occluding_screen_space_rects,
|
| + const std::vector<gfx::Rect>& non_occluding_screen_space_rects,
|
| + const LayerTreeDebugState& debug_state);
|
| +
|
| + const std::vector<DebugRect>& debug_rects() { return debug_rects_; }
|
| +
|
| + private:
|
| + DebugRectHistory();
|
| +
|
| + void SavePaintRects(LayerImpl* layer);
|
| + void SavePropertyChangedRects(
|
| + const std::vector<LayerImpl*>& render_surface_layer_list);
|
| + void SaveSurfaceDamageRects(
|
| + const std::vector<LayerImpl*>& render_surface_layer_list);
|
| + void SaveScreenSpaceRects(
|
| + const std::vector<LayerImpl*>& render_surface_layer_list);
|
| + void SaveOccludingRects(
|
| + const std::vector<gfx::Rect>& occluding_screen_space_rects);
|
| + void SaveNonOccludingRects(
|
| + const std::vector<gfx::Rect>& non_occluding_screen_space_rects);
|
| +
|
| + std::vector<DebugRect> debug_rects_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(DebugRectHistory);
|
| };
|
|
|
| } // namespace cc
|
|
|