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

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

Issue 4030005: Mac: Fix flicker on gpu->nongpu transitions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: '' Created 10 years, 2 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
« no previous file with comments | « chrome/browser/renderer_host/render_widget_host.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/renderer_host/render_widget_host.cc
diff --git a/chrome/browser/renderer_host/render_widget_host.cc b/chrome/browser/renderer_host/render_widget_host.cc
index a6efd58ae1847174aec14d0b9229276878560dfa..d5161ed6809dc2c497b9193569e144bf9d25d6f4 100644
--- a/chrome/browser/renderer_host/render_widget_host.cc
+++ b/chrome/browser/renderer_host/render_widget_host.cc
@@ -79,6 +79,9 @@ RenderWidgetHost::RenderWidgetHost(RenderProcessHost* process,
is_loading_(false),
is_hidden_(false),
is_gpu_rendering_active_(false),
+#if defined(OS_MACOSX)
+ needs_to_hide_gpu_view_on_paint_(false),
+#endif
repaint_ack_pending_(false),
resize_ack_pending_(false),
mouse_move_pending_(false),
@@ -823,6 +826,14 @@ void RenderWidgetHost::OnMsgUpdateRect(
}
}
+#if defined(OS_MACOSX)
+ if (needs_to_hide_gpu_view_on_paint_) {
+ if (view_)
+ view_->GpuRenderingStateDidChange();
+ needs_to_hide_gpu_view_on_paint_ = false;
+ }
+#endif
+
// ACK early so we can prefetch the next PaintRect if there is a next one.
// This must be done AFTER we're done painting with the bitmap supplied by the
// renderer. This ACK is a signal to the renderer that the backing store can
@@ -971,8 +982,14 @@ void RenderWidgetHost::OnMsgGpuRenderingActivated(bool activated) {
#endif
is_gpu_rendering_active_ = activated;
#if defined(OS_MACOSX)
- if (old_state != is_gpu_rendering_active_ && view_)
- view_->GpuRenderingStateDidChange();
+ if (old_state != is_gpu_rendering_active_ && view_) {
+ if (is_gpu_rendering_active_) {
+ view_->GpuRenderingStateDidChange();
+ } else {
+ // Delay revealing the non-gpu view until it has been repainted.
+ needs_to_hide_gpu_view_on_paint_ = true;
+ }
+ }
#endif
}
« no previous file with comments | « chrome/browser/renderer_host/render_widget_host.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698