| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "cc/surfaces/compositor_frame_sink_support.h" | 5 #include "cc/surfaces/compositor_frame_sink_support.h" |
| 6 | 6 |
| 7 #include "base/debug/stack_trace.h" | 7 #include "base/debug/stack_trace.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "cc/output/compositor_frame.h" | 9 #include "cc/output/compositor_frame.h" |
| 10 #include "cc/surfaces/compositor_frame_sink_support_client.h" | 10 #include "cc/surfaces/compositor_frame_sink_support_client.h" |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 testing::Test::SetUp(); | 171 testing::Test::SetUp(); |
| 172 begin_frame_source_ = | 172 begin_frame_source_ = |
| 173 base::MakeUnique<FakeExternalBeginFrameSource>(0.f, false); | 173 base::MakeUnique<FakeExternalBeginFrameSource>(0.f, false); |
| 174 surface_manager_.SetDependencyTracker( | 174 surface_manager_.SetDependencyTracker( |
| 175 base::MakeUnique<SurfaceDependencyTracker>(&surface_manager_, | 175 base::MakeUnique<SurfaceDependencyTracker>(&surface_manager_, |
| 176 begin_frame_source_.get())); | 176 begin_frame_source_.get())); |
| 177 supports_.push_back(base::MakeUnique<CompositorFrameSinkSupport>( | 177 supports_.push_back(base::MakeUnique<CompositorFrameSinkSupport>( |
| 178 &support_client_, &surface_manager_, kDisplayFrameSink, | 178 &support_client_, &surface_manager_, kDisplayFrameSink, |
| 179 true /* is_root */, true /* handles_frame_sink_id_invalidation */, | 179 true /* is_root */, true /* handles_frame_sink_id_invalidation */, |
| 180 true /* needs_sync_points */)); | 180 true /* needs_sync_points */)); |
| 181 supports_.back()->Init(); |
| 181 supports_.push_back(base::MakeUnique<CompositorFrameSinkSupport>( | 182 supports_.push_back(base::MakeUnique<CompositorFrameSinkSupport>( |
| 182 &support_client_, &surface_manager_, kParentFrameSink, | 183 &support_client_, &surface_manager_, kParentFrameSink, |
| 183 false /* is_root */, true /* handles_frame_sink_id_invalidation */, | 184 false /* is_root */, true /* handles_frame_sink_id_invalidation */, |
| 184 true /* needs_sync_points */)); | 185 true /* needs_sync_points */)); |
| 186 supports_.back()->Init(); |
| 185 supports_.push_back(base::MakeUnique<CompositorFrameSinkSupport>( | 187 supports_.push_back(base::MakeUnique<CompositorFrameSinkSupport>( |
| 186 &support_client_, &surface_manager_, kChildFrameSink1, | 188 &support_client_, &surface_manager_, kChildFrameSink1, |
| 187 false /* is_root */, true /* handles_frame_sink_id_invalidation */, | 189 false /* is_root */, true /* handles_frame_sink_id_invalidation */, |
| 188 true /* needs_sync_points */)); | 190 true /* needs_sync_points */)); |
| 191 supports_.back()->Init(); |
| 189 supports_.push_back(base::MakeUnique<CompositorFrameSinkSupport>( | 192 supports_.push_back(base::MakeUnique<CompositorFrameSinkSupport>( |
| 190 &support_client_, &surface_manager_, kChildFrameSink2, | 193 &support_client_, &surface_manager_, kChildFrameSink2, |
| 191 false /* is_root */, true /* handles_frame_sink_id_invalidation */, | 194 false /* is_root */, true /* handles_frame_sink_id_invalidation */, |
| 192 true /* needs_sync_points */)); | 195 true /* needs_sync_points */)); |
| 196 supports_.back()->Init(); |
| 193 | 197 |
| 194 // Normally, the BeginFrameSource would be registered by the Display. We | 198 // Normally, the BeginFrameSource would be registered by the Display. We |
| 195 // register it here so that BeginFrames are received by the display support, | 199 // register it here so that BeginFrames are received by the display support, |
| 196 // for use in the PassesOnBeginFrameAcks test. Other supports do not receive | 200 // for use in the PassesOnBeginFrameAcks test. Other supports do not receive |
| 197 // BeginFrames, since the frame sink hierarchy is not set up in this test. | 201 // BeginFrames, since the frame sink hierarchy is not set up in this test. |
| 198 surface_manager_.RegisterBeginFrameSource(begin_frame_source_.get(), | 202 surface_manager_.RegisterBeginFrameSource(begin_frame_source_.get(), |
| 199 kDisplayFrameSink); | 203 kDisplayFrameSink); |
| 200 } | 204 } |
| 201 | 205 |
| 202 void TearDown() override { | 206 void TearDown() override { |
| (...skipping 986 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1189 for (int i = 0; i < 3; ++i) { | 1193 for (int i = 0; i < 3; ++i) { |
| 1190 begin_frame_source()->TestOnBeginFrame(args); | 1194 begin_frame_source()->TestOnBeginFrame(args); |
| 1191 EXPECT_TRUE(dependency_tracker().has_deadline()); | 1195 EXPECT_TRUE(dependency_tracker().has_deadline()); |
| 1192 } | 1196 } |
| 1193 begin_frame_source()->TestOnBeginFrame(args); | 1197 begin_frame_source()->TestOnBeginFrame(args); |
| 1194 EXPECT_FALSE(dependency_tracker().has_deadline()); | 1198 EXPECT_FALSE(dependency_tracker().has_deadline()); |
| 1195 } | 1199 } |
| 1196 | 1200 |
| 1197 } // namespace test | 1201 } // namespace test |
| 1198 } // namespace cc | 1202 } // namespace cc |
| OLD | NEW |