Mir

Merge lp:~robertcarr/mir/simplify-depth-assignment into lp:~mir-team/mir/trunk

Proposed by Robert Carr
Status: Merged
Approved by: Robert Ancell
Approved revision: no longer in the source branch.
Merged at revision: 866
Proposed branch: lp:~robertcarr/mir/simplify-depth-assignment
Merge into: lp:~mir-team/mir/trunk
Diff against target: 414 lines (+68/-70)
10 files modified
include/server/mir/shell/surface_creation_parameters.h (+4/-0)
include/server/mir/surfaces/surface_stack.h (+1/-1)
include/server/mir/surfaces/surface_stack_model.h (+1/-1)
src/server/shell/surface_creation_parameters.cpp (+16/-4)
src/server/surfaces/surface_controller.cpp (+1/-2)
src/server/surfaces/surface_stack.cpp (+2/-2)
tests/acceptance-tests/test_client_input.cpp (+21/-36)
tests/unit-tests/surfaces/test_surface.cpp (+2/-2)
tests/unit-tests/surfaces/test_surface_controller.cpp (+2/-2)
tests/unit-tests/surfaces/test_surface_stack.cpp (+18/-20)
To merge this branch: bzr merge lp:~robertcarr/mir/simplify-depth-assignment
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Gerry Boland (community) Approve
Alexandros Frantzis (community) Approve
Kevin DuBois (community) Abstain
Alan Griffiths Abstain
Robert Ancell Approve
Review via email: mp+174872@code.launchpad.net

Commit message

Move the DepthId in surface creation to msh::SurfaceCreationParameters.

Description of the change

Simplify depth assignment so the shell can easily pass as part of the SurfaceCreationParameters rather than overriding one of our 'factory/controller' classes (SurfaceController).

Also a first pass at making things easier for the system compositor and the greeter stacking, but still need to find a way to get the session association in sensibly

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Robert Ancell (robert-ancell) wrote :

Shows a merge conflict

review: Needs Fixing
Revision history for this message
Robert Ancell (robert-ancell) wrote :

Other than that, +1

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Robert Ancell (robert-ancell) :
review: Approve
Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

80 bool msh::operator==(
81 const SurfaceCreationParameters& lhs,
82 const msh::SurfaceCreationParameters& rhs)

Don't we need to update operator==()? Is operator==() used at all?

review: Needs Fixing
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

I'm still deeply suspicious that DepthId is the wrong abstraction - so this has the feel of "shuffling deckchairs on a sinking ship".

operator==() is wrong before and after this MP

review: Abstain
Revision history for this message
Robert Carr (robertcarr) wrote :

Updated operator== (see changes to test_surface.cpp: (SurfaceCreationParameters, equality) as well I found the existing test misleading). DepthId is clearly on the way out eventually but at least it's less annoying here than in create_surface parameters.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Kevin DuBois (kdub) wrote :

> I'm still deeply suspicious that DepthId is the wrong abstraction - so this
> has the feel of "shuffling deckchairs on a sinking ship".

+1

I'd rather just present a z-ordering and have the shell have better tracking of what surface is where and how its stacked. I *somewhat* detect that the shell wants to group surfaces and order them more arbitrarily, and are trying to fit their square peg into SurfaceStack's round abstraction of a scenegraph

That being said, I suppose that if its already in the code base, its better that there's a way to use it.

My question is... are we planning on keeping DepthID forever, or do we think that as the shell evolves we will eliminate this? I sort of get the feeling that the stack would be a better abstraction if it was closer to a z-ordering (simpler).

review: Abstain
Revision history for this message
Kevin DuBois (kdub) wrote :

also though, don't want to derail this specific MP with esoteric planning about the surfacestack, I think the idea behind this specific MP is an improvement in the code :)

Revision history for this message
Gerry Boland (gerboland) wrote :

> My question is... are we planning on keeping DepthID forever, or do we think
> that as the shell evolves we will eliminate this? I sort of get the feeling
> that the stack would be a better abstraction if it was closer to a z-ordering
> (simpler).

