diff options
author | piman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-03 07:35:15 +0000 |
---|---|---|
committer | piman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-03 07:35:15 +0000 |
commit | b1fe6aaf4434a0e9b19c70118bf5f0acab62da69 (patch) | |
tree | a292dd22aba1dea1c05789785c15b15e2ecacf79 /content | |
parent | 3510c55316a0b0a5f67a1899b9771d258f2f7f48 (diff) | |
download | chromium_src-b1fe6aaf4434a0e9b19c70118bf5f0acab62da69.zip chromium_src-b1fe6aaf4434a0e9b19c70118bf5f0acab62da69.tar.gz chromium_src-b1fe6aaf4434a0e9b19c70118bf5f0acab62da69.tar.bz2 |
Aura: prevent synchronous drawing of web content from triggering an extra SchedulePaint
When resizing, we try to get the renderer to paint synchronously within a small
delay. When that happens, RWHVA::OnPaint calls RWH::GetBackingStore which calls
back RWHVA::DidUpdateBackingStore. We don't want that to schedule a paint
(including a compositing pass) for later, since we're already about to resolve
the resulting damage.
BUG=None
TEST=
Review URL: http://codereview.chromium.org/8386054
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108433 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r-- | content/browser/renderer_host/render_widget_host_view_aura.cc | 7 | ||||
-rw-r--r-- | content/browser/renderer_host/render_widget_host_view_aura.h | 2 |
2 files changed, 7 insertions, 2 deletions
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 ea4ab8d..b53a55c 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.cc +++ b/content/browser/renderer_host/render_widget_host_view_aura.cc @@ -84,7 +84,8 @@ RenderWidgetHostViewAura::RenderWidgetHostViewAura(RenderWidgetHost* host) ALLOW_THIS_IN_INITIALIZER_LIST(window_(new aura::Window(this))), is_fullscreen_(false), popup_parent_host_view_(NULL), - is_loading_(false) { + is_loading_(false), + skip_schedule_paint_(false) { host_->SetView(this); window_->SetProperty(aura::kTooltipTextKey, &tooltip_); } @@ -226,7 +227,7 @@ void RenderWidgetHostViewAura::ImeCancelComposition() { void RenderWidgetHostViewAura::DidUpdateBackingStore( const gfx::Rect& scroll_rect, int scroll_dx, int scroll_dy, const std::vector<gfx::Rect>& copy_rects) { - if (!window_->IsVisible()) + if (!window_->IsVisible() || skip_schedule_paint_) return; if (!scroll_rect.IsEmpty()) @@ -473,7 +474,9 @@ void RenderWidgetHostViewAura::OnCaptureLost() { void RenderWidgetHostViewAura::OnPaint(gfx::Canvas* canvas) { if (!window_->IsVisible()) return; + skip_schedule_paint_ = true; BackingStore* backing_store = host_->GetBackingStore(true); + skip_schedule_paint_ = false; if (backing_store) { static_cast<BackingStoreSkia*>(backing_store)->SkiaShowRect(gfx::Point(), canvas); diff --git a/content/browser/renderer_host/render_widget_host_view_aura.h b/content/browser/renderer_host/render_widget_host_view_aura.h index 5f7d9ce..b5da8ad 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.h +++ b/content/browser/renderer_host/render_widget_host_view_aura.h @@ -161,6 +161,8 @@ class RenderWidgetHostViewAura : public RenderWidgetHostView, accelerated_surface_containers_; #endif + bool skip_schedule_paint_; + DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAura); }; |