Merge lp:~vanvugt/mir/eliminate-stream-casts into lp:mir
- eliminate-stream-casts
- Merge into development-branch
Status: | Merged |
---|---|
Approved by: | Daniel van Vugt |
Approved revision: | no longer in the source branch. |
Merged at revision: | 3856 |
Proposed branch: | lp:~vanvugt/mir/eliminate-stream-casts |
Merge into: | lp:mir |
Diff against target: |
1064 lines (+118/-158) 27 files modified
src/client/buffer_stream.h (+2/-2) src/client/connection_surface_map.cpp (+3/-3) src/client/connection_surface_map.h (+4/-4) src/client/cursor_configuration.h (+2/-10) src/client/error_stream.h (+2/-2) src/client/mir_buffer_stream_api.cpp (+17/-38) src/client/mir_connection.cpp (+9/-14) src/client/mir_connection.h (+4/-5) src/client/mir_cursor_api.cpp (+2/-4) src/client/mir_debug_api.cpp (+1/-1) src/client/mir_screencast.cpp (+2/-2) src/client/mir_screencast.h (+3/-4) src/client/mir_screencast_api.cpp (+1/-1) src/client/mir_surface.cpp (+3/-3) src/client/mir_surface.h (+5/-6) src/client/mir_surface_api.cpp (+3/-4) src/client/render_surface.cpp (+1/-2) src/client/rpc/mir_protobuf_rpc_channel.cpp (+2/-2) src/client/screencast_stream.h (+2/-2) src/client/surface_map.h (+3/-3) src/include/client/mir/mir_buffer_stream.h (+20/-18) src/platforms/android/client/android_client_platform.cpp (+2/-3) tests/include/mir/test/doubles/mock_mir_buffer_stream.h (+5/-5) tests/unit-tests/client/test_client_mir_surface.cpp (+8/-8) tests/unit-tests/client/test_connection_resource_map.cpp (+4/-4) tests/unit-tests/client/test_mir_screencast.cpp (+2/-2) tests/unit-tests/client/test_protobuf_rpc_channel.cpp (+6/-6) |
To merge this branch: | bzr merge lp:~vanvugt/mir/eliminate-stream-casts |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Mir CI Bot | continuous-integration | Approve | |
Alan Griffiths | Approve | ||
Kevin DuBois (community) | Approve | ||
Review via email: mp+312133@code.launchpad.net |
Commit message
Simplify client buffer stream types and eliminate lots of casts.
Description of the change
Mir CI Bot (mir-ci-bot) wrote : | # |
Mir CI Bot (mir-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:3858
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Mir CI Bot (mir-ci-bot) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
https:/
Executed test runs:
FAILURE: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Daniel van Vugt (vanvugt) wrote : | # |
^^^
Bug 1570327
Mir CI Bot (mir-ci-bot) : | # |
Preview Diff
1 | === modified file 'src/client/buffer_stream.h' | |||
2 | --- src/client/buffer_stream.h 2016-11-24 10:17:52 +0000 | |||
3 | +++ src/client/buffer_stream.h 2016-11-30 09:56:15 +0000 | |||
4 | @@ -22,7 +22,7 @@ | |||
5 | 22 | #include "mir_wait_handle.h" | 22 | #include "mir_wait_handle.h" |
6 | 23 | #include "mir/egl_native_surface.h" | 23 | #include "mir/egl_native_surface.h" |
7 | 24 | #include "mir/client_buffer.h" | 24 | #include "mir/client_buffer.h" |
9 | 25 | #include "mir/client_buffer_stream.h" | 25 | #include "mir/mir_buffer_stream.h" |
10 | 26 | #include "mir/geometry/size.h" | 26 | #include "mir/geometry/size.h" |
11 | 27 | #include "mir/optional_value.h" | 27 | #include "mir/optional_value.h" |
12 | 28 | #include "buffer_stream_configuration.h" | 28 | #include "buffer_stream_configuration.h" |
13 | @@ -69,7 +69,7 @@ | |||
14 | 69 | struct MemoryRegion; | 69 | struct MemoryRegion; |
15 | 70 | class SurfaceMap; | 70 | class SurfaceMap; |
16 | 71 | class BufferDepository; | 71 | class BufferDepository; |
18 | 72 | class BufferStream : public EGLNativeSurface, public ClientBufferStream | 72 | class BufferStream : public EGLNativeSurface, public MirBufferStream |
19 | 73 | { | 73 | { |
20 | 74 | public: | 74 | public: |
21 | 75 | BufferStream( | 75 | BufferStream( |
22 | 76 | 76 | ||
23 | === modified file 'src/client/connection_surface_map.cpp' | |||
24 | --- src/client/connection_surface_map.cpp 2016-10-13 16:32:59 +0000 | |||
25 | +++ src/client/connection_surface_map.cpp 2016-11-30 09:56:15 +0000 | |||
26 | @@ -58,7 +58,7 @@ | |||
27 | 58 | } | 58 | } |
28 | 59 | 59 | ||
29 | 60 | void mcl::ConnectionSurfaceMap::with_stream_do( | 60 | void mcl::ConnectionSurfaceMap::with_stream_do( |
31 | 61 | mf::BufferStreamId stream_id, std::function<void(ClientBufferStream*)> const& exec) const | 61 | mf::BufferStreamId stream_id, std::function<void(MirBufferStream*)> const& exec) const |
32 | 62 | { | 62 | { |
33 | 63 | std::shared_lock<decltype(stream_guard)> lk(stream_guard); | 63 | std::shared_lock<decltype(stream_guard)> lk(stream_guard); |
34 | 64 | auto const it = streams.find(stream_id); | 64 | auto const it = streams.find(stream_id); |
35 | @@ -76,7 +76,7 @@ | |||
36 | 76 | } | 76 | } |
37 | 77 | } | 77 | } |
38 | 78 | 78 | ||
40 | 79 | void mcl::ConnectionSurfaceMap::with_all_streams_do(std::function<void(ClientBufferStream*)> const& fn) const | 79 | void mcl::ConnectionSurfaceMap::with_all_streams_do(std::function<void(MirBufferStream*)> const& fn) const |
41 | 80 | { | 80 | { |
42 | 81 | std::shared_lock<decltype(stream_guard)> lk(stream_guard); | 81 | std::shared_lock<decltype(stream_guard)> lk(stream_guard); |
43 | 82 | for(auto const& stream : streams) | 82 | for(auto const& stream : streams) |
44 | @@ -84,7 +84,7 @@ | |||
45 | 84 | } | 84 | } |
46 | 85 | 85 | ||
47 | 86 | void mcl::ConnectionSurfaceMap::insert( | 86 | void mcl::ConnectionSurfaceMap::insert( |
49 | 87 | mf::BufferStreamId stream_id, std::shared_ptr<ClientBufferStream> const& stream) | 87 | mf::BufferStreamId stream_id, std::shared_ptr<MirBufferStream> const& stream) |
50 | 88 | { | 88 | { |
51 | 89 | std::lock_guard<decltype(stream_guard)> lk(stream_guard); | 89 | std::lock_guard<decltype(stream_guard)> lk(stream_guard); |
52 | 90 | streams[stream_id] = stream; | 90 | streams[stream_id] = stream; |
53 | 91 | 91 | ||
54 | === modified file 'src/client/connection_surface_map.h' | |||
55 | --- src/client/connection_surface_map.h 2016-10-11 18:59:08 +0000 | |||
56 | +++ src/client/connection_surface_map.h 2016-11-30 09:56:15 +0000 | |||
57 | @@ -38,10 +38,10 @@ | |||
58 | 38 | void insert(frontend::SurfaceId surface_id, std::shared_ptr<MirSurface> const& surface); | 38 | void insert(frontend::SurfaceId surface_id, std::shared_ptr<MirSurface> const& surface); |
59 | 39 | void erase(frontend::SurfaceId surface_id); | 39 | void erase(frontend::SurfaceId surface_id); |
60 | 40 | 40 | ||
63 | 41 | void with_stream_do(frontend::BufferStreamId stream_id, std::function<void(ClientBufferStream*)> const& exec) const override; | 41 | void with_stream_do(frontend::BufferStreamId stream_id, std::function<void(MirBufferStream*)> const& exec) const override; |
64 | 42 | void with_all_streams_do(std::function<void(ClientBufferStream*)> const&) const override; | 42 | void with_all_streams_do(std::function<void(MirBufferStream*)> const&) const override; |
65 | 43 | 43 | ||
67 | 44 | void insert(frontend::BufferStreamId stream_id, std::shared_ptr<ClientBufferStream> const& chain); | 44 | void insert(frontend::BufferStreamId stream_id, std::shared_ptr<MirBufferStream> const& chain); |
68 | 45 | void insert(frontend::BufferStreamId stream_id, std::shared_ptr<MirPresentationChain> const& chain); | 45 | void insert(frontend::BufferStreamId stream_id, std::shared_ptr<MirPresentationChain> const& chain); |
69 | 46 | void erase(frontend::BufferStreamId surface_id); | 46 | void erase(frontend::BufferStreamId surface_id); |
70 | 47 | 47 | ||
71 | @@ -57,7 +57,7 @@ | |||
72 | 57 | std::shared_timed_mutex mutable guard; | 57 | std::shared_timed_mutex mutable guard; |
73 | 58 | std::unordered_map<frontend::SurfaceId, std::shared_ptr<MirSurface>> surfaces; | 58 | std::unordered_map<frontend::SurfaceId, std::shared_ptr<MirSurface>> surfaces; |
74 | 59 | std::shared_timed_mutex mutable stream_guard; | 59 | std::shared_timed_mutex mutable stream_guard; |
76 | 60 | std::unordered_map<frontend::BufferStreamId, std::shared_ptr<ClientBufferStream>> streams; | 60 | std::unordered_map<frontend::BufferStreamId, std::shared_ptr<MirBufferStream>> streams; |
77 | 61 | std::unordered_map<frontend::BufferStreamId, std::shared_ptr<MirPresentationChain>> chains; | 61 | std::unordered_map<frontend::BufferStreamId, std::shared_ptr<MirPresentationChain>> chains; |
78 | 62 | std::shared_timed_mutex mutable buffer_guard; | 62 | std::shared_timed_mutex mutable buffer_guard; |
79 | 63 | std::unordered_map<int, std::shared_ptr<MirBuffer>> buffers; | 63 | std::unordered_map<int, std::shared_ptr<MirBuffer>> buffers; |
80 | 64 | 64 | ||
81 | === modified file 'src/client/cursor_configuration.h' | |||
82 | --- src/client/cursor_configuration.h 2015-04-28 07:54:10 +0000 | |||
83 | +++ src/client/cursor_configuration.h 2016-11-30 09:56:15 +0000 | |||
84 | @@ -21,23 +21,15 @@ | |||
85 | 21 | 21 | ||
86 | 22 | #include <string> | 22 | #include <string> |
87 | 23 | 23 | ||
88 | 24 | namespace mir | ||
89 | 25 | { | ||
90 | 26 | namespace client | ||
91 | 27 | { | ||
92 | 28 | class ClientBufferStream; | ||
93 | 29 | } | ||
94 | 30 | } | ||
95 | 31 | |||
96 | 32 | // Parameters for configuring the apperance and behavior of the system cursor. | 24 | // Parameters for configuring the apperance and behavior of the system cursor. |
97 | 33 | // Will grow to include cursors specified by raw RGBA data, hotspots, etc... | 25 | // Will grow to include cursors specified by raw RGBA data, hotspots, etc... |
98 | 34 | struct MirCursorConfiguration | 26 | struct MirCursorConfiguration |
99 | 35 | { | 27 | { |
100 | 36 | MirCursorConfiguration(char const* name); | 28 | MirCursorConfiguration(char const* name); |
102 | 37 | MirCursorConfiguration(mir::client::ClientBufferStream const* stream, int hotspot_x, int hotspot_y); | 29 | MirCursorConfiguration(MirBufferStream const* stream, int hotspot_x, int hotspot_y); |
103 | 38 | 30 | ||
104 | 39 | std::string name; | 31 | std::string name; |
106 | 40 | mir::client::ClientBufferStream const* stream; | 32 | MirBufferStream const* stream; |
107 | 41 | int hotspot_x; | 33 | int hotspot_x; |
108 | 42 | int hotspot_y; | 34 | int hotspot_y; |
109 | 43 | }; | 35 | }; |
110 | 44 | 36 | ||
111 | === modified file 'src/client/error_stream.h' | |||
112 | --- src/client/error_stream.h 2016-11-23 04:37:50 +0000 | |||
113 | +++ src/client/error_stream.h 2016-11-30 09:56:15 +0000 | |||
114 | @@ -19,13 +19,13 @@ | |||
115 | 19 | #ifndef MIR_CLIENT_ERROR_STREAM_H_ | 19 | #ifndef MIR_CLIENT_ERROR_STREAM_H_ |
116 | 20 | #define MIR_CLIENT_ERROR_STREAM_H_ | 20 | #define MIR_CLIENT_ERROR_STREAM_H_ |
117 | 21 | 21 | ||
119 | 22 | #include "mir/client_buffer_stream.h" | 22 | #include "mir/mir_buffer_stream.h" |
120 | 23 | 23 | ||
121 | 24 | namespace mir | 24 | namespace mir |
122 | 25 | { | 25 | { |
123 | 26 | namespace client | 26 | namespace client |
124 | 27 | { | 27 | { |
126 | 28 | class ErrorStream : public ClientBufferStream | 28 | class ErrorStream : public MirBufferStream |
127 | 29 | { | 29 | { |
128 | 30 | public: | 30 | public: |
129 | 31 | ErrorStream( | 31 | ErrorStream( |
130 | 32 | 32 | ||
131 | === modified file 'src/client/mir_buffer_stream_api.cpp' | |||
132 | --- src/client/mir_buffer_stream_api.cpp 2016-11-14 21:59:19 +0000 | |||
133 | +++ src/client/mir_buffer_stream_api.cpp 2016-11-30 09:56:15 +0000 | |||
134 | @@ -88,9 +88,8 @@ | |||
135 | 88 | mir_buffer_stream_callback callback, | 88 | mir_buffer_stream_callback callback, |
136 | 89 | void* context) | 89 | void* context) |
137 | 90 | { | 90 | { |
141 | 91 | auto bs = reinterpret_cast<mcl::ClientBufferStream*>(buffer_stream); | 91 | auto connection = buffer_stream->connection(); |
142 | 92 | auto connection = bs->connection(); | 92 | return connection->release_buffer_stream(buffer_stream, callback, context); |
140 | 93 | return connection->release_buffer_stream(bs, callback, context); | ||
143 | 94 | } | 93 | } |
144 | 95 | 94 | ||
145 | 96 | void mir_buffer_stream_release_sync(MirBufferStream *buffer_stream) | 95 | void mir_buffer_stream_release_sync(MirBufferStream *buffer_stream) |
146 | @@ -101,8 +100,7 @@ | |||
147 | 101 | void mir_buffer_stream_get_current_buffer(MirBufferStream* buffer_stream, MirNativeBuffer** buffer_package_out) | 100 | void mir_buffer_stream_get_current_buffer(MirBufferStream* buffer_stream, MirNativeBuffer** buffer_package_out) |
148 | 102 | try | 101 | try |
149 | 103 | { | 102 | { |
152 | 104 | mcl::ClientBufferStream *bs = reinterpret_cast<mcl::ClientBufferStream*>(buffer_stream); | 103 | *buffer_package_out = buffer_stream->get_current_buffer_package(); |
151 | 105 | *buffer_package_out = bs->get_current_buffer_package(); | ||
153 | 106 | } | 104 | } |
154 | 107 | catch (std::exception const& ex) | 105 | catch (std::exception const& ex) |
155 | 108 | { | 106 | { |
156 | @@ -115,10 +113,9 @@ | |||
157 | 115 | void* context) | 113 | void* context) |
158 | 116 | try | 114 | try |
159 | 117 | { | 115 | { |
162 | 118 | mcl::ClientBufferStream *bs = reinterpret_cast<mcl::ClientBufferStream*>(buffer_stream); | 116 | return buffer_stream->next_buffer([buffer_stream, callback, context]{ |
161 | 119 | return bs->next_buffer([bs, callback, context]{ | ||
163 | 120 | if (callback) | 117 | if (callback) |
165 | 121 | callback(reinterpret_cast<MirBufferStream*>(bs), context); | 118 | callback(buffer_stream, context); |
166 | 122 | }); | 119 | }); |
167 | 123 | } | 120 | } |
168 | 124 | catch (std::exception const& ex) | 121 | catch (std::exception const& ex) |
169 | @@ -146,9 +143,7 @@ | |||
170 | 146 | MirGraphicsRegion *region_out) | 143 | MirGraphicsRegion *region_out) |
171 | 147 | try | 144 | try |
172 | 148 | { | 145 | { |
176 | 149 | mcl::ClientBufferStream *bs = reinterpret_cast<mcl::ClientBufferStream*>(buffer_stream); | 146 | auto secured_region = buffer_stream->secure_for_cpu_write(); |
174 | 150 | |||
175 | 151 | auto secured_region = bs->secure_for_cpu_write(); | ||
177 | 152 | region_out->width = secured_region->width.as_uint32_t(); | 147 | region_out->width = secured_region->width.as_uint32_t(); |
178 | 153 | region_out->height = secured_region->height.as_uint32_t(); | 148 | region_out->height = secured_region->height.as_uint32_t(); |
179 | 154 | region_out->stride = secured_region->stride.as_uint32_t(); | 149 | region_out->stride = secured_region->stride.as_uint32_t(); |
180 | @@ -163,8 +158,7 @@ | |||
181 | 163 | MirEGLNativeWindowType mir_buffer_stream_get_egl_native_window(MirBufferStream* buffer_stream) | 158 | MirEGLNativeWindowType mir_buffer_stream_get_egl_native_window(MirBufferStream* buffer_stream) |
182 | 164 | try | 159 | try |
183 | 165 | { | 160 | { |
186 | 166 | mcl::ClientBufferStream *bs = reinterpret_cast<mcl::ClientBufferStream*>(buffer_stream); | 161 | return reinterpret_cast<MirEGLNativeWindowType>(buffer_stream->egl_native_window()); |
185 | 167 | return reinterpret_cast<MirEGLNativeWindowType>(bs->egl_native_window()); | ||
187 | 168 | } | 162 | } |
188 | 169 | catch (std::exception const& ex) | 163 | catch (std::exception const& ex) |
189 | 170 | { | 164 | { |
190 | @@ -175,8 +169,7 @@ | |||
191 | 175 | MirPlatformType mir_buffer_stream_get_platform_type(MirBufferStream* buffer_stream) | 169 | MirPlatformType mir_buffer_stream_get_platform_type(MirBufferStream* buffer_stream) |
192 | 176 | try | 170 | try |
193 | 177 | { | 171 | { |
196 | 178 | mcl::ClientBufferStream *bs = reinterpret_cast<mcl::ClientBufferStream*>(buffer_stream); | 172 | return buffer_stream->platform_type(); |
195 | 179 | return bs->platform_type(); | ||
197 | 180 | } | 173 | } |
198 | 181 | catch (std::exception const& ex) | 174 | catch (std::exception const& ex) |
199 | 182 | { | 175 | { |
200 | @@ -186,14 +179,12 @@ | |||
201 | 186 | 179 | ||
202 | 187 | bool mir_buffer_stream_is_valid(MirBufferStream* opaque_stream) | 180 | bool mir_buffer_stream_is_valid(MirBufferStream* opaque_stream) |
203 | 188 | { | 181 | { |
206 | 189 | auto buffer_stream = reinterpret_cast<mcl::ClientBufferStream*>(opaque_stream); | 182 | return opaque_stream->valid(); |
205 | 190 | return buffer_stream->valid(); | ||
207 | 191 | } | 183 | } |
208 | 192 | 184 | ||
210 | 193 | MirWaitHandle* mir_buffer_stream_set_scale(MirBufferStream* opaque_stream, float scale) | 185 | MirWaitHandle* mir_buffer_stream_set_scale(MirBufferStream* buffer_stream, float scale) |
211 | 194 | try | 186 | try |
212 | 195 | { | 187 | { |
213 | 196 | auto buffer_stream = reinterpret_cast<mcl::ClientBufferStream*>(opaque_stream); | ||
214 | 197 | if (!buffer_stream) | 188 | if (!buffer_stream) |
215 | 198 | return nullptr; | 189 | return nullptr; |
216 | 199 | 190 | ||
217 | @@ -212,19 +203,17 @@ | |||
218 | 212 | wh->wait_for_all(); | 203 | wh->wait_for_all(); |
219 | 213 | } | 204 | } |
220 | 214 | 205 | ||
222 | 215 | char const* mir_buffer_stream_get_error_message(MirBufferStream* opaque_stream) | 206 | char const* mir_buffer_stream_get_error_message(MirBufferStream* buffer_stream) |
223 | 216 | { | 207 | { |
224 | 217 | auto buffer_stream = reinterpret_cast<mcl::ClientBufferStream*>(opaque_stream); | ||
225 | 218 | return buffer_stream->get_error_message(); | 208 | return buffer_stream->get_error_message(); |
226 | 219 | } | 209 | } |
227 | 220 | 210 | ||
229 | 221 | MirWaitHandle* mir_buffer_stream_set_swapinterval(MirBufferStream* stream, int interval) | 211 | MirWaitHandle* mir_buffer_stream_set_swapinterval(MirBufferStream* buffer_stream, int interval) |
230 | 222 | try | 212 | try |
231 | 223 | { | 213 | { |
232 | 224 | if ((interval < 0) || (interval > 1)) | 214 | if ((interval < 0) || (interval > 1)) |
233 | 225 | return nullptr; | 215 | return nullptr; |
234 | 226 | 216 | ||
235 | 227 | auto buffer_stream = reinterpret_cast<mcl::ClientBufferStream*>(stream); | ||
236 | 228 | if (!buffer_stream) | 217 | if (!buffer_stream) |
237 | 229 | return nullptr; | 218 | return nullptr; |
238 | 230 | 219 | ||
239 | @@ -236,10 +225,9 @@ | |||
240 | 236 | return nullptr; | 225 | return nullptr; |
241 | 237 | } | 226 | } |
242 | 238 | 227 | ||
244 | 239 | int mir_buffer_stream_get_swapinterval(MirBufferStream* stream) | 228 | int mir_buffer_stream_get_swapinterval(MirBufferStream* buffer_stream) |
245 | 240 | try | 229 | try |
246 | 241 | { | 230 | { |
247 | 242 | auto buffer_stream = reinterpret_cast<mcl::ClientBufferStream*>(stream); | ||
248 | 243 | if (buffer_stream) | 231 | if (buffer_stream) |
249 | 244 | return buffer_stream->swap_interval(); | 232 | return buffer_stream->swap_interval(); |
250 | 245 | else | 233 | else |
251 | @@ -255,8 +243,7 @@ | |||
252 | 255 | try | 243 | try |
253 | 256 | { | 244 | { |
254 | 257 | mir::require(stream); | 245 | mir::require(stream); |
257 | 258 | if (auto buffer_stream = reinterpret_cast<mcl::ClientBufferStream*>(stream)) | 246 | return stream->set_size(mir::geometry::Size{width, height}); |
256 | 259 | return buffer_stream->set_size(mir::geometry::Size{width, height}); | ||
258 | 260 | } | 247 | } |
259 | 261 | catch (std::exception const& ex) | 248 | catch (std::exception const& ex) |
260 | 262 | { | 249 | { |
261 | @@ -269,17 +256,9 @@ | |||
262 | 269 | mir::require(stream); | 256 | mir::require(stream); |
263 | 270 | mir::require(width); | 257 | mir::require(width); |
264 | 271 | mir::require(height); | 258 | mir::require(height); |
276 | 272 | if (auto buffer_stream = reinterpret_cast<mcl::ClientBufferStream*>(stream)) | 259 | auto size = stream->size(); |
277 | 273 | { | 260 | *width = size.width.as_int(); |
278 | 274 | auto size = buffer_stream->size(); | 261 | *height = size.height.as_int(); |
268 | 275 | *width = size.width.as_int(); | ||
269 | 276 | *height = size.height.as_int(); | ||
270 | 277 | } | ||
271 | 278 | else | ||
272 | 279 | { | ||
273 | 280 | *width = -1; | ||
274 | 281 | *height = -1; | ||
275 | 282 | } | ||
279 | 283 | } | 262 | } |
280 | 284 | catch (std::exception const& ex) | 263 | catch (std::exception const& ex) |
281 | 285 | { | 264 | { |
282 | 286 | 265 | ||
283 | === modified file 'src/client/mir_connection.cpp' | |||
284 | --- src/client/mir_connection.cpp 2016-11-22 18:18:59 +0000 | |||
285 | +++ src/client/mir_connection.cpp 2016-11-30 09:56:15 +0000 | |||
286 | @@ -386,7 +386,7 @@ | |||
287 | 386 | std::string name{spec.surface_name.is_set() ? | 386 | std::string name{spec.surface_name.is_set() ? |
288 | 387 | spec.surface_name.value() : ""}; | 387 | spec.surface_name.value() : ""}; |
289 | 388 | 388 | ||
291 | 389 | std::shared_ptr<mcl::ClientBufferStream> default_stream {nullptr}; | 389 | std::shared_ptr<MirBufferStream> default_stream {nullptr}; |
292 | 390 | if (surface_proto->buffer_stream().has_id()) | 390 | if (surface_proto->buffer_stream().has_id()) |
293 | 391 | { | 391 | { |
294 | 392 | try | 392 | try |
295 | @@ -465,7 +465,7 @@ | |||
296 | 465 | 465 | ||
297 | 466 | struct MirConnection::StreamRelease | 466 | struct MirConnection::StreamRelease |
298 | 467 | { | 467 | { |
300 | 468 | mcl::ClientBufferStream* stream; | 468 | MirBufferStream* stream; |
301 | 469 | MirWaitHandle* handle; | 469 | MirWaitHandle* handle; |
302 | 470 | mir_buffer_stream_callback callback; | 470 | mir_buffer_stream_callback callback; |
303 | 471 | void* context; | 471 | void* context; |
304 | @@ -476,7 +476,7 @@ | |||
305 | 476 | void MirConnection::released(StreamRelease data) | 476 | void MirConnection::released(StreamRelease data) |
306 | 477 | { | 477 | { |
307 | 478 | if (data.callback) | 478 | if (data.callback) |
309 | 479 | data.callback(reinterpret_cast<MirBufferStream*>(data.stream), data.context); | 479 | data.callback(data.stream, data.context); |
310 | 480 | if (data.handle) | 480 | if (data.handle) |
311 | 481 | data.handle->result_received(); | 481 | data.handle->result_received(); |
312 | 482 | 482 | ||
313 | @@ -634,7 +634,7 @@ | |||
314 | 634 | std::lock_guard<decltype(mutex)> lock(mutex); | 634 | std::lock_guard<decltype(mutex)> lock(mutex); |
315 | 635 | disconnecting = true; | 635 | disconnecting = true; |
316 | 636 | } | 636 | } |
318 | 637 | surface_map->with_all_streams_do([](mcl::ClientBufferStream* receiver) | 637 | surface_map->with_all_streams_do([](MirBufferStream* receiver) |
319 | 638 | { | 638 | { |
320 | 639 | receiver->buffer_unavailable(); | 639 | receiver->buffer_unavailable(); |
321 | 640 | }); | 640 | }); |
322 | @@ -839,10 +839,7 @@ | |||
323 | 839 | surface_map->insert(mf::BufferStreamId(protobuf_bs->id().value()), stream); | 839 | surface_map->insert(mf::BufferStreamId(protobuf_bs->id().value()), stream); |
324 | 840 | 840 | ||
325 | 841 | if (request->mbs_callback) | 841 | if (request->mbs_callback) |
330 | 842 | request->mbs_callback( | 842 | request->mbs_callback(stream.get(), request->context); |
327 | 843 | reinterpret_cast<MirBufferStream*>( | ||
328 | 844 | dynamic_cast<mcl::ClientBufferStream*>(stream.get())), | ||
329 | 845 | request->context); | ||
331 | 846 | 843 | ||
332 | 847 | request->wh->result_received(); | 844 | request->wh->result_received(); |
333 | 848 | } | 845 | } |
334 | @@ -931,15 +928,13 @@ | |||
335 | 931 | 928 | ||
336 | 932 | if (request->mbs_callback) | 929 | if (request->mbs_callback) |
337 | 933 | { | 930 | { |
341 | 934 | request->mbs_callback( | 931 | request->mbs_callback(stream.get(), request->context); |
339 | 935 | reinterpret_cast<MirBufferStream*>( | ||
340 | 936 | dynamic_cast<mcl::ClientBufferStream*>(stream.get())), request->context); | ||
342 | 937 | } | 932 | } |
343 | 938 | 933 | ||
344 | 939 | request->wh->result_received(); | 934 | request->wh->result_received(); |
345 | 940 | } | 935 | } |
346 | 941 | 936 | ||
348 | 942 | std::shared_ptr<mir::client::ClientBufferStream> MirConnection::make_consumer_stream( | 937 | std::shared_ptr<MirBufferStream> MirConnection::make_consumer_stream( |
349 | 943 | mp::BufferStream const& protobuf_bs) | 938 | mp::BufferStream const& protobuf_bs) |
350 | 944 | { | 939 | { |
351 | 945 | return std::make_shared<mcl::ScreencastStream>( | 940 | return std::make_shared<mcl::ScreencastStream>( |
352 | @@ -1144,7 +1139,7 @@ | |||
353 | 1144 | } | 1139 | } |
354 | 1145 | 1140 | ||
355 | 1146 | MirWaitHandle* MirConnection::release_buffer_stream( | 1141 | MirWaitHandle* MirConnection::release_buffer_stream( |
357 | 1147 | mir::client::ClientBufferStream* stream, | 1142 | MirBufferStream* stream, |
358 | 1148 | mir_buffer_stream_callback callback, | 1143 | mir_buffer_stream_callback callback, |
359 | 1149 | void *context) | 1144 | void *context) |
360 | 1150 | { | 1145 | { |
361 | @@ -1167,7 +1162,7 @@ | |||
362 | 1167 | return new_wait_handle; | 1162 | return new_wait_handle; |
363 | 1168 | } | 1163 | } |
364 | 1169 | 1164 | ||
366 | 1170 | void MirConnection::release_consumer_stream(mir::client::ClientBufferStream* stream) | 1165 | void MirConnection::release_consumer_stream(MirBufferStream* stream) |
367 | 1171 | { | 1166 | { |
368 | 1172 | surface_map->erase(stream->rpc_id()); | 1167 | surface_map->erase(stream->rpc_id()); |
369 | 1173 | } | 1168 | } |
370 | 1174 | 1169 | ||
371 | === modified file 'src/client/mir_connection.h' | |||
372 | --- src/client/mir_connection.h 2016-11-14 21:59:19 +0000 | |||
373 | +++ src/client/mir_connection.h 2016-11-30 09:56:15 +0000 | |||
374 | @@ -60,7 +60,6 @@ | |||
375 | 60 | { | 60 | { |
376 | 61 | class ConnectionConfiguration; | 61 | class ConnectionConfiguration; |
377 | 62 | class ClientPlatformFactory; | 62 | class ClientPlatformFactory; |
378 | 63 | class ClientBufferStream; | ||
379 | 64 | class ConnectionSurfaceMap; | 63 | class ConnectionSurfaceMap; |
380 | 65 | class DisplayConfiguration; | 64 | class DisplayConfiguration; |
381 | 66 | class EventHandlerRegister; | 65 | class EventHandlerRegister; |
382 | @@ -146,7 +145,7 @@ | |||
383 | 146 | void available_surface_formats(MirPixelFormat* formats, | 145 | void available_surface_formats(MirPixelFormat* formats, |
384 | 147 | unsigned int formats_size, unsigned int& valid_formats); | 146 | unsigned int formats_size, unsigned int& valid_formats); |
385 | 148 | 147 | ||
387 | 149 | std::shared_ptr<mir::client::ClientBufferStream> make_consumer_stream( | 148 | std::shared_ptr<MirBufferStream> make_consumer_stream( |
388 | 150 | mir::protobuf::BufferStream const& protobuf_bs); | 149 | mir::protobuf::BufferStream const& protobuf_bs); |
389 | 151 | 150 | ||
390 | 152 | typedef void (*buffer_stream_callback)(mir::client::BufferStream* stream, void* context); | 151 | typedef void (*buffer_stream_callback)(mir::client::BufferStream* stream, void* context); |
391 | @@ -163,7 +162,7 @@ | |||
392 | 163 | MirRenderSurface* render_surface, | 162 | MirRenderSurface* render_surface, |
393 | 164 | mir::protobuf::BufferStream const& a_protobuf_bs); | 163 | mir::protobuf::BufferStream const& a_protobuf_bs); |
394 | 165 | MirWaitHandle* release_buffer_stream( | 164 | MirWaitHandle* release_buffer_stream( |
396 | 166 | mir::client::ClientBufferStream*, | 165 | MirBufferStream*, |
397 | 167 | mir_buffer_stream_callback callback, | 166 | mir_buffer_stream_callback callback, |
398 | 168 | void *context); | 167 | void *context); |
399 | 169 | 168 | ||
400 | @@ -172,14 +171,14 @@ | |||
401 | 172 | void *context); | 171 | void *context); |
402 | 173 | void release_presentation_chain(MirPresentationChain* context); | 172 | void release_presentation_chain(MirPresentationChain* context); |
403 | 174 | 173 | ||
405 | 175 | void release_consumer_stream(mir::client::ClientBufferStream*); | 174 | void release_consumer_stream(MirBufferStream*); |
406 | 176 | 175 | ||
407 | 177 | static bool is_valid(MirConnection *connection); | 176 | static bool is_valid(MirConnection *connection); |
408 | 178 | 177 | ||
409 | 179 | EGLNativeDisplayType egl_native_display(); | 178 | EGLNativeDisplayType egl_native_display(); |
410 | 180 | MirPixelFormat egl_pixel_format(EGLDisplay, EGLConfig) const; | 179 | MirPixelFormat egl_pixel_format(EGLDisplay, EGLConfig) const; |
411 | 181 | 180 | ||
413 | 182 | void on_stream_created(int id, mir::client::ClientBufferStream* stream); | 181 | void on_stream_created(int id, MirBufferStream* stream); |
414 | 183 | 182 | ||
415 | 184 | MirWaitHandle* configure_display(MirDisplayConfiguration* configuration); | 183 | MirWaitHandle* configure_display(MirDisplayConfiguration* configuration); |
416 | 185 | void done_display_configure(); | 184 | void done_display_configure(); |
417 | 186 | 185 | ||
418 | === modified file 'src/client/mir_cursor_api.cpp' | |||
419 | --- src/client/mir_cursor_api.cpp 2016-10-12 10:12:15 +0000 | |||
420 | +++ src/client/mir_cursor_api.cpp 2016-11-30 09:56:15 +0000 | |||
421 | @@ -25,8 +25,6 @@ | |||
422 | 25 | 25 | ||
423 | 26 | #include <memory> | 26 | #include <memory> |
424 | 27 | 27 | ||
425 | 28 | namespace mcl = mir::client; | ||
426 | 29 | |||
427 | 30 | // Cursor names are from CSS3: https://www.w3.org/TR/css-ui-3/#propdef-cursor | 28 | // Cursor names are from CSS3: https://www.w3.org/TR/css-ui-3/#propdef-cursor |
428 | 31 | extern "C" char const* const mir_default_cursor_name = "default"; | 29 | extern "C" char const* const mir_default_cursor_name = "default"; |
429 | 32 | extern "C" char const* const mir_disabled_cursor_name = "none"; | 30 | extern "C" char const* const mir_disabled_cursor_name = "none"; |
430 | @@ -51,7 +49,7 @@ | |||
431 | 51 | { | 49 | { |
432 | 52 | } | 50 | } |
433 | 53 | 51 | ||
435 | 54 | MirCursorConfiguration::MirCursorConfiguration(mcl::ClientBufferStream const* stream, int hotspot_x, int hotspot_y) : | 52 | MirCursorConfiguration::MirCursorConfiguration(MirBufferStream const* stream, int hotspot_x, int hotspot_y) : |
436 | 55 | stream(stream), | 53 | stream(stream), |
437 | 56 | hotspot_x(hotspot_x), | 54 | hotspot_x(hotspot_x), |
438 | 57 | hotspot_y(hotspot_y) | 55 | hotspot_y(hotspot_y) |
439 | @@ -81,7 +79,7 @@ | |||
440 | 81 | { | 79 | { |
441 | 82 | try | 80 | try |
442 | 83 | { | 81 | { |
444 | 84 | return new MirCursorConfiguration(reinterpret_cast<mcl::ClientBufferStream const*>(stream), hotspot_x, hotspot_y); | 82 | return new MirCursorConfiguration(stream, hotspot_x, hotspot_y); |
445 | 85 | } | 83 | } |
446 | 86 | catch (std::exception const& ex) | 84 | catch (std::exception const& ex) |
447 | 87 | { | 85 | { |
448 | 88 | 86 | ||
449 | === modified file 'src/client/mir_debug_api.cpp' | |||
450 | --- src/client/mir_debug_api.cpp 2016-11-22 03:42:44 +0000 | |||
451 | +++ src/client/mir_debug_api.cpp 2016-11-30 09:56:15 +0000 | |||
452 | @@ -19,7 +19,7 @@ | |||
453 | 19 | #include "mir_toolkit/debug/surface.h" | 19 | #include "mir_toolkit/debug/surface.h" |
454 | 20 | 20 | ||
455 | 21 | #include "mir_surface.h" | 21 | #include "mir_surface.h" |
457 | 22 | #include "mir/client_buffer_stream.h" | 22 | #include "mir/mir_buffer_stream.h" |
458 | 23 | 23 | ||
459 | 24 | uint32_t mir_debug_surface_current_buffer_id(MirSurface* surface) | 24 | uint32_t mir_debug_surface_current_buffer_id(MirSurface* surface) |
460 | 25 | { | 25 | { |
461 | 26 | 26 | ||
462 | === modified file 'src/client/mir_screencast.cpp' | |||
463 | --- src/client/mir_screencast.cpp 2016-11-22 03:42:44 +0000 | |||
464 | +++ src/client/mir_screencast.cpp 2016-11-30 09:56:15 +0000 | |||
465 | @@ -20,7 +20,7 @@ | |||
466 | 20 | #include "mir_connection.h" | 20 | #include "mir_connection.h" |
467 | 21 | #include "mir_protobuf.pb.h" | 21 | #include "mir_protobuf.pb.h" |
468 | 22 | #include "make_protobuf_object.h" | 22 | #include "make_protobuf_object.h" |
470 | 23 | #include "mir/client_buffer_stream.h" | 23 | #include "mir/mir_buffer_stream.h" |
471 | 24 | #include "mir/frontend/client_constants.h" | 24 | #include "mir/frontend/client_constants.h" |
472 | 25 | #include "mir_toolkit/mir_native_buffer.h" | 25 | #include "mir_toolkit/mir_native_buffer.h" |
473 | 26 | 26 | ||
474 | @@ -205,7 +205,7 @@ | |||
475 | 205 | release_wait_handle.result_received(); | 205 | release_wait_handle.result_received(); |
476 | 206 | } | 206 | } |
477 | 207 | 207 | ||
479 | 208 | mir::client::ClientBufferStream* MirScreencast::get_buffer_stream() | 208 | MirBufferStream* MirScreencast::get_buffer_stream() |
480 | 209 | { | 209 | { |
481 | 210 | std::lock_guard<decltype(mutex)> lock(mutex); | 210 | std::lock_guard<decltype(mutex)> lock(mutex); |
482 | 211 | return buffer_stream.get(); | 211 | return buffer_stream.get(); |
483 | 212 | 212 | ||
484 | === modified file 'src/client/mir_screencast.h' | |||
485 | --- src/client/mir_screencast.h 2016-07-18 07:38:38 +0000 | |||
486 | +++ src/client/mir_screencast.h 2016-11-30 09:56:15 +0000 | |||
487 | @@ -42,8 +42,7 @@ | |||
488 | 42 | { | 42 | { |
489 | 43 | class DisplayServer; | 43 | class DisplayServer; |
490 | 44 | } | 44 | } |
493 | 45 | class ClientBufferStreamFactory; | 45 | class MirBufferStreamFactory; |
492 | 46 | class ClientBufferStream; | ||
494 | 47 | } | 46 | } |
495 | 48 | } | 47 | } |
496 | 49 | 48 | ||
497 | @@ -84,7 +83,7 @@ | |||
498 | 84 | 83 | ||
499 | 85 | EGLNativeWindowType egl_native_window(); | 84 | EGLNativeWindowType egl_native_window(); |
500 | 86 | 85 | ||
502 | 87 | mir::client::ClientBufferStream* get_buffer_stream(); | 86 | MirBufferStream* get_buffer_stream(); |
503 | 88 | 87 | ||
504 | 89 | private: | 88 | private: |
505 | 90 | void screencast_created( | 89 | void screencast_created( |
506 | @@ -95,7 +94,7 @@ | |||
507 | 95 | std::mutex mutable mutex; | 94 | std::mutex mutable mutex; |
508 | 96 | mir::client::rpc::DisplayServer* const server{nullptr}; | 95 | mir::client::rpc::DisplayServer* const server{nullptr}; |
509 | 97 | MirConnection* const connection{nullptr}; | 96 | MirConnection* const connection{nullptr}; |
511 | 98 | std::shared_ptr<mir::client::ClientBufferStream> buffer_stream; | 97 | std::shared_ptr<MirBufferStream> buffer_stream; |
512 | 99 | 98 | ||
513 | 100 | std::unique_ptr<mir::protobuf::Screencast> const protobuf_screencast; | 99 | std::unique_ptr<mir::protobuf::Screencast> const protobuf_screencast; |
514 | 101 | std::unique_ptr<mir::protobuf::Void> const protobuf_void; | 100 | std::unique_ptr<mir::protobuf::Void> const protobuf_void; |
515 | 102 | 101 | ||
516 | === modified file 'src/client/mir_screencast_api.cpp' | |||
517 | --- src/client/mir_screencast_api.cpp 2016-07-18 07:38:38 +0000 | |||
518 | +++ src/client/mir_screencast_api.cpp 2016-11-30 09:56:15 +0000 | |||
519 | @@ -124,7 +124,7 @@ | |||
520 | 124 | MirBufferStream *mir_screencast_get_buffer_stream(MirScreencast *screencast) | 124 | MirBufferStream *mir_screencast_get_buffer_stream(MirScreencast *screencast) |
521 | 125 | try | 125 | try |
522 | 126 | { | 126 | { |
524 | 127 | return reinterpret_cast<MirBufferStream*>(screencast->get_buffer_stream()); | 127 | return screencast->get_buffer_stream(); |
525 | 128 | } | 128 | } |
526 | 129 | catch (std::exception const& ex) | 129 | catch (std::exception const& ex) |
527 | 130 | { | 130 | { |
528 | 131 | 131 | ||
529 | === modified file 'src/client/mir_surface.cpp' | |||
530 | --- src/client/mir_surface.cpp 2016-11-22 03:42:44 +0000 | |||
531 | +++ src/client/mir_surface.cpp 2016-11-30 09:56:15 +0000 | |||
532 | @@ -25,7 +25,7 @@ | |||
533 | 25 | #include "mir_toolkit/mir_client_library.h" | 25 | #include "mir_toolkit/mir_client_library.h" |
534 | 26 | #include "mir/frontend/client_constants.h" | 26 | #include "mir/frontend/client_constants.h" |
535 | 27 | #include "mir/client_buffer.h" | 27 | #include "mir/client_buffer.h" |
537 | 28 | #include "mir/client_buffer_stream.h" | 28 | #include "mir/mir_buffer_stream.h" |
538 | 29 | #include "mir/dispatch/threaded_dispatcher.h" | 29 | #include "mir/dispatch/threaded_dispatcher.h" |
539 | 30 | #include "mir/input/input_platform.h" | 30 | #include "mir/input/input_platform.h" |
540 | 31 | #include "mir/input/xkb_mapper.h" | 31 | #include "mir/input/xkb_mapper.h" |
541 | @@ -109,7 +109,7 @@ | |||
542 | 109 | MirConnection *allocating_connection, | 109 | MirConnection *allocating_connection, |
543 | 110 | mclr::DisplayServer& the_server, | 110 | mclr::DisplayServer& the_server, |
544 | 111 | mclr::DisplayServerDebug* debug, | 111 | mclr::DisplayServerDebug* debug, |
546 | 112 | std::shared_ptr<mcl::ClientBufferStream> const& buffer_stream, | 112 | std::shared_ptr<MirBufferStream> const& buffer_stream, |
547 | 113 | std::shared_ptr<mircv::InputPlatform> const& input_platform, | 113 | std::shared_ptr<mircv::InputPlatform> const& input_platform, |
548 | 114 | MirSurfaceSpec const& spec, | 114 | MirSurfaceSpec const& spec, |
549 | 115 | mir::protobuf::Surface const& surface_proto, | 115 | mir::protobuf::Surface const& surface_proto, |
550 | @@ -504,7 +504,7 @@ | |||
551 | 504 | google::protobuf::NewCallback(google::protobuf::DoNothing)); | 504 | google::protobuf::NewCallback(google::protobuf::DoNothing)); |
552 | 505 | } | 505 | } |
553 | 506 | 506 | ||
555 | 507 | mir::client::ClientBufferStream* MirSurface::get_buffer_stream() | 507 | MirBufferStream* MirSurface::get_buffer_stream() |
556 | 508 | { | 508 | { |
557 | 509 | std::lock_guard<decltype(mutex)> lock(mutex); | 509 | std::lock_guard<decltype(mutex)> lock(mutex); |
558 | 510 | 510 | ||
559 | 511 | 511 | ||
560 | === modified file 'src/client/mir_surface.h' | |||
561 | --- src/client/mir_surface.h 2016-11-22 03:42:44 +0000 | |||
562 | +++ src/client/mir_surface.h 2016-11-30 09:56:15 +0000 | |||
563 | @@ -18,7 +18,7 @@ | |||
564 | 18 | #ifndef MIR_CLIENT_MIR_SURFACE_H_ | 18 | #ifndef MIR_CLIENT_MIR_SURFACE_H_ |
565 | 19 | #define MIR_CLIENT_MIR_SURFACE_H_ | 19 | #define MIR_CLIENT_MIR_SURFACE_H_ |
566 | 20 | 20 | ||
568 | 21 | #include "mir/client_buffer_stream.h" | 21 | #include "mir/mir_buffer_stream.h" |
569 | 22 | #include "mir_wait_handle.h" | 22 | #include "mir_wait_handle.h" |
570 | 23 | #include "rpc/mir_display_server.h" | 23 | #include "rpc/mir_display_server.h" |
571 | 24 | #include "rpc/mir_display_server_debug.h" | 24 | #include "rpc/mir_display_server_debug.h" |
572 | @@ -68,8 +68,7 @@ | |||
573 | 68 | } | 68 | } |
574 | 69 | 69 | ||
575 | 70 | class ClientBuffer; | 70 | class ClientBuffer; |
578 | 71 | class ClientBufferStream; | 71 | class MirBufferStreamFactory; |
577 | 72 | class ClientBufferStreamFactory; | ||
579 | 73 | 72 | ||
580 | 74 | struct MemoryRegion; | 73 | struct MemoryRegion; |
581 | 75 | } | 74 | } |
582 | @@ -164,7 +163,7 @@ | |||
583 | 164 | MirConnection *allocating_connection, | 163 | MirConnection *allocating_connection, |
584 | 165 | mir::client::rpc::DisplayServer& server, | 164 | mir::client::rpc::DisplayServer& server, |
585 | 166 | mir::client::rpc::DisplayServerDebug* debug, | 165 | mir::client::rpc::DisplayServerDebug* debug, |
587 | 167 | std::shared_ptr<mir::client::ClientBufferStream> const& buffer_stream, | 166 | std::shared_ptr<MirBufferStream> const& buffer_stream, |
588 | 168 | std::shared_ptr<mir::input::receiver::InputPlatform> const& input_platform, | 167 | std::shared_ptr<mir::input::receiver::InputPlatform> const& input_platform, |
589 | 169 | MirSurfaceSpec const& spec, mir::protobuf::Surface const& surface_proto, | 168 | MirSurfaceSpec const& spec, mir::protobuf::Surface const& surface_proto, |
590 | 170 | std::shared_ptr<MirWaitHandle> const& handle); | 169 | std::shared_ptr<MirWaitHandle> const& handle); |
591 | @@ -198,7 +197,7 @@ | |||
592 | 198 | 197 | ||
593 | 199 | void request_and_wait_for_configure(MirSurfaceAttrib a, int value); | 198 | void request_and_wait_for_configure(MirSurfaceAttrib a, int value); |
594 | 200 | 199 | ||
596 | 201 | mir::client::ClientBufferStream* get_buffer_stream(); | 200 | MirBufferStream* get_buffer_stream(); |
597 | 202 | 201 | ||
598 | 203 | MirWaitHandle* modify(MirSurfaceSpec const& changes); | 202 | MirWaitHandle* modify(MirSurfaceSpec const& changes); |
599 | 204 | 203 | ||
600 | @@ -233,7 +232,7 @@ | |||
601 | 233 | MirWaitHandle persistent_id_wait_handle; | 232 | MirWaitHandle persistent_id_wait_handle; |
602 | 234 | 233 | ||
603 | 235 | //Deprecated functions can cause MirSurfaces to be created with a default stream | 234 | //Deprecated functions can cause MirSurfaces to be created with a default stream |
605 | 236 | std::shared_ptr<mir::client::ClientBufferStream> default_stream; | 235 | std::shared_ptr<MirBufferStream> default_stream; |
606 | 237 | std::shared_ptr<mir::input::receiver::InputPlatform> const input_platform; | 236 | std::shared_ptr<mir::input::receiver::InputPlatform> const input_platform; |
607 | 238 | std::shared_ptr<mir::input::receiver::XKBMapper> const keymapper; | 237 | std::shared_ptr<mir::input::receiver::XKBMapper> const keymapper; |
608 | 239 | 238 | ||
609 | 240 | 239 | ||
610 | === modified file 'src/client/mir_surface_api.cpp' | |||
611 | --- src/client/mir_surface_api.cpp 2016-11-17 21:37:04 +0000 | |||
612 | +++ src/client/mir_surface_api.cpp 2016-11-30 09:56:15 +0000 | |||
613 | @@ -524,7 +524,7 @@ | |||
614 | 524 | MirBufferStream *mir_surface_get_buffer_stream(MirSurface *surface) | 524 | MirBufferStream *mir_surface_get_buffer_stream(MirSurface *surface) |
615 | 525 | try | 525 | try |
616 | 526 | { | 526 | { |
618 | 527 | return reinterpret_cast<MirBufferStream*>(surface->get_buffer_stream()); | 527 | return surface->get_buffer_stream(); |
619 | 528 | } | 528 | } |
620 | 529 | catch (std::exception const& ex) | 529 | catch (std::exception const& ex) |
621 | 530 | { | 530 | { |
622 | @@ -576,7 +576,7 @@ | |||
623 | 576 | mir::require(mir_buffer_stream_is_valid(streams[i].stream)); | 576 | mir::require(mir_buffer_stream_is_valid(streams[i].stream)); |
624 | 577 | copy.emplace_back(ContentInfo{ | 577 | copy.emplace_back(ContentInfo{ |
625 | 578 | mir::geometry::Displacement{streams[i].displacement_x, streams[i].displacement_y}, | 578 | mir::geometry::Displacement{streams[i].displacement_x, streams[i].displacement_y}, |
627 | 579 | reinterpret_cast<mcl::ClientBufferStream*>(streams[i].stream)->rpc_id().as_value(), | 579 | streams[i].stream->rpc_id().as_value(), |
628 | 580 | {}}); | 580 | {}}); |
629 | 581 | } | 581 | } |
630 | 582 | spec->streams = copy; | 582 | spec->streams = copy; |
631 | @@ -616,8 +616,7 @@ | |||
632 | 616 | try | 616 | try |
633 | 617 | { | 617 | { |
634 | 618 | mir::require(spec && stream); | 618 | mir::require(spec && stream); |
637 | 619 | auto bs = reinterpret_cast<mcl::ClientBufferStream*>(stream); | 619 | ContentInfo info{{displacement_x, displacement_y}, stream->rpc_id().as_value(), mir::geometry::Size{width, height}}; |
636 | 620 | ContentInfo info{{displacement_x, displacement_y}, bs->rpc_id().as_value(), mir::geometry::Size{width, height}}; | ||
638 | 621 | 620 | ||
639 | 622 | if (spec->streams.is_set()) | 621 | if (spec->streams.is_set()) |
640 | 623 | spec->streams.value().push_back(info); | 622 | spec->streams.value().push_back(info); |
641 | 624 | 623 | ||
642 | === modified file 'src/client/render_surface.cpp' | |||
643 | --- src/client/render_surface.cpp 2016-11-22 18:44:52 +0000 | |||
644 | +++ src/client/render_surface.cpp 2016-11-30 09:56:15 +0000 | |||
645 | @@ -76,8 +76,7 @@ | |||
646 | 76 | } | 76 | } |
647 | 77 | } | 77 | } |
648 | 78 | 78 | ||
651 | 79 | return reinterpret_cast<MirBufferStream*>( | 79 | return stream_from_id.get(); |
650 | 80 | dynamic_cast<ClientBufferStream*>(stream_from_id.get())); | ||
652 | 81 | } | 80 | } |
653 | 82 | 81 | ||
654 | 83 | geom::Size mcl::RenderSurface::size() const | 82 | geom::Size mcl::RenderSurface::size() const |
655 | 84 | 83 | ||
656 | === modified file 'src/client/rpc/mir_protobuf_rpc_channel.cpp' | |||
657 | --- src/client/rpc/mir_protobuf_rpc_channel.cpp 2016-11-15 20:53:57 +0000 | |||
658 | +++ src/client/rpc/mir_protobuf_rpc_channel.cpp 2016-11-30 09:56:15 +0000 | |||
659 | @@ -105,7 +105,7 @@ | |||
660 | 105 | if (auto map = surface_map.lock()) | 105 | if (auto map = surface_map.lock()) |
661 | 106 | { | 106 | { |
662 | 107 | map->with_all_streams_do( | 107 | map->with_all_streams_do( |
664 | 108 | [](mcl::ClientBufferStream* receiver) { | 108 | [](MirBufferStream* receiver) { |
665 | 109 | if (receiver) receiver->buffer_unavailable(); | 109 | if (receiver) receiver->buffer_unavailable(); |
666 | 110 | }); | 110 | }); |
667 | 111 | } | 111 | } |
668 | @@ -313,7 +313,7 @@ | |||
669 | 313 | if (seq.buffer_request().has_id()) | 313 | if (seq.buffer_request().has_id()) |
670 | 314 | { | 314 | { |
671 | 315 | map->with_stream_do(mf::BufferStreamId(seq.buffer_request().id().value()), | 315 | map->with_stream_do(mf::BufferStreamId(seq.buffer_request().id().value()), |
673 | 316 | [&] (mcl::ClientBufferStream* receiver) { | 316 | [&] (MirBufferStream* receiver) { |
674 | 317 | receiver->buffer_available(seq.buffer_request().buffer()); | 317 | receiver->buffer_available(seq.buffer_request().buffer()); |
675 | 318 | }); | 318 | }); |
676 | 319 | } | 319 | } |
677 | 320 | 320 | ||
678 | === modified file 'src/client/screencast_stream.h' | |||
679 | --- src/client/screencast_stream.h 2016-11-22 03:42:44 +0000 | |||
680 | +++ src/client/screencast_stream.h 2016-11-30 09:56:15 +0000 | |||
681 | @@ -22,7 +22,7 @@ | |||
682 | 22 | #include "mir_wait_handle.h" | 22 | #include "mir_wait_handle.h" |
683 | 23 | #include "mir/egl_native_surface.h" | 23 | #include "mir/egl_native_surface.h" |
684 | 24 | #include "mir/client_buffer.h" | 24 | #include "mir/client_buffer.h" |
686 | 25 | #include "mir/client_buffer_stream.h" | 25 | #include "mir/mir_buffer_stream.h" |
687 | 26 | #include "mir/geometry/size.h" | 26 | #include "mir/geometry/size.h" |
688 | 27 | 27 | ||
689 | 28 | #include "mir_toolkit/client_types.h" | 28 | #include "mir_toolkit/client_types.h" |
690 | @@ -63,7 +63,7 @@ | |||
691 | 63 | class ClientPlatform; | 63 | class ClientPlatform; |
692 | 64 | class PerfReport; | 64 | class PerfReport; |
693 | 65 | struct MemoryRegion; | 65 | struct MemoryRegion; |
695 | 66 | class ScreencastStream : public EGLNativeSurface, public ClientBufferStream | 66 | class ScreencastStream : public EGLNativeSurface, public MirBufferStream |
696 | 67 | { | 67 | { |
697 | 68 | public: | 68 | public: |
698 | 69 | ScreencastStream( | 69 | ScreencastStream( |
699 | 70 | 70 | ||
700 | === modified file 'src/client/surface_map.h' | |||
701 | --- src/client/surface_map.h 2016-07-18 07:38:38 +0000 | |||
702 | +++ src/client/surface_map.h 2016-11-30 09:56:15 +0000 | |||
703 | @@ -25,6 +25,7 @@ | |||
704 | 25 | #include <memory> | 25 | #include <memory> |
705 | 26 | 26 | ||
706 | 27 | struct MirSurface; | 27 | struct MirSurface; |
707 | 28 | struct MirBufferStream; | ||
708 | 28 | 29 | ||
709 | 29 | namespace mir | 30 | namespace mir |
710 | 30 | { | 31 | { |
711 | @@ -35,7 +36,6 @@ | |||
712 | 35 | namespace client | 36 | namespace client |
713 | 36 | { | 37 | { |
714 | 37 | class MirBuffer; | 38 | class MirBuffer; |
715 | 38 | class ClientBufferStream; | ||
716 | 39 | 39 | ||
717 | 40 | class SurfaceMap | 40 | class SurfaceMap |
718 | 41 | { | 41 | { |
719 | @@ -43,8 +43,8 @@ | |||
720 | 43 | virtual void with_surface_do( | 43 | virtual void with_surface_do( |
721 | 44 | frontend::SurfaceId surface_id, std::function<void(MirSurface*)> const& exec) const = 0; | 44 | frontend::SurfaceId surface_id, std::function<void(MirSurface*)> const& exec) const = 0; |
722 | 45 | virtual void with_stream_do( | 45 | virtual void with_stream_do( |
725 | 46 | frontend::BufferStreamId stream_id, std::function<void(ClientBufferStream*)> const& exec) const = 0; | 46 | frontend::BufferStreamId stream_id, std::function<void(MirBufferStream*)> const& exec) const = 0; |
726 | 47 | virtual void with_all_streams_do(std::function<void(ClientBufferStream*)> const&) const = 0; | 47 | virtual void with_all_streams_do(std::function<void(MirBufferStream*)> const&) const = 0; |
727 | 48 | virtual std::shared_ptr<MirBuffer> buffer(int buffer_id) const = 0; | 48 | virtual std::shared_ptr<MirBuffer> buffer(int buffer_id) const = 0; |
728 | 49 | virtual void insert(int buffer_id, std::shared_ptr<MirBuffer> const& buffer) = 0; | 49 | virtual void insert(int buffer_id, std::shared_ptr<MirBuffer> const& buffer) = 0; |
729 | 50 | virtual void erase(int buffer_id) = 0; | 50 | virtual void erase(int buffer_id) = 0; |
730 | 51 | 51 | ||
731 | === renamed file 'src/include/client/mir/client_buffer_stream.h' => 'src/include/client/mir/mir_buffer_stream.h' | |||
732 | --- src/include/client/mir/client_buffer_stream.h 2016-11-22 03:42:44 +0000 | |||
733 | +++ src/include/client/mir/mir_buffer_stream.h 2016-11-30 09:56:15 +0000 | |||
734 | @@ -16,8 +16,11 @@ | |||
735 | 16 | * Authored by: Robert Carr <robert.carr@canonical.com> | 16 | * Authored by: Robert Carr <robert.carr@canonical.com> |
736 | 17 | */ | 17 | */ |
737 | 18 | 18 | ||
740 | 19 | #ifndef MIR_CLIENT_CLIENT_BUFFER_STREAM_H_ | 19 | // MIR_MIR_? Yes. |
741 | 20 | #define MIR_CLIENT_CLIENT_BUFFER_STREAM_H_ | 20 | // The internal interface is mir/mir_buffer_stream.h |
742 | 21 | // The public client API is mir_toolkit/mir_buffer_stream.h | ||
743 | 22 | #ifndef MIR_MIR_BUFFER_STREAM_H_ | ||
744 | 23 | #define MIR_MIR_BUFFER_STREAM_H_ | ||
745 | 21 | 24 | ||
746 | 22 | #include "mir/frontend/buffer_stream_id.h" | 25 | #include "mir/frontend/buffer_stream_id.h" |
747 | 23 | #include "mir/geometry/size.h" | 26 | #include "mir/geometry/size.h" |
748 | @@ -30,7 +33,7 @@ | |||
749 | 30 | #include <EGL/eglplatform.h> | 33 | #include <EGL/eglplatform.h> |
750 | 31 | 34 | ||
751 | 32 | /* | 35 | /* |
753 | 33 | * ClientBufferStream::egl_native_window() returns EGLNativeWindowType. | 36 | * MirBufferStream::egl_native_window() returns EGLNativeWindowType. |
754 | 34 | * | 37 | * |
755 | 35 | * EGLNativeWindowType is an EGL platform-specific type that is typically a | 38 | * EGLNativeWindowType is an EGL platform-specific type that is typically a |
756 | 36 | * (possibly slightly obfuscated) pointer. This makes our client module ABI | 39 | * (possibly slightly obfuscated) pointer. This makes our client module ABI |
757 | @@ -48,7 +51,7 @@ | |||
758 | 48 | static_assert( | 51 | static_assert( |
759 | 49 | sizeof(EGLNativeWindowType) == sizeof(void*) && | 52 | sizeof(EGLNativeWindowType) == sizeof(void*) && |
760 | 50 | std::is_pod<EGLNativeWindowType>::value, | 53 | std::is_pod<EGLNativeWindowType>::value, |
762 | 51 | "The ClientBufferStream requires that EGLNativeWindowType be no-op convertible to void*"); | 54 | "The MirBufferStream requires that EGLNativeWindowType be no-op convertible to void*"); |
763 | 52 | 55 | ||
764 | 53 | #undef EGLNativeWindowType | 56 | #undef EGLNativeWindowType |
765 | 54 | #define EGLNativeWindowType void* | 57 | #define EGLNativeWindowType void* |
766 | @@ -66,19 +69,21 @@ | |||
767 | 66 | { | 69 | { |
768 | 67 | class ClientBuffer; | 70 | class ClientBuffer; |
769 | 68 | class MemoryRegion; | 71 | class MemoryRegion; |
770 | 72 | } | ||
771 | 73 | } | ||
772 | 69 | 74 | ||
774 | 70 | class ClientBufferStream | 75 | struct MirBufferStream |
775 | 71 | { | 76 | { |
776 | 72 | public: | 77 | public: |
778 | 73 | virtual ~ClientBufferStream() = default; | 78 | virtual ~MirBufferStream() = default; |
779 | 74 | 79 | ||
780 | 75 | virtual MirSurfaceParameters get_parameters() const = 0; | 80 | virtual MirSurfaceParameters get_parameters() const = 0; |
782 | 76 | virtual std::shared_ptr<ClientBuffer> get_current_buffer() = 0; | 81 | virtual std::shared_ptr<mir::client::ClientBuffer> get_current_buffer() = 0; |
783 | 77 | virtual uint32_t get_current_buffer_id() = 0; | 82 | virtual uint32_t get_current_buffer_id() = 0; |
784 | 78 | virtual EGLNativeWindowType egl_native_window() = 0; | 83 | virtual EGLNativeWindowType egl_native_window() = 0; |
785 | 79 | virtual MirWaitHandle* next_buffer(std::function<void()> const& done) = 0; | 84 | virtual MirWaitHandle* next_buffer(std::function<void()> const& done) = 0; |
786 | 80 | 85 | ||
788 | 81 | virtual std::shared_ptr<MemoryRegion> secure_for_cpu_write() = 0; | 86 | virtual std::shared_ptr<mir::client::MemoryRegion> secure_for_cpu_write() = 0; |
789 | 82 | 87 | ||
790 | 83 | virtual int swap_interval() const = 0; | 88 | virtual int swap_interval() const = 0; |
791 | 84 | virtual MirWaitHandle* set_swap_interval(int interval) = 0; | 89 | virtual MirWaitHandle* set_swap_interval(int interval) = 0; |
792 | @@ -86,11 +91,11 @@ | |||
793 | 86 | virtual MirNativeBuffer* get_current_buffer_package() = 0; | 91 | virtual MirNativeBuffer* get_current_buffer_package() = 0; |
794 | 87 | virtual MirPlatformType platform_type() = 0; | 92 | virtual MirPlatformType platform_type() = 0; |
795 | 88 | 93 | ||
797 | 89 | virtual frontend::BufferStreamId rpc_id() const = 0; | 94 | virtual mir::frontend::BufferStreamId rpc_id() const = 0; |
798 | 90 | 95 | ||
799 | 91 | virtual bool valid() const = 0; | 96 | virtual bool valid() const = 0; |
802 | 92 | virtual void set_size(geometry::Size) = 0; | 97 | virtual void set_size(mir::geometry::Size) = 0; |
803 | 93 | virtual geometry::Size size() const = 0; | 98 | virtual mir::geometry::Size size() const = 0; |
804 | 94 | virtual MirWaitHandle* set_scale(float) = 0; | 99 | virtual MirWaitHandle* set_scale(float) = 0; |
805 | 95 | virtual char const* get_error_message() const = 0; | 100 | virtual char const* get_error_message() const = 0; |
806 | 96 | virtual MirConnection* connection() const = 0; | 101 | virtual MirConnection* connection() const = 0; |
807 | @@ -99,12 +104,9 @@ | |||
808 | 99 | virtual void buffer_available(mir::protobuf::Buffer const& buffer) = 0; | 104 | virtual void buffer_available(mir::protobuf::Buffer const& buffer) = 0; |
809 | 100 | virtual void buffer_unavailable() = 0; | 105 | virtual void buffer_unavailable() = 0; |
810 | 101 | protected: | 106 | protected: |
814 | 102 | ClientBufferStream() = default; | 107 | MirBufferStream() = default; |
815 | 103 | ClientBufferStream(const ClientBufferStream&) = delete; | 108 | MirBufferStream(const MirBufferStream&) = delete; |
816 | 104 | ClientBufferStream& operator=(const ClientBufferStream&) = delete; | 109 | MirBufferStream& operator=(const MirBufferStream&) = delete; |
817 | 105 | }; | 110 | }; |
818 | 106 | 111 | ||
823 | 107 | } | 112 | #endif /* MIR_MIR_BUFFER_STREAM_H_ */ |
820 | 108 | } | ||
821 | 109 | |||
822 | 110 | #endif /* MIR_CLIENT_CLIENT_BUFFER_STREAM_H_ */ | ||
824 | 111 | 113 | ||
825 | === modified file 'src/platforms/android/client/android_client_platform.cpp' | |||
826 | --- src/platforms/android/client/android_client_platform.cpp 2016-11-23 04:37:50 +0000 | |||
827 | +++ src/platforms/android/client/android_client_platform.cpp 2016-11-30 09:56:15 +0000 | |||
828 | @@ -22,7 +22,7 @@ | |||
829 | 22 | #include "mir/client_context.h" | 22 | #include "mir/client_context.h" |
830 | 23 | #include "mir/mir_buffer.h" | 23 | #include "mir/mir_buffer.h" |
831 | 24 | #include "mir/client_buffer.h" | 24 | #include "mir/client_buffer.h" |
833 | 25 | #include "mir/client_buffer_stream.h" | 25 | #include "mir/mir_buffer_stream.h" |
834 | 26 | #include "android_client_platform.h" | 26 | #include "android_client_platform.h" |
835 | 27 | #include "gralloc_registrar.h" | 27 | #include "gralloc_registrar.h" |
836 | 28 | #include "android_client_buffer_factory.h" | 28 | #include "android_client_buffer_factory.h" |
837 | @@ -66,8 +66,7 @@ | |||
838 | 66 | 66 | ||
839 | 67 | ANativeWindow* create_anw(MirBufferStream* buffer_stream) | 67 | ANativeWindow* create_anw(MirBufferStream* buffer_stream) |
840 | 68 | { | 68 | { |
843 | 69 | mcl::ClientBufferStream *bs = reinterpret_cast<mcl::ClientBufferStream*>(buffer_stream); | 69 | return static_cast<ANativeWindow*>(buffer_stream->egl_native_window()); |
842 | 70 | return static_cast<ANativeWindow*>(bs->egl_native_window()); | ||
844 | 71 | } | 70 | } |
845 | 72 | 71 | ||
846 | 73 | void destroy_anw(ANativeWindow*) | 72 | void destroy_anw(ANativeWindow*) |
847 | 74 | 73 | ||
848 | === renamed file 'tests/include/mir/test/doubles/mock_client_buffer_stream.h' => 'tests/include/mir/test/doubles/mock_mir_buffer_stream.h' | |||
849 | --- tests/include/mir/test/doubles/mock_client_buffer_stream.h 2016-11-22 03:42:44 +0000 | |||
850 | +++ tests/include/mir/test/doubles/mock_mir_buffer_stream.h 2016-11-30 09:56:15 +0000 | |||
851 | @@ -16,10 +16,10 @@ | |||
852 | 16 | * Authored by: Robert Carr <robert.carr@canonical.com> | 16 | * Authored by: Robert Carr <robert.carr@canonical.com> |
853 | 17 | */ | 17 | */ |
854 | 18 | 18 | ||
857 | 19 | #ifndef MIR_TEST_DOUBLES_MOCK_CLIENT_BUFFER_STREAM_H_ | 19 | #ifndef MIR_TEST_DOUBLES_MOCK_MIR_BUFFER_STREAM_H_ |
858 | 20 | #define MIR_TEST_DOUBLES_MOCK_CLIENT_BUFFER_STREAM_H_ | 20 | #define MIR_TEST_DOUBLES_MOCK_MIR_BUFFER_STREAM_H_ |
859 | 21 | 21 | ||
861 | 22 | #include "src/include/client/mir/client_buffer_stream.h" | 22 | #include "src/include/client/mir/mir_buffer_stream.h" |
862 | 23 | 23 | ||
863 | 24 | #include <gmock/gmock.h> | 24 | #include <gmock/gmock.h> |
864 | 25 | 25 | ||
865 | @@ -30,7 +30,7 @@ | |||
866 | 30 | namespace doubles | 30 | namespace doubles |
867 | 31 | { | 31 | { |
868 | 32 | 32 | ||
870 | 33 | struct MockClientBufferStream : public client::ClientBufferStream | 33 | struct MockMirBufferStream : public MirBufferStream |
871 | 34 | { | 34 | { |
872 | 35 | MOCK_METHOD2(release, MirWaitHandle*(mir_buffer_stream_callback, void*)); | 35 | MOCK_METHOD2(release, MirWaitHandle*(mir_buffer_stream_callback, void*)); |
873 | 36 | 36 | ||
874 | @@ -61,4 +61,4 @@ | |||
875 | 61 | } | 61 | } |
876 | 62 | } | 62 | } |
877 | 63 | 63 | ||
879 | 64 | #endif // MIR_TEST_DOUBLES_MOCK_CLIENT_BUFFER_STREAM_H_ | 64 | #endif // MIR_TEST_DOUBLES_MOCK_MIR_BUFFER_STREAM_H_ |
880 | 65 | 65 | ||
881 | === modified file 'tests/unit-tests/client/test_client_mir_surface.cpp' | |||
882 | --- tests/unit-tests/client/test_client_mir_surface.cpp 2016-11-09 02:30:14 +0000 | |||
883 | +++ tests/unit-tests/client/test_client_mir_surface.cpp 2016-11-30 09:56:15 +0000 | |||
884 | @@ -52,7 +52,7 @@ | |||
885 | 52 | #include <boost/throw_exception.hpp> | 52 | #include <boost/throw_exception.hpp> |
886 | 53 | #include "mir/test/doubles/stub_client_buffer_factory.h" | 53 | #include "mir/test/doubles/stub_client_buffer_factory.h" |
887 | 54 | #include "mir/test/doubles/stub_buffer_stream.h" | 54 | #include "mir/test/doubles/stub_buffer_stream.h" |
889 | 55 | #include "mir/test/doubles/mock_client_buffer_stream.h" | 55 | #include "mir/test/doubles/mock_mir_buffer_stream.h" |
890 | 56 | 56 | ||
891 | 57 | #include "mir_test_framework/stub_client_platform_factory.h" | 57 | #include "mir_test_framework/stub_client_platform_factory.h" |
892 | 58 | 58 | ||
893 | @@ -329,7 +329,7 @@ | |||
894 | 329 | 329 | ||
895 | 330 | std::shared_ptr<MirSurface> create_surface_with( | 330 | std::shared_ptr<MirSurface> create_surface_with( |
896 | 331 | mclr::DisplayServer& server_stub, | 331 | mclr::DisplayServer& server_stub, |
898 | 332 | std::shared_ptr<mcl::ClientBufferStream> const& buffer_stream) | 332 | std::shared_ptr<MirBufferStream> const& buffer_stream) |
899 | 333 | { | 333 | { |
900 | 334 | return std::make_shared<MirSurface>( | 334 | return std::make_shared<MirSurface>( |
901 | 335 | connection.get(), | 335 | connection.get(), |
902 | @@ -351,7 +351,7 @@ | |||
903 | 351 | 351 | ||
904 | 352 | std::shared_ptr<MirSurface> create_and_wait_for_surface_with( | 352 | std::shared_ptr<MirSurface> create_and_wait_for_surface_with( |
905 | 353 | mclr::DisplayServer& server_stub, | 353 | mclr::DisplayServer& server_stub, |
907 | 354 | std::shared_ptr<mcl::ClientBufferStream> const& buffer_stream) | 354 | std::shared_ptr<MirBufferStream> const& buffer_stream) |
908 | 355 | { | 355 | { |
909 | 356 | auto surface = create_surface_with(server_stub, buffer_stream); | 356 | auto surface = create_surface_with(server_stub, buffer_stream); |
910 | 357 | return surface; | 357 | return surface; |
911 | @@ -360,7 +360,7 @@ | |||
912 | 360 | std::shared_ptr<MirConnection> connection; | 360 | std::shared_ptr<MirConnection> connection; |
913 | 361 | 361 | ||
914 | 362 | MirSurfaceSpec const spec{nullptr, 33, 45, mir_pixel_format_abgr_8888}; | 362 | MirSurfaceSpec const spec{nullptr, 33, 45, mir_pixel_format_abgr_8888}; |
916 | 363 | std::shared_ptr<mtd::MockClientBufferStream> stub_buffer_stream{std::make_shared<mtd::MockClientBufferStream>()}; | 363 | std::shared_ptr<mtd::MockMirBufferStream> stub_buffer_stream{std::make_shared<mtd::MockMirBufferStream>()}; |
917 | 364 | std::shared_ptr<StubClientInputPlatform> const input_platform = | 364 | std::shared_ptr<StubClientInputPlatform> const input_platform = |
918 | 365 | std::make_shared<StubClientInputPlatform>(); | 365 | std::make_shared<StubClientInputPlatform>(); |
919 | 366 | std::shared_ptr<MockServerPackageGenerator> const mock_server_tool = | 366 | std::shared_ptr<MockServerPackageGenerator> const mock_server_tool = |
920 | @@ -494,7 +494,7 @@ | |||
921 | 494 | TEST_F(MirClientSurfaceTest, resizes_streams_and_calls_callback_if_no_customized_streams) | 494 | TEST_F(MirClientSurfaceTest, resizes_streams_and_calls_callback_if_no_customized_streams) |
922 | 495 | { | 495 | { |
923 | 496 | using namespace testing; | 496 | using namespace testing; |
925 | 497 | auto mock_stream = std::make_shared<mtd::MockClientBufferStream>(); | 497 | auto mock_stream = std::make_shared<mtd::MockMirBufferStream>(); |
926 | 498 | auto mock_input_platform = std::make_shared<NiceMock<MockClientInputPlatform>>(); | 498 | auto mock_input_platform = std::make_shared<NiceMock<MockClientInputPlatform>>(); |
927 | 499 | ON_CALL(*mock_input_platform, create_input_receiver(_,_,_)) | 499 | ON_CALL(*mock_input_platform, create_input_receiver(_,_,_)) |
928 | 500 | .WillByDefault(Return(std::make_shared<mt::TestDispatchable>([]{}))); | 500 | .WillByDefault(Return(std::make_shared<mt::TestDispatchable>([]{}))); |
929 | @@ -513,7 +513,7 @@ | |||
930 | 513 | TEST_F(MirClientSurfaceTest, resizes_streams_and_calls_callback_if_customized_streams) | 513 | TEST_F(MirClientSurfaceTest, resizes_streams_and_calls_callback_if_customized_streams) |
931 | 514 | { | 514 | { |
932 | 515 | using namespace testing; | 515 | using namespace testing; |
934 | 516 | auto mock_stream = std::make_shared<NiceMock<mtd::MockClientBufferStream>>(); | 516 | auto mock_stream = std::make_shared<NiceMock<mtd::MockMirBufferStream>>(); |
935 | 517 | auto mock_input_platform = std::make_shared<NiceMock<MockClientInputPlatform>>(); | 517 | auto mock_input_platform = std::make_shared<NiceMock<MockClientInputPlatform>>(); |
936 | 518 | ON_CALL(*mock_stream, rpc_id()).WillByDefault(Return(mir::frontend::BufferStreamId(2))); | 518 | ON_CALL(*mock_stream, rpc_id()).WillByDefault(Return(mir::frontend::BufferStreamId(2))); |
937 | 519 | ON_CALL(*mock_input_platform, create_input_receiver(_,_,_)) | 519 | ON_CALL(*mock_input_platform, create_input_receiver(_,_,_)) |
938 | @@ -537,7 +537,7 @@ | |||
939 | 537 | TEST_F(MirClientSurfaceTest, parameters_are_unhooked_from_stream_sizes) | 537 | TEST_F(MirClientSurfaceTest, parameters_are_unhooked_from_stream_sizes) |
940 | 538 | { | 538 | { |
941 | 539 | using namespace testing; | 539 | using namespace testing; |
943 | 540 | auto mock_stream = std::make_shared<mtd::MockClientBufferStream>(); | 540 | auto mock_stream = std::make_shared<mtd::MockMirBufferStream>(); |
944 | 541 | auto mock_input_platform = std::make_shared<NiceMock<MockClientInputPlatform>>(); | 541 | auto mock_input_platform = std::make_shared<NiceMock<MockClientInputPlatform>>(); |
945 | 542 | ON_CALL(*mock_input_platform, create_input_receiver(_,_,_)) | 542 | ON_CALL(*mock_input_platform, create_input_receiver(_,_,_)) |
946 | 543 | .WillByDefault(Return(std::make_shared<mt::TestDispatchable>([]{}))); | 543 | .WillByDefault(Return(std::make_shared<mt::TestDispatchable>([]{}))); |
947 | @@ -565,7 +565,7 @@ | |||
948 | 565 | TEST_F(MirClientSurfaceTest, initial_sizes_are_from_response_from_server) | 565 | TEST_F(MirClientSurfaceTest, initial_sizes_are_from_response_from_server) |
949 | 566 | { | 566 | { |
950 | 567 | using namespace testing; | 567 | using namespace testing; |
952 | 568 | auto mock_stream = std::make_shared<mtd::MockClientBufferStream>(); | 568 | auto mock_stream = std::make_shared<mtd::MockMirBufferStream>(); |
953 | 569 | auto mock_input_platform = std::make_shared<NiceMock<MockClientInputPlatform>>(); | 569 | auto mock_input_platform = std::make_shared<NiceMock<MockClientInputPlatform>>(); |
954 | 570 | ON_CALL(*mock_input_platform, create_input_receiver(_,_,_)) | 570 | ON_CALL(*mock_input_platform, create_input_receiver(_,_,_)) |
955 | 571 | .WillByDefault(Return(std::make_shared<mt::TestDispatchable>([]{}))); | 571 | .WillByDefault(Return(std::make_shared<mt::TestDispatchable>([]{}))); |
956 | 572 | 572 | ||
957 | === modified file 'tests/unit-tests/client/test_connection_resource_map.cpp' | |||
958 | --- tests/unit-tests/client/test_connection_resource_map.cpp 2016-11-14 15:44:53 +0000 | |||
959 | +++ tests/unit-tests/client/test_connection_resource_map.cpp 2016-11-30 09:56:15 +0000 | |||
960 | @@ -20,7 +20,7 @@ | |||
961 | 20 | #include "src/client/mir_surface.h" | 20 | #include "src/client/mir_surface.h" |
962 | 21 | #include "src/client/presentation_chain.h" | 21 | #include "src/client/presentation_chain.h" |
963 | 22 | #include "src/client/render_surface.h" | 22 | #include "src/client/render_surface.h" |
965 | 23 | #include "mir/test/doubles/mock_client_buffer_stream.h" | 23 | #include "mir/test/doubles/mock_mir_buffer_stream.h" |
966 | 24 | #include "mir/test/doubles/mock_protobuf_server.h" | 24 | #include "mir/test/doubles/mock_protobuf_server.h" |
967 | 25 | #include <gtest/gtest.h> | 25 | #include <gtest/gtest.h> |
968 | 26 | 26 | ||
969 | @@ -38,7 +38,7 @@ | |||
970 | 38 | { | 38 | { |
971 | 39 | std::shared_ptr<MirWaitHandle> wh { std::make_shared<MirWaitHandle>() }; | 39 | std::shared_ptr<MirWaitHandle> wh { std::make_shared<MirWaitHandle>() }; |
972 | 40 | std::shared_ptr<MirSurface> surface{std::make_shared<MirSurface>("a string", nullptr, mf::SurfaceId{2}, wh)}; | 40 | std::shared_ptr<MirSurface> surface{std::make_shared<MirSurface>("a string", nullptr, mf::SurfaceId{2}, wh)}; |
974 | 41 | std::shared_ptr<mcl::ClientBufferStream> stream{ std::make_shared<mtd::MockClientBufferStream>() }; | 41 | std::shared_ptr<MirBufferStream> stream{ std::make_shared<mtd::MockMirBufferStream>() }; |
975 | 42 | std::shared_ptr<mcl::Buffer> buffer { | 42 | std::shared_ptr<mcl::Buffer> buffer { |
976 | 43 | std::make_shared<mcl::Buffer>(buffer_cb, nullptr, 0, nullptr, nullptr, mir_buffer_usage_software) }; | 43 | std::make_shared<mcl::Buffer>(buffer_cb, nullptr, 0, nullptr, nullptr, mir_buffer_usage_software) }; |
977 | 44 | mtd::MockProtobufServer mock_server; | 44 | mtd::MockProtobufServer mock_server; |
978 | @@ -74,7 +74,7 @@ | |||
979 | 74 | map.insert(surface_id, surface); | 74 | map.insert(surface_id, surface); |
980 | 75 | map.erase(surface_id); | 75 | map.erase(surface_id); |
981 | 76 | EXPECT_THROW({ | 76 | EXPECT_THROW({ |
983 | 77 | map.with_stream_do(stream_id, [](mcl::ClientBufferStream*){}); | 77 | map.with_stream_do(stream_id, [](MirBufferStream*){}); |
984 | 78 | }, std::runtime_error); | 78 | }, std::runtime_error); |
985 | 79 | } | 79 | } |
986 | 80 | 80 | ||
987 | @@ -84,7 +84,7 @@ | |||
988 | 84 | auto stream_called = false; | 84 | auto stream_called = false; |
989 | 85 | mcl::ConnectionSurfaceMap map; | 85 | mcl::ConnectionSurfaceMap map; |
990 | 86 | map.insert(stream_id, stream); | 86 | map.insert(stream_id, stream); |
992 | 87 | map.with_stream_do(stream_id, [&](mcl::ClientBufferStream* str) { | 87 | map.with_stream_do(stream_id, [&](MirBufferStream* str) { |
993 | 88 | EXPECT_THAT(str, Eq(stream.get())); | 88 | EXPECT_THAT(str, Eq(stream.get())); |
994 | 89 | stream_called = true; | 89 | stream_called = true; |
995 | 90 | }); | 90 | }); |
996 | 91 | 91 | ||
997 | === modified file 'tests/unit-tests/client/test_mir_screencast.cpp' | |||
998 | --- tests/unit-tests/client/test_mir_screencast.cpp 2016-07-18 07:38:38 +0000 | |||
999 | +++ tests/unit-tests/client/test_mir_screencast.cpp 2016-11-30 09:56:15 +0000 | |||
1000 | @@ -22,7 +22,7 @@ | |||
1001 | 22 | #include "mir/client_buffer_factory.h" | 22 | #include "mir/client_buffer_factory.h" |
1002 | 23 | #include "mir/client_platform.h" | 23 | #include "mir/client_platform.h" |
1003 | 24 | 24 | ||
1005 | 25 | #include "mir/test/doubles/mock_client_buffer_stream.h" | 25 | #include "mir/test/doubles/mock_mir_buffer_stream.h" |
1006 | 26 | #include "mir/test/doubles/null_client_buffer.h" | 26 | #include "mir/test/doubles/null_client_buffer.h" |
1007 | 27 | #include "mir/test/doubles/stub_display_server.h" | 27 | #include "mir/test/doubles/stub_display_server.h" |
1008 | 28 | #include "mir/test/fake_shared.h" | 28 | #include "mir/test/fake_shared.h" |
1009 | @@ -179,7 +179,7 @@ | |||
1010 | 179 | mir::geometry::Rectangle default_region; | 179 | mir::geometry::Rectangle default_region; |
1011 | 180 | MirPixelFormat default_pixel_format; | 180 | MirPixelFormat default_pixel_format; |
1012 | 181 | MirScreencastSpec default_spec; | 181 | MirScreencastSpec default_spec; |
1014 | 182 | mtd::MockClientBufferStream mock_bs; | 182 | mtd::MockMirBufferStream mock_bs; |
1015 | 183 | }; | 183 | }; |
1016 | 184 | 184 | ||
1017 | 185 | } | 185 | } |
1018 | 186 | 186 | ||
1019 | === modified file 'tests/unit-tests/client/test_protobuf_rpc_channel.cpp' | |||
1020 | --- tests/unit-tests/client/test_protobuf_rpc_channel.cpp 2016-11-24 09:45:22 +0000 | |||
1021 | +++ tests/unit-tests/client/test_protobuf_rpc_channel.cpp 2016-11-30 09:56:15 +0000 | |||
1022 | @@ -32,7 +32,7 @@ | |||
1023 | 32 | #include "mir/input/input_devices.h" | 32 | #include "mir/input/input_devices.h" |
1024 | 33 | 33 | ||
1025 | 34 | #include "mir/test/doubles/null_client_event_sink.h" | 34 | #include "mir/test/doubles/null_client_event_sink.h" |
1027 | 35 | #include "mir/test/doubles/mock_client_buffer_stream.h" | 35 | #include "mir/test/doubles/mock_mir_buffer_stream.h" |
1028 | 36 | #include "mir/test/doubles/mock_client_buffer.h" | 36 | #include "mir/test/doubles/mock_client_buffer.h" |
1029 | 37 | #include "mir/test/fd_utils.h" | 37 | #include "mir/test/fd_utils.h" |
1030 | 38 | #include "mir/test/gmock_fixes.h" | 38 | #include "mir/test/gmock_fixes.h" |
1031 | @@ -62,9 +62,9 @@ | |||
1032 | 62 | MOCK_CONST_METHOD2(with_surface_do, | 62 | MOCK_CONST_METHOD2(with_surface_do, |
1033 | 63 | void(mir::frontend::SurfaceId, std::function<void(MirSurface*)> const&)); | 63 | void(mir::frontend::SurfaceId, std::function<void(MirSurface*)> const&)); |
1034 | 64 | MOCK_CONST_METHOD2(with_stream_do, | 64 | MOCK_CONST_METHOD2(with_stream_do, |
1036 | 65 | void(mir::frontend::BufferStreamId, std::function<void(mcl::ClientBufferStream*)> const&)); | 65 | void(mir::frontend::BufferStreamId, std::function<void(MirBufferStream*)> const&)); |
1037 | 66 | MOCK_CONST_METHOD1(with_all_streams_do, | 66 | MOCK_CONST_METHOD1(with_all_streams_do, |
1039 | 67 | void(std::function<void(mcl::ClientBufferStream*)> const&)); | 67 | void(std::function<void(MirBufferStream*)> const&)); |
1040 | 68 | MOCK_CONST_METHOD1(buffer, std::shared_ptr<mcl::MirBuffer>(int)); | 68 | MOCK_CONST_METHOD1(buffer, std::shared_ptr<mcl::MirBuffer>(int)); |
1041 | 69 | MOCK_METHOD2(insert, void(int, std::shared_ptr<mcl::MirBuffer> const&)); | 69 | MOCK_METHOD2(insert, void(int, std::shared_ptr<mcl::MirBuffer> const&)); |
1042 | 70 | MOCK_METHOD2(insert, void(mir::frontend::BufferStreamId, std::shared_ptr<MirPresentationChain> const&)); | 70 | MOCK_METHOD2(insert, void(mir::frontend::BufferStreamId, std::shared_ptr<MirPresentationChain> const&)); |
1043 | @@ -79,10 +79,10 @@ | |||
1044 | 79 | { | 79 | { |
1045 | 80 | } | 80 | } |
1046 | 81 | void with_stream_do( | 81 | void with_stream_do( |
1048 | 82 | mir::frontend::BufferStreamId, std::function<void(mcl::ClientBufferStream*)> const&) const override | 82 | mir::frontend::BufferStreamId, std::function<void(MirBufferStream*)> const&) const override |
1049 | 83 | { | 83 | { |
1050 | 84 | } | 84 | } |
1052 | 85 | void with_all_streams_do(std::function<void(mcl::ClientBufferStream*)> const&) const override | 85 | void with_all_streams_do(std::function<void(MirBufferStream*)> const&) const override |
1053 | 86 | { | 86 | { |
1054 | 87 | } | 87 | } |
1055 | 88 | void insert(mir::frontend::BufferStreamId, std::shared_ptr<MirPresentationChain> const&) | 88 | void insert(mir::frontend::BufferStreamId, std::shared_ptr<MirPresentationChain> const&) |
1056 | @@ -254,7 +254,7 @@ | |||
1057 | 254 | MockStreamTransport* transport; | 254 | MockStreamTransport* transport; |
1058 | 255 | std::shared_ptr<mcl::LifecycleControl> lifecycle; | 255 | std::shared_ptr<mcl::LifecycleControl> lifecycle; |
1059 | 256 | std::shared_ptr<mclr::MirProtobufRpcChannel> channel; | 256 | std::shared_ptr<mclr::MirProtobufRpcChannel> channel; |
1061 | 257 | mtd::MockClientBufferStream stream; | 257 | mtd::MockMirBufferStream stream; |
1062 | 258 | }; | 258 | }; |
1063 | 259 | 259 | ||
1064 | 260 | } | 260 | } |
FAILED: Continuous integration, rev:3857 /mir-jenkins. ubuntu. com/job/ mir-ci/ 2287/ /mir-jenkins. ubuntu. com/job/ build-mir/ 2971/console /mir-jenkins. ubuntu. com/job/ build-0- fetch/3036 /mir-jenkins. ubuntu. com/job/ build-1- sourcepkg/ release= vivid+overlay/ 3028 /mir-jenkins. ubuntu. com/job/ build-1- sourcepkg/ release= xenial+ overlay/ 3028 /mir-jenkins. ubuntu. com/job/ build-1- sourcepkg/ release= yakkety/ 3028 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= clang,platform= mesa,release= yakkety/ 3000 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= clang,platform= mesa,release= yakkety/ 3000/artifact/ output/ *zip*/output. zip /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= gcc,platform= mesa,release= xenial+ overlay/ 3000 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= gcc,platform= mesa,release= xenial+ overlay/ 3000/artifact/ output/ *zip*/output. zip /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= gcc,platform= mesa,release= yakkety/ 3000 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= gcc,platform= mesa,release= yakkety/ 3000/artifact/ output/ *zip*/output. zip /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= cross-armhf, compiler= gcc,platform= android, release= vivid+overlay/ 3000 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= cross-armhf, compiler= gcc,platform= android, release= vivid+overlay/ 3000/artifact/ output/ *zip*/output. zip /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= i386,compiler= gcc,platform= android, release= vivid+overlay/ 3000 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= i386,compiler= gcc,platform= android, release= vivid+overlay/ 3000/artifact/ output/ *zip*/output. zip /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= i386,compiler= gcc,platform= mesa,release= xenial+ overlay/ 3000/console
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
Click here to trigger a rebuild: /mir-jenkins. ubuntu. com/job/ mir-ci/ 2287/rebuild
https:/