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

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

Issue 1001573003: [Android] Stop hiding the RWHV layer subtree when hiding the widget (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Semi-working build Created 5 years, 9 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
Index: content/browser/renderer_host/render_widget_host_view_android.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_android.cc b/content/browser/renderer_host/render_widget_host_view_android.cc
index d61000b735e53f350cf1506e7b906a303edc8b79..2902d23a482a8875b7506ee91894d3fad6cefe6c 100644
--- a/content/browser/renderer_host/render_widget_host_view_android.cc
+++ b/content/browser/renderer_host/render_widget_host_view_android.cc
@@ -392,6 +392,7 @@ RenderWidgetHostViewAndroid::RenderWidgetHostViewAndroid(
frame_evictor_(new DelegatedFrameEvictor(this)),
locks_on_frame_count_(0),
observing_root_window_(false),
+ should_unlock_surface_on_visibility_lost_or_activity_resumed_(false),
weak_ptr_factory_(this) {
host_->SetView(this);
SetContentViewCore(content_view_core);
@@ -708,6 +709,7 @@ void RenderWidgetHostViewAndroid::OnShowUnhandledTapUIIfNeeded(int x_dip,
}
void RenderWidgetHostViewAndroid::ReleaseLocksOnSurface() {
+ should_unlock_surface_on_visibility_lost_or_activity_resumed_ = false;
if (!frame_evictor_->HasFrame()) {
DCHECK_EQ(locks_on_frame_count_, 0u);
return;
@@ -1881,6 +1883,17 @@ void RenderWidgetHostViewAndroid::OnDetachCompositor() {
overscroll_controller_.reset();
}
+void RenderWidgetHostViewAndroid::OnVisibilityChanged(bool visible) {
+ if (visible)
jdduke (slow) 2015/03/16 16:54:12 We never see this callback, as we stop observing t
no sievers 2015/03/17 21:37:47 Maybe that's ok. If somebody called Hide() we alre
+ return;
+
+ if (should_unlock_surface_on_visibility_lost_or_activity_resumed_) {
no sievers 2015/03/17 21:37:47 nit: maybe |surface_locked_for_paused_activity_| o
+ should_unlock_surface_on_visibility_lost_or_activity_resumed_ = false;
+ DCHECK_GT(locks_on_frame_count_, 0U);
+ UnlockCompositingSurface();
+ }
+}
+
void RenderWidgetHostViewAndroid::OnVSync(base::TimeTicks frame_time,
base::TimeDelta vsync_period) {
TRACE_EVENT0("cc,benchmark", "RenderWidgetHostViewAndroid::OnVSync");
@@ -1907,6 +1920,22 @@ void RenderWidgetHostViewAndroid::OnAnimate(base::TimeTicks begin_frame_time) {
SetNeedsAnimate();
}
+void RenderWidgetHostViewAndroid::OnActivityResumed() {
+ if (should_unlock_surface_on_visibility_lost_or_activity_resumed_) {
+ should_unlock_surface_on_visibility_lost_or_activity_resumed_ = false;
+ DCHECK_GT(locks_on_frame_count_, 0U);
+ UnlockCompositingSurface();
+ }
+}
+
+void RenderWidgetHostViewAndroid::OnActivityPaused() {
+ if (IsShowing()) {
+ DCHECK(!should_unlock_surface_on_visibility_lost_or_activity_resumed_);
+ should_unlock_surface_on_visibility_lost_or_activity_resumed_ = true;
+ LockCompositingSurface();
+ }
+}
+
void RenderWidgetHostViewAndroid::OnLostResources() {
ReleaseLocksOnSurface();
if (layer_.get())

Powered by Google App Engine
This is Rietveld 408576698