Commit 690e4f99 authored by mmocny@chromium.org's avatar mmocny@chromium.org

Smooth Tab Switching on aura.

If there is no available front surface to display when switching to a tab, delay compositing until the next swap which gives us something
to display, or some timeout is reached instead.


BUG=126526
TEST=Manual


Review URL: https://chromiumcodereview.appspot.com/10543010

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@141733 0039d316-1c4b-4281-b951-d872f2087c98
parent 097c1d40
......@@ -287,10 +287,14 @@ RenderWidgetHost* RenderWidgetHostViewAura::GetRenderWidgetHost() const {
void RenderWidgetHostViewAura::DidBecomeSelected() {
host_->WasRestored();
if (!current_surface_ && host_->is_accelerated_compositing_active() &&
!released_front_lock_.get())
released_front_lock_ = window_->GetRootWindow()->GetCompositorLock();
}
void RenderWidgetHostViewAura::WasHidden() {
host_->WasHidden();
released_front_lock_ = NULL;
}
void RenderWidgetHostViewAura::SetSize(const gfx::Size& size) {
......@@ -506,6 +510,8 @@ void RenderWidgetHostViewAura::UpdateExternalTexture() {
container->Update();
window_->SetExternalTexture(container);
released_front_lock_ = NULL;
if (!container) {
resize_locks_.clear();
} else {
......
......@@ -22,6 +22,10 @@
#include "ui/gfx/rect.h"
#include "webkit/glue/webcursor.h"
namespace aura {
class CompositorLock;
}
namespace content {
class RenderWidgetHostImpl;
class RenderWidgetHostView;
......@@ -308,6 +312,9 @@ class RenderWidgetHostViewAura
// These locks are the ones waiting for a frame to be drawn.
std::vector<linked_ptr<ResizeLock> > locks_pending_draw_;
// This lock is for waiting for a front surface to become available to draw.
scoped_refptr<aura::CompositorLock> released_front_lock_;
DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAura);
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment