OLD | NEW |
---|---|
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 CHROME_RENDERER_PAINT_AGGREGATOR_H_ | 5 #ifndef CHROME_RENDERER_PAINT_AGGREGATOR_H_ |
6 #define CHROME_RENDERER_PAINT_AGGREGATOR_H_ | 6 #define CHROME_RENDERER_PAINT_AGGREGATOR_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 25 matching lines...) Expand all Loading... | |
36 gfx::Point scroll_delta; | 36 gfx::Point scroll_delta; |
37 gfx::Rect scroll_rect; | 37 gfx::Rect scroll_rect; |
38 std::vector<gfx::Rect> paint_rects; | 38 std::vector<gfx::Rect> paint_rects; |
39 }; | 39 }; |
40 | 40 |
41 // There is a PendingUpdate if InvalidateRect or ScrollRect were called and | 41 // There is a PendingUpdate if InvalidateRect or ScrollRect were called and |
42 // ClearPendingUpdate was not called. | 42 // ClearPendingUpdate was not called. |
43 bool HasPendingUpdate() const; | 43 bool HasPendingUpdate() const; |
44 void ClearPendingUpdate(); | 44 void ClearPendingUpdate(); |
45 | 45 |
46 const PendingUpdate& GetPendingUpdate() const { return update_; } | 46 // Returns and clears the pending update. |
brettw
2010/12/06 23:16:18
Returns -> Fills |update|
| |
47 void PopPendingUpdate(PendingUpdate* update); | |
47 | 48 |
48 // The given rect should be repainted. | 49 // The given rect should be repainted. |
49 void InvalidateRect(const gfx::Rect& rect); | 50 void InvalidateRect(const gfx::Rect& rect); |
50 | 51 |
51 // The given rect should be scrolled by the given amounts. | 52 // The given rect should be scrolled by the given amounts. |
52 void ScrollRect(int dx, int dy, const gfx::Rect& clip_rect); | 53 void ScrollRect(int dx, int dy, const gfx::Rect& clip_rect); |
53 | 54 |
54 private: | 55 private: |
55 gfx::Rect ScrollPaintRect(const gfx::Rect& paint_rect, int dx, int dy) const; | 56 gfx::Rect ScrollPaintRect(const gfx::Rect& paint_rect, int dx, int dy) const; |
56 bool ShouldInvalidateScrollRect(const gfx::Rect& rect) const; | 57 bool ShouldInvalidateScrollRect(const gfx::Rect& rect) const; |
57 void InvalidateScrollRect(); | 58 void InvalidateScrollRect(); |
58 void CombinePaintRects(); | 59 void CombinePaintRects(); |
59 | 60 |
60 PendingUpdate update_; | 61 PendingUpdate update_; |
61 }; | 62 }; |
62 | 63 |
63 #endif // CHROME_RENDERER_PAINT_AGGREGATOR_H_ | 64 #endif // CHROME_RENDERER_PAINT_AGGREGATOR_H_ |
OLD | NEW |