Merge lp:~kdub/mir/no-rendering-operator into lp:mir
- no-rendering-operator
- Merge into development-branch
Status: | Merged |
---|---|
Approved by: | Kevin DuBois |
Approved revision: | no longer in the source branch. |
Merged at revision: | 1536 |
Proposed branch: | lp:~kdub/mir/no-rendering-operator |
Merge into: | lp:mir |
Diff against target: |
342 lines (+58/-198) 7 files modified
src/server/compositor/CMakeLists.txt (+0/-1) src/server/compositor/default_display_buffer_compositor.cpp (+14/-32) src/server/compositor/rendering_operator.cpp (+0/-37) src/server/compositor/rendering_operator.h (+0/-49) tests/unit-tests/compositor/CMakeLists.txt (+0/-1) tests/unit-tests/compositor/test_default_display_buffer_compositor.cpp (+44/-2) tests/unit-tests/compositor/test_rendering_operator.cpp (+0/-76) |
To merge this branch: | bzr merge lp:~kdub/mir/no-rendering-operator |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Alan Griffiths | Approve | ||
Alexandros Frantzis (community) | Approve | ||
PS Jenkins bot (community) | continuous-integration | Approve | |
Alberto Aguirre (community) | Approve | ||
Review via email: mp+213943@code.launchpad.net |
Commit message
Remove the RenderingOperator and VisibilityFilter classes in favor of rendering on the generated list of renderables from the scene
Description of the change
Remove the RenderingOperator and VisibilityFilter classes in favor of rendering on the generated list of renderables from the scene
This does not address the Scene locking problem, but puts us in a good position to do so!
PS Jenkins bot (ps-jenkins) wrote : | # |
Alexandros Frantzis (afrantzis) wrote : | # |
271 + EXPECT_
272 + EXPECT_
Expectations are reversed (we can use EXPECT_THAT() which is less error prone).
But, taking a step back, I see two issues with the test:
1. It's checking the number of users *before* posting, whereas we care about the number of users *after* posting, but that's OK for a unit test (that is we are modelling a post_update() that doesn't mess with the buffers, which is reasonable).
2. The test is too strict and dependent on the internals. We are checking that the number of users at posting time is the same as the number of users at rendering time, but that's not what we really care about. What we want to check is that the buffer is held alive until after post_update(), i.e., there is at least one user (besides the test function) at that point:
EXPECT_
EXPECT_
Alexandros Frantzis (afrantzis) wrote : | # |
So (1) is not really an issue just something that caught my eye...
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:1526
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Alberto Aguirre (albaguirre) wrote : | # |
Much easier to reason about, lgtm.
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:1527
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Alexandros Frantzis (afrantzis) wrote : | # |
Looks good.
Alan Griffiths (alan-griffiths) wrote : | # |
84 + //'renderer.get()' serves as an ID to distinguish itself from other compositors
85 + auto buffer = renderable-
Seems fragile, but not a reason to block this change.
Kevin DuBois (kdub) wrote : | # |
> 84 + //'renderer.get()' serves as an ID to distinguish itself from other
> compositors
> 85 + auto buffer = renderable-
>
> Seems fragile, but not a reason to block this change.
indeed, just preserving what was there before. I'll have to rectify that situation before the android stuff can work.
Preview Diff
1 | === modified file 'src/server/compositor/CMakeLists.txt' | |||
2 | --- src/server/compositor/CMakeLists.txt 2014-03-06 06:05:17 +0000 | |||
3 | +++ src/server/compositor/CMakeLists.txt 2014-04-03 23:09:17 +0000 | |||
4 | @@ -6,7 +6,6 @@ | |||
5 | 6 | temporary_buffers.cpp | 6 | temporary_buffers.cpp |
6 | 7 | buffer_stream_factory.cpp | 7 | buffer_stream_factory.cpp |
7 | 8 | buffer_stream_surfaces.cpp | 8 | buffer_stream_surfaces.cpp |
8 | 9 | rendering_operator.cpp | ||
9 | 10 | gl_renderer.cpp | 9 | gl_renderer.cpp |
10 | 11 | gl_renderer_factory.cpp | 10 | gl_renderer_factory.cpp |
11 | 12 | multi_threaded_compositor.cpp | 11 | multi_threaded_compositor.cpp |
12 | 13 | 12 | ||
13 | === modified file 'src/server/compositor/default_display_buffer_compositor.cpp' | |||
14 | --- src/server/compositor/default_display_buffer_compositor.cpp 2014-04-01 19:44:01 +0000 | |||
15 | +++ src/server/compositor/default_display_buffer_compositor.cpp 2014-04-03 23:09:17 +0000 | |||
16 | @@ -19,8 +19,8 @@ | |||
17 | 19 | 19 | ||
18 | 20 | #include "default_display_buffer_compositor.h" | 20 | #include "default_display_buffer_compositor.h" |
19 | 21 | 21 | ||
20 | 22 | #include "rendering_operator.h" | ||
21 | 23 | #include "mir/compositor/scene.h" | 22 | #include "mir/compositor/scene.h" |
22 | 23 | #include "mir/compositor/renderer.h" | ||
23 | 24 | #include "mir/graphics/renderable.h" | 24 | #include "mir/graphics/renderable.h" |
24 | 25 | #include "mir/graphics/display_buffer.h" | 25 | #include "mir/graphics/display_buffer.h" |
25 | 26 | #include "mir/graphics/buffer.h" | 26 | #include "mir/graphics/buffer.h" |
26 | @@ -34,32 +34,6 @@ | |||
27 | 34 | namespace mc = mir::compositor; | 34 | namespace mc = mir::compositor; |
28 | 35 | namespace mg = mir::graphics; | 35 | namespace mg = mir::graphics; |
29 | 36 | 36 | ||
30 | 37 | //TODO remove VisibilityFilter once we don't need filters/operators for rendering | ||
31 | 38 | namespace | ||
32 | 39 | { | ||
33 | 40 | struct VisibilityFilter : public mc::FilterForScene | ||
34 | 41 | { | ||
35 | 42 | public: | ||
36 | 43 | VisibilityFilter( | ||
37 | 44 | mg::RenderableList const& renderable_list) | ||
38 | 45 | : list(renderable_list) | ||
39 | 46 | { | ||
40 | 47 | } | ||
41 | 48 | |||
42 | 49 | bool operator()(mg::Renderable const& r) | ||
43 | 50 | { | ||
44 | 51 | auto matcher = [&r](std::shared_ptr<mg::Renderable> const& renderable) | ||
45 | 52 | { | ||
46 | 53 | return (renderable.get() == &r); | ||
47 | 54 | }; | ||
48 | 55 | return (std::find_if(list.begin(), list.end(), matcher) != list.end()); | ||
49 | 56 | } | ||
50 | 57 | |||
51 | 58 | private: | ||
52 | 59 | mg::RenderableList const& list; | ||
53 | 60 | }; | ||
54 | 61 | } | ||
55 | 62 | |||
56 | 63 | mc::DefaultDisplayBufferCompositor::DefaultDisplayBufferCompositor( | 37 | mc::DefaultDisplayBufferCompositor::DefaultDisplayBufferCompositor( |
57 | 64 | mg::DisplayBuffer& display_buffer, | 38 | mg::DisplayBuffer& display_buffer, |
58 | 65 | std::shared_ptr<mc::Scene> const& scene, | 39 | std::shared_ptr<mc::Scene> const& scene, |
59 | @@ -124,20 +98,28 @@ | |||
60 | 124 | 98 | ||
61 | 125 | if (!bypassed) | 99 | if (!bypassed) |
62 | 126 | { | 100 | { |
63 | 101 | //preserves buffers backing GL textures until after post_update | ||
64 | 102 | std::vector<std::shared_ptr<mg::Buffer>> saved_resources; | ||
65 | 103 | |||
66 | 127 | display_buffer.make_current(); | 104 | display_buffer.make_current(); |
67 | 128 | 105 | ||
68 | 129 | auto const& view_area = display_buffer.view_area(); | 106 | auto const& view_area = display_buffer.view_area(); |
69 | 130 | auto renderable_list = scene->generate_renderable_list(); | 107 | auto renderable_list = scene->generate_renderable_list(); |
70 | 131 | mc::filter_occlusions_from(renderable_list, view_area); | 108 | mc::filter_occlusions_from(renderable_list, view_area); |
71 | 132 | 109 | ||
72 | 110 | renderer->set_rotation(display_buffer.orientation()); | ||
73 | 111 | renderer->begin(); | ||
74 | 112 | |||
75 | 133 | for(auto const& renderable : renderable_list) | 113 | for(auto const& renderable : renderable_list) |
76 | 114 | { | ||
77 | 134 | uncomposited_buffers |= (renderable->buffers_ready_for_compositor() > 1); | 115 | uncomposited_buffers |= (renderable->buffers_ready_for_compositor() > 1); |
78 | 135 | 116 | ||
84 | 136 | renderer->set_rotation(display_buffer.orientation()); | 117 | //'renderer.get()' serves as an ID to distinguish itself from other compositors |
85 | 137 | renderer->begin(); | 118 | auto buffer = renderable->buffer(renderer.get()); |
86 | 138 | mc::RenderingOperator applicator(*renderer); | 119 | renderer->render(*renderable, *buffer); |
87 | 139 | VisibilityFilter selector(renderable_list); | 120 | saved_resources.push_back(buffer); |
88 | 140 | scene->for_each_if(selector, applicator); | 121 | } |
89 | 122 | |||
90 | 141 | renderer->end(); | 123 | renderer->end(); |
91 | 142 | 124 | ||
92 | 143 | display_buffer.post_update(); | 125 | display_buffer.post_update(); |
93 | 144 | 126 | ||
94 | === removed file 'src/server/compositor/rendering_operator.cpp' | |||
95 | --- src/server/compositor/rendering_operator.cpp 2014-03-26 23:41:48 +0000 | |||
96 | +++ src/server/compositor/rendering_operator.cpp 1970-01-01 00:00:00 +0000 | |||
97 | @@ -1,37 +0,0 @@ | |||
98 | 1 | /* | ||
99 | 2 | * Copyright © 2012 Canonical Ltd. | ||
100 | 3 | * | ||
101 | 4 | * This program is free software: you can redistribute it and/or modify it | ||
102 | 5 | * under the terms of the GNU General Public License version 3, | ||
103 | 6 | * as published by the Free Software Foundation. | ||
104 | 7 | * | ||
105 | 8 | * This program is distributed in the hope that it will be useful, | ||
106 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
107 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
108 | 11 | * GNU General Public License for more details. | ||
109 | 12 | * | ||
110 | 13 | * You should have received a copy of the GNU General Public License | ||
111 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
112 | 15 | * | ||
113 | 16 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> | ||
114 | 17 | */ | ||
115 | 18 | |||
116 | 19 | #include "rendering_operator.h" | ||
117 | 20 | #include "mir/compositor/buffer_stream.h" | ||
118 | 21 | #include "mir/graphics/renderable.h" | ||
119 | 22 | |||
120 | 23 | namespace mc=mir::compositor; | ||
121 | 24 | |||
122 | 25 | mc::RenderingOperator::RenderingOperator( | ||
123 | 26 | Renderer& renderer) | ||
124 | 27 | : renderer(renderer) | ||
125 | 28 | { | ||
126 | 29 | } | ||
127 | 30 | |||
128 | 31 | void mc::RenderingOperator::operator()(graphics::Renderable const& renderable) | ||
129 | 32 | { | ||
130 | 33 | auto compositor_buffer = renderable.buffer(&renderer); | ||
131 | 34 | // preserves buffers used in rendering until after post_update() | ||
132 | 35 | saved_resources.push_back(compositor_buffer); | ||
133 | 36 | renderer.render(renderable, *compositor_buffer); | ||
134 | 37 | } | ||
135 | 38 | 0 | ||
136 | === removed file 'src/server/compositor/rendering_operator.h' | |||
137 | --- src/server/compositor/rendering_operator.h 2014-03-26 23:41:48 +0000 | |||
138 | +++ src/server/compositor/rendering_operator.h 1970-01-01 00:00:00 +0000 | |||
139 | @@ -1,49 +0,0 @@ | |||
140 | 1 | /* | ||
141 | 2 | * Copyright © 2012 Canonical Ltd. | ||
142 | 3 | * | ||
143 | 4 | * This program is free software: you can redistribute it and/or modify it | ||
144 | 5 | * under the terms of the GNU General Public License version 3, | ||
145 | 6 | * as published by the Free Software Foundation. | ||
146 | 7 | * | ||
147 | 8 | * This program is distributed in the hope that it will be useful, | ||
148 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
149 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
150 | 11 | * GNU General Public License for more details. | ||
151 | 12 | * | ||
152 | 13 | * You should have received a copy of the GNU General Public License | ||
153 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
154 | 15 | * | ||
155 | 16 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> | ||
156 | 17 | */ | ||
157 | 18 | #ifndef MIR_COMPOSITOR_RENDERING_OPERATOR_H_ | ||
158 | 19 | #define MIR_COMPOSITOR_RENDERING_OPERATOR_H_ | ||
159 | 20 | |||
160 | 21 | #include "mir/compositor/renderer.h" | ||
161 | 22 | #include "mir/compositor/scene.h" | ||
162 | 23 | |||
163 | 24 | #include <vector> | ||
164 | 25 | #include <functional> | ||
165 | 26 | #include <memory> | ||
166 | 27 | |||
167 | 28 | namespace mir | ||
168 | 29 | { | ||
169 | 30 | namespace compositor | ||
170 | 31 | { | ||
171 | 32 | |||
172 | 33 | class RenderingOperator : public OperatorForScene | ||
173 | 34 | { | ||
174 | 35 | public: | ||
175 | 36 | explicit RenderingOperator( | ||
176 | 37 | Renderer& renderer); | ||
177 | 38 | ~RenderingOperator() = default; | ||
178 | 39 | |||
179 | 40 | void operator()(graphics::Renderable const&); | ||
180 | 41 | |||
181 | 42 | private: | ||
182 | 43 | Renderer& renderer; | ||
183 | 44 | std::vector<std::shared_ptr<void>> saved_resources; | ||
184 | 45 | }; | ||
185 | 46 | |||
186 | 47 | } | ||
187 | 48 | } | ||
188 | 49 | #endif /* MIR_COMPOSITOR_RENDERING_OPERATOR_H_ */ | ||
189 | 50 | 0 | ||
190 | === modified file 'tests/unit-tests/compositor/CMakeLists.txt' | |||
191 | --- tests/unit-tests/compositor/CMakeLists.txt 2014-03-06 06:05:17 +0000 | |||
192 | +++ tests/unit-tests/compositor/CMakeLists.txt 2014-04-03 23:09:17 +0000 | |||
193 | @@ -2,7 +2,6 @@ | |||
194 | 2 | ${CMAKE_CURRENT_SOURCE_DIR}/test_default_display_buffer_compositor.cpp | 2 | ${CMAKE_CURRENT_SOURCE_DIR}/test_default_display_buffer_compositor.cpp |
195 | 3 | ${CMAKE_CURRENT_SOURCE_DIR}/test_buffer_stream.cpp | 3 | ${CMAKE_CURRENT_SOURCE_DIR}/test_buffer_stream.cpp |
196 | 4 | ${CMAKE_CURRENT_SOURCE_DIR}/test_temporary_buffers.cpp | 4 | ${CMAKE_CURRENT_SOURCE_DIR}/test_temporary_buffers.cpp |
197 | 5 | ${CMAKE_CURRENT_SOURCE_DIR}/test_rendering_operator.cpp | ||
198 | 6 | ${CMAKE_CURRENT_SOURCE_DIR}/test_multi_threaded_compositor.cpp | 5 | ${CMAKE_CURRENT_SOURCE_DIR}/test_multi_threaded_compositor.cpp |
199 | 7 | ${CMAKE_CURRENT_SOURCE_DIR}/test_switching_bundle.cpp | 6 | ${CMAKE_CURRENT_SOURCE_DIR}/test_switching_bundle.cpp |
200 | 8 | ${CMAKE_CURRENT_SOURCE_DIR}/test_gl_renderer.cpp | 7 | ${CMAKE_CURRENT_SOURCE_DIR}/test_gl_renderer.cpp |
201 | 9 | 8 | ||
202 | === modified file 'tests/unit-tests/compositor/test_default_display_buffer_compositor.cpp' | |||
203 | --- tests/unit-tests/compositor/test_default_display_buffer_compositor.cpp 2014-04-01 20:39:59 +0000 | |||
204 | +++ tests/unit-tests/compositor/test_default_display_buffer_compositor.cpp 2014-04-03 23:09:17 +0000 | |||
205 | @@ -119,8 +119,6 @@ | |||
206 | 119 | .Times(1); | 119 | .Times(1); |
207 | 120 | EXPECT_CALL(scene, generate_renderable_list()) | 120 | EXPECT_CALL(scene, generate_renderable_list()) |
208 | 121 | .Times(1); | 121 | .Times(1); |
209 | 122 | EXPECT_CALL(scene, for_each_if(_,_)) | ||
210 | 123 | .Times(1); | ||
211 | 124 | EXPECT_CALL(display_buffer, post_update()) | 122 | EXPECT_CALL(display_buffer, post_update()) |
212 | 125 | .Times(1); | 123 | .Times(1); |
213 | 126 | 124 | ||
214 | @@ -555,3 +553,47 @@ | |||
215 | 555 | EXPECT_TRUE(compositor.composite()); | 553 | EXPECT_TRUE(compositor.composite()); |
216 | 556 | EXPECT_FALSE(compositor.composite()); | 554 | EXPECT_FALSE(compositor.composite()); |
217 | 557 | } | 555 | } |
218 | 556 | |||
219 | 557 | TEST_F(DefaultDisplayBufferCompositor, buffers_held_until_post_update_is_done) | ||
220 | 558 | { | ||
221 | 559 | using namespace testing; | ||
222 | 560 | auto mock_renderable1 = std::make_shared<NiceMock<mtd::MockRenderable>>(); | ||
223 | 561 | auto mock_renderable2 = std::make_shared<NiceMock<mtd::MockRenderable>>(); | ||
224 | 562 | auto buf1 = std::make_shared<mtd::StubBuffer>(); | ||
225 | 563 | auto buf2 = std::make_shared<mtd::StubBuffer>(); | ||
226 | 564 | ON_CALL(*mock_renderable1, buffer(_)) | ||
227 | 565 | .WillByDefault(Return(buf1)); | ||
228 | 566 | ON_CALL(*mock_renderable2, buffer(_)) | ||
229 | 567 | .WillByDefault(Return(buf2)); | ||
230 | 568 | ON_CALL(display_buffer, view_area()) | ||
231 | 569 | .WillByDefault(Return(geom::Rectangle{{0,0},{14,14}})); | ||
232 | 570 | EXPECT_CALL(*mock_renderable1, screen_position()) | ||
233 | 571 | .WillRepeatedly(Return(geom::Rectangle{{1,2}, {3,4}})); | ||
234 | 572 | EXPECT_CALL(*mock_renderable2, screen_position()) | ||
235 | 573 | .WillRepeatedly(Return(geom::Rectangle{{0,2}, {3,4}})); | ||
236 | 574 | |||
237 | 575 | mg::RenderableList list{ | ||
238 | 576 | mock_renderable1, | ||
239 | 577 | mock_renderable2 | ||
240 | 578 | }; | ||
241 | 579 | FakeScene scene(list); | ||
242 | 580 | |||
243 | 581 | long test_use_count1{buf1.use_count()}; | ||
244 | 582 | long test_use_count2{buf2.use_count()}; | ||
245 | 583 | |||
246 | 584 | EXPECT_CALL(display_buffer, post_update()) | ||
247 | 585 | .Times(1) | ||
248 | 586 | .WillOnce(Invoke([&test_use_count1, &test_use_count2, &buf1, &buf2]() | ||
249 | 587 | { | ||
250 | 588 | EXPECT_GT(buf1.use_count(), test_use_count1); | ||
251 | 589 | EXPECT_GT(buf2.use_count(), test_use_count2); | ||
252 | 590 | })); | ||
253 | 591 | |||
254 | 592 | mc::DefaultDisplayBufferCompositor compositor( | ||
255 | 593 | display_buffer, | ||
256 | 594 | mt::fake_shared(scene), | ||
257 | 595 | mt::fake_shared(mock_renderer), | ||
258 | 596 | mr::null_compositor_report()); | ||
259 | 597 | compositor.composite(); | ||
260 | 598 | } | ||
261 | 599 | |||
262 | 558 | 600 | ||
263 | === removed file 'tests/unit-tests/compositor/test_rendering_operator.cpp' | |||
264 | --- tests/unit-tests/compositor/test_rendering_operator.cpp 2014-03-26 05:48:59 +0000 | |||
265 | +++ tests/unit-tests/compositor/test_rendering_operator.cpp 1970-01-01 00:00:00 +0000 | |||
266 | @@ -1,76 +0,0 @@ | |||
267 | 1 | /* | ||
268 | 2 | * Copyright © 2012 Canonical Ltd. | ||
269 | 3 | * | ||
270 | 4 | * This program is free software: you can redistribute it and/or modify | ||
271 | 5 | * it under the terms of the GNU General Public License version 3 as | ||
272 | 6 | * published by the Free Software Foundation. | ||
273 | 7 | * | ||
274 | 8 | * This program is distributed in the hope that it will be useful, | ||
275 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
276 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
277 | 11 | * GNU General Public License for more details. | ||
278 | 12 | * | ||
279 | 13 | * You should have received a copy of the GNU General Public License | ||
280 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
281 | 15 | * | ||
282 | 16 | * Authored by: Kevin DuBois <kevin.dubois@canonical.com> | ||
283 | 17 | */ | ||
284 | 18 | |||
285 | 19 | #include "src/server/compositor/rendering_operator.h" | ||
286 | 20 | #include "mir/geometry/rectangle.h" | ||
287 | 21 | #include "mir_test_doubles/mock_renderer.h" | ||
288 | 22 | #include "mir_test_doubles/mock_buffer_stream.h" | ||
289 | 23 | #include "mir_test_doubles/mock_renderable.h" | ||
290 | 24 | #include "mir_test_doubles/stub_buffer.h" | ||
291 | 25 | |||
292 | 26 | #include <gmock/gmock.h> | ||
293 | 27 | #include <gtest/gtest.h> | ||
294 | 28 | |||
295 | 29 | namespace mc = mir::compositor; | ||
296 | 30 | namespace mg = mir::graphics; | ||
297 | 31 | namespace geom = mir::geometry; | ||
298 | 32 | namespace mtd = mir::test::doubles; | ||
299 | 33 | namespace mg = mir::graphics; | ||
300 | 34 | |||
301 | 35 | TEST(RenderingOperator, render_operator_saves_resources) | ||
302 | 36 | { | ||
303 | 37 | using namespace testing; | ||
304 | 38 | |||
305 | 39 | mtd::MockRenderer mock_renderer; | ||
306 | 40 | mtd::MockRenderable mock_renderable; | ||
307 | 41 | auto stub_buffer0 = std::make_shared<mtd::StubBuffer>(); | ||
308 | 42 | auto stub_buffer1 = std::make_shared<mtd::StubBuffer>(); | ||
309 | 43 | auto stub_buffer2 = std::make_shared<mtd::StubBuffer>(); | ||
310 | 44 | |||
311 | 45 | EXPECT_CALL(mock_renderable, buffer(_)) | ||
312 | 46 | .Times(3) | ||
313 | 47 | .WillOnce(Return(stub_buffer0)) | ||
314 | 48 | .WillOnce(Return(stub_buffer1)) | ||
315 | 49 | .WillOnce(Return(stub_buffer2)); | ||
316 | 50 | |||
317 | 51 | Sequence seq; | ||
318 | 52 | EXPECT_CALL(mock_renderer, render(Ref(mock_renderable), Ref(*stub_buffer0))) | ||
319 | 53 | .InSequence(seq); | ||
320 | 54 | EXPECT_CALL(mock_renderer, render(Ref(mock_renderable), Ref(*stub_buffer1))) | ||
321 | 55 | .InSequence(seq); | ||
322 | 56 | EXPECT_CALL(mock_renderer, render(Ref(mock_renderable), Ref(*stub_buffer2))) | ||
323 | 57 | .InSequence(seq); | ||
324 | 58 | |||
325 | 59 | auto use_count_before0 = stub_buffer0.use_count(); | ||
326 | 60 | auto use_count_before1 = stub_buffer1.use_count(); | ||
327 | 61 | auto use_count_before2 = stub_buffer2.use_count(); | ||
328 | 62 | { | ||
329 | 63 | mc::RenderingOperator rendering_operator(mock_renderer); | ||
330 | 64 | rendering_operator(mock_renderable); | ||
331 | 65 | rendering_operator(mock_renderable); | ||
332 | 66 | rendering_operator(mock_renderable); | ||
333 | 67 | |||
334 | 68 | EXPECT_EQ(use_count_before0 + 1, stub_buffer0.use_count()); | ||
335 | 69 | EXPECT_EQ(use_count_before1 + 1, stub_buffer1.use_count()); | ||
336 | 70 | EXPECT_EQ(use_count_before2 + 1, stub_buffer2.use_count()); | ||
337 | 71 | } | ||
338 | 72 | |||
339 | 73 | EXPECT_EQ(use_count_before0, stub_buffer0.use_count()); | ||
340 | 74 | EXPECT_EQ(use_count_before1, stub_buffer1.use_count()); | ||
341 | 75 | EXPECT_EQ(use_count_before2, stub_buffer2.use_count()); | ||
342 | 76 | } |
FAILED: Continuous integration, rev:1525 jenkins. qa.ubuntu. com/job/ mir-team- mir-development -branch- ci/1235/ jenkins. qa.ubuntu. com/job/ mir-android- trusty- i386-build/ 1468 jenkins. qa.ubuntu. com/job/ mir-clang- trusty- amd64-build/ 1466 jenkins. qa.ubuntu. com/job/ mir-mediumtests -trusty- touch/1045/ console jenkins. qa.ubuntu. com/job/ mir-team- mir-development -branch- trusty- amd64-ci/ 967 jenkins. qa.ubuntu. com/job/ mir-team- mir-development -branch- trusty- amd64-ci/ 967/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ mir-team- mir-development -branch- trusty- armhf-ci/ 972 jenkins. qa.ubuntu. com/job/ mir-team- mir-development -branch- trusty- armhf-ci/ 972/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ mir-mediumtests -builder- trusty- armhf/1046 jenkins. qa.ubuntu. com/job/ mir-mediumtests -builder- trusty- armhf/1046/ artifact/ work/output/ *zip*/output. zip
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/mir- team-mir- development- branch- ci/1235/ rebuild
http://