diff options
author | jdduke <jdduke@chromium.org> | 2015-03-25 13:15:00 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-03-25 20:15:55 +0000 |
commit | 7954daf991a2adda234dc2e886b2d1ddf0049221 (patch) | |
tree | d285508d123c9019c474d3d64d7ee1031cfb915a /content/browser/renderer_host/delegated_frame_evictor.cc | |
parent | ed9b8624c70da7ee429fc2beee125a4ec0fc36d0 (diff) | |
download | chromium_src-7954daf991a2adda234dc2e886b2d1ddf0049221.zip chromium_src-7954daf991a2adda234dc2e886b2d1ddf0049221.tar.gz chromium_src-7954daf991a2adda234dc2e886b2d1ddf0049221.tar.bz2 |
Reland "[Android] Preserve the front buffer when the activity is paused"
This change was reverted in r322170 due to WebView breakage. The
ApplicationStatus dependency has been made optional, allowing
WebView to opt-out of its use.
Original description: ----------------------------
Currently, when an activity is stopped, we explicitly hide the
foreground Tab. This is problematic, as current hiding semantics
might clear the visual front buffer before the window is hidden.
This in turn causes an unpleasant flickering during activity
transitions, e.g., when backgrounding Chrome or locking the screen.
Wire Activity onPause/onResume notifications to WindowAndroidObservers,
allowing the foreground tab to preserve its front buffer while hiding
its web content. If the tab is explicitly hidden, or the root window
is lost, the front buffer will be cleared as usual.
BUG=462752,434401
Review URL: https://codereview.chromium.org/1001573003
Cr-Commit-Position: refs/heads/master@{#322228}
Diffstat (limited to 'content/browser/renderer_host/delegated_frame_evictor.cc')
-rw-r--r-- | content/browser/renderer_host/delegated_frame_evictor.cc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/content/browser/renderer_host/delegated_frame_evictor.cc b/content/browser/renderer_host/delegated_frame_evictor.cc index 33d6b2c..65ae483 100644 --- a/content/browser/renderer_host/delegated_frame_evictor.cc +++ b/content/browser/renderer_host/delegated_frame_evictor.cc @@ -10,11 +10,13 @@ namespace content { DelegatedFrameEvictor::DelegatedFrameEvictor( DelegatedFrameEvictorClient* client) - : client_(client), has_frame_(false) {} + : client_(client), has_frame_(false), visible_(false) { +} DelegatedFrameEvictor::~DelegatedFrameEvictor() { DiscardedFrame(); } void DelegatedFrameEvictor::SwappedFrame(bool visible) { + visible_ = visible; has_frame_ = true; RendererFrameManager::GetInstance()->AddFrame(this, visible); } @@ -25,11 +27,14 @@ void DelegatedFrameEvictor::DiscardedFrame() { } void DelegatedFrameEvictor::SetVisible(bool visible) { + if (visible_ == visible) + return; + visible_ = visible; if (has_frame_) { if (visible) { - RendererFrameManager::GetInstance()->LockFrame(this); + LockFrame(); } else { - RendererFrameManager::GetInstance()->UnlockFrame(this); + UnlockFrame(); } } } |