Merge lp:~robertcarr/mir/simplify-depth-assignment into lp:~mir-team/mir/trunk
- simplify-depth-assignment
- Merge into trunk
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 |
Related bugs: |
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::SurfaceCre
Description of the change
Simplify depth assignment so the shell can easily pass as part of the SurfaceCreation
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
PS Jenkins bot (ps-jenkins) wrote : | # |
Robert Ancell (robert-ancell) wrote : | # |
Shows a merge conflict
Robert Ancell (robert-ancell) wrote : | # |
Other than that, +1
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:837
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
Robert Ancell (robert-ancell) : | # |
Alexandros Frantzis (afrantzis) wrote : | # |
80 bool msh::operator==(
81 const SurfaceCreation
82 const msh::SurfaceCre
Don't we need to update operator==()? Is operator==() used at all?
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
Robert Carr (robertcarr) wrote : | # |
Updated operator== (see changes to test_surface.cpp: (SurfaceCreatio
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:838
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
FAILURE: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
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).
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 :)
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.
Alexandros Frantzis (afrantzis) wrote : | # |
Looks good.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:838
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
Gerry Boland (gerboland) wrote : | # |
No objection here
Robert Carr (robertcarr) wrote : | # |
This should land after https:/
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:838
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:838
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Robert Carr (robertcarr) wrote : | # |
Merged trunk.
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:839
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Preview Diff
1 | === modified file 'include/server/mir/shell/surface_creation_parameters.h' | |||
2 | --- include/server/mir/shell/surface_creation_parameters.h 2013-05-21 17:16:43 +0000 | |||
3 | +++ include/server/mir/shell/surface_creation_parameters.h 2013-07-18 22:32:28 +0000 | |||
4 | @@ -23,6 +23,7 @@ | |||
5 | 23 | #include "mir/geometry/point.h" | 23 | #include "mir/geometry/point.h" |
6 | 24 | #include "mir/geometry/size.h" | 24 | #include "mir/geometry/size.h" |
7 | 25 | #include "mir/compositor/buffer_properties.h" | 25 | #include "mir/compositor/buffer_properties.h" |
8 | 26 | #include "mir/surfaces/depth_id.h" | ||
9 | 26 | 27 | ||
10 | 27 | #include <memory> | 28 | #include <memory> |
11 | 28 | #include <string> | 29 | #include <string> |
12 | @@ -47,12 +48,15 @@ | |||
13 | 47 | SurfaceCreationParameters& of_buffer_usage(compositor::BufferUsage new_buffer_usage); | 48 | SurfaceCreationParameters& of_buffer_usage(compositor::BufferUsage new_buffer_usage); |
14 | 48 | 49 | ||
15 | 49 | SurfaceCreationParameters& of_pixel_format(geometry::PixelFormat new_pixel_format); | 50 | SurfaceCreationParameters& of_pixel_format(geometry::PixelFormat new_pixel_format); |
16 | 51 | |||
17 | 52 | SurfaceCreationParameters& of_depth(surfaces::DepthId const& new_depth); | ||
18 | 50 | 53 | ||
19 | 51 | std::string name; | 54 | std::string name; |
20 | 52 | geometry::Size size; | 55 | geometry::Size size; |
21 | 53 | geometry::Point top_left; | 56 | geometry::Point top_left; |
22 | 54 | compositor::BufferUsage buffer_usage; | 57 | compositor::BufferUsage buffer_usage; |
23 | 55 | geometry::PixelFormat pixel_format; | 58 | geometry::PixelFormat pixel_format; |
24 | 59 | surfaces::DepthId depth; | ||
25 | 56 | }; | 60 | }; |
26 | 57 | 61 | ||
27 | 58 | bool operator==(const SurfaceCreationParameters& lhs, const SurfaceCreationParameters& rhs); | 62 | bool operator==(const SurfaceCreationParameters& lhs, const SurfaceCreationParameters& rhs); |
28 | 59 | 63 | ||
29 | === modified file 'include/server/mir/surfaces/surface_stack.h' | |||
30 | --- include/server/mir/surfaces/surface_stack.h 2013-07-17 09:09:30 +0000 | |||
31 | +++ include/server/mir/surfaces/surface_stack.h 2013-07-18 22:32:28 +0000 | |||
32 | @@ -73,7 +73,7 @@ | |||
33 | 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); |
34 | 74 | 74 | ||
35 | 75 | // From SurfaceStackModel | 75 | // From SurfaceStackModel |
37 | 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); |
38 | 77 | 77 | ||
39 | 78 | virtual void destroy_surface(std::weak_ptr<Surface> const& surface); | 78 | virtual void destroy_surface(std::weak_ptr<Surface> const& surface); |
40 | 79 | 79 | ||
41 | 80 | 80 | ||
42 | === modified file 'include/server/mir/surfaces/surface_stack_model.h' | |||
43 | --- include/server/mir/surfaces/surface_stack_model.h 2013-06-25 20:28:17 +0000 | |||
44 | +++ include/server/mir/surfaces/surface_stack_model.h 2013-07-18 22:32:28 +0000 | |||
45 | @@ -40,7 +40,7 @@ | |||
46 | 40 | public: | 40 | public: |
47 | 41 | virtual ~SurfaceStackModel() {} | 41 | virtual ~SurfaceStackModel() {} |
48 | 42 | 42 | ||
50 | 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; |
51 | 44 | virtual void destroy_surface(std::weak_ptr<Surface> const& surface) = 0; | 44 | virtual void destroy_surface(std::weak_ptr<Surface> const& surface) = 0; |
52 | 45 | 45 | ||
53 | 46 | virtual void raise(std::weak_ptr<Surface> const& surface) = 0; | 46 | virtual void raise(std::weak_ptr<Surface> const& surface) = 0; |
54 | 47 | 47 | ||
55 | === modified file 'src/server/shell/surface_creation_parameters.cpp' | |||
56 | --- src/server/shell/surface_creation_parameters.cpp 2013-07-11 16:54:41 +0000 | |||
57 | +++ src/server/shell/surface_creation_parameters.cpp 2013-07-18 22:32:28 +0000 | |||
58 | @@ -24,7 +24,8 @@ | |||
59 | 24 | 24 | ||
60 | 25 | msh::SurfaceCreationParameters::SurfaceCreationParameters() | 25 | msh::SurfaceCreationParameters::SurfaceCreationParameters() |
61 | 26 | : name(), size(), top_left(), buffer_usage(mc::BufferUsage::undefined), | 26 | : name(), size(), top_left(), buffer_usage(mc::BufferUsage::undefined), |
63 | 27 | pixel_format(geom::PixelFormat::invalid) | 27 | pixel_format(geom::PixelFormat::invalid), |
64 | 28 | depth{0} | ||
65 | 28 | { | 29 | { |
66 | 29 | } | 30 | } |
67 | 30 | 31 | ||
68 | @@ -73,13 +74,24 @@ | |||
69 | 73 | return *this; | 74 | return *this; |
70 | 74 | } | 75 | } |
71 | 75 | 76 | ||
72 | 77 | msh::SurfaceCreationParameters& msh::SurfaceCreationParameters::of_depth( | ||
73 | 78 | surfaces::DepthId const& new_depth) | ||
74 | 79 | { | ||
75 | 80 | depth = new_depth; | ||
76 | 81 | |||
77 | 82 | return *this; | ||
78 | 83 | } | ||
79 | 84 | |||
80 | 76 | bool msh::operator==( | 85 | bool msh::operator==( |
81 | 77 | const SurfaceCreationParameters& lhs, | 86 | const SurfaceCreationParameters& lhs, |
82 | 78 | const msh::SurfaceCreationParameters& rhs) | 87 | const msh::SurfaceCreationParameters& rhs) |
83 | 79 | { | 88 | { |
87 | 80 | return lhs.size == rhs.size && | 89 | return lhs.name == rhs.name && |
88 | 81 | lhs.buffer_usage == rhs.buffer_usage && | 90 | lhs.size == rhs.size && |
89 | 82 | lhs.pixel_format == rhs.pixel_format; | 91 | lhs.top_left == rhs.top_left && |
90 | 92 | lhs.buffer_usage == rhs.buffer_usage && | ||
91 | 93 | lhs.pixel_format == rhs.pixel_format && | ||
92 | 94 | lhs.depth == rhs.depth; | ||
93 | 83 | } | 95 | } |
94 | 84 | 96 | ||
95 | 85 | bool msh::operator!=( | 97 | bool msh::operator!=( |
96 | 86 | 98 | ||
97 | === modified file 'src/server/surfaces/surface_controller.cpp' | |||
98 | --- src/server/surfaces/surface_controller.cpp 2013-06-25 20:28:17 +0000 | |||
99 | +++ src/server/surfaces/surface_controller.cpp 2013-07-18 22:32:28 +0000 | |||
100 | @@ -28,8 +28,7 @@ | |||
101 | 28 | 28 | ||
102 | 29 | std::weak_ptr<ms::Surface> ms::SurfaceController::create_surface(shell::SurfaceCreationParameters const& params) | 29 | std::weak_ptr<ms::Surface> ms::SurfaceController::create_surface(shell::SurfaceCreationParameters const& params) |
103 | 30 | { | 30 | { |
106 | 31 | static ms::DepthId const default_surface_depth{0}; | 31 | return surface_stack->create_surface(params); |
105 | 32 | return surface_stack->create_surface(params, default_surface_depth); | ||
107 | 33 | } | 32 | } |
108 | 34 | 33 | ||
109 | 35 | void ms::SurfaceController::destroy_surface(std::weak_ptr<Surface> const& surface) | 34 | void ms::SurfaceController::destroy_surface(std::weak_ptr<Surface> const& surface) |
110 | 36 | 35 | ||
111 | === modified file 'src/server/surfaces/surface_stack.cpp' | |||
112 | --- src/server/surfaces/surface_stack.cpp 2013-07-17 09:09:30 +0000 | |||
113 | +++ src/server/surfaces/surface_stack.cpp 2013-07-18 22:32:28 +0000 | |||
114 | @@ -73,13 +73,13 @@ | |||
115 | 73 | notify_change = f; | 73 | notify_change = f; |
116 | 74 | } | 74 | } |
117 | 75 | 75 | ||
119 | 76 | std::weak_ptr<ms::Surface> ms::SurfaceStack::create_surface(shell::SurfaceCreationParameters const& params, ms::DepthId depth) | 76 | std::weak_ptr<ms::Surface> ms::SurfaceStack::create_surface(shell::SurfaceCreationParameters const& params) |
120 | 77 | { | 77 | { |
121 | 78 | auto change_cb = [this]() { emit_change_notification(); }; | 78 | auto change_cb = [this]() { emit_change_notification(); }; |
122 | 79 | auto surface = surface_factory->create_surface(params, change_cb); | 79 | auto surface = surface_factory->create_surface(params, change_cb); |
123 | 80 | { | 80 | { |
124 | 81 | std::lock_guard<std::mutex> lg(guard); | 81 | std::lock_guard<std::mutex> lg(guard); |
126 | 82 | layers_by_depth[depth].push_back(surface); | 82 | layers_by_depth[params.depth].push_back(surface); |
127 | 83 | } | 83 | } |
128 | 84 | 84 | ||
129 | 85 | input_registrar->input_channel_opened(surface->input_channel(), surface->input_surface()); | 85 | input_registrar->input_channel_opened(surface->input_channel(), surface->input_surface()); |
130 | 86 | 86 | ||
131 | === modified file 'tests/acceptance-tests/test_client_input.cpp' | |||
132 | --- tests/acceptance-tests/test_client_input.cpp 2013-07-12 09:47:40 +0000 | |||
133 | +++ tests/acceptance-tests/test_client_input.cpp 2013-07-18 22:32:28 +0000 | |||
134 | @@ -436,26 +436,37 @@ | |||
135 | 436 | 436 | ||
136 | 437 | namespace | 437 | namespace |
137 | 438 | { | 438 | { |
139 | 439 | typedef std::map<std::string, geom::Rectangle> GeometryList; | 439 | typedef std::map<std::string, geom::Rectangle> GeometryMap; |
140 | 440 | typedef std::map<std::string, ms::DepthId> DepthMap; | ||
141 | 440 | 441 | ||
142 | 441 | struct StaticPlacementStrategy : public msh::PlacementStrategy | 442 | struct StaticPlacementStrategy : public msh::PlacementStrategy |
143 | 442 | { | 443 | { |
146 | 443 | StaticPlacementStrategy(GeometryList const& positions) | 444 | StaticPlacementStrategy(GeometryMap const& positions, |
147 | 444 | : surface_geometry_by_name(positions) | 445 | DepthMap const& depths) |
148 | 446 | : surface_geometry_by_name(positions), | ||
149 | 447 | surface_depths_by_name(depths) | ||
150 | 448 | { | ||
151 | 449 | } | ||
152 | 450 | |||
153 | 451 | StaticPlacementStrategy(GeometryMap const& positions) | ||
154 | 452 | : StaticPlacementStrategy(positions, DepthMap()) | ||
155 | 445 | { | 453 | { |
156 | 446 | } | 454 | } |
157 | 447 | 455 | ||
158 | 448 | msh::SurfaceCreationParameters place(msh::SurfaceCreationParameters const& request_parameters) | 456 | msh::SurfaceCreationParameters place(msh::SurfaceCreationParameters const& request_parameters) |
159 | 449 | { | 457 | { |
160 | 450 | auto placed = request_parameters; | 458 | auto placed = request_parameters; |
162 | 451 | auto geometry = surface_geometry_by_name[request_parameters.name]; | 459 | auto const& name = request_parameters.name; |
163 | 460 | auto geometry = surface_geometry_by_name[name]; | ||
164 | 452 | 461 | ||
165 | 453 | placed.top_left = geometry.top_left; | 462 | placed.top_left = geometry.top_left; |
166 | 454 | placed.size = geometry.size; | 463 | placed.size = geometry.size; |
167 | 464 | placed.depth = surface_depths_by_name[name]; | ||
168 | 455 | 465 | ||
169 | 456 | return placed; | 466 | return placed; |
170 | 457 | } | 467 | } |
172 | 458 | GeometryList surface_geometry_by_name; | 468 | GeometryMap surface_geometry_by_name; |
173 | 469 | DepthMap surface_depths_by_name; | ||
174 | 459 | }; | 470 | }; |
175 | 460 | 471 | ||
176 | 461 | } | 472 | } |
177 | @@ -475,7 +486,7 @@ | |||
178 | 475 | { | 486 | { |
179 | 476 | std::shared_ptr<msh::PlacementStrategy> the_shell_placement_strategy() override | 487 | std::shared_ptr<msh::PlacementStrategy> the_shell_placement_strategy() override |
180 | 477 | { | 488 | { |
182 | 478 | static GeometryList positions; | 489 | static GeometryMap positions; |
183 | 479 | positions[test_client_1] = geom::Rectangle{geom::Point{0, 0}, | 490 | positions[test_client_1] = geom::Rectangle{geom::Point{0, 0}, |
184 | 480 | geom::Size{client_width, client_height}}; | 491 | geom::Size{client_width, client_height}}; |
185 | 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}, |
186 | @@ -585,7 +596,7 @@ | |||
187 | 585 | { | 596 | { |
188 | 586 | std::shared_ptr<msh::PlacementStrategy> the_shell_placement_strategy() override | 597 | std::shared_ptr<msh::PlacementStrategy> the_shell_placement_strategy() override |
189 | 587 | { | 598 | { |
191 | 588 | static GeometryList positions; | 599 | static GeometryMap positions; |
192 | 589 | positions[test_client_name] = screen_geometry; | 600 | positions[test_client_name] = screen_geometry; |
193 | 590 | 601 | ||
194 | 591 | return std::make_shared<StaticPlacementStrategy>(positions); | 602 | return std::make_shared<StaticPlacementStrategy>(positions); |
195 | @@ -649,27 +660,6 @@ | |||
196 | 649 | launch_client_process(client_config); | 660 | launch_client_process(client_config); |
197 | 650 | } | 661 | } |
198 | 651 | 662 | ||
199 | 652 | namespace | ||
200 | 653 | { | ||
201 | 654 | typedef std::map<std::string, ms::DepthId> DepthList; | ||
202 | 655 | |||
203 | 656 | struct StackingSurfaceController : public ms::SurfaceController | ||
204 | 657 | { | ||
205 | 658 | StackingSurfaceController(std::shared_ptr<ms::SurfaceStackModel> const& surface_stack_model, DepthList const& depths) | ||
206 | 659 | : SurfaceController(surface_stack_model), | ||
207 | 660 | surface_depths_by_name(depths) | ||
208 | 661 | { | ||
209 | 662 | } | ||
210 | 663 | |||
211 | 664 | std::weak_ptr<ms::Surface> create_surface(msh::SurfaceCreationParameters const& params) override | ||
212 | 665 | { | ||
213 | 666 | return surface_stack->create_surface(params, surface_depths_by_name[params.name]); | ||
214 | 667 | } | ||
215 | 668 | |||
216 | 669 | DepthList surface_depths_by_name; | ||
217 | 670 | }; | ||
218 | 671 | } | ||
219 | 672 | |||
220 | 673 | TEST_F(TestClientInput, surfaces_obscure_motion_events_by_stacking) | 663 | TEST_F(TestClientInput, surfaces_obscure_motion_events_by_stacking) |
221 | 674 | { | 664 | { |
222 | 675 | using namespace ::testing; | 665 | using namespace ::testing; |
223 | @@ -687,23 +677,18 @@ | |||
224 | 687 | { | 677 | { |
225 | 688 | std::shared_ptr<msh::PlacementStrategy> the_shell_placement_strategy() override | 678 | std::shared_ptr<msh::PlacementStrategy> the_shell_placement_strategy() override |
226 | 689 | { | 679 | { |
228 | 690 | static GeometryList positions; | 680 | static GeometryMap positions; |
229 | 691 | positions[test_client_name_1] = screen_geometry; | 681 | positions[test_client_name_1] = screen_geometry; |
230 | 692 | 682 | ||
231 | 693 | auto smaller_geometry = screen_geometry; | 683 | auto smaller_geometry = screen_geometry; |
232 | 694 | smaller_geometry.size.width = geom::Width{screen_width/2}; | 684 | smaller_geometry.size.width = geom::Width{screen_width/2}; |
233 | 695 | positions[test_client_name_2] = smaller_geometry; | 685 | positions[test_client_name_2] = smaller_geometry; |
234 | 696 | 686 | ||
241 | 697 | return std::make_shared<StaticPlacementStrategy>(positions); | 687 | static DepthMap depths; |
236 | 698 | } | ||
237 | 699 | |||
238 | 700 | std::shared_ptr<msh::SurfaceBuilder> the_surface_builder() override | ||
239 | 701 | { | ||
240 | 702 | static DepthList depths; | ||
242 | 703 | depths[test_client_name_1] = ms::DepthId{0}; | 688 | depths[test_client_name_1] = ms::DepthId{0}; |
243 | 704 | depths[test_client_name_2] = ms::DepthId{1}; | 689 | depths[test_client_name_2] = ms::DepthId{1}; |
244 | 705 | 690 | ||
246 | 706 | return std::make_shared<StackingSurfaceController>(the_surface_stack_model(), depths); | 691 | return std::make_shared<StaticPlacementStrategy>(positions, depths); |
247 | 707 | } | 692 | } |
248 | 708 | 693 | ||
249 | 709 | void inject_input() override | 694 | void inject_input() override |
250 | 710 | 695 | ||
251 | === modified file 'tests/unit-tests/surfaces/test_surface.cpp' | |||
252 | --- tests/unit-tests/surfaces/test_surface.cpp 2013-07-16 15:37:58 +0000 | |||
253 | +++ tests/unit-tests/surfaces/test_surface.cpp 2013-07-18 22:32:28 +0000 | |||
254 | @@ -92,12 +92,12 @@ | |||
255 | 92 | mc::BufferUsage const usage{mc::BufferUsage::hardware}; | 92 | mc::BufferUsage const usage{mc::BufferUsage::hardware}; |
256 | 93 | geom::PixelFormat const format{geom::PixelFormat::abgr_8888}; | 93 | geom::PixelFormat const format{geom::PixelFormat::abgr_8888}; |
257 | 94 | 94 | ||
259 | 95 | auto params0 = msh::a_surface().of_name("surface0") | 95 | auto params0 = msh::a_surface().of_name("surface") |
260 | 96 | .of_size(size) | 96 | .of_size(size) |
261 | 97 | .of_buffer_usage(usage) | 97 | .of_buffer_usage(usage) |
262 | 98 | .of_pixel_format(format); | 98 | .of_pixel_format(format); |
263 | 99 | 99 | ||
265 | 100 | auto params1 = msh::a_surface().of_name("surface1") | 100 | auto params1 = msh::a_surface().of_name("surface") |
266 | 101 | .of_size(size) | 101 | .of_size(size) |
267 | 102 | .of_buffer_usage(usage) | 102 | .of_buffer_usage(usage) |
268 | 103 | .of_pixel_format(format); | 103 | .of_pixel_format(format); |
269 | 104 | 104 | ||
270 | === modified file 'tests/unit-tests/surfaces/test_surface_controller.cpp' | |||
271 | --- tests/unit-tests/surfaces/test_surface_controller.cpp 2013-06-25 20:28:17 +0000 | |||
272 | +++ tests/unit-tests/surfaces/test_surface_controller.cpp 2013-07-18 22:32:28 +0000 | |||
273 | @@ -33,7 +33,7 @@ | |||
274 | 33 | { | 33 | { |
275 | 34 | struct MockSurfaceStackModel : public ms::SurfaceStackModel | 34 | struct MockSurfaceStackModel : public ms::SurfaceStackModel |
276 | 35 | { | 35 | { |
278 | 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&)); |
279 | 37 | MOCK_METHOD1(destroy_surface, void(std::weak_ptr<ms::Surface> const&)); | 37 | MOCK_METHOD1(destroy_surface, void(std::weak_ptr<ms::Surface> const&)); |
280 | 38 | MOCK_METHOD1(raise, void(std::weak_ptr<ms::Surface> const&)); | 38 | MOCK_METHOD1(raise, void(std::weak_ptr<ms::Surface> const&)); |
281 | 39 | }; | 39 | }; |
282 | @@ -49,7 +49,7 @@ | |||
283 | 49 | ms::SurfaceController controller(mt::fake_shared(model)); | 49 | ms::SurfaceController controller(mt::fake_shared(model)); |
284 | 50 | 50 | ||
285 | 51 | InSequence seq; | 51 | InSequence seq; |
287 | 52 | EXPECT_CALL(model, create_surface(_, _)).Times(1).WillOnce(Return(null_surface)); | 52 | EXPECT_CALL(model, create_surface(_)).Times(1).WillOnce(Return(null_surface)); |
288 | 53 | EXPECT_CALL(model, destroy_surface(_)).Times(1); | 53 | EXPECT_CALL(model, destroy_surface(_)).Times(1); |
289 | 54 | 54 | ||
290 | 55 | auto surface = controller.create_surface(msh::a_surface()); | 55 | auto surface = controller.create_surface(msh::a_surface()); |
291 | 56 | 56 | ||
292 | === modified file 'tests/unit-tests/surfaces/test_surface_stack.cpp' | |||
293 | --- tests/unit-tests/surfaces/test_surface_stack.cpp 2013-07-18 11:04:18 +0000 | |||
294 | +++ tests/unit-tests/surfaces/test_surface_stack.cpp 2013-07-18 22:32:28 +0000 | |||
295 | @@ -146,8 +146,6 @@ | |||
296 | 146 | std::function<void()> const&)); | 146 | std::function<void()> const&)); |
297 | 147 | }; | 147 | }; |
298 | 148 | 148 | ||
299 | 149 | static ms::DepthId const default_depth{0}; | ||
300 | 150 | |||
301 | 151 | struct StubBufferStreamFactory : public ms::BufferStreamFactory | 149 | struct StubBufferStreamFactory : public ms::BufferStreamFactory |
302 | 152 | { | 150 | { |
303 | 153 | std::shared_ptr<ms::BufferStream> create_buffer_stream(mc::BufferProperties const&) | 151 | std::shared_ptr<ms::BufferStream> create_buffer_stream(mc::BufferProperties const&) |
304 | @@ -201,7 +199,7 @@ | |||
305 | 201 | 199 | ||
306 | 202 | auto use_count = stub_surface1.use_count(); | 200 | auto use_count = stub_surface1.use_count(); |
307 | 203 | 201 | ||
309 | 204 | auto surface = stack.create_surface(default_params, default_depth); | 202 | auto surface = stack.create_surface(default_params); |
310 | 205 | { | 203 | { |
311 | 206 | EXPECT_EQ(stub_surface1, surface.lock()); | 204 | EXPECT_EQ(stub_surface1, surface.lock()); |
312 | 207 | } | 205 | } |
313 | @@ -222,13 +220,13 @@ | |||
314 | 222 | .WillOnce(Return(stub_surface3)); | 220 | .WillOnce(Return(stub_surface3)); |
315 | 223 | 221 | ||
316 | 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)); |
318 | 225 | auto s1 = stack.create_surface(default_params, default_depth); | 223 | auto s1 = stack.create_surface(default_params); |
319 | 226 | auto criteria1 = s1.lock()->compositing_criteria(); | 224 | auto criteria1 = s1.lock()->compositing_criteria(); |
320 | 227 | auto stream1 = s1.lock()->buffer_stream(); | 225 | auto stream1 = s1.lock()->buffer_stream(); |
322 | 228 | auto s2 = stack.create_surface(default_params, default_depth); | 226 | auto s2 = stack.create_surface(default_params); |
323 | 229 | auto criteria2 = s2.lock()->compositing_criteria(); | 227 | auto criteria2 = s2.lock()->compositing_criteria(); |
324 | 230 | auto stream2 = s2.lock()->buffer_stream(); | 228 | auto stream2 = s2.lock()->buffer_stream(); |
326 | 231 | auto s3 = stack.create_surface(default_params, default_depth); | 229 | auto s3 = stack.create_surface(default_params); |
327 | 232 | auto criteria3 = s3.lock()->compositing_criteria(); | 230 | auto criteria3 = s3.lock()->compositing_criteria(); |
328 | 233 | auto stream3 = s3.lock()->buffer_stream(); | 231 | auto stream3 = s3.lock()->buffer_stream(); |
329 | 234 | 232 | ||
330 | @@ -264,13 +262,13 @@ | |||
331 | 264 | 262 | ||
332 | 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)); |
333 | 266 | 264 | ||
335 | 267 | auto s1 = stack.create_surface(default_params, default_depth); | 265 | auto s1 = stack.create_surface(default_params); |
336 | 268 | auto criteria1 = s1.lock()->compositing_criteria(); | 266 | auto criteria1 = s1.lock()->compositing_criteria(); |
337 | 269 | auto stream1 = s1.lock()->buffer_stream(); | 267 | auto stream1 = s1.lock()->buffer_stream(); |
339 | 270 | auto s2 = stack.create_surface(default_params, default_depth); | 268 | auto s2 = stack.create_surface(default_params); |
340 | 271 | auto criteria2 = s2.lock()->compositing_criteria(); | 269 | auto criteria2 = s2.lock()->compositing_criteria(); |
341 | 272 | auto stream2 = s2.lock()->buffer_stream(); | 270 | auto stream2 = s2.lock()->buffer_stream(); |
343 | 273 | auto s3 = stack.create_surface(default_params, default_depth); | 271 | auto s3 = stack.create_surface(default_params); |
344 | 274 | auto criteria3 = s3.lock()->compositing_criteria(); | 272 | auto criteria3 = s3.lock()->compositing_criteria(); |
345 | 275 | auto stream3 = s3.lock()->buffer_stream(); | 273 | auto stream3 = s3.lock()->buffer_stream(); |
346 | 276 | 274 | ||
347 | @@ -296,7 +294,7 @@ | |||
348 | 296 | 294 | ||
349 | 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)); |
350 | 298 | stack.set_change_callback(std::bind(&MockCallback::call, &mock_cb)); | 296 | stack.set_change_callback(std::bind(&MockCallback::call, &mock_cb)); |
352 | 299 | auto surface = stack.create_surface(default_params, default_depth); | 297 | auto surface = stack.create_surface(default_params); |
353 | 300 | stack.destroy_surface(surface); | 298 | stack.destroy_surface(surface); |
354 | 301 | } | 299 | } |
355 | 302 | 300 | ||
356 | @@ -310,13 +308,13 @@ | |||
357 | 310 | .WillOnce(Return(stub_surface3)); | 308 | .WillOnce(Return(stub_surface3)); |
358 | 311 | 309 | ||
359 | 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)); |
361 | 313 | auto s1 = stack.create_surface(default_params, ms::DepthId{0}); | 311 | auto s1 = stack.create_surface(default_params.of_depth(ms::DepthId{0})); |
362 | 314 | auto criteria1 = s1.lock()->compositing_criteria(); | 312 | auto criteria1 = s1.lock()->compositing_criteria(); |
363 | 315 | auto stream1 = s1.lock()->buffer_stream(); | 313 | auto stream1 = s1.lock()->buffer_stream(); |
365 | 316 | auto s2 = stack.create_surface(default_params, ms::DepthId{1}); | 314 | auto s2 = stack.create_surface(default_params.of_depth(ms::DepthId{1})); |
366 | 317 | auto criteria2 = s2.lock()->compositing_criteria(); | 315 | auto criteria2 = s2.lock()->compositing_criteria(); |
367 | 318 | auto stream2 = s2.lock()->buffer_stream(); | 316 | auto stream2 = s2.lock()->buffer_stream(); |
369 | 319 | auto s3 = stack.create_surface(default_params, ms::DepthId{0}); | 317 | auto s3 = stack.create_surface(default_params.of_depth(ms::DepthId{0})); |
370 | 320 | auto criteria3 = s3.lock()->compositing_criteria(); | 318 | auto criteria3 = s3.lock()->compositing_criteria(); |
371 | 321 | auto stream3 = s3.lock()->buffer_stream(); | 319 | auto stream3 = s3.lock()->buffer_stream(); |
372 | 322 | 320 | ||
373 | @@ -347,7 +345,7 @@ | |||
374 | 347 | 345 | ||
375 | 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)); |
376 | 349 | 347 | ||
378 | 350 | auto s = stack.create_surface(msh::a_surface(), default_depth); | 348 | auto s = stack.create_surface(msh::a_surface()); |
379 | 351 | stack.destroy_surface(s); | 349 | stack.destroy_surface(s); |
380 | 352 | } | 350 | } |
381 | 353 | 351 | ||
382 | @@ -361,13 +359,13 @@ | |||
383 | 361 | .WillOnce(Return(stub_surface3)); | 359 | .WillOnce(Return(stub_surface3)); |
384 | 362 | 360 | ||
385 | 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)); |
387 | 364 | auto s1 = stack.create_surface(default_params, default_depth); | 362 | auto s1 = stack.create_surface(default_params); |
388 | 365 | auto criteria1 = s1.lock()->compositing_criteria(); | 363 | auto criteria1 = s1.lock()->compositing_criteria(); |
389 | 366 | auto stream1 = s1.lock()->buffer_stream(); | 364 | auto stream1 = s1.lock()->buffer_stream(); |
391 | 367 | auto s2 = stack.create_surface(default_params, default_depth); | 365 | auto s2 = stack.create_surface(default_params); |
392 | 368 | auto criteria2 = s2.lock()->compositing_criteria(); | 366 | auto criteria2 = s2.lock()->compositing_criteria(); |
393 | 369 | auto stream2 = s2.lock()->buffer_stream(); | 367 | auto stream2 = s2.lock()->buffer_stream(); |
395 | 370 | auto s3 = stack.create_surface(default_params, default_depth); | 368 | auto s3 = stack.create_surface(default_params); |
396 | 371 | auto criteria3 = s3.lock()->compositing_criteria(); | 369 | auto criteria3 = s3.lock()->compositing_criteria(); |
397 | 372 | auto stream3 = s3.lock()->buffer_stream(); | 370 | auto stream3 = s3.lock()->buffer_stream(); |
398 | 373 | 371 | ||
399 | @@ -404,13 +402,13 @@ | |||
400 | 404 | .WillOnce(Return(stub_surface3)); | 402 | .WillOnce(Return(stub_surface3)); |
401 | 405 | 403 | ||
402 | 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)); |
404 | 407 | auto s1 = stack.create_surface(default_params, ms::DepthId{0}); | 405 | auto s1 = stack.create_surface(default_params.of_depth(ms::DepthId{0})); |
405 | 408 | auto criteria1 = s1.lock()->compositing_criteria(); | 406 | auto criteria1 = s1.lock()->compositing_criteria(); |
406 | 409 | auto stream1 = s1.lock()->buffer_stream(); | 407 | auto stream1 = s1.lock()->buffer_stream(); |
408 | 410 | auto s2 = stack.create_surface(default_params, ms::DepthId{0}); | 408 | auto s2 = stack.create_surface(default_params.of_depth(ms::DepthId{0})); |
409 | 411 | auto criteria2 = s2.lock()->compositing_criteria(); | 409 | auto criteria2 = s2.lock()->compositing_criteria(); |
410 | 412 | auto stream2 = s2.lock()->buffer_stream(); | 410 | auto stream2 = s2.lock()->buffer_stream(); |
412 | 413 | auto s3 = stack.create_surface(default_params, ms::DepthId{1}); | 411 | auto s3 = stack.create_surface(default_params.of_depth(ms::DepthId{1})); |
413 | 414 | auto criteria3 = s3.lock()->compositing_criteria(); | 412 | auto criteria3 = s3.lock()->compositing_criteria(); |
414 | 415 | auto stream3 = s3.lock()->buffer_stream(); | 413 | auto stream3 = s3.lock()->buffer_stream(); |
415 | 416 | 414 |
FAILED: Continuous integration, rev:836 jenkins. qa.ubuntu. com/job/ mir-ci/ 1015/ jenkins. qa.ubuntu. com/job/ mir-android- saucy-i386- build/1319/ console jenkins. qa.ubuntu. com/job/ mir-clang- saucy-amd64- build/1204/ console jenkins. qa.ubuntu. com/job/ mir-saucy- amd64-ci/ 253/console jenkins. qa.ubuntu. com/job/ mir-vm- ci-build/ ./distribution= quantal, flavor= amd64/646
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
SUCCESS: http://
Click here to trigger a rebuild: s-jenkins: 8080/job/ mir-ci/ 1015/rebuild
http://