Mir

Merge lp:~vanvugt/mir/eliminate-stream-casts into lp:mir

Proposed by Daniel van Vugt
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
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.

To post a comment you must log in.
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

FAILED: Continuous integration, rev:3857
https://mir-jenkins.ubuntu.com/job/mir-ci/2287/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/2971/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/3036
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/3028
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/3028
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/3028
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=yakkety/3000
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=yakkety/3000/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/3000
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/3000/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=yakkety/3000
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=yakkety/3000/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/3000
        deb: https://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
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/3000
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/3000/artifact/output/*zip*/output.zip
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/3000/console

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/2287/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

PASSED: Continuous integration, rev:3858
https://mir-jenkins.ubuntu.com/job/mir-ci/2289/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/2974
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/3039
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/3031
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/3031
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/3031
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=yakkety/3003
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=yakkety/3003/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/3003
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/3003/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=yakkety/3003
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=yakkety/3003/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/3003
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/3003/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/3003
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/3003/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/3003
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/3003/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/2289/rebuild

review: Approve (continuous-integration)
Revision history for this message
Kevin DuBois (kdub) wrote :

much cleaner, lgtm

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

yes

review: Approve
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

FAILED: Autolanding.
More details in the following jenkins job:
https://mir-jenkins.ubuntu.com/job/mir-autolanding/825/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/2978/console
    None: https://mir-jenkins.ubuntu.com/job/generic-land-mp/872/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/3043
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/3035
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/3035
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/3035
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=yakkety/3007
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=yakkety/3007/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/3007
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/3007/artifact/output/*zip*/output.zip
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=yakkety/3007/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/3007
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/3007/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/3007
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/3007/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/3007
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/3007/artifact/output/*zip*/output.zip