Speaking from the shell perspective, I see situations in future when just DepthID and limited z-order manipulation via focus changes will be too limiting. I'd vote for z-order access.

Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

Looks good.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Gerry Boland (gerboland) wrote :

No objection here

review: Approve
Revision history for this message
Robert Carr (robertcarr) wrote :

This should land after https://code.launchpad.net/~robertcarr/mir/fix-depth-tests/+merge/175410 or this diff becomes very confusing.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Robert Carr (robertcarr) wrote :

Merged trunk.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'include/server/mir/shell/surface_creation_parameters.h'
--- include/server/mir/shell/surface_creation_parameters.h 2013-05-21 17:16:43 +0000
+++ include/server/mir/shell/surface_creation_parameters.h 2013-07-18 22:32:28 +0000
@@ -23,6 +23,7 @@
23#include "mir/geometry/point.h"23#include "mir/geometry/point.h"
24#include "mir/geometry/size.h"24#include "mir/geometry/size.h"
25#include "mir/compositor/buffer_properties.h"25#include "mir/compositor/buffer_properties.h"
26#include "mir/surfaces/depth_id.h"
2627
27#include <memory>28#include <memory>
28#include <string>29#include <string>
@@ -47,12 +48,15 @@
47 SurfaceCreationParameters& of_buffer_usage(compositor::BufferUsage new_buffer_usage);48 SurfaceCreationParameters& of_buffer_usage(compositor::BufferUsage new_buffer_usage);
4849
49 SurfaceCreationParameters& of_pixel_format(geometry::PixelFormat new_pixel_format);50 SurfaceCreationParameters& of_pixel_format(geometry::PixelFormat new_pixel_format);
51
52 SurfaceCreationParameters& of_depth(surfaces::DepthId const& new_depth);
5053
51 std::string name;54 std::string name;
52 geometry::Size size;55 geometry::Size size;
53 geometry::Point top_left;56 geometry::Point top_left;
54 compositor::BufferUsage buffer_usage;57 compositor::BufferUsage buffer_usage;
55 geometry::PixelFormat pixel_format;58 geometry::PixelFormat pixel_format;
59 surfaces::DepthId depth;
56};60};
5761
58bool operator==(const SurfaceCreationParameters& lhs, const SurfaceCreationParameters& rhs);62bool operator==(const SurfaceCreationParameters& lhs, const SurfaceCreationParameters& rhs);
5963
=== modified file 'include/server/mir/surfaces/surface_stack.h'
--- include/server/mir/surfaces/surface_stack.h 2013-07-17 09:09:30 +0000
+++ include/server/mir/surfaces/surface_stack.h 2013-07-18 22:32:28 +0000
@@ -73,7 +73,7 @@
73 void for_each(std::function<void(std::shared_ptr<input::InputChannel> const&)> const& callback);73 void for_each(std::function<void(std::shared_ptr<input::InputChannel> const&)> const& callback);
7474
75 // From SurfaceStackModel 75 // From SurfaceStackModel
76 virtual std::weak_ptr<Surface> create_surface(const shell::SurfaceCreationParameters& params, DepthId depth);76 virtual std::weak_ptr<Surface> create_surface(const shell::SurfaceCreationParameters& params);
7777
78 virtual void destroy_surface(std::weak_ptr<Surface> const& surface);78 virtual void destroy_surface(std::weak_ptr<Surface> const& surface);
79 79
8080
=== modified file 'include/server/mir/surfaces/surface_stack_model.h'
--- include/server/mir/surfaces/surface_stack_model.h 2013-06-25 20:28:17 +0000
+++ include/server/mir/surfaces/surface_stack_model.h 2013-07-18 22:32:28 +0000
@@ -40,7 +40,7 @@
40public:40public:
41 virtual ~SurfaceStackModel() {}41 virtual ~SurfaceStackModel() {}
4242
43 virtual std::weak_ptr<Surface> create_surface(shell::SurfaceCreationParameters const& params, DepthId depth) = 0;43 virtual std::weak_ptr<Surface> create_surface(shell::SurfaceCreationParameters const& params) = 0;
44 virtual void destroy_surface(std::weak_ptr<Surface> const& surface) = 0;44 virtual void destroy_surface(std::weak_ptr<Surface> const& surface) = 0;
4545
46 virtual void raise(std::weak_ptr<Surface> const& surface) = 0;46 virtual void raise(std::weak_ptr<Surface> const& surface) = 0;
4747
=== modified file 'src/server/shell/surface_creation_parameters.cpp'
--- src/server/shell/surface_creation_parameters.cpp 2013-07-11 16:54:41 +0000
+++ src/server/shell/surface_creation_parameters.cpp 2013-07-18 22:32:28 +0000
@@ -24,7 +24,8 @@
2424
25msh::SurfaceCreationParameters::SurfaceCreationParameters()25msh::SurfaceCreationParameters::SurfaceCreationParameters()
26 : name(), size(), top_left(), buffer_usage(mc::BufferUsage::undefined),26 : name(), size(), top_left(), buffer_usage(mc::BufferUsage::undefined),
27 pixel_format(geom::PixelFormat::invalid)27 pixel_format(geom::PixelFormat::invalid),
28 depth{0}
28{29{
29}30}
3031
@@ -73,13 +74,24 @@
73 return *this;74 return *this;
74}75}
7576
77msh::SurfaceCreationParameters& msh::SurfaceCreationParameters::of_depth(
78 surfaces::DepthId const& new_depth)
79{
80 depth = new_depth;
81
82 return *this;
83}
84
76bool msh::operator==(85bool msh::operator==(
77 const SurfaceCreationParameters& lhs,86 const SurfaceCreationParameters& lhs,
78 const msh::SurfaceCreationParameters& rhs)87 const msh::SurfaceCreationParameters& rhs)
79{88{
80 return lhs.size == rhs.size &&89 return lhs.name == rhs.name &&
81 lhs.buffer_usage == rhs.buffer_usage &&90 lhs.size == rhs.size &&
82 lhs.pixel_format == rhs.pixel_format;91 lhs.top_left == rhs.top_left &&
92 lhs.buffer_usage == rhs.buffer_usage &&
93 lhs.pixel_format == rhs.pixel_format &&
94 lhs.depth == rhs.depth;
83}95}
8496
85bool msh::operator!=(97bool msh::operator!=(
8698
=== modified file 'src/server/surfaces/surface_controller.cpp'
--- src/server/surfaces/surface_controller.cpp 2013-06-25 20:28:17 +0000
+++ src/server/surfaces/surface_controller.cpp 2013-07-18 22:32:28 +0000
@@ -28,8 +28,7 @@
2828
29std::weak_ptr<ms::Surface> ms::SurfaceController::create_surface(shell::SurfaceCreationParameters const& params)29std::weak_ptr<ms::Surface> ms::SurfaceController::create_surface(shell::SurfaceCreationParameters const& params)
30{30{
31 static ms::DepthId const default_surface_depth{0};31 return surface_stack->create_surface(params);
32 return surface_stack->create_surface(params, default_surface_depth);
33}32}
3433
35void ms::SurfaceController::destroy_surface(std::weak_ptr<Surface> const& surface)34void ms::SurfaceController::destroy_surface(std::weak_ptr<Surface> const& surface)
3635
=== modified file 'src/server/surfaces/surface_stack.cpp'
--- src/server/surfaces/surface_stack.cpp 2013-07-17 09:09:30 +0000
+++ src/server/surfaces/surface_stack.cpp 2013-07-18 22:32:28 +0000
@@ -73,13 +73,13 @@
73 notify_change = f;73 notify_change = f;
74}74}
7575
76std::weak_ptr<ms::Surface> ms::SurfaceStack::create_surface(shell::SurfaceCreationParameters const& params, ms::DepthId depth)76std::weak_ptr<ms::Surface> ms::SurfaceStack::create_surface(shell::SurfaceCreationParameters const& params)
77{77{
78 auto change_cb = [this]() { emit_change_notification(); };78 auto change_cb = [this]() { emit_change_notification(); };
79 auto surface = surface_factory->create_surface(params, change_cb); 79 auto surface = surface_factory->create_surface(params, change_cb);
80 {80 {
81 std::lock_guard<std::mutex> lg(guard);81 std::lock_guard<std::mutex> lg(guard);
82 layers_by_depth[depth].push_back(surface);82 layers_by_depth[params.depth].push_back(surface);
83 }83 }
8484
85 input_registrar->input_channel_opened(surface->input_channel(), surface->input_surface());85 input_registrar->input_channel_opened(surface->input_channel(), surface->input_surface());
8686
=== modified file 'tests/acceptance-tests/test_client_input.cpp'
--- tests/acceptance-tests/test_client_input.cpp 2013-07-12 09:47:40 +0000
+++ tests/acceptance-tests/test_client_input.cpp 2013-07-18 22:32:28 +0000
@@ -436,26 +436,37 @@
436436
437namespace437namespace
438{438{
439typedef std::map<std::string, geom::Rectangle> GeometryList;439typedef std::map<std::string, geom::Rectangle> GeometryMap;
440typedef std::map<std::string, ms::DepthId> DepthMap;
440441
441struct StaticPlacementStrategy : public msh::PlacementStrategy442struct StaticPlacementStrategy : public msh::PlacementStrategy
442{443{
443 StaticPlacementStrategy(GeometryList const& positions)444 StaticPlacementStrategy(GeometryMap const& positions,
444 : surface_geometry_by_name(positions)445 DepthMap const& depths)
446 : surface_geometry_by_name(positions),
447 surface_depths_by_name(depths)
448 {
449 }
450
451 StaticPlacementStrategy(GeometryMap const& positions)
452 : StaticPlacementStrategy(positions, DepthMap())
445 {453 {
446 }454 }
447455
448 msh::SurfaceCreationParameters place(msh::SurfaceCreationParameters const& request_parameters)456 msh::SurfaceCreationParameters place(msh::SurfaceCreationParameters const& request_parameters)
449 {457 {
450 auto placed = request_parameters;458 auto placed = request_parameters;
451 auto geometry = surface_geometry_by_name[request_parameters.name];459 auto const& name = request_parameters.name;
460 auto geometry = surface_geometry_by_name[name];
452461
453 placed.top_left = geometry.top_left;462 placed.top_left = geometry.top_left;
454 placed.size = geometry.size;463 placed.size = geometry.size;
464 placed.depth = surface_depths_by_name[name];
455 465
456 return placed;466 return placed;
457 }467 }
458 GeometryList surface_geometry_by_name;468 GeometryMap surface_geometry_by_name;
469 DepthMap surface_depths_by_name;
459};470};
460471
461}472}
@@ -475,7 +486,7 @@
475 {486 {
476 std::shared_ptr<msh::PlacementStrategy> the_shell_placement_strategy() override487 std::shared_ptr<msh::PlacementStrategy> the_shell_placement_strategy() override
477 {488 {
478 static GeometryList positions;489 static GeometryMap positions;
479 positions[test_client_1] = geom::Rectangle{geom::Point{0, 0},490 positions[test_client_1] = geom::Rectangle{geom::Point{0, 0},
480 geom::Size{client_width, client_height}};491 geom::Size{client_width, client_height}};
481 positions[test_client_2] = geom::Rectangle{geom::Point{screen_width/2, screen_height/2},492 positions[test_client_2] = geom::Rectangle{geom::Point{screen_width/2, screen_height/2},
@@ -585,7 +596,7 @@
585 {596 {
586 std::shared_ptr<msh::PlacementStrategy> the_shell_placement_strategy() override597 std::shared_ptr<msh::PlacementStrategy> the_shell_placement_strategy() override
587 {598 {
588 static GeometryList positions;599 static GeometryMap positions;
589 positions[test_client_name] = screen_geometry;600 positions[test_client_name] = screen_geometry;
590 601
591 return std::make_shared<StaticPlacementStrategy>(positions);602 return std::make_shared<StaticPlacementStrategy>(positions);
@@ -649,27 +660,6 @@
649 launch_client_process(client_config);660 launch_client_process(client_config);
650}661}
651662
652namespace
653{
654typedef std::map<std::string, ms::DepthId> DepthList;
655
656struct StackingSurfaceController : public ms::SurfaceController
657{
658 StackingSurfaceController(std::shared_ptr<ms::SurfaceStackModel> const& surface_stack_model, DepthList const& depths)
659 : SurfaceController(surface_stack_model),
660 surface_depths_by_name(depths)
661 {
662 }
663
664 std::weak_ptr<ms::Surface> create_surface(msh::SurfaceCreationParameters const& params) override
665 {
666 return surface_stack->create_surface(params, surface_depths_by_name[params.name]);
667 }
668
669 DepthList surface_depths_by_name;
670};
671}
672
673TEST_F(TestClientInput, surfaces_obscure_motion_events_by_stacking)663TEST_F(TestClientInput, surfaces_obscure_motion_events_by_stacking)
674{664{
675 using namespace ::testing;665 using namespace ::testing;
@@ -687,23 +677,18 @@
687 {677 {
688 std::shared_ptr<msh::PlacementStrategy> the_shell_placement_strategy() override678 std::shared_ptr<msh::PlacementStrategy> the_shell_placement_strategy() override
689 {679 {
690 static GeometryList positions;680 static GeometryMap positions;
691 positions[test_client_name_1] = screen_geometry;681 positions[test_client_name_1] = screen_geometry;
692 682
693 auto smaller_geometry = screen_geometry;683 auto smaller_geometry = screen_geometry;
694 smaller_geometry.size.width = geom::Width{screen_width/2};684 smaller_geometry.size.width = geom::Width{screen_width/2};
695 positions[test_client_name_2] = smaller_geometry;685 positions[test_client_name_2] = smaller_geometry;
696 686
697 return std::make_shared<StaticPlacementStrategy>(positions);687 static DepthMap depths;
698 }
699
700 std::shared_ptr<msh::SurfaceBuilder> the_surface_builder() override
701 {
702 static DepthList depths;
703 depths[test_client_name_1] = ms::DepthId{0};688 depths[test_client_name_1] = ms::DepthId{0};
704 depths[test_client_name_2] = ms::DepthId{1};689 depths[test_client_name_2] = ms::DepthId{1};
705 690
706 return std::make_shared<StackingSurfaceController>(the_surface_stack_model(), depths);691 return std::make_shared<StaticPlacementStrategy>(positions, depths);
707 }692 }
708 693
709 void inject_input() override694 void inject_input() override
710695
=== modified file 'tests/unit-tests/surfaces/test_surface.cpp'
--- tests/unit-tests/surfaces/test_surface.cpp 2013-07-16 15:37:58 +0000
+++ tests/unit-tests/surfaces/test_surface.cpp 2013-07-18 22:32:28 +0000
@@ -92,12 +92,12 @@
92 mc::BufferUsage const usage{mc::BufferUsage::hardware};92 mc::BufferUsage const usage{mc::BufferUsage::hardware};
93 geom::PixelFormat const format{geom::PixelFormat::abgr_8888};93 geom::PixelFormat const format{geom::PixelFormat::abgr_8888};
9494
95 auto params0 = msh::a_surface().of_name("surface0")95 auto params0 = msh::a_surface().of_name("surface")
96 .of_size(size)96 .of_size(size)
97 .of_buffer_usage(usage)97 .of_buffer_usage(usage)
98 .of_pixel_format(format);98 .of_pixel_format(format);
9999
100 auto params1 = msh::a_surface().of_name("surface1")100 auto params1 = msh::a_surface().of_name("surface")
101 .of_size(size)101 .of_size(size)
102 .of_buffer_usage(usage)102 .of_buffer_usage(usage)
103 .of_pixel_format(format);103 .of_pixel_format(format);
104104
=== modified file 'tests/unit-tests/surfaces/test_surface_controller.cpp'
--- tests/unit-tests/surfaces/test_surface_controller.cpp 2013-06-25 20:28:17 +0000
+++ tests/unit-tests/surfaces/test_surface_controller.cpp 2013-07-18 22:32:28 +0000
@@ -33,7 +33,7 @@
33{33{
34struct MockSurfaceStackModel : public ms::SurfaceStackModel34struct MockSurfaceStackModel : public ms::SurfaceStackModel
35{35{
36 MOCK_METHOD2(create_surface, std::weak_ptr<ms::Surface>(msh::SurfaceCreationParameters const&, ms::DepthId depth));36 MOCK_METHOD1(create_surface, std::weak_ptr<ms::Surface>(msh::SurfaceCreationParameters const&));
37 MOCK_METHOD1(destroy_surface, void(std::weak_ptr<ms::Surface> const&));37 MOCK_METHOD1(destroy_surface, void(std::weak_ptr<ms::Surface> const&));
38 MOCK_METHOD1(raise, void(std::weak_ptr<ms::Surface> const&));38 MOCK_METHOD1(raise, void(std::weak_ptr<ms::Surface> const&));
39};39};
@@ -49,7 +49,7 @@
49 ms::SurfaceController controller(mt::fake_shared(model));49 ms::SurfaceController controller(mt::fake_shared(model));
5050
51 InSequence seq;51 InSequence seq;
52 EXPECT_CALL(model, create_surface(_, _)).Times(1).WillOnce(Return(null_surface));52 EXPECT_CALL(model, create_surface(_)).Times(1).WillOnce(Return(null_surface));
53 EXPECT_CALL(model, destroy_surface(_)).Times(1);53 EXPECT_CALL(model, destroy_surface(_)).Times(1);
5454
55 auto surface = controller.create_surface(msh::a_surface());55 auto surface = controller.create_surface(msh::a_surface());
5656
=== modified file 'tests/unit-tests/surfaces/test_surface_stack.cpp'
--- tests/unit-tests/surfaces/test_surface_stack.cpp 2013-07-18 11:04:18 +0000
+++ tests/unit-tests/surfaces/test_surface_stack.cpp 2013-07-18 22:32:28 +0000
@@ -146,8 +146,6 @@
146 std::function<void()> const&)); 146 std::function<void()> const&));
147};147};
148148
149static ms::DepthId const default_depth{0};
150
151struct StubBufferStreamFactory : public ms::BufferStreamFactory149struct StubBufferStreamFactory : public ms::BufferStreamFactory
152{150{
153 std::shared_ptr<ms::BufferStream> create_buffer_stream(mc::BufferProperties const&)151 std::shared_ptr<ms::BufferStream> create_buffer_stream(mc::BufferProperties const&)
@@ -201,7 +199,7 @@
201199
202 auto use_count = stub_surface1.use_count();200 auto use_count = stub_surface1.use_count();
203201
204 auto surface = stack.create_surface(default_params, default_depth);202 auto surface = stack.create_surface(default_params);
205 {203 {
206 EXPECT_EQ(stub_surface1, surface.lock());204 EXPECT_EQ(stub_surface1, surface.lock());
207 }205 }
@@ -222,13 +220,13 @@
222 .WillOnce(Return(stub_surface3));220 .WillOnce(Return(stub_surface3));
223221
224 ms::SurfaceStack stack(mt::fake_shared(mock_surface_allocator), mt::fake_shared(input_registrar));222 ms::SurfaceStack stack(mt::fake_shared(mock_surface_allocator), mt::fake_shared(input_registrar));
225 auto s1 = stack.create_surface(default_params, default_depth);223 auto s1 = stack.create_surface(default_params);
226 auto criteria1 = s1.lock()->compositing_criteria();224 auto criteria1 = s1.lock()->compositing_criteria();
227 auto stream1 = s1.lock()->buffer_stream();225 auto stream1 = s1.lock()->buffer_stream();
228 auto s2 = stack.create_surface(default_params, default_depth);226 auto s2 = stack.create_surface(default_params);
229 auto criteria2 = s2.lock()->compositing_criteria();227 auto criteria2 = s2.lock()->compositing_criteria();
230 auto stream2 = s2.lock()->buffer_stream();228 auto stream2 = s2.lock()->buffer_stream();
231 auto s3 = stack.create_surface(default_params, default_depth);229 auto s3 = stack.create_surface(default_params);
232 auto criteria3 = s3.lock()->compositing_criteria();230 auto criteria3 = s3.lock()->compositing_criteria();
233 auto stream3 = s3.lock()->buffer_stream();231 auto stream3 = s3.lock()->buffer_stream();
234232
@@ -264,13 +262,13 @@
264262
265 ms::SurfaceStack stack(mt::fake_shared(mock_surface_allocator), mt::fake_shared(input_registrar));263 ms::SurfaceStack stack(mt::fake_shared(mock_surface_allocator), mt::fake_shared(input_registrar));
266264
267 auto s1 = stack.create_surface(default_params, default_depth);265 auto s1 = stack.create_surface(default_params);
268 auto criteria1 = s1.lock()->compositing_criteria();266 auto criteria1 = s1.lock()->compositing_criteria();
269 auto stream1 = s1.lock()->buffer_stream();267 auto stream1 = s1.lock()->buffer_stream();
270 auto s2 = stack.create_surface(default_params, default_depth);268 auto s2 = stack.create_surface(default_params);
271 auto criteria2 = s2.lock()->compositing_criteria();269 auto criteria2 = s2.lock()->compositing_criteria();
272 auto stream2 = s2.lock()->buffer_stream();270 auto stream2 = s2.lock()->buffer_stream();
273 auto s3 = stack.create_surface(default_params, default_depth);271 auto s3 = stack.create_surface(default_params);
274 auto criteria3 = s3.lock()->compositing_criteria();272 auto criteria3 = s3.lock()->compositing_criteria();
275 auto stream3 = s3.lock()->buffer_stream();273 auto stream3 = s3.lock()->buffer_stream();
276274
@@ -296,7 +294,7 @@
296294
297 ms::SurfaceStack stack(mt::fake_shared(mock_surface_allocator), mt::fake_shared(input_registrar));295 ms::SurfaceStack stack(mt::fake_shared(mock_surface_allocator), mt::fake_shared(input_registrar));
298 stack.set_change_callback(std::bind(&MockCallback::call, &mock_cb));296 stack.set_change_callback(std::bind(&MockCallback::call, &mock_cb));
299 auto surface = stack.create_surface(default_params, default_depth);297 auto surface = stack.create_surface(default_params);
300 stack.destroy_surface(surface);298 stack.destroy_surface(surface);
301}299}
302300
@@ -310,13 +308,13 @@
310 .WillOnce(Return(stub_surface3));308 .WillOnce(Return(stub_surface3));
311309
312 ms::SurfaceStack stack(mt::fake_shared(mock_surface_allocator), mt::fake_shared(input_registrar));310 ms::SurfaceStack stack(mt::fake_shared(mock_surface_allocator), mt::fake_shared(input_registrar));
313 auto s1 = stack.create_surface(default_params, ms::DepthId{0});311 auto s1 = stack.create_surface(default_params.of_depth(ms::DepthId{0}));
314 auto criteria1 = s1.lock()->compositing_criteria();312 auto criteria1 = s1.lock()->compositing_criteria();
315 auto stream1 = s1.lock()->buffer_stream();313 auto stream1 = s1.lock()->buffer_stream();
316 auto s2 = stack.create_surface(default_params, ms::DepthId{1});314 auto s2 = stack.create_surface(default_params.of_depth(ms::DepthId{1}));
317 auto criteria2 = s2.lock()->compositing_criteria();315 auto criteria2 = s2.lock()->compositing_criteria();
318 auto stream2 = s2.lock()->buffer_stream();316 auto stream2 = s2.lock()->buffer_stream();
319 auto s3 = stack.create_surface(default_params, ms::DepthId{0});317 auto s3 = stack.create_surface(default_params.of_depth(ms::DepthId{0}));
320 auto criteria3 = s3.lock()->compositing_criteria();318 auto criteria3 = s3.lock()->compositing_criteria();
321 auto stream3 = s3.lock()->buffer_stream();319 auto stream3 = s3.lock()->buffer_stream();
322320
@@ -347,7 +345,7 @@
347345
348 ms::SurfaceStack stack(mt::fake_shared(mock_surface_allocator), mt::fake_shared(registrar));346 ms::SurfaceStack stack(mt::fake_shared(mock_surface_allocator), mt::fake_shared(registrar));
349 347
350 auto s = stack.create_surface(msh::a_surface(), default_depth);348 auto s = stack.create_surface(msh::a_surface());
351 stack.destroy_surface(s);349 stack.destroy_surface(s);
352}350}
353351
@@ -361,13 +359,13 @@
361 .WillOnce(Return(stub_surface3));359 .WillOnce(Return(stub_surface3));
362360
363 ms::SurfaceStack stack(mt::fake_shared(mock_surface_allocator), mt::fake_shared(input_registrar));361 ms::SurfaceStack stack(mt::fake_shared(mock_surface_allocator), mt::fake_shared(input_registrar));
364 auto s1 = stack.create_surface(default_params, default_depth);362 auto s1 = stack.create_surface(default_params);
365 auto criteria1 = s1.lock()->compositing_criteria();363 auto criteria1 = s1.lock()->compositing_criteria();
366 auto stream1 = s1.lock()->buffer_stream();364 auto stream1 = s1.lock()->buffer_stream();
367 auto s2 = stack.create_surface(default_params, default_depth);365 auto s2 = stack.create_surface(default_params);
368 auto criteria2 = s2.lock()->compositing_criteria();366 auto criteria2 = s2.lock()->compositing_criteria();
369 auto stream2 = s2.lock()->buffer_stream();367 auto stream2 = s2.lock()->buffer_stream();
370 auto s3 = stack.create_surface(default_params, default_depth);368 auto s3 = stack.create_surface(default_params);
371 auto criteria3 = s3.lock()->compositing_criteria();369 auto criteria3 = s3.lock()->compositing_criteria();
372 auto stream3 = s3.lock()->buffer_stream();370 auto stream3 = s3.lock()->buffer_stream();
373371
@@ -404,13 +402,13 @@
404 .WillOnce(Return(stub_surface3));402 .WillOnce(Return(stub_surface3));
405403
406 ms::SurfaceStack stack(mt::fake_shared(mock_surface_allocator), mt::fake_shared(input_registrar));404 ms::SurfaceStack stack(mt::fake_shared(mock_surface_allocator), mt::fake_shared(input_registrar));
407 auto s1 = stack.create_surface(default_params, ms::DepthId{0});405 auto s1 = stack.create_surface(default_params.of_depth(ms::DepthId{0}));
408 auto criteria1 = s1.lock()->compositing_criteria();406 auto criteria1 = s1.lock()->compositing_criteria();
409 auto stream1 = s1.lock()->buffer_stream();407 auto stream1 = s1.lock()->buffer_stream();
410 auto s2 = stack.create_surface(default_params, ms::DepthId{0});408 auto s2 = stack.create_surface(default_params.of_depth(ms::DepthId{0}));
411 auto criteria2 = s2.lock()->compositing_criteria();409 auto criteria2 = s2.lock()->compositing_criteria();
412 auto stream2 = s2.lock()->buffer_stream();410 auto stream2 = s2.lock()->buffer_stream();
413 auto s3 = stack.create_surface(default_params, ms::DepthId{1});411 auto s3 = stack.create_surface(default_params.of_depth(ms::DepthId{1}));
414 auto criteria3 = s3.lock()->compositing_criteria();412 auto criteria3 = s3.lock()->compositing_criteria();
415 auto stream3 = s3.lock()->buffer_stream();413 auto stream3 = s3.lock()->buffer_stream();
416414

Subscribers

People subscribed via source and target branches