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

Side by Side Diff: cc/test/compositor_frame_helpers.cc

Issue 2802023002: Remove SurfaceFactory And SurfaceFactoryClient (Closed)
Patch Set: Rebase SurfaceSynchronizationTest Created 3 years, 7 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
« no previous file with comments | « cc/test/compositor_frame_helpers.h ('k') | cc/test/mock_compositor_frame_sink_support_client.h » ('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 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/test/compositor_frame_helpers.h" 5 #include "cc/test/compositor_frame_helpers.h"
6
6 #include "cc/output/compositor_frame.h" 7 #include "cc/output/compositor_frame.h"
7 8
8 namespace cc { 9 namespace cc {
9 namespace test { 10 namespace test {
10 11
11 CompositorFrame MakeCompositorFrame() { 12 CompositorFrame MakeCompositorFrame() {
12 CompositorFrame frame = MakeEmptyCompositorFrame(); 13 CompositorFrame frame = MakeEmptyCompositorFrame();
13 std::unique_ptr<RenderPass> pass = RenderPass::Create(); 14 std::unique_ptr<RenderPass> pass = RenderPass::Create();
14 pass->SetNew(1, gfx::Rect(0, 0, 20, 20), gfx::Rect(), gfx::Transform()); 15 pass->SetNew(1, gfx::Rect(0, 0, 20, 20), gfx::Rect(), gfx::Transform());
15 frame.render_pass_list.push_back(std::move(pass)); 16 frame.render_pass_list.push_back(std::move(pass));
16 return frame; 17 return frame;
17 } 18 }
18 19
19 CompositorFrame MakeEmptyCompositorFrame() { 20 CompositorFrame MakeEmptyCompositorFrame() {
20 CompositorFrame frame; 21 CompositorFrame frame;
21 frame.metadata.begin_frame_ack.source_id = BeginFrameArgs::kManualSourceId; 22 frame.metadata.begin_frame_ack.source_id = BeginFrameArgs::kManualSourceId;
22 frame.metadata.begin_frame_ack.sequence_number = 23 frame.metadata.begin_frame_ack.sequence_number =
23 BeginFrameArgs::kStartingFrameNumber; 24 BeginFrameArgs::kStartingFrameNumber;
24 frame.metadata.device_scale_factor = 1; 25 frame.metadata.device_scale_factor = 1;
25 return frame; 26 return frame;
26 } 27 }
27 28
29 CompositorFrame MakeCompositorFrame(
30 std::vector<SurfaceId> activation_dependencies,
31 std::vector<SurfaceId> referenced_surfaces,
32 TransferableResourceArray resource_list) {
33 CompositorFrame compositor_frame = test::MakeCompositorFrame();
34 compositor_frame.metadata.begin_frame_ack = BeginFrameAck(0, 1, 1, true);
35 compositor_frame.metadata.activation_dependencies =
36 std::move(activation_dependencies);
37 compositor_frame.metadata.referenced_surfaces =
38 std::move(referenced_surfaces);
39 compositor_frame.resource_list = std::move(resource_list);
40 return compositor_frame;
41 }
42
28 } // namespace test 43 } // namespace test
29 } // namespace cc 44 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/compositor_frame_helpers.h ('k') | cc/test/mock_compositor_frame_sink_support_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698