review: Needs Fixing (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :
Revision history for this message
Mir CI Bot (mir-ci-bot) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/client/buffer_stream.h'
--- src/client/buffer_stream.h 2016-11-24 10:17:52 +0000
+++ src/client/buffer_stream.h 2016-11-30 09:56:15 +0000
@@ -22,7 +22,7 @@
22#include "mir_wait_handle.h"22#include "mir_wait_handle.h"
23#include "mir/egl_native_surface.h"23#include "mir/egl_native_surface.h"
24#include "mir/client_buffer.h"24#include "mir/client_buffer.h"
25#include "mir/client_buffer_stream.h"25#include "mir/mir_buffer_stream.h"
26#include "mir/geometry/size.h"26#include "mir/geometry/size.h"
27#include "mir/optional_value.h"27#include "mir/optional_value.h"
28#include "buffer_stream_configuration.h"28#include "buffer_stream_configuration.h"
@@ -69,7 +69,7 @@
69struct MemoryRegion;69struct MemoryRegion;
70class SurfaceMap;70class SurfaceMap;
71class BufferDepository;71class BufferDepository;
72class BufferStream : public EGLNativeSurface, public ClientBufferStream72class BufferStream : public EGLNativeSurface, public MirBufferStream
73{73{
74public:74public:
75 BufferStream(75 BufferStream(
7676
=== modified file 'src/client/connection_surface_map.cpp'
--- src/client/connection_surface_map.cpp 2016-10-13 16:32:59 +0000
+++ src/client/connection_surface_map.cpp 2016-11-30 09:56:15 +0000
@@ -58,7 +58,7 @@
58}58}
5959
60void mcl::ConnectionSurfaceMap::with_stream_do(60void mcl::ConnectionSurfaceMap::with_stream_do(
61 mf::BufferStreamId stream_id, std::function<void(ClientBufferStream*)> const& exec) const61 mf::BufferStreamId stream_id, std::function<void(MirBufferStream*)> const& exec) const
62{62{
63 std::shared_lock<decltype(stream_guard)> lk(stream_guard);63 std::shared_lock<decltype(stream_guard)> lk(stream_guard);
64 auto const it = streams.find(stream_id);64 auto const it = streams.find(stream_id);
@@ -76,7 +76,7 @@
76 }76 }
77}77}
7878
79void mcl::ConnectionSurfaceMap::with_all_streams_do(std::function<void(ClientBufferStream*)> const& fn) const79void mcl::ConnectionSurfaceMap::with_all_streams_do(std::function<void(MirBufferStream*)> const& fn) const
80{80{
81 std::shared_lock<decltype(stream_guard)> lk(stream_guard);81 std::shared_lock<decltype(stream_guard)> lk(stream_guard);
82 for(auto const& stream : streams)82 for(auto const& stream : streams)
@@ -84,7 +84,7 @@
84}84}
8585
86void mcl::ConnectionSurfaceMap::insert(86void mcl::ConnectionSurfaceMap::insert(
87 mf::BufferStreamId stream_id, std::shared_ptr<ClientBufferStream> const& stream)87 mf::BufferStreamId stream_id, std::shared_ptr<MirBufferStream> const& stream)
88{88{
89 std::lock_guard<decltype(stream_guard)> lk(stream_guard);89 std::lock_guard<decltype(stream_guard)> lk(stream_guard);
90 streams[stream_id] = stream;90 streams[stream_id] = stream;
9191
=== modified file 'src/client/connection_surface_map.h'
--- src/client/connection_surface_map.h 2016-10-11 18:59:08 +0000
+++ src/client/connection_surface_map.h 2016-11-30 09:56:15 +0000
@@ -38,10 +38,10 @@
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);
39 void erase(frontend::SurfaceId surface_id);39 void erase(frontend::SurfaceId surface_id);
4040
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;
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;
4343
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);
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);
46 void erase(frontend::BufferStreamId surface_id);46 void erase(frontend::BufferStreamId surface_id);
4747
@@ -57,7 +57,7 @@
57 std::shared_timed_mutex mutable guard;57 std::shared_timed_mutex mutable guard;
58 std::unordered_map<frontend::SurfaceId, std::shared_ptr<MirSurface>> surfaces;58 std::unordered_map<frontend::SurfaceId, std::shared_ptr<MirSurface>> surfaces;
59 std::shared_timed_mutex mutable stream_guard;59 std::shared_timed_mutex mutable stream_guard;
60 std::unordered_map<frontend::BufferStreamId, std::shared_ptr<ClientBufferStream>> streams;60 std::unordered_map<frontend::BufferStreamId, std::shared_ptr<MirBufferStream>> streams;
61 std::unordered_map<frontend::BufferStreamId, std::shared_ptr<MirPresentationChain>> chains;61 std::unordered_map<frontend::BufferStreamId, std::shared_ptr<MirPresentationChain>> chains;
62 std::shared_timed_mutex mutable buffer_guard;62 std::shared_timed_mutex mutable buffer_guard;
63 std::unordered_map<int, std::shared_ptr<MirBuffer>> buffers;63 std::unordered_map<int, std::shared_ptr<MirBuffer>> buffers;
6464
=== modified file 'src/client/cursor_configuration.h'
--- src/client/cursor_configuration.h 2015-04-28 07:54:10 +0000
+++ src/client/cursor_configuration.h 2016-11-30 09:56:15 +0000
@@ -21,23 +21,15 @@
2121
22#include <string>22#include <string>
2323
24namespace mir
25{
26namespace client
27{
28class ClientBufferStream;
29}
30}
31
32// Parameters for configuring the apperance and behavior of the system cursor. 24// Parameters for configuring the apperance and behavior of the system cursor.
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...
34struct MirCursorConfiguration 26struct MirCursorConfiguration
35{27{
36 MirCursorConfiguration(char const* name);28 MirCursorConfiguration(char const* name);
37 MirCursorConfiguration(mir::client::ClientBufferStream const* stream, int hotspot_x, int hotspot_y);29 MirCursorConfiguration(MirBufferStream const* stream, int hotspot_x, int hotspot_y);
3830
39 std::string name;31 std::string name;
40 mir::client::ClientBufferStream const* stream;32 MirBufferStream const* stream;
41 int hotspot_x;33 int hotspot_x;
42 int hotspot_y;34 int hotspot_y;
43};35};
4436
=== modified file 'src/client/error_stream.h'
--- src/client/error_stream.h 2016-11-23 04:37:50 +0000
+++ src/client/error_stream.h 2016-11-30 09:56:15 +0000
@@ -19,13 +19,13 @@
19#ifndef MIR_CLIENT_ERROR_STREAM_H_19#ifndef MIR_CLIENT_ERROR_STREAM_H_
20#define MIR_CLIENT_ERROR_STREAM_H_20#define MIR_CLIENT_ERROR_STREAM_H_
2121
22#include "mir/client_buffer_stream.h"22#include "mir/mir_buffer_stream.h"
2323
24namespace mir24namespace mir
25{25{
26namespace client26namespace client
27{27{
28class ErrorStream : public ClientBufferStream28class ErrorStream : public MirBufferStream
29{29{
30public:30public:
31 ErrorStream(31 ErrorStream(
3232
=== modified file 'src/client/mir_buffer_stream_api.cpp'
--- src/client/mir_buffer_stream_api.cpp 2016-11-14 21:59:19 +0000
+++ src/client/mir_buffer_stream_api.cpp 2016-11-30 09:56:15 +0000
@@ -88,9 +88,8 @@
88 mir_buffer_stream_callback callback,88 mir_buffer_stream_callback callback,
89 void* context)89 void* context)
90{90{
91 auto bs = reinterpret_cast<mcl::ClientBufferStream*>(buffer_stream);91 auto connection = buffer_stream->connection();
92 auto connection = bs->connection();92 return connection->release_buffer_stream(buffer_stream, callback, context);
93 return connection->release_buffer_stream(bs, callback, context);
94}93}
9594
96void mir_buffer_stream_release_sync(MirBufferStream *buffer_stream)95void mir_buffer_stream_release_sync(MirBufferStream *buffer_stream)
@@ -101,8 +100,7 @@
101void mir_buffer_stream_get_current_buffer(MirBufferStream* buffer_stream, MirNativeBuffer** buffer_package_out)100void mir_buffer_stream_get_current_buffer(MirBufferStream* buffer_stream, MirNativeBuffer** buffer_package_out)
102try101try
103{102{
104 mcl::ClientBufferStream *bs = reinterpret_cast<mcl::ClientBufferStream*>(buffer_stream);103 *buffer_package_out = buffer_stream->get_current_buffer_package();
105 *buffer_package_out = bs->get_current_buffer_package();
106}104}
107catch (std::exception const& ex)105catch (std::exception const& ex)
108{106{
@@ -115,10 +113,9 @@
115 void* context)113 void* context)
116try114try
117{115{
118 mcl::ClientBufferStream *bs = reinterpret_cast<mcl::ClientBufferStream*>(buffer_stream);116 return buffer_stream->next_buffer([buffer_stream, callback, context]{
119 return bs->next_buffer([bs, callback, context]{
120 if (callback)117 if (callback)
121 callback(reinterpret_cast<MirBufferStream*>(bs), context);118 callback(buffer_stream, context);
122 });119 });
123}120}
124catch (std::exception const& ex)121catch (std::exception const& ex)
@@ -146,9 +143,7 @@
146 MirGraphicsRegion *region_out)143 MirGraphicsRegion *region_out)
147try144try
148{145{
149 mcl::ClientBufferStream *bs = reinterpret_cast<mcl::ClientBufferStream*>(buffer_stream);146 auto secured_region = buffer_stream->secure_for_cpu_write();
150
151 auto secured_region = bs->secure_for_cpu_write();
152 region_out->width = secured_region->width.as_uint32_t();147 region_out->width = secured_region->width.as_uint32_t();
153 region_out->height = secured_region->height.as_uint32_t();148 region_out->height = secured_region->height.as_uint32_t();
154 region_out->stride = secured_region->stride.as_uint32_t();149 region_out->stride = secured_region->stride.as_uint32_t();
@@ -163,8 +158,7 @@
163MirEGLNativeWindowType mir_buffer_stream_get_egl_native_window(MirBufferStream* buffer_stream)158MirEGLNativeWindowType mir_buffer_stream_get_egl_native_window(MirBufferStream* buffer_stream)
164try159try
165{160{
166 mcl::ClientBufferStream *bs = reinterpret_cast<mcl::ClientBufferStream*>(buffer_stream);161 return reinterpret_cast<MirEGLNativeWindowType>(buffer_stream->egl_native_window());
167 return reinterpret_cast<MirEGLNativeWindowType>(bs->egl_native_window());
168}162}
169catch (std::exception const& ex)163catch (std::exception const& ex)
170{164{
@@ -175,8 +169,7 @@
175MirPlatformType mir_buffer_stream_get_platform_type(MirBufferStream* buffer_stream)169MirPlatformType mir_buffer_stream_get_platform_type(MirBufferStream* buffer_stream)
176try170try
177{171{
178 mcl::ClientBufferStream *bs = reinterpret_cast<mcl::ClientBufferStream*>(buffer_stream);172 return buffer_stream->platform_type();
179 return bs->platform_type();
180}173}
181catch (std::exception const& ex)174catch (std::exception const& ex)
182{175{
@@ -186,14 +179,12 @@
186179
187bool mir_buffer_stream_is_valid(MirBufferStream* opaque_stream)180bool mir_buffer_stream_is_valid(MirBufferStream* opaque_stream)
188{181{
189 auto buffer_stream = reinterpret_cast<mcl::ClientBufferStream*>(opaque_stream);182 return opaque_stream->valid();
190 return buffer_stream->valid();
191}183}
192184
193MirWaitHandle* mir_buffer_stream_set_scale(MirBufferStream* opaque_stream, float scale)185MirWaitHandle* mir_buffer_stream_set_scale(MirBufferStream* buffer_stream, float scale)
194try186try
195{187{
196 auto buffer_stream = reinterpret_cast<mcl::ClientBufferStream*>(opaque_stream);
197 if (!buffer_stream)188 if (!buffer_stream)
198 return nullptr;189 return nullptr;
199190
@@ -212,19 +203,17 @@
212 wh->wait_for_all();203 wh->wait_for_all();
213}204}
214205
215char const* mir_buffer_stream_get_error_message(MirBufferStream* opaque_stream)206char const* mir_buffer_stream_get_error_message(MirBufferStream* buffer_stream)
216{207{
217 auto buffer_stream = reinterpret_cast<mcl::ClientBufferStream*>(opaque_stream);
218 return buffer_stream->get_error_message();208 return buffer_stream->get_error_message();
219}209}
220210
221MirWaitHandle* mir_buffer_stream_set_swapinterval(MirBufferStream* stream, int interval)211MirWaitHandle* mir_buffer_stream_set_swapinterval(MirBufferStream* buffer_stream, int interval)
222try212try
223{213{
224 if ((interval < 0) || (interval > 1))214 if ((interval < 0) || (interval > 1))
225 return nullptr;215 return nullptr;
226216
227 auto buffer_stream = reinterpret_cast<mcl::ClientBufferStream*>(stream);
228 if (!buffer_stream)217 if (!buffer_stream)
229 return nullptr;218 return nullptr;
230219
@@ -236,10 +225,9 @@
236 return nullptr;225 return nullptr;
237}226}
238227
239int mir_buffer_stream_get_swapinterval(MirBufferStream* stream)228int mir_buffer_stream_get_swapinterval(MirBufferStream* buffer_stream)
240try229try
241{230{
242 auto buffer_stream = reinterpret_cast<mcl::ClientBufferStream*>(stream);
243 if (buffer_stream)231 if (buffer_stream)
244 return buffer_stream->swap_interval();232 return buffer_stream->swap_interval();
245 else233 else
@@ -255,8 +243,7 @@
255try243try
256{244{
257 mir::require(stream);245 mir::require(stream);
258 if (auto buffer_stream = reinterpret_cast<mcl::ClientBufferStream*>(stream))246 return stream->set_size(mir::geometry::Size{width, height});
259 return buffer_stream->set_size(mir::geometry::Size{width, height});
260}247}
261catch (std::exception const& ex)248catch (std::exception const& ex)
262{249{
@@ -269,17 +256,9 @@
269 mir::require(stream);256 mir::require(stream);
270 mir::require(width);257 mir::require(width);
271 mir::require(height);258 mir::require(height);
272 if (auto buffer_stream = reinterpret_cast<mcl::ClientBufferStream*>(stream))259 auto size = stream->size();
273 {260 *width = size.width.as_int();
274 auto size = buffer_stream->size();261 *height = size.height.as_int();
275 *width = size.width.as_int();
276 *height = size.height.as_int();
277 }
278 else
279 {
280 *width = -1;
281 *height = -1;
282 }
283}262}
284catch (std::exception const& ex)263catch (std::exception const& ex)
285{264{
286265
=== modified file 'src/client/mir_connection.cpp'
--- src/client/mir_connection.cpp 2016-11-22 18:18:59 +0000
+++ src/client/mir_connection.cpp 2016-11-30 09:56:15 +0000
@@ -386,7 +386,7 @@
386 std::string name{spec.surface_name.is_set() ?386 std::string name{spec.surface_name.is_set() ?
387 spec.surface_name.value() : ""};387 spec.surface_name.value() : ""};
388388
389 std::shared_ptr<mcl::ClientBufferStream> default_stream {nullptr};389 std::shared_ptr<MirBufferStream> default_stream {nullptr};
390 if (surface_proto->buffer_stream().has_id())390 if (surface_proto->buffer_stream().has_id())
391 {391 {
392 try392 try
@@ -465,7 +465,7 @@
465465
466struct MirConnection::StreamRelease466struct MirConnection::StreamRelease
467{467{
468 mcl::ClientBufferStream* stream;468 MirBufferStream* stream;
469 MirWaitHandle* handle;469 MirWaitHandle* handle;
470 mir_buffer_stream_callback callback;470 mir_buffer_stream_callback callback;
471 void* context;471 void* context;
@@ -476,7 +476,7 @@
476void MirConnection::released(StreamRelease data)476void MirConnection::released(StreamRelease data)
477{477{
478 if (data.callback)478 if (data.callback)
479 data.callback(reinterpret_cast<MirBufferStream*>(data.stream), data.context);479 data.callback(data.stream, data.context);
480 if (data.handle)480 if (data.handle)
481 data.handle->result_received();481 data.handle->result_received();
482482
@@ -634,7 +634,7 @@
634 std::lock_guard<decltype(mutex)> lock(mutex);634 std::lock_guard<decltype(mutex)> lock(mutex);
635 disconnecting = true;635 disconnecting = true;
636 }636 }
637 surface_map->with_all_streams_do([](mcl::ClientBufferStream* receiver)637 surface_map->with_all_streams_do([](MirBufferStream* receiver)
638 {638 {
639 receiver->buffer_unavailable();639 receiver->buffer_unavailable();
640 });640 });
@@ -839,10 +839,7 @@
839 surface_map->insert(mf::BufferStreamId(protobuf_bs->id().value()), stream);839 surface_map->insert(mf::BufferStreamId(protobuf_bs->id().value()), stream);
840840
841 if (request->mbs_callback)841 if (request->mbs_callback)
842 request->mbs_callback(842 request->mbs_callback(stream.get(), request->context);
843 reinterpret_cast<MirBufferStream*>(
844 dynamic_cast<mcl::ClientBufferStream*>(stream.get())),
845 request->context);
846843
847 request->wh->result_received();844 request->wh->result_received();
848 }845 }
@@ -931,15 +928,13 @@
931928
932 if (request->mbs_callback)929 if (request->mbs_callback)
933 {930 {
934 request->mbs_callback(931 request->mbs_callback(stream.get(), request->context);
935 reinterpret_cast<MirBufferStream*>(
936 dynamic_cast<mcl::ClientBufferStream*>(stream.get())), request->context);
937 }932 }
938933
939 request->wh->result_received();934 request->wh->result_received();
940}935}
941936
942std::shared_ptr<mir::client::ClientBufferStream> MirConnection::make_consumer_stream(937std::shared_ptr<MirBufferStream> MirConnection::make_consumer_stream(
943 mp::BufferStream const& protobuf_bs)938 mp::BufferStream const& protobuf_bs)
944{939{
945 return std::make_shared<mcl::ScreencastStream>(940 return std::make_shared<mcl::ScreencastStream>(
@@ -1144,7 +1139,7 @@
1144}1139}
11451140
1146MirWaitHandle* MirConnection::release_buffer_stream(1141MirWaitHandle* MirConnection::release_buffer_stream(
1147 mir::client::ClientBufferStream* stream,1142 MirBufferStream* stream,
1148 mir_buffer_stream_callback callback,1143 mir_buffer_stream_callback callback,
1149 void *context)1144 void *context)
1150{1145{
@@ -1167,7 +1162,7 @@
1167 return new_wait_handle;1162 return new_wait_handle;
1168}1163}
11691164
1170void MirConnection::release_consumer_stream(mir::client::ClientBufferStream* stream)1165void MirConnection::release_consumer_stream(MirBufferStream* stream)
1171{1166{
1172 surface_map->erase(stream->rpc_id());1167 surface_map->erase(stream->rpc_id());
1173}1168}
11741169
=== modified file 'src/client/mir_connection.h'
--- src/client/mir_connection.h 2016-11-14 21:59:19 +0000
+++ src/client/mir_connection.h 2016-11-30 09:56:15 +0000
@@ -60,7 +60,6 @@
60{60{
61class ConnectionConfiguration;61class ConnectionConfiguration;
62class ClientPlatformFactory;62class ClientPlatformFactory;
63class ClientBufferStream;
64class ConnectionSurfaceMap;63class ConnectionSurfaceMap;
65class DisplayConfiguration;64class DisplayConfiguration;
66class EventHandlerRegister;65class EventHandlerRegister;
@@ -146,7 +145,7 @@
146 void available_surface_formats(MirPixelFormat* formats,145 void available_surface_formats(MirPixelFormat* formats,
147 unsigned int formats_size, unsigned int& valid_formats);146 unsigned int formats_size, unsigned int& valid_formats);
148147
149 std::shared_ptr<mir::client::ClientBufferStream> make_consumer_stream(148 std::shared_ptr<MirBufferStream> make_consumer_stream(
150 mir::protobuf::BufferStream const& protobuf_bs);149 mir::protobuf::BufferStream const& protobuf_bs);
151150
152 typedef void (*buffer_stream_callback)(mir::client::BufferStream* stream, void* context);151 typedef void (*buffer_stream_callback)(mir::client::BufferStream* stream, void* context);
@@ -163,7 +162,7 @@
163 MirRenderSurface* render_surface,162 MirRenderSurface* render_surface,
164 mir::protobuf::BufferStream const& a_protobuf_bs);163 mir::protobuf::BufferStream const& a_protobuf_bs);
165 MirWaitHandle* release_buffer_stream(164 MirWaitHandle* release_buffer_stream(
166 mir::client::ClientBufferStream*,165 MirBufferStream*,
167 mir_buffer_stream_callback callback,166 mir_buffer_stream_callback callback,
168 void *context);167 void *context);
169168
@@ -172,14 +171,14 @@
172 void *context);171 void *context);
173 void release_presentation_chain(MirPresentationChain* context);172 void release_presentation_chain(MirPresentationChain* context);
174173
175 void release_consumer_stream(mir::client::ClientBufferStream*);174 void release_consumer_stream(MirBufferStream*);
176175
177 static bool is_valid(MirConnection *connection);176 static bool is_valid(MirConnection *connection);
178177
179 EGLNativeDisplayType egl_native_display();178 EGLNativeDisplayType egl_native_display();
180 MirPixelFormat egl_pixel_format(EGLDisplay, EGLConfig) const;179 MirPixelFormat egl_pixel_format(EGLDisplay, EGLConfig) const;
181180
182 void on_stream_created(int id, mir::client::ClientBufferStream* stream);181 void on_stream_created(int id, MirBufferStream* stream);
183182
184 MirWaitHandle* configure_display(MirDisplayConfiguration* configuration);183 MirWaitHandle* configure_display(MirDisplayConfiguration* configuration);
185 void done_display_configure();184 void done_display_configure();
186185
=== modified file 'src/client/mir_cursor_api.cpp'
--- src/client/mir_cursor_api.cpp 2016-10-12 10:12:15 +0000
+++ src/client/mir_cursor_api.cpp 2016-11-30 09:56:15 +0000
@@ -25,8 +25,6 @@
2525
26#include <memory>26#include <memory>
2727
28namespace mcl = mir::client;
29
30// Cursor names are from CSS3: https://www.w3.org/TR/css-ui-3/#propdef-cursor28// Cursor names are from CSS3: https://www.w3.org/TR/css-ui-3/#propdef-cursor
31extern "C" char const* const mir_default_cursor_name = "default";29extern "C" char const* const mir_default_cursor_name = "default";
32extern "C" char const* const mir_disabled_cursor_name = "none";30extern "C" char const* const mir_disabled_cursor_name = "none";
@@ -51,7 +49,7 @@
51{49{
52}50}
5351
54MirCursorConfiguration::MirCursorConfiguration(mcl::ClientBufferStream const* stream, int hotspot_x, int hotspot_y) :52MirCursorConfiguration::MirCursorConfiguration(MirBufferStream const* stream, int hotspot_x, int hotspot_y) :
55 stream(stream),53 stream(stream),
56 hotspot_x(hotspot_x),54 hotspot_x(hotspot_x),
57 hotspot_y(hotspot_y)55 hotspot_y(hotspot_y)
@@ -81,7 +79,7 @@
81{79{
82 try 80 try
83 {81 {
84 return new MirCursorConfiguration(reinterpret_cast<mcl::ClientBufferStream const*>(stream), hotspot_x, hotspot_y);82 return new MirCursorConfiguration(stream, hotspot_x, hotspot_y);
85 }83 }
86 catch (std::exception const& ex)84 catch (std::exception const& ex)
87 {85 {
8886
=== modified file 'src/client/mir_debug_api.cpp'
--- src/client/mir_debug_api.cpp 2016-11-22 03:42:44 +0000
+++ src/client/mir_debug_api.cpp 2016-11-30 09:56:15 +0000
@@ -19,7 +19,7 @@
19#include "mir_toolkit/debug/surface.h"19#include "mir_toolkit/debug/surface.h"
2020
21#include "mir_surface.h"21#include "mir_surface.h"
22#include "mir/client_buffer_stream.h"22#include "mir/mir_buffer_stream.h"
2323
24uint32_t mir_debug_surface_current_buffer_id(MirSurface* surface)24uint32_t mir_debug_surface_current_buffer_id(MirSurface* surface)
25{25{
2626
=== modified file 'src/client/mir_screencast.cpp'
--- src/client/mir_screencast.cpp 2016-11-22 03:42:44 +0000
+++ src/client/mir_screencast.cpp 2016-11-30 09:56:15 +0000
@@ -20,7 +20,7 @@
20#include "mir_connection.h"20#include "mir_connection.h"
21#include "mir_protobuf.pb.h"21#include "mir_protobuf.pb.h"
22#include "make_protobuf_object.h"22#include "make_protobuf_object.h"
23#include "mir/client_buffer_stream.h"23#include "mir/mir_buffer_stream.h"
24#include "mir/frontend/client_constants.h"24#include "mir/frontend/client_constants.h"
25#include "mir_toolkit/mir_native_buffer.h"25#include "mir_toolkit/mir_native_buffer.h"
2626
@@ -205,7 +205,7 @@
205 release_wait_handle.result_received();205 release_wait_handle.result_received();
206}206}
207207
208mir::client::ClientBufferStream* MirScreencast::get_buffer_stream()208MirBufferStream* MirScreencast::get_buffer_stream()
209{209{
210 std::lock_guard<decltype(mutex)> lock(mutex);210 std::lock_guard<decltype(mutex)> lock(mutex);
211 return buffer_stream.get();211 return buffer_stream.get();
212212
=== modified file 'src/client/mir_screencast.h'
--- src/client/mir_screencast.h 2016-07-18 07:38:38 +0000
+++ src/client/mir_screencast.h 2016-11-30 09:56:15 +0000
@@ -42,8 +42,7 @@
42{42{
43class DisplayServer;43class DisplayServer;
44}44}
45class ClientBufferStreamFactory;45class MirBufferStreamFactory;
46class ClientBufferStream;
47}46}
48}47}
4948
@@ -84,7 +83,7 @@
8483
85 EGLNativeWindowType egl_native_window();84 EGLNativeWindowType egl_native_window();
8685
87 mir::client::ClientBufferStream* get_buffer_stream();86 MirBufferStream* get_buffer_stream();
8887
89private:88private:
90 void screencast_created(89 void screencast_created(
@@ -95,7 +94,7 @@
95 std::mutex mutable mutex;94 std::mutex mutable mutex;
96 mir::client::rpc::DisplayServer* const server{nullptr};95 mir::client::rpc::DisplayServer* const server{nullptr};
97 MirConnection* const connection{nullptr};96 MirConnection* const connection{nullptr};
98 std::shared_ptr<mir::client::ClientBufferStream> buffer_stream;97 std::shared_ptr<MirBufferStream> buffer_stream;
9998
100 std::unique_ptr<mir::protobuf::Screencast> const protobuf_screencast;99 std::unique_ptr<mir::protobuf::Screencast> const protobuf_screencast;
101 std::unique_ptr<mir::protobuf::Void> const protobuf_void;100 std::unique_ptr<mir::protobuf::Void> const protobuf_void;
102101
=== modified file 'src/client/mir_screencast_api.cpp'
--- src/client/mir_screencast_api.cpp 2016-07-18 07:38:38 +0000
+++ src/client/mir_screencast_api.cpp 2016-11-30 09:56:15 +0000
@@ -124,7 +124,7 @@
124MirBufferStream *mir_screencast_get_buffer_stream(MirScreencast *screencast)124MirBufferStream *mir_screencast_get_buffer_stream(MirScreencast *screencast)
125try125try
126{126{
127 return reinterpret_cast<MirBufferStream*>(screencast->get_buffer_stream());127 return screencast->get_buffer_stream();
128}128}
129catch (std::exception const& ex)129catch (std::exception const& ex)
130{130{
131131
=== modified file 'src/client/mir_surface.cpp'
--- src/client/mir_surface.cpp 2016-11-22 03:42:44 +0000
+++ src/client/mir_surface.cpp 2016-11-30 09:56:15 +0000
@@ -25,7 +25,7 @@
25#include "mir_toolkit/mir_client_library.h"25#include "mir_toolkit/mir_client_library.h"
26#include "mir/frontend/client_constants.h"26#include "mir/frontend/client_constants.h"
27#include "mir/client_buffer.h"27#include "mir/client_buffer.h"
28#include "mir/client_buffer_stream.h"28#include "mir/mir_buffer_stream.h"
29#include "mir/dispatch/threaded_dispatcher.h"29#include "mir/dispatch/threaded_dispatcher.h"
30#include "mir/input/input_platform.h"30#include "mir/input/input_platform.h"
31#include "mir/input/xkb_mapper.h"31#include "mir/input/xkb_mapper.h"
@@ -109,7 +109,7 @@
109 MirConnection *allocating_connection,109 MirConnection *allocating_connection,
110 mclr::DisplayServer& the_server,110 mclr::DisplayServer& the_server,
111 mclr::DisplayServerDebug* debug,111 mclr::DisplayServerDebug* debug,
112 std::shared_ptr<mcl::ClientBufferStream> const& buffer_stream,112 std::shared_ptr<MirBufferStream> const& buffer_stream,
113 std::shared_ptr<mircv::InputPlatform> const& input_platform,113 std::shared_ptr<mircv::InputPlatform> const& input_platform,
114 MirSurfaceSpec const& spec,114 MirSurfaceSpec const& spec,
115 mir::protobuf::Surface const& surface_proto,115 mir::protobuf::Surface const& surface_proto,
@@ -504,7 +504,7 @@
504 google::protobuf::NewCallback(google::protobuf::DoNothing));504 google::protobuf::NewCallback(google::protobuf::DoNothing));
505}505}
506506
507mir::client::ClientBufferStream* MirSurface::get_buffer_stream()507MirBufferStream* MirSurface::get_buffer_stream()
508{508{
509 std::lock_guard<decltype(mutex)> lock(mutex);509 std::lock_guard<decltype(mutex)> lock(mutex);
510 510
511511
=== modified file 'src/client/mir_surface.h'
--- src/client/mir_surface.h 2016-11-22 03:42:44 +0000
+++ src/client/mir_surface.h 2016-11-30 09:56:15 +0000
@@ -18,7 +18,7 @@
18#ifndef MIR_CLIENT_MIR_SURFACE_H_18#ifndef MIR_CLIENT_MIR_SURFACE_H_
19#define MIR_CLIENT_MIR_SURFACE_H_19#define MIR_CLIENT_MIR_SURFACE_H_
2020
21#include "mir/client_buffer_stream.h"21#include "mir/mir_buffer_stream.h"
22#include "mir_wait_handle.h"22#include "mir_wait_handle.h"
23#include "rpc/mir_display_server.h"23#include "rpc/mir_display_server.h"
24#include "rpc/mir_display_server_debug.h"24#include "rpc/mir_display_server_debug.h"
@@ -68,8 +68,7 @@
68}68}
6969
70class ClientBuffer;70class ClientBuffer;
71class ClientBufferStream;71class MirBufferStreamFactory;
72class ClientBufferStreamFactory;
7372
74struct MemoryRegion;73struct MemoryRegion;
75}74}
@@ -164,7 +163,7 @@
164 MirConnection *allocating_connection,163 MirConnection *allocating_connection,
165 mir::client::rpc::DisplayServer& server,164 mir::client::rpc::DisplayServer& server,
166 mir::client::rpc::DisplayServerDebug* debug,165 mir::client::rpc::DisplayServerDebug* debug,
167 std::shared_ptr<mir::client::ClientBufferStream> const& buffer_stream,166 std::shared_ptr<MirBufferStream> const& buffer_stream,
168 std::shared_ptr<mir::input::receiver::InputPlatform> const& input_platform,167 std::shared_ptr<mir::input::receiver::InputPlatform> const& input_platform,
169 MirSurfaceSpec const& spec, mir::protobuf::Surface const& surface_proto,168 MirSurfaceSpec const& spec, mir::protobuf::Surface const& surface_proto,
170 std::shared_ptr<MirWaitHandle> const& handle);169 std::shared_ptr<MirWaitHandle> const& handle);
@@ -198,7 +197,7 @@
198197
199 void request_and_wait_for_configure(MirSurfaceAttrib a, int value);198 void request_and_wait_for_configure(MirSurfaceAttrib a, int value);
200199
201 mir::client::ClientBufferStream* get_buffer_stream();200 MirBufferStream* get_buffer_stream();
202201
203 MirWaitHandle* modify(MirSurfaceSpec const& changes);202 MirWaitHandle* modify(MirSurfaceSpec const& changes);
204203
@@ -233,7 +232,7 @@
233 MirWaitHandle persistent_id_wait_handle;232 MirWaitHandle persistent_id_wait_handle;
234233
235 //Deprecated functions can cause MirSurfaces to be created with a default stream234 //Deprecated functions can cause MirSurfaces to be created with a default stream
236 std::shared_ptr<mir::client::ClientBufferStream> default_stream;235 std::shared_ptr<MirBufferStream> default_stream;
237 std::shared_ptr<mir::input::receiver::InputPlatform> const input_platform;236 std::shared_ptr<mir::input::receiver::InputPlatform> const input_platform;
238 std::shared_ptr<mir::input::receiver::XKBMapper> const keymapper;237 std::shared_ptr<mir::input::receiver::XKBMapper> const keymapper;
239238
240239
=== modified file 'src/client/mir_surface_api.cpp'
--- src/client/mir_surface_api.cpp 2016-11-17 21:37:04 +0000
+++ src/client/mir_surface_api.cpp 2016-11-30 09:56:15 +0000
@@ -524,7 +524,7 @@
524MirBufferStream *mir_surface_get_buffer_stream(MirSurface *surface)524MirBufferStream *mir_surface_get_buffer_stream(MirSurface *surface)
525try525try
526{526{
527 return reinterpret_cast<MirBufferStream*>(surface->get_buffer_stream());527 return surface->get_buffer_stream();
528}528}
529catch (std::exception const& ex)529catch (std::exception const& ex)
530{530{
@@ -576,7 +576,7 @@
576 mir::require(mir_buffer_stream_is_valid(streams[i].stream));576 mir::require(mir_buffer_stream_is_valid(streams[i].stream));
577 copy.emplace_back(ContentInfo{577 copy.emplace_back(ContentInfo{
578 mir::geometry::Displacement{streams[i].displacement_x, streams[i].displacement_y},578 mir::geometry::Displacement{streams[i].displacement_x, streams[i].displacement_y},
579 reinterpret_cast<mcl::ClientBufferStream*>(streams[i].stream)->rpc_id().as_value(),579 streams[i].stream->rpc_id().as_value(),
580 {}});580 {}});
581 }581 }
582 spec->streams = copy;582 spec->streams = copy;
@@ -616,8 +616,7 @@
616try616try
617{617{
618 mir::require(spec && stream);618 mir::require(spec && stream);
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}};
620 ContentInfo info{{displacement_x, displacement_y}, bs->rpc_id().as_value(), mir::geometry::Size{width, height}};
621620
622 if (spec->streams.is_set())621 if (spec->streams.is_set())
623 spec->streams.value().push_back(info);622 spec->streams.value().push_back(info);
624623
=== modified file 'src/client/render_surface.cpp'
--- src/client/render_surface.cpp 2016-11-22 18:44:52 +0000
+++ src/client/render_surface.cpp 2016-11-30 09:56:15 +0000
@@ -76,8 +76,7 @@
76 }76 }
77 }77 }
7878
79 return reinterpret_cast<MirBufferStream*>(79 return stream_from_id.get();
80 dynamic_cast<ClientBufferStream*>(stream_from_id.get()));
81}80}
8281
83geom::Size mcl::RenderSurface::size() const82geom::Size mcl::RenderSurface::size() const
8483
=== modified file 'src/client/rpc/mir_protobuf_rpc_channel.cpp'
--- src/client/rpc/mir_protobuf_rpc_channel.cpp 2016-11-15 20:53:57 +0000
+++ src/client/rpc/mir_protobuf_rpc_channel.cpp 2016-11-30 09:56:15 +0000
@@ -105,7 +105,7 @@
105 if (auto map = surface_map.lock()) 105 if (auto map = surface_map.lock())
106 {106 {
107 map->with_all_streams_do(107 map->with_all_streams_do(
108 [](mcl::ClientBufferStream* receiver) {108 [](MirBufferStream* receiver) {
109 if (receiver) receiver->buffer_unavailable();109 if (receiver) receiver->buffer_unavailable();
110 });110 });
111 }111 }
@@ -313,7 +313,7 @@
313 if (seq.buffer_request().has_id())313 if (seq.buffer_request().has_id())
314 {314 {
315 map->with_stream_do(mf::BufferStreamId(seq.buffer_request().id().value()),315 map->with_stream_do(mf::BufferStreamId(seq.buffer_request().id().value()),
316 [&] (mcl::ClientBufferStream* receiver) {316 [&] (MirBufferStream* receiver) {
317 receiver->buffer_available(seq.buffer_request().buffer());317 receiver->buffer_available(seq.buffer_request().buffer());
318 });318 });
319 }319 }
320320
=== modified file 'src/client/screencast_stream.h'
--- src/client/screencast_stream.h 2016-11-22 03:42:44 +0000
+++ src/client/screencast_stream.h 2016-11-30 09:56:15 +0000
@@ -22,7 +22,7 @@
22#include "mir_wait_handle.h"22#include "mir_wait_handle.h"
23#include "mir/egl_native_surface.h"23#include "mir/egl_native_surface.h"
24#include "mir/client_buffer.h"24#include "mir/client_buffer.h"
25#include "mir/client_buffer_stream.h"25#include "mir/mir_buffer_stream.h"
26#include "mir/geometry/size.h"26#include "mir/geometry/size.h"
2727
28#include "mir_toolkit/client_types.h"28#include "mir_toolkit/client_types.h"
@@ -63,7 +63,7 @@
63class ClientPlatform;63class ClientPlatform;
64class PerfReport;64class PerfReport;
65struct MemoryRegion;65struct MemoryRegion;
66class ScreencastStream : public EGLNativeSurface, public ClientBufferStream66class ScreencastStream : public EGLNativeSurface, public MirBufferStream
67{67{
68public:68public:
69 ScreencastStream(69 ScreencastStream(
7070
=== modified file 'src/client/surface_map.h'
--- src/client/surface_map.h 2016-07-18 07:38:38 +0000
+++ src/client/surface_map.h 2016-11-30 09:56:15 +0000
@@ -25,6 +25,7 @@
25#include <memory>25#include <memory>
2626
27struct MirSurface;27struct MirSurface;
28struct MirBufferStream;
2829
29namespace mir30namespace mir
30{31{
@@ -35,7 +36,6 @@
35namespace client36namespace client
36{37{
37class MirBuffer;38class MirBuffer;
38class ClientBufferStream;
3939
40class SurfaceMap40class SurfaceMap
41{41{
@@ -43,8 +43,8 @@
43 virtual void with_surface_do(43 virtual void with_surface_do(
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;
45 virtual void with_stream_do(45 virtual void with_stream_do(
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;
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;
48 virtual std::shared_ptr<MirBuffer> buffer(int buffer_id) const = 0;48 virtual std::shared_ptr<MirBuffer> buffer(int buffer_id) const = 0;
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;
50 virtual void erase(int buffer_id) = 0; 50 virtual void erase(int buffer_id) = 0;
5151
=== renamed file 'src/include/client/mir/client_buffer_stream.h' => 'src/include/client/mir/mir_buffer_stream.h'
--- src/include/client/mir/client_buffer_stream.h 2016-11-22 03:42:44 +0000
+++ src/include/client/mir/mir_buffer_stream.h 2016-11-30 09:56:15 +0000
@@ -16,8 +16,11 @@
16 * Authored by: Robert Carr <robert.carr@canonical.com>16 * Authored by: Robert Carr <robert.carr@canonical.com>
17 */17 */
1818
19#ifndef MIR_CLIENT_CLIENT_BUFFER_STREAM_H_19// MIR_MIR_? Yes.
20#define MIR_CLIENT_CLIENT_BUFFER_STREAM_H_20// The internal interface is mir/mir_buffer_stream.h
21// The public client API is mir_toolkit/mir_buffer_stream.h
22#ifndef MIR_MIR_BUFFER_STREAM_H_
23#define MIR_MIR_BUFFER_STREAM_H_
2124
22#include "mir/frontend/buffer_stream_id.h"25#include "mir/frontend/buffer_stream_id.h"
23#include "mir/geometry/size.h"26#include "mir/geometry/size.h"
@@ -30,7 +33,7 @@
30#include <EGL/eglplatform.h>33#include <EGL/eglplatform.h>
3134
32/*35/*
33 * ClientBufferStream::egl_native_window() returns EGLNativeWindowType.36 * MirBufferStream::egl_native_window() returns EGLNativeWindowType.
34 *37 *
35 * EGLNativeWindowType is an EGL platform-specific type that is typically a38 * EGLNativeWindowType is an EGL platform-specific type that is typically a
36 * (possibly slightly obfuscated) pointer. This makes our client module ABI39 * (possibly slightly obfuscated) pointer. This makes our client module ABI
@@ -48,7 +51,7 @@
48static_assert(51static_assert(
49 sizeof(EGLNativeWindowType) == sizeof(void*) &&52 sizeof(EGLNativeWindowType) == sizeof(void*) &&
50 std::is_pod<EGLNativeWindowType>::value,53 std::is_pod<EGLNativeWindowType>::value,
51 "The ClientBufferStream requires that EGLNativeWindowType be no-op convertible to void*");54 "The MirBufferStream requires that EGLNativeWindowType be no-op convertible to void*");
5255
53#undef EGLNativeWindowType56#undef EGLNativeWindowType
54#define EGLNativeWindowType void*57#define EGLNativeWindowType void*
@@ -66,19 +69,21 @@
66{69{
67class ClientBuffer;70class ClientBuffer;
68class MemoryRegion;71class MemoryRegion;
72}
73}
6974
70class ClientBufferStream75struct MirBufferStream
71{76{
72public:77public:
73 virtual ~ClientBufferStream() = default;78 virtual ~MirBufferStream() = default;
7479
75 virtual MirSurfaceParameters get_parameters() const = 0;80 virtual MirSurfaceParameters get_parameters() const = 0;
76 virtual std::shared_ptr<ClientBuffer> get_current_buffer() = 0;81 virtual std::shared_ptr<mir::client::ClientBuffer> get_current_buffer() = 0;
77 virtual uint32_t get_current_buffer_id() = 0;82 virtual uint32_t get_current_buffer_id() = 0;
78 virtual EGLNativeWindowType egl_native_window() = 0;83 virtual EGLNativeWindowType egl_native_window() = 0;
79 virtual MirWaitHandle* next_buffer(std::function<void()> const& done) = 0;84 virtual MirWaitHandle* next_buffer(std::function<void()> const& done) = 0;
8085
81 virtual std::shared_ptr<MemoryRegion> secure_for_cpu_write() = 0;86 virtual std::shared_ptr<mir::client::MemoryRegion> secure_for_cpu_write() = 0;
8287
83 virtual int swap_interval() const = 0;88 virtual int swap_interval() const = 0;
84 virtual MirWaitHandle* set_swap_interval(int interval) = 0;89 virtual MirWaitHandle* set_swap_interval(int interval) = 0;
@@ -86,11 +91,11 @@
86 virtual MirNativeBuffer* get_current_buffer_package() = 0;91 virtual MirNativeBuffer* get_current_buffer_package() = 0;
87 virtual MirPlatformType platform_type() = 0;92 virtual MirPlatformType platform_type() = 0;
8893
89 virtual frontend::BufferStreamId rpc_id() const = 0;94 virtual mir::frontend::BufferStreamId rpc_id() const = 0;
90 95
91 virtual bool valid() const = 0;96 virtual bool valid() const = 0;
92 virtual void set_size(geometry::Size) = 0;97 virtual void set_size(mir::geometry::Size) = 0;
93 virtual geometry::Size size() const = 0;98 virtual mir::geometry::Size size() const = 0;
94 virtual MirWaitHandle* set_scale(float) = 0;99 virtual MirWaitHandle* set_scale(float) = 0;
95 virtual char const* get_error_message() const = 0;100 virtual char const* get_error_message() const = 0;
96 virtual MirConnection* connection() const = 0;101 virtual MirConnection* connection() const = 0;
@@ -99,12 +104,9 @@
99 virtual void buffer_available(mir::protobuf::Buffer const& buffer) = 0;104 virtual void buffer_available(mir::protobuf::Buffer const& buffer) = 0;
100 virtual void buffer_unavailable() = 0;105 virtual void buffer_unavailable() = 0;
101protected:106protected:
102 ClientBufferStream() = default;107 MirBufferStream() = default;
103 ClientBufferStream(const ClientBufferStream&) = delete;108 MirBufferStream(const MirBufferStream&) = delete;
104 ClientBufferStream& operator=(const ClientBufferStream&) = delete;109 MirBufferStream& operator=(const MirBufferStream&) = delete;
105};110};
106111
107}112#endif /* MIR_MIR_BUFFER_STREAM_H_ */
108}
109
110#endif /* MIR_CLIENT_CLIENT_BUFFER_STREAM_H_ */
111113
=== modified file 'src/platforms/android/client/android_client_platform.cpp'
--- src/platforms/android/client/android_client_platform.cpp 2016-11-23 04:37:50 +0000
+++ src/platforms/android/client/android_client_platform.cpp 2016-11-30 09:56:15 +0000
@@ -22,7 +22,7 @@
22#include "mir/client_context.h"22#include "mir/client_context.h"
23#include "mir/mir_buffer.h"23#include "mir/mir_buffer.h"
24#include "mir/client_buffer.h"24#include "mir/client_buffer.h"
25#include "mir/client_buffer_stream.h"25#include "mir/mir_buffer_stream.h"
26#include "android_client_platform.h"26#include "android_client_platform.h"
27#include "gralloc_registrar.h"27#include "gralloc_registrar.h"
28#include "android_client_buffer_factory.h"28#include "android_client_buffer_factory.h"
@@ -66,8 +66,7 @@
6666
67ANativeWindow* create_anw(MirBufferStream* buffer_stream)67ANativeWindow* create_anw(MirBufferStream* buffer_stream)
68{68{
69 mcl::ClientBufferStream *bs = reinterpret_cast<mcl::ClientBufferStream*>(buffer_stream);69 return static_cast<ANativeWindow*>(buffer_stream->egl_native_window());
70 return static_cast<ANativeWindow*>(bs->egl_native_window());
71}70}
7271
73void destroy_anw(ANativeWindow*)72void destroy_anw(ANativeWindow*)
7473
=== renamed file 'tests/include/mir/test/doubles/mock_client_buffer_stream.h' => 'tests/include/mir/test/doubles/mock_mir_buffer_stream.h'
--- tests/include/mir/test/doubles/mock_client_buffer_stream.h 2016-11-22 03:42:44 +0000
+++ tests/include/mir/test/doubles/mock_mir_buffer_stream.h 2016-11-30 09:56:15 +0000
@@ -16,10 +16,10 @@
16 * Authored by: Robert Carr <robert.carr@canonical.com>16 * Authored by: Robert Carr <robert.carr@canonical.com>
17 */17 */
1818
19#ifndef MIR_TEST_DOUBLES_MOCK_CLIENT_BUFFER_STREAM_H_19#ifndef MIR_TEST_DOUBLES_MOCK_MIR_BUFFER_STREAM_H_
20#define MIR_TEST_DOUBLES_MOCK_CLIENT_BUFFER_STREAM_H_20#define MIR_TEST_DOUBLES_MOCK_MIR_BUFFER_STREAM_H_
2121
22#include "src/include/client/mir/client_buffer_stream.h"22#include "src/include/client/mir/mir_buffer_stream.h"
2323
24#include <gmock/gmock.h>24#include <gmock/gmock.h>
2525
@@ -30,7 +30,7 @@
30namespace doubles30namespace doubles
31{31{
3232
33struct MockClientBufferStream : public client::ClientBufferStream33struct MockMirBufferStream : public MirBufferStream
34{34{
35 MOCK_METHOD2(release, MirWaitHandle*(mir_buffer_stream_callback, void*));35 MOCK_METHOD2(release, MirWaitHandle*(mir_buffer_stream_callback, void*));
36 36
@@ -61,4 +61,4 @@
61}61}
62}62}
6363
64#endif // MIR_TEST_DOUBLES_MOCK_CLIENT_BUFFER_STREAM_H_64#endif // MIR_TEST_DOUBLES_MOCK_MIR_BUFFER_STREAM_H_
6565
=== modified file 'tests/unit-tests/client/test_client_mir_surface.cpp'
--- tests/unit-tests/client/test_client_mir_surface.cpp 2016-11-09 02:30:14 +0000
+++ tests/unit-tests/client/test_client_mir_surface.cpp 2016-11-30 09:56:15 +0000
@@ -52,7 +52,7 @@
52#include <boost/throw_exception.hpp>52#include <boost/throw_exception.hpp>
53#include "mir/test/doubles/stub_client_buffer_factory.h"53#include "mir/test/doubles/stub_client_buffer_factory.h"
54#include "mir/test/doubles/stub_buffer_stream.h"54#include "mir/test/doubles/stub_buffer_stream.h"
55#include "mir/test/doubles/mock_client_buffer_stream.h"55#include "mir/test/doubles/mock_mir_buffer_stream.h"
5656
57#include "mir_test_framework/stub_client_platform_factory.h"57#include "mir_test_framework/stub_client_platform_factory.h"
5858
@@ -329,7 +329,7 @@
329329
330 std::shared_ptr<MirSurface> create_surface_with(330 std::shared_ptr<MirSurface> create_surface_with(
331 mclr::DisplayServer& server_stub,331 mclr::DisplayServer& server_stub,
332 std::shared_ptr<mcl::ClientBufferStream> const& buffer_stream)332 std::shared_ptr<MirBufferStream> const& buffer_stream)
333 {333 {
334 return std::make_shared<MirSurface>(334 return std::make_shared<MirSurface>(
335 connection.get(),335 connection.get(),
@@ -351,7 +351,7 @@
351351
352 std::shared_ptr<MirSurface> create_and_wait_for_surface_with(352 std::shared_ptr<MirSurface> create_and_wait_for_surface_with(
353 mclr::DisplayServer& server_stub,353 mclr::DisplayServer& server_stub,
354 std::shared_ptr<mcl::ClientBufferStream> const& buffer_stream)354 std::shared_ptr<MirBufferStream> const& buffer_stream)
355 {355 {
356 auto surface = create_surface_with(server_stub, buffer_stream);356 auto surface = create_surface_with(server_stub, buffer_stream);
357 return surface;357 return surface;
@@ -360,7 +360,7 @@
360 std::shared_ptr<MirConnection> connection;360 std::shared_ptr<MirConnection> connection;
361361
362 MirSurfaceSpec const spec{nullptr, 33, 45, mir_pixel_format_abgr_8888};362 MirSurfaceSpec const spec{nullptr, 33, 45, mir_pixel_format_abgr_8888};
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>()};
364 std::shared_ptr<StubClientInputPlatform> const input_platform =364 std::shared_ptr<StubClientInputPlatform> const input_platform =
365 std::make_shared<StubClientInputPlatform>();365 std::make_shared<StubClientInputPlatform>();
366 std::shared_ptr<MockServerPackageGenerator> const mock_server_tool =366 std::shared_ptr<MockServerPackageGenerator> const mock_server_tool =
@@ -494,7 +494,7 @@
494TEST_F(MirClientSurfaceTest, resizes_streams_and_calls_callback_if_no_customized_streams)494TEST_F(MirClientSurfaceTest, resizes_streams_and_calls_callback_if_no_customized_streams)
495{495{
496 using namespace testing;496 using namespace testing;
497 auto mock_stream = std::make_shared<mtd::MockClientBufferStream>(); 497 auto mock_stream = std::make_shared<mtd::MockMirBufferStream>();
498 auto mock_input_platform = std::make_shared<NiceMock<MockClientInputPlatform>>();498 auto mock_input_platform = std::make_shared<NiceMock<MockClientInputPlatform>>();
499 ON_CALL(*mock_input_platform, create_input_receiver(_,_,_))499 ON_CALL(*mock_input_platform, create_input_receiver(_,_,_))
500 .WillByDefault(Return(std::make_shared<mt::TestDispatchable>([]{})));500 .WillByDefault(Return(std::make_shared<mt::TestDispatchable>([]{})));
@@ -513,7 +513,7 @@
513TEST_F(MirClientSurfaceTest, resizes_streams_and_calls_callback_if_customized_streams)513TEST_F(MirClientSurfaceTest, resizes_streams_and_calls_callback_if_customized_streams)
514{514{
515 using namespace testing;515 using namespace testing;
516 auto mock_stream = std::make_shared<NiceMock<mtd::MockClientBufferStream>>();516 auto mock_stream = std::make_shared<NiceMock<mtd::MockMirBufferStream>>();
517 auto mock_input_platform = std::make_shared<NiceMock<MockClientInputPlatform>>();517 auto mock_input_platform = std::make_shared<NiceMock<MockClientInputPlatform>>();
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)));
519 ON_CALL(*mock_input_platform, create_input_receiver(_,_,_))519 ON_CALL(*mock_input_platform, create_input_receiver(_,_,_))
@@ -537,7 +537,7 @@
537TEST_F(MirClientSurfaceTest, parameters_are_unhooked_from_stream_sizes)537TEST_F(MirClientSurfaceTest, parameters_are_unhooked_from_stream_sizes)
538{538{
539 using namespace testing;539 using namespace testing;
540 auto mock_stream = std::make_shared<mtd::MockClientBufferStream>(); 540 auto mock_stream = std::make_shared<mtd::MockMirBufferStream>();
541 auto mock_input_platform = std::make_shared<NiceMock<MockClientInputPlatform>>();541 auto mock_input_platform = std::make_shared<NiceMock<MockClientInputPlatform>>();
542 ON_CALL(*mock_input_platform, create_input_receiver(_,_,_))542 ON_CALL(*mock_input_platform, create_input_receiver(_,_,_))
543 .WillByDefault(Return(std::make_shared<mt::TestDispatchable>([]{})));543 .WillByDefault(Return(std::make_shared<mt::TestDispatchable>([]{})));
@@ -565,7 +565,7 @@
565TEST_F(MirClientSurfaceTest, initial_sizes_are_from_response_from_server)565TEST_F(MirClientSurfaceTest, initial_sizes_are_from_response_from_server)
566{566{
567 using namespace testing;567 using namespace testing;
568 auto mock_stream = std::make_shared<mtd::MockClientBufferStream>(); 568 auto mock_stream = std::make_shared<mtd::MockMirBufferStream>();
569 auto mock_input_platform = std::make_shared<NiceMock<MockClientInputPlatform>>();569 auto mock_input_platform = std::make_shared<NiceMock<MockClientInputPlatform>>();
570 ON_CALL(*mock_input_platform, create_input_receiver(_,_,_))570 ON_CALL(*mock_input_platform, create_input_receiver(_,_,_))
571 .WillByDefault(Return(std::make_shared<mt::TestDispatchable>([]{})));571 .WillByDefault(Return(std::make_shared<mt::TestDispatchable>([]{})));
572572
=== modified file 'tests/unit-tests/client/test_connection_resource_map.cpp'
--- tests/unit-tests/client/test_connection_resource_map.cpp 2016-11-14 15:44:53 +0000
+++ tests/unit-tests/client/test_connection_resource_map.cpp 2016-11-30 09:56:15 +0000
@@ -20,7 +20,7 @@
20#include "src/client/mir_surface.h"20#include "src/client/mir_surface.h"
21#include "src/client/presentation_chain.h"21#include "src/client/presentation_chain.h"
22#include "src/client/render_surface.h"22#include "src/client/render_surface.h"
23#include "mir/test/doubles/mock_client_buffer_stream.h"23#include "mir/test/doubles/mock_mir_buffer_stream.h"
24#include "mir/test/doubles/mock_protobuf_server.h"24#include "mir/test/doubles/mock_protobuf_server.h"
25#include <gtest/gtest.h>25#include <gtest/gtest.h>
2626
@@ -38,7 +38,7 @@
38{38{
39 std::shared_ptr<MirWaitHandle> wh { std::make_shared<MirWaitHandle>() };39 std::shared_ptr<MirWaitHandle> wh { std::make_shared<MirWaitHandle>() };
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)};
41 std::shared_ptr<mcl::ClientBufferStream> stream{ std::make_shared<mtd::MockClientBufferStream>() }; 41 std::shared_ptr<MirBufferStream> stream{ std::make_shared<mtd::MockMirBufferStream>() };
42 std::shared_ptr<mcl::Buffer> buffer {42 std::shared_ptr<mcl::Buffer> buffer {
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) };
44 mtd::MockProtobufServer mock_server;44 mtd::MockProtobufServer mock_server;
@@ -74,7 +74,7 @@
74 map.insert(surface_id, surface);74 map.insert(surface_id, surface);
75 map.erase(surface_id);75 map.erase(surface_id);
76 EXPECT_THROW({76 EXPECT_THROW({
77 map.with_stream_do(stream_id, [](mcl::ClientBufferStream*){});77 map.with_stream_do(stream_id, [](MirBufferStream*){});
78 }, std::runtime_error);78 }, std::runtime_error);
79}79}
8080
@@ -84,7 +84,7 @@
84 auto stream_called = false;84 auto stream_called = false;
85 mcl::ConnectionSurfaceMap map;85 mcl::ConnectionSurfaceMap map;
86 map.insert(stream_id, stream);86 map.insert(stream_id, stream);
87 map.with_stream_do(stream_id, [&](mcl::ClientBufferStream* str) {87 map.with_stream_do(stream_id, [&](MirBufferStream* str) {
88 EXPECT_THAT(str, Eq(stream.get()));88 EXPECT_THAT(str, Eq(stream.get()));
89 stream_called = true;89 stream_called = true;
90 });90 });
9191
=== modified file 'tests/unit-tests/client/test_mir_screencast.cpp'
--- tests/unit-tests/client/test_mir_screencast.cpp 2016-07-18 07:38:38 +0000
+++ tests/unit-tests/client/test_mir_screencast.cpp 2016-11-30 09:56:15 +0000
@@ -22,7 +22,7 @@
22#include "mir/client_buffer_factory.h"22#include "mir/client_buffer_factory.h"
23#include "mir/client_platform.h"23#include "mir/client_platform.h"
2424
25#include "mir/test/doubles/mock_client_buffer_stream.h"25#include "mir/test/doubles/mock_mir_buffer_stream.h"
26#include "mir/test/doubles/null_client_buffer.h"26#include "mir/test/doubles/null_client_buffer.h"
27#include "mir/test/doubles/stub_display_server.h"27#include "mir/test/doubles/stub_display_server.h"
28#include "mir/test/fake_shared.h"28#include "mir/test/fake_shared.h"
@@ -179,7 +179,7 @@
179 mir::geometry::Rectangle default_region;179 mir::geometry::Rectangle default_region;
180 MirPixelFormat default_pixel_format;180 MirPixelFormat default_pixel_format;
181 MirScreencastSpec default_spec;181 MirScreencastSpec default_spec;
182 mtd::MockClientBufferStream mock_bs;182 mtd::MockMirBufferStream mock_bs;
183};183};
184184
185}185}
186186
=== modified file 'tests/unit-tests/client/test_protobuf_rpc_channel.cpp'
--- tests/unit-tests/client/test_protobuf_rpc_channel.cpp 2016-11-24 09:45:22 +0000
+++ tests/unit-tests/client/test_protobuf_rpc_channel.cpp 2016-11-30 09:56:15 +0000
@@ -32,7 +32,7 @@
32#include "mir/input/input_devices.h"32#include "mir/input/input_devices.h"
3333
34#include "mir/test/doubles/null_client_event_sink.h"34#include "mir/test/doubles/null_client_event_sink.h"
35#include "mir/test/doubles/mock_client_buffer_stream.h"35#include "mir/test/doubles/mock_mir_buffer_stream.h"
36#include "mir/test/doubles/mock_client_buffer.h"36#include "mir/test/doubles/mock_client_buffer.h"
37#include "mir/test/fd_utils.h"37#include "mir/test/fd_utils.h"
38#include "mir/test/gmock_fixes.h"38#include "mir/test/gmock_fixes.h"
@@ -62,9 +62,9 @@
62 MOCK_CONST_METHOD2(with_surface_do,62 MOCK_CONST_METHOD2(with_surface_do,
63 void(mir::frontend::SurfaceId, std::function<void(MirSurface*)> const&));63 void(mir::frontend::SurfaceId, std::function<void(MirSurface*)> const&));
64 MOCK_CONST_METHOD2(with_stream_do,64 MOCK_CONST_METHOD2(with_stream_do,
65 void(mir::frontend::BufferStreamId, std::function<void(mcl::ClientBufferStream*)> const&));65 void(mir::frontend::BufferStreamId, std::function<void(MirBufferStream*)> const&));
66 MOCK_CONST_METHOD1(with_all_streams_do,66 MOCK_CONST_METHOD1(with_all_streams_do,
67 void(std::function<void(mcl::ClientBufferStream*)> const&));67 void(std::function<void(MirBufferStream*)> const&));
68 MOCK_CONST_METHOD1(buffer, std::shared_ptr<mcl::MirBuffer>(int));68 MOCK_CONST_METHOD1(buffer, std::shared_ptr<mcl::MirBuffer>(int));
69 MOCK_METHOD2(insert, void(int, std::shared_ptr<mcl::MirBuffer> const&));69 MOCK_METHOD2(insert, void(int, std::shared_ptr<mcl::MirBuffer> const&));
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&));
@@ -79,10 +79,10 @@
79 {79 {
80 }80 }
81 void with_stream_do(81 void with_stream_do(
82 mir::frontend::BufferStreamId, std::function<void(mcl::ClientBufferStream*)> const&) const override82 mir::frontend::BufferStreamId, std::function<void(MirBufferStream*)> const&) const override
83 {83 {
84 }84 }
85 void with_all_streams_do(std::function<void(mcl::ClientBufferStream*)> const&) const override85 void with_all_streams_do(std::function<void(MirBufferStream*)> const&) const override
86 {86 {
87 }87 }
88 void insert(mir::frontend::BufferStreamId, std::shared_ptr<MirPresentationChain> const&)88 void insert(mir::frontend::BufferStreamId, std::shared_ptr<MirPresentationChain> const&)
@@ -254,7 +254,7 @@
254 MockStreamTransport* transport;254 MockStreamTransport* transport;
255 std::shared_ptr<mcl::LifecycleControl> lifecycle;255 std::shared_ptr<mcl::LifecycleControl> lifecycle;
256 std::shared_ptr<mclr::MirProtobufRpcChannel> channel;256 std::shared_ptr<mclr::MirProtobufRpcChannel> channel;
257 mtd::MockClientBufferStream stream;257 mtd::MockMirBufferStream stream;
258};258};
259259
260}260}

Subscribers

People subscribed via source and target branches