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

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

Issue 2449853004: Getting rid of DelegatedFrameData (Closed)
Patch Set: nit 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 unified diff | Download patch
« no previous file with comments | « cc/surfaces/direct_compositor_frame_sink.cc ('k') | cc/surfaces/display.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/direct_compositor_frame_sink.h" 5 #include "cc/surfaces/direct_compositor_frame_sink.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "cc/output/renderer_settings.h" 9 #include "cc/output/renderer_settings.h"
10 #include "cc/output/texture_mailbox_deleter.h" 10 #include "cc/output/texture_mailbox_deleter.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 70
71 ~DirectCompositorFrameSinkTest() override { 71 ~DirectCompositorFrameSinkTest() override {
72 compositor_frame_sink_->DetachFromClient(); 72 compositor_frame_sink_->DetachFromClient();
73 } 73 }
74 74
75 void SwapBuffersWithDamage(const gfx::Rect& damage_rect) { 75 void SwapBuffersWithDamage(const gfx::Rect& damage_rect) {
76 std::unique_ptr<RenderPass> render_pass(RenderPass::Create()); 76 std::unique_ptr<RenderPass> render_pass(RenderPass::Create());
77 render_pass->SetNew(RenderPassId(1, 1), display_rect_, damage_rect, 77 render_pass->SetNew(RenderPassId(1, 1), display_rect_, damage_rect,
78 gfx::Transform()); 78 gfx::Transform());
79 79
80 auto frame_data = base::MakeUnique<DelegatedFrameData>();
81 frame_data->render_pass_list.push_back(std::move(render_pass));
82
83 CompositorFrame frame; 80 CompositorFrame frame;
84 frame.delegated_frame_data = std::move(frame_data); 81 frame.render_pass_list.push_back(std::move(render_pass));
85 82
86 compositor_frame_sink_->SubmitCompositorFrame(std::move(frame)); 83 compositor_frame_sink_->SubmitCompositorFrame(std::move(frame));
87 } 84 }
88 85
89 void SetUp() override { 86 void SetUp() override {
90 // Draw the first frame to start in an "unlocked" state. 87 // Draw the first frame to start in an "unlocked" state.
91 SwapBuffersWithDamage(display_rect_); 88 SwapBuffersWithDamage(display_rect_);
92 89
93 EXPECT_EQ(0u, display_output_surface_->num_sent_frames()); 90 EXPECT_EQ(0u, display_output_surface_->num_sent_frames());
94 task_runner_->RunUntilIdle(); 91 task_runner_->RunUntilIdle();
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 EXPECT_EQ(1u, display_output_surface_->num_sent_frames()); 146 EXPECT_EQ(1u, display_output_surface_->num_sent_frames());
150 147
151 SwapBuffersWithDamage(gfx::Rect()); 148 SwapBuffersWithDamage(gfx::Rect());
152 EXPECT_EQ(1u, display_output_surface_->num_sent_frames()); 149 EXPECT_EQ(1u, display_output_surface_->num_sent_frames());
153 task_runner_->RunUntilIdle(); 150 task_runner_->RunUntilIdle();
154 EXPECT_EQ(1u, display_output_surface_->num_sent_frames()); 151 EXPECT_EQ(1u, display_output_surface_->num_sent_frames());
155 } 152 }
156 153
157 } // namespace 154 } // namespace
158 } // namespace cc 155 } // namespace cc
OLDNEW
« no previous file with comments | « cc/surfaces/direct_compositor_frame_sink.cc ('k') | cc/surfaces/display.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698