Commit 79edda64 authored by Fady Samuel's avatar Fady Samuel Committed by Commit Bot

Reland "Surface synchronization: Add a diagnostic CHECK in ClientLayerTreeFrameSink"

This is a reland of 119455cb

Original change's description:
> Surface synchronization: Add a diagnostic CHECK in ClientLayerTreeFrameSink
>
> There's a race in cc somewhere from commit to draw. I don't know exactly
> how to repro the race yet even though I have a high probably fix. This
> CL is intended to catch the race in the wild and produce a stack trace
> in a crash log. Hopefully from there we can acertain repro steps.
>
> Once repo steps are produced locally (either via user interaction or
> unit test) then this CL will be reverted.
>
> Bug: 672962
> Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel
> Change-Id: I3bce066591e15d5c3aac7d4c8685dce411e284b7
> Reviewed-on: https://chromium-review.googlesource.com/973987
> Reviewed-by: Saman Sami <samans@chromium.org>
> Commit-Queue: Fady Samuel <fsamuel@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#544834}

Bug: 672962
TBR: samans@chromium.org
Change-Id: I880540f3f00c419efb4055007787e86f4722d675
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel
Reviewed-on: https://chromium-review.googlesource.com/981154
Commit-Queue: Fady Samuel <fsamuel@chromium.org>
Reviewed-by: default avatarFady Samuel <fsamuel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#545994}
parent 12ce94a1
...@@ -133,6 +133,10 @@ void ClientLayerTreeFrameSink::SubmitCompositorFrame(CompositorFrame frame) { ...@@ -133,6 +133,10 @@ void ClientLayerTreeFrameSink::SubmitCompositorFrame(CompositorFrame frame) {
if (!enable_surface_synchronization_) { if (!enable_surface_synchronization_) {
local_surface_id_ = local_surface_id_ =
local_surface_id_provider_->GetLocalSurfaceIdForFrame(frame); local_surface_id_provider_->GetLocalSurfaceIdForFrame(frame);
} else {
CHECK(local_surface_id_ != last_submitted_local_surface_id_ ||
(last_submitted_device_scale_factor_ == frame.device_scale_factor() &&
last_submitted_size_in_pixels_ == frame.size_in_pixels()));
} }
TRACE_EVENT_FLOW_BEGIN0(TRACE_DISABLED_BY_DEFAULT("cc.debug.ipc"), TRACE_EVENT_FLOW_BEGIN0(TRACE_DISABLED_BY_DEFAULT("cc.debug.ipc"),
...@@ -145,6 +149,10 @@ void ClientLayerTreeFrameSink::SubmitCompositorFrame(CompositorFrame frame) { ...@@ -145,6 +149,10 @@ void ClientLayerTreeFrameSink::SubmitCompositorFrame(CompositorFrame frame) {
if (hit_test_data_provider_) if (hit_test_data_provider_)
hit_test_region_list = hit_test_data_provider_->GetHitTestData(frame); hit_test_region_list = hit_test_data_provider_->GetHitTestData(frame);
last_submitted_local_surface_id_ = local_surface_id_;
last_submitted_device_scale_factor_ = frame.device_scale_factor();
last_submitted_size_in_pixels_ = frame.size_in_pixels();
compositor_frame_sink_ptr_->SubmitCompositorFrame( compositor_frame_sink_ptr_->SubmitCompositorFrame(
local_surface_id_, std::move(frame), std::move(hit_test_region_list), local_surface_id_, std::move(frame), std::move(hit_test_region_list),
tracing_enabled ? base::TimeTicks::Now().since_origin().InMicroseconds() tracing_enabled ? base::TimeTicks::Now().since_origin().InMicroseconds()
......
...@@ -128,6 +128,10 @@ class VIZ_CLIENT_EXPORT ClientLayerTreeFrameSink ...@@ -128,6 +128,10 @@ class VIZ_CLIENT_EXPORT ClientLayerTreeFrameSink
const bool enable_surface_synchronization_; const bool enable_surface_synchronization_;
const bool wants_animate_only_begin_frames_; const bool wants_animate_only_begin_frames_;
LocalSurfaceId last_submitted_local_surface_id_;
float last_submitted_device_scale_factor_ = 1.f;
gfx::Size last_submitted_size_in_pixels_;
base::WeakPtrFactory<ClientLayerTreeFrameSink> weak_factory_; base::WeakPtrFactory<ClientLayerTreeFrameSink> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(ClientLayerTreeFrameSink); DISALLOW_COPY_AND_ASSIGN(ClientLayerTreeFrameSink);
......
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