Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(504)

Side by Side Diff: chrome/renderer/paint_aggregator.h

Issue 403005: Refactors RenderWidget to extract a PaintAggregator class.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | chrome/renderer/paint_aggregator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_RENDERER_PAINT_AGGREGATOR_H_
6 #define CHROME_RENDERER_PAINT_AGGREGATOR_H_
7
8 #include "base/gfx/rect.h"
9
10 // This class is responsible for aggregating multiple invalidation and scroll
11 // commands to produce a single scroll and repaint.
12 class PaintAggregator {
13 public:
14
15 // This structure describes an aggregation of InvalidateRect and ScrollRect
16 // calls. If |scroll_rect| is non-empty, then that rect should be scrolled
17 // by the amount specified by |scroll_delta|. If |paint_rect| is non-empty,
18 // then that rect should be repainted. If |scroll_rect| and |paint_rect| are
19 // non-empty, then scrolling should be performed before repainting.
20 // |scroll_delta| can only specify scrolling in one direction (i.e., the x
21 // and y members cannot both be non-zero).
22 struct PendingUpdate {
23 gfx::Point scroll_delta;
24 gfx::Rect scroll_rect;
25 gfx::Rect paint_rect;
26
27 // Returns the rect damaged by scrolling within |scroll_rect| by
28 // |scroll_delta|. This rect must be repainted.
29 gfx::Rect GetScrollDamage() const;
30 };
31
32 // There is a PendingUpdate if InvalidateRect or ScrollRect were called and
33 // ClearPendingUpdate was not called.
34 bool HasPendingUpdate() const;
35 void ClearPendingUpdate();
36
37 const PendingUpdate& GetPendingUpdate() const { return update_; }
38
39 // The given rect should be repainted.
40 void InvalidateRect(const gfx::Rect& rect);
41
42 // The given rect should be scrolled by the given amounts.
43 void ScrollRect(int dx, int dy, const gfx::Rect& clip_rect);
44
45 private:
46 PendingUpdate update_;
47 };
48
49 #endif // CHROME_RENDERER_PAINT_AGGREGATOR_H_
OLDNEW
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | chrome/renderer/paint_aggregator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698