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

Unified Diff: cc/surfaces/surfaces_pixeltest.cc

Issue 2485473003: Remove SurfaceFactory::Create and SurfaceFactory::Destroy (Closed)
Patch Set: SetPreviousFrame lint Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: cc/surfaces/surfaces_pixeltest.cc
diff --git a/cc/surfaces/surfaces_pixeltest.cc b/cc/surfaces/surfaces_pixeltest.cc
index 026db2d3cd0d0c45f7f2e266775b75426cfbb06f..95fa6e0ae8070800c618bf2a711d0d5b2b8bdc9e 100644
--- a/cc/surfaces/surfaces_pixeltest.cc
+++ b/cc/surfaces/surfaces_pixeltest.cc
@@ -81,13 +81,11 @@ TEST_F(SurfacesPixelTest, DrawSimpleFrame) {
LocalFrameId root_local_frame_id = allocator_.GenerateId();
SurfaceId root_surface_id(factory_.frame_sink_id(), root_local_frame_id);
- factory_.Create(root_local_frame_id);
factory_.SubmitCompositorFrame(root_local_frame_id, std::move(root_frame),
SurfaceFactory::DrawCallback());
SurfaceAggregator aggregator(&manager_, resource_provider_.get(), true);
CompositorFrame aggregated_frame = aggregator.Aggregate(root_surface_id);
- factory_.Destroy(root_local_frame_id);
bool discard_alpha = false;
ExactPixelComparator pixel_comparator(discard_alpha);
@@ -104,9 +102,8 @@ TEST_F(SurfacesPixelTest, DrawSimpleAggregatedFrame) {
SurfaceId child_surface_id(factory_.frame_sink_id(), child_local_frame_id);
LocalFrameId root_local_frame_id = allocator_.GenerateId();
SurfaceId root_surface_id(factory_.frame_sink_id(), root_local_frame_id);
+ SurfaceFactory child_factory(kArbitraryFrameSinkId, &manager_, &client_);
- factory_.Create(child_local_frame_id);
- factory_.Create(root_local_frame_id);
{
gfx::Rect rect(device_viewport_size_);
RenderPassId id(1, 1);
@@ -160,8 +157,9 @@ TEST_F(SurfacesPixelTest, DrawSimpleAggregatedFrame) {
CompositorFrame child_frame;
child_frame.render_pass_list.push_back(std::move(pass));
- factory_.SubmitCompositorFrame(child_local_frame_id, std::move(child_frame),
- SurfaceFactory::DrawCallback());
+ child_factory.SubmitCompositorFrame(child_local_frame_id,
+ std::move(child_frame),
+ SurfaceFactory::DrawCallback());
}
SurfaceAggregator aggregator(&manager_, resource_provider_.get(), true);
@@ -173,8 +171,6 @@ TEST_F(SurfacesPixelTest, DrawSimpleAggregatedFrame) {
EXPECT_TRUE(RunPixelTest(pass_list,
base::FilePath(FILE_PATH_LITERAL("blue_yellow.png")),
pixel_comparator));
- factory_.Destroy(root_local_frame_id);
- factory_.Destroy(child_local_frame_id);
}
// Tests a surface quad that has a non-identity transform into its pass.
@@ -194,9 +190,8 @@ TEST_F(SurfacesPixelTest, DrawAggregatedFrameWithSurfaceTransforms) {
SurfaceId right_child_id(factory_.frame_sink_id(), right_child_local_id);
LocalFrameId root_local_frame_id = allocator_.GenerateId();
SurfaceId root_surface_id(factory_.frame_sink_id(), root_local_frame_id);
- factory_.Create(left_child_local_id);
- factory_.Create(right_child_local_id);
- factory_.Create(root_local_frame_id);
+ SurfaceFactory left_factory(kArbitraryFrameSinkId, &manager_, &client_);
+ SurfaceFactory right_factory(kArbitraryFrameSinkId, &manager_, &client_);
{
gfx::Rect rect(device_viewport_size_);
@@ -262,8 +257,9 @@ TEST_F(SurfacesPixelTest, DrawAggregatedFrameWithSurfaceTransforms) {
CompositorFrame child_frame;
child_frame.render_pass_list.push_back(std::move(pass));
- factory_.SubmitCompositorFrame(left_child_local_id, std::move(child_frame),
- SurfaceFactory::DrawCallback());
+ left_factory.SubmitCompositorFrame(left_child_local_id,
+ std::move(child_frame),
+ SurfaceFactory::DrawCallback());
}
{
@@ -295,8 +291,9 @@ TEST_F(SurfacesPixelTest, DrawAggregatedFrameWithSurfaceTransforms) {
CompositorFrame child_frame;
child_frame.render_pass_list.push_back(std::move(pass));
- factory_.SubmitCompositorFrame(right_child_local_id, std::move(child_frame),
- SurfaceFactory::DrawCallback());
+ right_factory.SubmitCompositorFrame(right_child_local_id,
+ std::move(child_frame),
+ SurfaceFactory::DrawCallback());
}
SurfaceAggregator aggregator(&manager_, resource_provider_.get(), true);
@@ -309,10 +306,6 @@ TEST_F(SurfacesPixelTest, DrawAggregatedFrameWithSurfaceTransforms) {
pass_list,
base::FilePath(FILE_PATH_LITERAL("four_blue_green_checkers.png")),
pixel_comparator));
-
- factory_.Destroy(root_local_frame_id);
- factory_.Destroy(left_child_local_id);
- factory_.Destroy(right_child_local_id);
}
} // namespace

Powered by Google App Engine
This is Rietveld 408576698