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

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

Issue 2810813004: Hide fullscreen rotation jank (Closed)
Patch Set: Remove clearThumbnailPlaceholder fn Created 3 years, 5 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
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_android.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 c74066822d18317de92f74007a8671c337547cd7..3ef9e1480db85152d5506d2b71f250fb912162f7 100644
--- a/content/browser/renderer_host/render_widget_host_view_android.cc
+++ b/content/browser/renderer_host/render_widget_host_view_android.cc
@@ -1200,6 +1200,17 @@ void RenderWidgetHostViewAndroid::DidCreateNewRendererCompositorFrameSink(
surface_returned_resources_.clear();
}
+void RenderWidgetHostViewAndroid::EvictFrameIfNecessary() {
+ if (host_->delegate()->IsFullscreenForCurrentTab() &&
+ current_surface_size_ != view_.GetPhysicalBackingSize()) {
+ // When we're in a fullscreen and the frame size doesn't match the view
+ // size (e.g. during a fullscreen rotation), we show black instead of the
+ // incorrectly-sized frame.
+ EvictDelegatedFrame();
+ UpdateBackgroundColor(SK_ColorBLACK);
+ }
+}
+
void RenderWidgetHostViewAndroid::SubmitCompositorFrame(
const cc::LocalSurfaceId& local_surface_id,
cc::CompositorFrame frame) {
@@ -1259,6 +1270,7 @@ void RenderWidgetHostViewAndroid::DestroyDelegatedContent() {
frame_evictor_->DiscardedFrame();
delegated_frame_host_->DestroyDelegatedContent();
+ current_surface_size_.SetSize(0, 0);
}
void RenderWidgetHostViewAndroid::OnDidNotProduceFrame(
@@ -1519,6 +1531,8 @@ void RenderWidgetHostViewAndroid::OnFrameMetadataUpdated(
frame_metadata.max_page_scale_factor),
frame_metadata.root_layer_size, frame_metadata.scrollable_viewport_size,
top_content_offset, top_shown_pix, top_changed, is_mobile_optimized);
+
+ EvictFrameIfNecessary();
}
void RenderWidgetHostViewAndroid::ShowInternal() {
@@ -2143,6 +2157,7 @@ void RenderWidgetHostViewAndroid::OnGestureEvent(
}
void RenderWidgetHostViewAndroid::OnPhysicalBackingSizeChanged() {
+ EvictFrameIfNecessary();
WasResized();
}
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_android.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698