diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-19 19:21:56 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-19 19:21:56 +0000 |
commit | 3cbacdcbc6765a739ca5a1edf13c2dd20be13bf1 (patch) | |
tree | 3194bd84d04ea7dddb4558a6408a6d8a363b019c /content | |
parent | 815ee47fa0fdfb8fafe76b1e9ef5b478d588dc7a (diff) | |
download | chromium_src-3cbacdcbc6765a739ca5a1edf13c2dd20be13bf1.zip chromium_src-3cbacdcbc6765a739ca5a1edf13c2dd20be13bf1.tar.gz chromium_src-3cbacdcbc6765a739ca5a1edf13c2dd20be13bf1.tar.bz2 |
Fixes bug where RenderWidgetHostViewAura could drop an update request
on the floor so that when the window becomes visible again the layer
has the wrong contents. This scenario happens with contrained
windows.
BUG=134966
TEST=see bug
R=piman@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10803028
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@147503 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r-- | content/browser/renderer_host/render_widget_host_impl.h | 3 | ||||
-rw-r--r-- | content/browser/renderer_host/render_widget_host_view_aura.cc | 20 |
2 files changed, 14 insertions, 9 deletions
diff --git a/content/browser/renderer_host/render_widget_host_impl.h b/content/browser/renderer_host/render_widget_host_impl.h index 470182a..dd43f37 100644 --- a/content/browser/renderer_host/render_widget_host_impl.h +++ b/content/browser/renderer_host/render_widget_host_impl.h @@ -157,6 +157,9 @@ class CONTENT_EXPORT RenderWidgetHostImpl : virtual public RenderWidgetHost, void WasHidden(); void WasRestored(); + // Returns true if the RenderWidget is hidden. + bool is_hidden() const { return is_hidden_; } + // Called to notify the RenderWidget that its associated native window got // focused. virtual void GotFocus(); 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 141a759..5fd9a2a 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.cc +++ b/content/browser/renderer_host/render_widget_host_view_aura.cc @@ -382,12 +382,18 @@ void RenderWidgetHostViewAura::ImeCompositionRangeChanged( void RenderWidgetHostViewAura::DidUpdateBackingStore( const gfx::Rect& scroll_rect, int scroll_dx, int scroll_dy, const std::vector<gfx::Rect>& copy_rects) { - if (!window_->IsVisible()) - return; - if (accelerated_compositing_state_changed_) UpdateExternalTexture(); + // Use the state of the RenderWidgetHost and not the window as the two may + // differ. In particular if the window is hidden but the renderer isn't and we + // ignore the update and the window is made visible again the layer isn't + // marked as dirty and we show the wrong thing. + // We do this after UpdateExternalTexture() so that when we become visible + // we're not drawing a stale texture. + if (host_->is_hidden()) + return; + gfx::Rect clip_rect; if (paint_canvas_) { SkRect sk_clip_rect; @@ -507,10 +513,8 @@ void RenderWidgetHostViewAura::UpdateExternalTexture() { accelerated_compositing_state_changed_ = false; } - if (current_surface_ != 0 && - host_->is_accelerated_compositing_active()) { - ui::Texture* container = - image_transport_clients_[current_surface_]; + if (current_surface_ != 0 && host_->is_accelerated_compositing_active()) { + ui::Texture* container = image_transport_clients_[current_surface_]; window_->SetExternalTexture(container); released_front_lock_ = NULL; @@ -1200,8 +1204,6 @@ void RenderWidgetHostViewAura::OnCaptureLost() { } void RenderWidgetHostViewAura::OnPaint(gfx::Canvas* canvas) { - if (!window_->IsVisible()) - return; paint_canvas_ = canvas; BackingStore* backing_store = host_->GetBackingStore(true); paint_canvas_ = NULL; |