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

Side by Side Diff: cc/surfaces/compositor_frame_sink_support_unittest.cc

Issue 2696743002: Prepare CompositorFrameSinkSupport To Be Used By DirectCompositorFrameSink (Closed)
Patch Set: rebase android Created 3 years, 10 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 unified diff | Download patch
OLDNEW
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/macros.h" 7 #include "base/macros.h"
8 #include "cc/output/compositor_frame.h" 8 #include "cc/output/compositor_frame.h"
9 #include "cc/surfaces/compositor_frame_sink_support_client.h" 9 #include "cc/surfaces/compositor_frame_sink_support_client.h"
10 #include "cc/surfaces/frame_sink_id.h" 10 #include "cc/surfaces/frame_sink_id.h"
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 void SetUp() override { 130 void SetUp() override {
131 testing::Test::SetUp(); 131 testing::Test::SetUp();
132 begin_frame_source_ = 132 begin_frame_source_ =
133 base::MakeUnique<FakeExternalBeginFrameSource>(0.f, false); 133 base::MakeUnique<FakeExternalBeginFrameSource>(0.f, false);
134 std::unique_ptr<SurfaceDependencyTracker> dependency_tracker( 134 std::unique_ptr<SurfaceDependencyTracker> dependency_tracker(
135 new SurfaceDependencyTracker(&surface_manager_, 135 new SurfaceDependencyTracker(&surface_manager_,
136 begin_frame_source_.get())); 136 begin_frame_source_.get()));
137 surface_manager_.SetDependencyTracker(std::move(dependency_tracker)); 137 surface_manager_.SetDependencyTracker(std::move(dependency_tracker));
138 supports_.push_back(base::MakeUnique<CompositorFrameSinkSupport>( 138 supports_.push_back(base::MakeUnique<CompositorFrameSinkSupport>(
139 this, &surface_manager_, kParentFrameSink, 139 this, &surface_manager_, kParentFrameSink,
140 false /* submits_to_display_compositor */)); 140 false /* submits_to_display_compositor */,
141 true /* handles_frame_sink_id_invalidation */,
142 true /* needs_sync_points */));
141 supports_.push_back(base::MakeUnique<CompositorFrameSinkSupport>( 143 supports_.push_back(base::MakeUnique<CompositorFrameSinkSupport>(
142 this, &surface_manager_, kChildFrameSink1, 144 this, &surface_manager_, kChildFrameSink1,
143 false /* submits_to_display_compositor */)); 145 false /* submits_to_display_compositor */,
146 true /* handles_frame_sink_id_invalidation */,
147 true /* needs_sync_points */));
144 supports_.push_back(base::MakeUnique<CompositorFrameSinkSupport>( 148 supports_.push_back(base::MakeUnique<CompositorFrameSinkSupport>(
145 this, &surface_manager_, kChildFrameSink2, 149 this, &surface_manager_, kChildFrameSink2,
146 false /* submits_to_display_compositor */)); 150 false /* submits_to_display_compositor */,
151 true /* handles_frame_sink_id_invalidation */,
152 true /* needs_sync_points */));
147 } 153 }
148 154
149 void TearDown() override { 155 void TearDown() override {
150 surface_manager_.SetDependencyTracker(nullptr); 156 surface_manager_.SetDependencyTracker(nullptr);
151 157
152 // SurfaceDependencyTracker depends on this BeginFrameSource and so it must 158 // SurfaceDependencyTracker depends on this BeginFrameSource and so it must
153 // be destroyed AFTER the dependency tracker is destroyed. 159 // be destroyed AFTER the dependency tracker is destroyed.
154 begin_frame_source_.reset(); 160 begin_frame_source_.reset();
155 161
156 supports_.clear(); 162 supports_.clear();
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after
568 EXPECT_THAT(child_surface1()->blocking_surfaces_for_testing(), IsEmpty()); 574 EXPECT_THAT(child_surface1()->blocking_surfaces_for_testing(), IsEmpty());
569 575
570 // Verify that there is no temporary reference for the child and that 576 // Verify that there is no temporary reference for the child and that
571 // the reference from the parent to the child still exists. 577 // the reference from the parent to the child still exists.
572 EXPECT_THAT(GetTempReferences(child_id.frame_sink_id()), IsEmpty()); 578 EXPECT_THAT(GetTempReferences(child_id.frame_sink_id()), IsEmpty());
573 EXPECT_THAT(GetChildReferences(parent_id), UnorderedElementsAre(child_id)); 579 EXPECT_THAT(GetChildReferences(parent_id), UnorderedElementsAre(child_id));
574 } 580 }
575 581
576 } // namespace test 582 } // namespace test
577 } // namespace cc 583 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698