diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-02-15 14:18:00 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-02-15 14:00:37 +0000 |
commit | 66a2147d838e293f4a5db7711c8eba4e6faaaf0f (patch) | |
tree | 61ad99912355f5b6cc603d9b1dfadd77b950ce98 /chromium/cc | |
parent | da51f56cc21233c2d30f0fe0d171727c3102b2e0 (diff) |
BASELINE: Update Chromium to 65.0.3325.75
Change-Id: I5485bc5c111539356276457516584fa5737f07d8
Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
Diffstat (limited to 'chromium/cc')
-rw-r--r-- | chromium/cc/scheduler/scheduler_state_machine.h | 2 | ||||
-rw-r--r-- | chromium/cc/scheduler/scheduler_state_machine_unittest.cc | 1 | ||||
-rw-r--r-- | chromium/cc/scheduler/scheduler_unittest.cc | 16 | ||||
-rw-r--r-- | chromium/cc/trees/layer_tree_host_impl.cc | 9 | ||||
-rw-r--r-- | chromium/cc/trees/layer_tree_host_impl.h | 2 | ||||
-rw-r--r-- | chromium/cc/trees/layer_tree_host_unittest.cc | 38 |
6 files changed, 66 insertions, 2 deletions
diff --git a/chromium/cc/scheduler/scheduler_state_machine.h b/chromium/cc/scheduler/scheduler_state_machine.h index a408e304b26..3c763683945 100644 --- a/chromium/cc/scheduler/scheduler_state_machine.h +++ b/chromium/cc/scheduler/scheduler_state_machine.h @@ -402,7 +402,7 @@ class CC_EXPORT SchedulerStateMachine { bool did_submit_in_last_frame_ = false; bool needs_impl_side_invalidation_ = false; bool next_invalidation_needs_first_draw_on_activation_ = false; - bool should_defer_invalidation_for_fast_main_frame_ = false; + bool should_defer_invalidation_for_fast_main_frame_ = true; // Set to true if the main thread fails to respond with a commit or abort the // main frame before the draw deadline on the previous impl frame. diff --git a/chromium/cc/scheduler/scheduler_state_machine_unittest.cc b/chromium/cc/scheduler/scheduler_state_machine_unittest.cc index 8c4064cef7e..aee47f6fdda 100644 --- a/chromium/cc/scheduler/scheduler_state_machine_unittest.cc +++ b/chromium/cc/scheduler/scheduler_state_machine_unittest.cc @@ -2359,6 +2359,7 @@ TEST(SchedulerStateMachineTest, ImplSideInvalidationWhenPendingTreeExists) { // Since there is no main frame request, this should perform impl-side // invalidations. + state.set_should_defer_invalidation_for_fast_main_frame(false); state.IssueNextBeginImplFrame(); EXPECT_ACTION_UPDATE_STATE( SchedulerStateMachine::Action::PERFORM_IMPL_SIDE_INVALIDATION); diff --git a/chromium/cc/scheduler/scheduler_unittest.cc b/chromium/cc/scheduler/scheduler_unittest.cc index e58941d2d29..04ec8ea1bee 100644 --- a/chromium/cc/scheduler/scheduler_unittest.cc +++ b/chromium/cc/scheduler/scheduler_unittest.cc @@ -3918,5 +3918,21 @@ TEST_F(SchedulerTest, EXPECT_ACTIONS("WillBeginImplFrame"); } +TEST_F(SchedulerTest, SynchronousCompositorImplSideInvalidation) { + // Synchronous compositor doesn't have a deadline and our heuristics can't + // work. We should never be prioritizing impl-side invalidations over main + // frames. + scheduler_settings_.using_synchronous_renderer_compositor = true; + SetUpScheduler(EXTERNAL_BFS); + + fake_compositor_timing_history_->SetAllEstimatesTo(kSlowDuration); + scheduler_->SetNeedsBeginMainFrame(); + const bool needs_first_draw_on_activation = true; + scheduler_->SetNeedsImplSideInvalidation(needs_first_draw_on_activation); + client_->Reset(); + EXPECT_SCOPED(AdvanceFrame()); + EXPECT_ACTIONS("WillBeginImplFrame", "ScheduledActionSendBeginMainFrame"); +} + } // namespace } // namespace cc diff --git a/chromium/cc/trees/layer_tree_host_impl.cc b/chromium/cc/trees/layer_tree_host_impl.cc index 5482b96da89..06d59301904 100644 --- a/chromium/cc/trees/layer_tree_host_impl.cc +++ b/chromium/cc/trees/layer_tree_host_impl.cc @@ -862,10 +862,16 @@ bool LayerTreeHostImpl::HasDamage(bool handle_visibility_changed) const { bool must_always_swap = layer_tree_frame_sink_->capabilities().must_always_swap; + // If we have a new LocalSurfaceId, we must always submit a CompositorFrame + // because the parent is blocking on us. + bool local_surface_id_changed = + settings_.enable_surface_synchronization && + (last_draw_local_surface_id_ != active_tree->local_surface_id()); + return !root_surface_has_contributing_layers || !root_surface_has_no_visible_damage || active_tree_->property_trees()->effect_tree.HasCopyRequests() || - must_always_swap || hud_wants_to_draw_; + must_always_swap || hud_wants_to_draw_ || local_surface_id_changed; } DrawResult LayerTreeHostImpl::CalculateRenderPasses(FrameData* frame) { @@ -1929,6 +1935,7 @@ bool LayerTreeHostImpl::DrawLayers(FrameData* frame) { active_tree()->local_surface_id().is_valid()) { layer_tree_frame_sink_->SetLocalSurfaceId( active_tree()->local_surface_id()); + last_draw_local_surface_id_ = active_tree()->local_surface_id(); } if (const char* client_name = GetClientNameForMetrics()) { size_t total_quad_count = 0; diff --git a/chromium/cc/trees/layer_tree_host_impl.h b/chromium/cc/trees/layer_tree_host_impl.h index abae9212c9b..41d6de7f90e 100644 --- a/chromium/cc/trees/layer_tree_host_impl.h +++ b/chromium/cc/trees/layer_tree_host_impl.h @@ -975,6 +975,8 @@ class CC_EXPORT LayerTreeHostImpl // to zero when no more presentation tokens are in flight. uint32_t last_presentation_token_ = 0u; + viz::LocalSurfaceId last_draw_local_surface_id_; + DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); }; diff --git a/chromium/cc/trees/layer_tree_host_unittest.cc b/chromium/cc/trees/layer_tree_host_unittest.cc index 94e20f1d7bd..3e733b65d02 100644 --- a/chromium/cc/trees/layer_tree_host_unittest.cc +++ b/chromium/cc/trees/layer_tree_host_unittest.cc @@ -8515,5 +8515,43 @@ class DontUpdateLayersWithEmptyBounds : public LayerTreeTest { SINGLE_AND_MULTI_THREAD_TEST_F(DontUpdateLayersWithEmptyBounds); +// Verifies that if we have a new LocalSurfaceId we submit a CompositorFrame +// even if there is no damage. +class LayerTreeHostTestNewLocalSurfaceIdForcesDraw : public LayerTreeHostTest { + public: + LayerTreeHostTestNewLocalSurfaceIdForcesDraw() {} + + void InitializeSettings(LayerTreeSettings* settings) override { + settings->enable_surface_synchronization = true; + } + + void BeginTest() override { + layer_tree_host()->SetViewportSize(gfx::Size(10, 10)); + layer_tree_host()->root_layer()->SetBounds(gfx::Size(10, 10)); + local_surface_id_ = allocator_.GenerateId(); + PostSetLocalSurfaceIdToMainThread(local_surface_id_); + } + + void DidReceiveCompositorFrameAck() override { + switch (layer_tree_host()->SourceFrameNumber()) { + case 1: + local_surface_id_ = allocator_.GenerateId(); + PostSetLocalSurfaceIdToMainThread(local_surface_id_); + break; + case 2: + EndTest(); + break; + default: + NOTREACHED(); + } + } + + void AfterTest() override {} + viz::LocalSurfaceId local_surface_id_; + viz::ParentLocalSurfaceIdAllocator allocator_; +}; + +SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestNewLocalSurfaceIdForcesDraw); + } // namespace } // namespace cc |