| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 CONTENT_RENDERER_PAINT_AGGREGATOR_H_ | 5 #ifndef CONTENT_RENDERER_PAINT_AGGREGATOR_H_ |
| 6 #define CONTENT_RENDERER_PAINT_AGGREGATOR_H_ | 6 #define CONTENT_RENDERER_PAINT_AGGREGATOR_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "content/common/content_export.h" | 11 #include "content/common/content_export.h" |
| 12 #include "ui/gfx/rect.h" | 12 #include "ui/gfx/rect.h" |
| 13 | 13 |
| 14 namespace content { |
| 15 |
| 14 // This class is responsible for aggregating multiple invalidation and scroll | 16 // This class is responsible for aggregating multiple invalidation and scroll |
| 15 // commands to produce a scroll and repaint sequence. | 17 // commands to produce a scroll and repaint sequence. |
| 16 class CONTENT_EXPORT PaintAggregator { | 18 class CONTENT_EXPORT PaintAggregator { |
| 17 public: | 19 public: |
| 18 // This structure describes an aggregation of InvalidateRect and ScrollRect | 20 // This structure describes an aggregation of InvalidateRect and ScrollRect |
| 19 // calls. If |scroll_rect| is non-empty, then that rect should be scrolled | 21 // calls. If |scroll_rect| is non-empty, then that rect should be scrolled |
| 20 // by the amount specified by |scroll_delta|. If |paint_rects| is non-empty, | 22 // by the amount specified by |scroll_delta|. If |paint_rects| is non-empty, |
| 21 // then those rects should be repainted. If |scroll_rect| and |paint_rects| | 23 // then those rects should be repainted. If |scroll_rect| and |paint_rects| |
| 22 // are non-empty, then scrolling should be performed before repainting. | 24 // are non-empty, then scrolling should be performed before repainting. |
| 23 // |scroll_delta| can only specify scrolling in one direction (i.e., the x | 25 // |scroll_delta| can only specify scrolling in one direction (i.e., the x |
| (...skipping 30 matching lines...) Expand all Loading... |
| 54 | 56 |
| 55 private: | 57 private: |
| 56 gfx::Rect ScrollPaintRect(const gfx::Rect& paint_rect, int dx, int dy) const; | 58 gfx::Rect ScrollPaintRect(const gfx::Rect& paint_rect, int dx, int dy) const; |
| 57 bool ShouldInvalidateScrollRect(const gfx::Rect& rect) const; | 59 bool ShouldInvalidateScrollRect(const gfx::Rect& rect) const; |
| 58 void InvalidateScrollRect(); | 60 void InvalidateScrollRect(); |
| 59 void CombinePaintRects(); | 61 void CombinePaintRects(); |
| 60 | 62 |
| 61 PendingUpdate update_; | 63 PendingUpdate update_; |
| 62 }; | 64 }; |
| 63 | 65 |
| 66 } // namespace content |
| 67 |
| 64 #endif // CONTENT_RENDERER_PAINT_AGGREGATOR_H_ | 68 #endif // CONTENT_RENDERER_PAINT_AGGREGATOR_H_ |
| OLD | NEW |