Commit 6535d459 authored by Fady Samuel's avatar Fady Samuel Committed by Commit Bot

Surface synchronization: Check surface invariants on Android

We would like to start a Finch trial for surface sync on Android soon.
This CL re-enables Android-specific surface invariants violations checks
on Android by removing code in RenderWidgetHostImpl that bypasses those
checks. This CL also ensures that when the background transparency
changes a new LocalSurfaceId is allocated as this matches the behavior
pre-surface-sync.

Bug: 672962, 789259, 801350
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Iad2dc6c508770314ea33eb53f05944609f29b0b9
Reviewed-on: https://chromium-review.googlesource.com/1104315Reviewed-by: default avatarSaman Sami <samans@chromium.org>
Commit-Queue: Fady Samuel <fsamuel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#568091}
parent 1fe2b882
......@@ -1976,7 +1976,9 @@ RenderFrameMetadata LayerTreeHostImpl::MakeRenderFrameMetadata(
metadata.bottom_controls_height ||
last_draw_render_frame_metadata_->bottom_controls_shown_ratio !=
metadata.bottom_controls_shown_ratio ||
last_draw_render_frame_metadata_->selection != metadata.selection);
last_draw_render_frame_metadata_->selection != metadata.selection ||
last_draw_render_frame_metadata_->has_transparent_background !=
metadata.has_transparent_background);
#endif
viz::LocalSurfaceId local_surface_id =
......
......@@ -2863,8 +2863,7 @@ void RenderWidgetHostImpl::SubmitCompositorFrame(
RenderWidgetSurfaceProperties::FromCompositorFrame(frame);
if (local_surface_id == last_local_surface_id_ &&
SurfacePropertiesMismatch(new_surface_properties,
last_surface_properties_)) {
new_surface_properties != last_surface_properties_) {
std::string error = base::StringPrintf(
"[OOPIF? %d] %s\n", view_ && view_->IsRenderWidgetHostViewChildFrame(),
new_surface_properties.ToDiffString(last_surface_properties_).c_str());
......@@ -3073,36 +3072,6 @@ void RenderWidgetHostImpl::SetScreenOrientationForTesting(
SynchronizeVisualProperties();
}
// TODO(ericrk): On Android, with surface synchronization enabled, we need to
// request a new surface ID when things like top/bottom control height or
// selection handles change. This will be enabled by child surface id
// generation. For now ignore these mismatches. Remove this function when this
// issue is resolved: https://crbug.com/789259 and https://crbug.com/801350
bool RenderWidgetHostImpl::SurfacePropertiesMismatch(
const RenderWidgetSurfaceProperties& first,
const RenderWidgetSurfaceProperties& second) const {
#ifdef OS_ANDROID
if (enable_surface_synchronization_) {
// To make this comparison resistant to changes in
// RenderWidgetSurfaceProperties, create new properties which are forced to
// match only for those categories we want to ignore.
RenderWidgetSurfaceProperties second_reduced = second;
second_reduced.top_controls_height = first.top_controls_height;
second_reduced.top_controls_shown_ratio = first.top_controls_shown_ratio;
second_reduced.bottom_controls_height = first.bottom_controls_height;
second_reduced.bottom_controls_shown_ratio =
first.bottom_controls_shown_ratio;
second_reduced.selection = first.selection;
return first != second_reduced;
}
#endif
// For non-Android or when surface synchronization is not enabled, just use a
// basic comparison.
return first != second;
}
bool RenderWidgetHostImpl::LockKeyboard() {
if (!keyboard_lock_allowed_ || !is_focused_ || !view_)
return false;
......
......@@ -886,10 +886,6 @@ class CONTENT_EXPORT RenderWidgetHostImpl
void SetupInputRouter();
bool SurfacePropertiesMismatch(
const RenderWidgetSurfaceProperties& first,
const RenderWidgetSurfaceProperties& second) const;
// Start intercepting system keyboard events.
bool LockKeyboard();
......
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