diff options
author | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-13 19:59:34 +0000 |
---|---|---|
committer | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-13 19:59:34 +0000 |
commit | ef0a90512e67c67b5845b0661c379de5a9fb3180 (patch) | |
tree | e75a2bd272cc0e20ad679058567e1d6307113796 | |
parent | 0bafddac190f5cb7fa2645e7ec4ec165c3cc41f4 (diff) | |
download | chromium_src-ef0a90512e67c67b5845b0661c379de5a9fb3180.zip chromium_src-ef0a90512e67c67b5845b0661c379de5a9fb3180.tar.gz chromium_src-ef0a90512e67c67b5845b0661c379de5a9fb3180.tar.bz2 |
touchui: Fix painting issues caused by the X message pump.
WidgetGtk has two GtkWidgets, |widget_|, and |window_contents_| inside it.
|window_contents_| is the widget that receives the GTK+ expose events and shows
up on top of |widget_|. However, RenderWidgetHostViewViews paints on |widget_|s
window, because |widget_| is considered as the NativeView. So change
native_view() to return |window_contents_| instead of |widget_| so that the
correct canvas is used for painting.
BUG=None
TEST=Webpages show up correctly with the X message pump.
Review URL: http://codereview.chromium.org/5776002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69036 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/renderer_host/render_widget_host_view_views.cc | 14 | ||||
-rw-r--r-- | chrome/browser/renderer_host/render_widget_host_view_views.h | 2 |
2 files changed, 11 insertions, 5 deletions
diff --git a/chrome/browser/renderer_host/render_widget_host_view_views.cc b/chrome/browser/renderer_host/render_widget_host_view_views.cc index 371f60e..cdc2e38 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_views.cc +++ b/chrome/browser/renderer_host/render_widget_host_view_views.cc @@ -27,6 +27,7 @@ #include "third_party/WebKit/WebKit/chromium/public/WebInputEvent.h" #include "views/event.h" #include "views/widget/widget.h" +#include "views/widget/widget_gtk.h" static const int kMaxWindowWidth = 4000; static const int kMaxWindowHeight = 4000; @@ -192,7 +193,7 @@ void RenderWidgetHostViewViews::SetSize(const gfx::Size& size) { void RenderWidgetHostViewViews::MovePluginWindows( const std::vector<webkit_glue::WebPluginGeometry>& moves) { // TODO(anicolao): NIY - NOTIMPLEMENTED(); + // NOTIMPLEMENTED(); } void RenderWidgetHostViewViews::Focus() { @@ -326,6 +327,13 @@ BackingStore* RenderWidgetHostViewViews::AllocBackingStore( } gfx::NativeView RenderWidgetHostViewViews::native_view() const { + // TODO(sad): Ideally this function should be equivalent to GetNativeView, and + // WidgetGtk-specific function call should not be necessary. + views::WidgetGtk* widget = static_cast<views::WidgetGtk*>(GetWidget()); + return widget ? widget->window_contents() : NULL; +} + +gfx::NativeView RenderWidgetHostViewViews::GetNativeView() { if (GetWidget()) return GetWidget()->GetNativeView(); return NULL; @@ -381,7 +389,7 @@ void RenderWidgetHostViewViews::Paint(gfx::Canvas* canvas) { // In the common case, use XCopyArea. We don't draw more than once, so // we don't need to double buffer. backing_store->XShowRect(origin, - paint_rect, x11_util::GetX11WindowFromGtkWidget(native_view())); + paint_rect, x11_util::GetX11WindowFromGdkWindow(window)); } else { // If the grey blend is showing, we make two drawing calls. Use double // buffering to prevent flicker. Use CairoShowRect because XShowRect @@ -420,8 +428,6 @@ void RenderWidgetHostViewViews::Paint(gfx::Canvas* canvas) { tab_switch_paint_time_ = base::TimeTicks(); } } else { - if (window) - gdk_window_clear(window); if (whiteout_start_time_.is_null()) whiteout_start_time_ = base::TimeTicks::Now(); } diff --git a/chrome/browser/renderer_host/render_widget_host_view_views.h b/chrome/browser/renderer_host/render_widget_host_view_views.h index 5a1b07e..a9a918f 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_views.h +++ b/chrome/browser/renderer_host/render_widget_host_view_views.h @@ -75,7 +75,7 @@ class RenderWidgetHostViewViews : public RenderWidgetHostView, virtual void AcceleratedCompositingActivated(bool activated); gfx::NativeView native_view() const; - virtual gfx::NativeView GetNativeView() { return native_view(); } + virtual gfx::NativeView GetNativeView(); virtual void Paint(gfx::Canvas* canvas); |