summaryrefslogtreecommitdiffstats
path: root/chrome/browser/renderer_host/render_widget_host_view_gtk.cc
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-14 18:33:32 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-14 18:33:32 +0000
commitdafa99a9ee99fd8ca6b584ec0d8327fa22ccf32b (patch)
tree089c9ff01b80ca729a06dc82653992b69ea7633b /chrome/browser/renderer_host/render_widget_host_view_gtk.cc
parent52be96635f1adde6a39ded1b802c34ed5f32f076 (diff)
downloadchromium_src-dafa99a9ee99fd8ca6b584ec0d8327fa22ccf32b.zip
chromium_src-dafa99a9ee99fd8ca6b584ec0d8327fa22ccf32b.tar.gz
chromium_src-dafa99a9ee99fd8ca6b584ec0d8327fa22ccf32b.tar.bz2
Fix problems correctly invalidating/repainting when our updated paint rect for a large area came back while we were repainting a smaller area.
Review URL: http://codereview.chromium.org/66013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13681 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/renderer_host/render_widget_host_view_gtk.cc')
-rw-r--r--chrome/browser/renderer_host/render_widget_host_view_gtk.cc14
1 files changed, 12 insertions, 2 deletions
diff --git a/chrome/browser/renderer_host/render_widget_host_view_gtk.cc b/chrome/browser/renderer_host/render_widget_host_view_gtk.cc
index 32135f9..eb1b966 100644
--- a/chrome/browser/renderer_host/render_widget_host_view_gtk.cc
+++ b/chrome/browser/renderer_host/render_widget_host_view_gtk.cc
@@ -159,6 +159,7 @@ RenderWidgetHostViewGtk::RenderWidgetHostViewGtk(RenderWidgetHost* widget_host)
parent_(NULL),
popup_signal_id_(0),
activatable_(true),
+ about_to_validate_and_paint_(false),
is_loading_(false) {
host_->set_view(this);
}
@@ -277,7 +278,10 @@ void RenderWidgetHostViewGtk::IMEUpdateStatus(int control,
}
void RenderWidgetHostViewGtk::DidPaintRect(const gfx::Rect& rect) {
- Paint(rect);
+ if (about_to_validate_and_paint_)
+ invalid_rect_ = invalid_rect_.Union(rect);
+ else
+ Paint(rect);
}
void RenderWidgetHostViewGtk::DidScrollRect(const gfx::Rect& rect, int dx,
@@ -338,7 +342,13 @@ void RenderWidgetHostViewGtk::PasteFromSelectionClipboard() {
}
void RenderWidgetHostViewGtk::Paint(const gfx::Rect& damage_rect) {
+ DCHECK(!about_to_validate_and_paint_);
+
+ invalid_rect_ = damage_rect;
+ about_to_validate_and_paint_ = true;
BackingStore* backing_store = host_->GetBackingStore();
+ // Calling GetBackingStore maybe have changed |invalid_rect_|...
+ about_to_validate_and_paint_ = false;
GdkWindow* window = view_.get()->window;
if (backing_store) {
@@ -347,7 +357,7 @@ void RenderWidgetHostViewGtk::Paint(const gfx::Rect& damage_rect) {
// Destroy()ed yet and it receives paint messages...
if (window) {
backing_store->ShowRect(
- damage_rect, x11_util::GetX11WindowFromGtkWidget(view_.get()));
+ invalid_rect_, x11_util::GetX11WindowFromGtkWidget(view_.get()));
}
} else {
if (window)