diff options
author | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-19 05:24:57 +0000 |
---|---|---|
committer | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-19 05:24:57 +0000 |
commit | 552e600db9f51ac1efb0438bd749227226dffa64 (patch) | |
tree | 121e6a11a6f637e9b5cfd2d04244c94b1961420f /chrome/renderer/render_widget.h | |
parent | 0dea18f231b425216aae0c956129bc80b7086770 (diff) | |
download | chromium_src-552e600db9f51ac1efb0438bd749227226dffa64.zip chromium_src-552e600db9f51ac1efb0438bd749227226dffa64.tar.gz chromium_src-552e600db9f51ac1efb0438bd749227226dffa64.tar.bz2 |
Refactors RenderWidget to extract a PaintAggregator class.
After this change, I plan on changing the PaintAggregator algorithm.
Some things to note:
1- Previously, it was possible to send overlapping ViewHostMsg_PaintRect and
ViewHostMsg_ScrollRect messages. This happened when scrolling a page since the
scrollbar would need to be repainted while the contents of the page are being
scrolled. With this CL, this overlapping behavior is a bit more explicit.
2- There was a TODO about view_size clipping that I've eliminated. I was able
to eliminate it because I realized that it is correct to clip the rects passed
by didInvalidateRect and didScrollRect to the size of the RenderWidget.
Apparently WebKit can sometimes invalidate regions outside the view.
R=brettw
BUG=25905
TEST=none
Review URL: http://codereview.chromium.org/403005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32496 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/render_widget.h')
-rw-r--r-- | chrome/renderer/render_widget.h | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/chrome/renderer/render_widget.h b/chrome/renderer/render_widget.h index df17bd1..31eee61 100644 --- a/chrome/renderer/render_widget.h +++ b/chrome/renderer/render_widget.h @@ -14,6 +14,7 @@ #include "base/gfx/size.h" #include "base/ref_counted.h" #include "base/shared_memory.h" +#include "chrome/renderer/paint_aggregator.h" #include "chrome/renderer/render_process.h" #include "ipc/ipc_channel.h" #include "skia/ext/platform_canvas.h" @@ -120,10 +121,8 @@ class RenderWidget : public IPC::Channel::Listener, // must ensure that the given rect fits within the bounds of the WebWidget. void PaintRect(const gfx::Rect& rect, skia::PlatformCanvas* canvas); - void CallDoDeferredPaint(); - void DoDeferredPaint(); - void CallDoDeferredScroll(); - void DoDeferredScroll(); + void CallDoDeferredUpdate(); + void DoDeferredUpdate(); void DoDeferredClose(); void DoDeferredSetWindowRect(const WebKit::WebRect& pos); @@ -240,20 +239,11 @@ class RenderWidget : public IPC::Channel::Listener, TransportDIB* current_paint_buf_; TransportDIB* current_scroll_buf_; - // The smallest bounding rectangle that needs to be re-painted. This is non- - // empty if a paint event is pending. - gfx::Rect paint_rect_; - - // The clip rect for the pending scroll event. This is non-empty if a - // scroll event is pending. - gfx::Rect scroll_rect_; + PaintAggregator paint_aggregator_; // The area that must be reserved for drawing the resize corner. gfx::Rect resizer_rect_; - // The scroll delta for a pending scroll event. - gfx::Point scroll_delta_; - // Flags for the next ViewHostMsg_PaintRect message. int next_paint_flags_; |