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

Unified Diff: chrome/browser/renderer_host/render_widget_host_view_gtk.cc

Issue 66013: Fix problems correctly invalidating/repainting when our updated paint rect fo... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 8 months 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/renderer_host/render_widget_host_view_gtk.cc
===================================================================
--- chrome/browser/renderer_host/render_widget_host_view_gtk.cc (revision 13668)
+++ chrome/browser/renderer_host/render_widget_host_view_gtk.cc (working copy)
@@ -159,6 +159,7 @@
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::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::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 @@
// 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)
« no previous file with comments | « chrome/browser/renderer_host/render_widget_host_view_gtk.h ('k') | chrome/browser/renderer_host/render_widget_host_view_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698