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

Unified Diff: content/browser/renderer_host/render_widget_host_view_aura.cc

Issue 10692114: Fixes black flash when accelerated composited paints the tab background (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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 | « content/browser/renderer_host/render_widget_host_view_aura.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_widget_host_view_aura.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index e0e3c52ffd6abf3a5120f14f4b4c6dd605dff45a..7a97cf16730a05397bf759014930f6f7463c4af9 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -218,7 +218,7 @@ RenderWidgetHostViewAura::RenderWidgetHostViewAura(RenderWidgetHost* host)
current_surface_(0),
paint_canvas_(NULL),
synthetic_move_sent_(false),
- needs_update_texture_(false) {
+ accelerated_compositing_state_changed_(false) {
host_->SetView(this);
window_observer_.reset(new WindowObserver(this));
window_->AddObserver(window_observer_.get());
@@ -379,7 +379,7 @@ void RenderWidgetHostViewAura::DidUpdateBackingStore(
if (!window_->IsVisible())
return;
- if (needs_update_texture_)
+ if (accelerated_compositing_state_changed_)
UpdateExternalTexture();
gfx::Rect clip_rect;
@@ -477,22 +477,30 @@ void RenderWidgetHostViewAura::CopyFromCompositingSurface(
}
void RenderWidgetHostViewAura::OnAcceleratedCompositingStateChange() {
- // Delay UpdateExternalTexture until we actually got a software frame.
+ // Delay processing the state change until we either get a software frame if
+ // switching to software mode or receive a buffers swapped notification
+ // if switching to accelerated mode.
// Sometimes (e.g. on a page load) the renderer will spuriously disable then
// re-enable accelerated compositing, causing us to flash.
// TODO(piman): factor the enable/disable accelerated compositing message into
// the UpdateRect/AcceleratedSurfaceBuffersSwapped messages so that we have
// fewer inconsistent temporary states.
- needs_update_texture_ = true;
-
- // Don't scale the contents in accelerated mode because the renderer takes
- // care of it.
- window_->layer()->set_scale_content(
- !host_->is_accelerated_compositing_active());
+ accelerated_compositing_state_changed_ = true;
}
void RenderWidgetHostViewAura::UpdateExternalTexture() {
- needs_update_texture_ = false;
+ // Delay processing accelerated compositing state change till here where we
+ // act upon the state change. (Clear the external texture if switching to
+ // software mode or set the external texture if going to accelerated mode).
+ if (accelerated_compositing_state_changed_) {
+ // Don't scale the contents in accelerated mode because the renderer takes
+ // care of it.
+ window_->layer()->set_scale_content(
+ !host_->is_accelerated_compositing_active());
+
+ accelerated_compositing_state_changed_ = false;
+ }
+
if (current_surface_ != 0 &&
host_->is_accelerated_compositing_active()) {
ImageTransportClient* container =
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_aura.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698