Merge lp:~kdub/mir/more-const-in-mirbuffer into lp:mir
- more-const-in-mirbuffer
- Merge into development-branch
Proposed by
Kevin DuBois
Status: | Merged |
---|---|
Approved by: | Daniel van Vugt |
Approved revision: | no longer in the source branch. |
Merged at revision: | 4089 |
Proposed branch: | lp:~kdub/mir/more-const-in-mirbuffer |
Merge into: | lp:mir |
Prerequisite: | lp:~kdub/mir/gbm-ext-v2 |
Diff against target: |
377 lines (+45/-45) 6 files modified
include/client/mir_toolkit/extensions/android_buffer.h (+5/-5) include/client/mir_toolkit/extensions/gbm_buffer.h (+6/-6) include/client/mir_toolkit/mir_buffer.h (+5/-5) src/client/mir_buffer_api.cpp (+10/-10) src/platforms/android/client/android_client_platform.cpp (+7/-7) src/platforms/mesa/client/client_platform.cpp (+12/-12) |
To merge this branch: | bzr merge lp:~kdub/mir/more-const-in-mirbuffer |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Daniel van Vugt | Approve | ||
Cemil Azizoglu (community) | Approve | ||
Mir CI Bot | continuous-integration | Approve | |
Review via email: mp+319811@code.launchpad.net |
Commit message
add more const fields to MirBuffer extensions and api.
Description of the change
add more const fields to MirBuffer extensions and api. Adding const to parameters doesn't break abi or api. (removing them would break api, but no removals here)
To post a comment you must log in.
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote : | # |
review:
Approve
(continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote : | # |
Woo, free consts for everybody.
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'include/client/mir_toolkit/extensions/android_buffer.h' | |||
2 | --- include/client/mir_toolkit/extensions/android_buffer.h 2017-03-14 04:41:33 +0000 | |||
3 | +++ include/client/mir_toolkit/extensions/android_buffer.h 2017-03-14 12:31:32 +0000 | |||
4 | @@ -89,7 +89,7 @@ | |||
5 | 89 | * \param [in] buffer The buffer | 89 | * \param [in] buffer The buffer |
6 | 90 | * \return True if suitable, false if unsuitable | 90 | * \return True if suitable, false if unsuitable |
7 | 91 | */ | 91 | */ |
9 | 92 | typedef bool (*MirBufferIsAndroidCompatible)(MirBuffer* buffer); | 92 | typedef bool (*MirBufferIsAndroidCompatible)(MirBuffer const* buffer); |
10 | 93 | 93 | ||
11 | 94 | /** Access the data from the native_handle_t of the MirBuffer | 94 | /** Access the data from the native_handle_t of the MirBuffer |
12 | 95 | * \warning Take care not to close any of the fds. | 95 | * \warning Take care not to close any of the fds. |
13 | @@ -101,7 +101,7 @@ | |||
14 | 101 | * \param [out] data The data | 101 | * \param [out] data The data |
15 | 102 | */ | 102 | */ |
16 | 103 | typedef void (*MirBufferAndroidNativeHandle)( | 103 | typedef void (*MirBufferAndroidNativeHandle)( |
18 | 104 | MirBuffer* buffer, | 104 | MirBuffer const* buffer, |
19 | 105 | int* num_fds, int const** fds, | 105 | int* num_fds, int const** fds, |
20 | 106 | int* num_data, int const** data); | 106 | int* num_data, int const** data); |
21 | 107 | 107 | ||
22 | @@ -111,7 +111,7 @@ | |||
23 | 111 | * \return The hal_pixel_format of the buffer | 111 | * \return The hal_pixel_format of the buffer |
24 | 112 | */ | 112 | */ |
25 | 113 | typedef unsigned int (*MirBufferAndroidHalPixelFormat)( | 113 | typedef unsigned int (*MirBufferAndroidHalPixelFormat)( |
27 | 114 | MirBuffer* buffer); | 114 | MirBuffer const* buffer); |
28 | 115 | 115 | ||
29 | 116 | /** Access the GRALLOC_USAGE_FLAGS of the buffer | 116 | /** Access the GRALLOC_USAGE_FLAGS of the buffer |
30 | 117 | * \pre The buffer is suitable for android use | 117 | * \pre The buffer is suitable for android use |
31 | @@ -119,7 +119,7 @@ | |||
32 | 119 | * \return The gralloc_usage of the buffer | 119 | * \return The gralloc_usage of the buffer |
33 | 120 | */ | 120 | */ |
34 | 121 | typedef unsigned int (*MirBufferAndroidGrallocUsage)( | 121 | typedef unsigned int (*MirBufferAndroidGrallocUsage)( |
36 | 122 | MirBuffer* buffer); | 122 | MirBuffer const* buffer); |
37 | 123 | 123 | ||
38 | 124 | /** Access the stride in bytes of the buffer | 124 | /** Access the stride in bytes of the buffer |
39 | 125 | * \pre The buffer is suitable for android use | 125 | * \pre The buffer is suitable for android use |
40 | @@ -127,7 +127,7 @@ | |||
41 | 127 | * \return The stride of the buffer | 127 | * \return The stride of the buffer |
42 | 128 | */ | 128 | */ |
43 | 129 | typedef unsigned int (*MirBufferAndroidStride)( | 129 | typedef unsigned int (*MirBufferAndroidStride)( |
45 | 130 | MirBuffer* buffer); | 130 | MirBuffer const* buffer); |
46 | 131 | 131 | ||
47 | 132 | /** Increase refcount of the ANativeWindowBuffer | 132 | /** Increase refcount of the ANativeWindowBuffer |
48 | 133 | * \pre The buffer is suitable for android use | 133 | * \pre The buffer is suitable for android use |
49 | 134 | 134 | ||
50 | === modified file 'include/client/mir_toolkit/extensions/gbm_buffer.h' | |||
51 | --- include/client/mir_toolkit/extensions/gbm_buffer.h 2017-03-14 12:31:32 +0000 | |||
52 | +++ include/client/mir_toolkit/extensions/gbm_buffer.h 2017-03-14 12:31:32 +0000 | |||
53 | @@ -98,7 +98,7 @@ | |||
54 | 98 | * \param [in] buffer The buffer | 98 | * \param [in] buffer The buffer |
55 | 99 | * \return True if suitable, false if unsuitable | 99 | * \return True if suitable, false if unsuitable |
56 | 100 | */ | 100 | */ |
58 | 101 | typedef bool (*MirBufferIsGbmImportable)(MirBuffer* buffer); | 101 | typedef bool (*MirBufferIsGbmImportable)(MirBuffer const* buffer); |
59 | 102 | 102 | ||
60 | 103 | /** Access the fd a MirBuffer suitable for gbm import | 103 | /** Access the fd a MirBuffer suitable for gbm import |
61 | 104 | * \pre The buffer is suitable for GBM_BO_IMPORT_FD | 104 | * \pre The buffer is suitable for GBM_BO_IMPORT_FD |
62 | @@ -106,35 +106,35 @@ | |||
63 | 106 | * \param [in] buffer The buffer | 106 | * \param [in] buffer The buffer |
64 | 107 | * \return The fd | 107 | * \return The fd |
65 | 108 | */ | 108 | */ |
67 | 109 | typedef int (*MirBufferGbmFd)(MirBuffer* buffer); | 109 | typedef int (*MirBufferGbmFd)(MirBuffer const* buffer); |
68 | 110 | 110 | ||
69 | 111 | /** Get the stride of a MirBuffer | 111 | /** Get the stride of a MirBuffer |
70 | 112 | * \pre The buffer is suitable for GBM_BO_IMPORT_FD | 112 | * \pre The buffer is suitable for GBM_BO_IMPORT_FD |
71 | 113 | * \param [in] buffer The buffer | 113 | * \param [in] buffer The buffer |
72 | 114 | * \return The stride of the buffer | 114 | * \return The stride of the buffer |
73 | 115 | */ | 115 | */ |
75 | 116 | typedef uint32_t (*MirBufferGbmStride)(MirBuffer* buffer); | 116 | typedef uint32_t (*MirBufferGbmStride)(MirBuffer const* buffer); |
76 | 117 | 117 | ||
77 | 118 | /** Get the GBM_FORMAT of a MirBuffer | 118 | /** Get the GBM_FORMAT of a MirBuffer |
78 | 119 | * \pre The buffer is suitable for GBM_BO_IMPORT_FD | 119 | * \pre The buffer is suitable for GBM_BO_IMPORT_FD |
79 | 120 | * \param [in] buffer The buffer | 120 | * \param [in] buffer The buffer |
80 | 121 | * \return The GBM_FORMAT of the buffer | 121 | * \return The GBM_FORMAT of the buffer |
81 | 122 | */ | 122 | */ |
83 | 123 | typedef uint32_t (*MirBufferGbmFormat)(MirBuffer* buffer); | 123 | typedef uint32_t (*MirBufferGbmFormat)(MirBuffer const* buffer); |
84 | 124 | 124 | ||
85 | 125 | /** Get the gbm_bo_flags of a MirBuffer | 125 | /** Get the gbm_bo_flags of a MirBuffer |
86 | 126 | * \pre The buffer is suitable for GBM_BO_IMPORT_FD | 126 | * \pre The buffer is suitable for GBM_BO_IMPORT_FD |
87 | 127 | * \param [in] buffer The buffer | 127 | * \param [in] buffer The buffer |
88 | 128 | * \return The gbm_bo_flags of the buffer | 128 | * \return The gbm_bo_flags of the buffer |
89 | 129 | */ | 129 | */ |
91 | 130 | typedef uint32_t (*MirBufferGbmFlags)(MirBuffer* buffer); | 130 | typedef uint32_t (*MirBufferGbmFlags)(MirBuffer const* buffer); |
92 | 131 | 131 | ||
93 | 132 | /** Get the age of a MirBuffer | 132 | /** Get the age of a MirBuffer |
94 | 133 | * \pre The buffer is suitable for GBM_BO_IMPORT_FD | 133 | * \pre The buffer is suitable for GBM_BO_IMPORT_FD |
95 | 134 | * \param [in] buffer The buffer | 134 | * \param [in] buffer The buffer |
96 | 135 | * \return The age of the buffer | 135 | * \return The age of the buffer |
97 | 136 | */ | 136 | */ |
99 | 137 | typedef unsigned int (*MirBufferGbmAge)(MirBuffer* buffer); | 137 | typedef unsigned int (*MirBufferGbmAge)(MirBuffer const* buffer); |
100 | 138 | 138 | ||
101 | 139 | typedef struct MirExtensionGbmBufferV2 | 139 | typedef struct MirExtensionGbmBufferV2 |
102 | 140 | { | 140 | { |
103 | 141 | 141 | ||
104 | === modified file 'include/client/mir_toolkit/mir_buffer.h' | |||
105 | --- include/client/mir_toolkit/mir_buffer.h 2017-03-10 19:47:57 +0000 | |||
106 | +++ include/client/mir_toolkit/mir_buffer.h 2017-03-14 12:31:32 +0000 | |||
107 | @@ -68,7 +68,7 @@ | |||
108 | 68 | * \param [in] buffer The buffer | 68 | * \param [in] buffer The buffer |
109 | 69 | * \return True if the buffer is valid, or false otherwise. | 69 | * \return True if the buffer is valid, or false otherwise. |
110 | 70 | **/ | 70 | **/ |
112 | 71 | bool mir_buffer_is_valid(MirBuffer* buffer); | 71 | bool mir_buffer_is_valid(MirBuffer const* buffer); |
113 | 72 | 72 | ||
114 | 73 | /** Retrieve a text description an error associated with a MirBuffer. | 73 | /** Retrieve a text description an error associated with a MirBuffer. |
115 | 74 | * The returned string is owned by the library and remains valid until the | 74 | * The returned string is owned by the library and remains valid until the |
116 | @@ -78,7 +78,7 @@ | |||
117 | 78 | * invalid buffer, or the empty string "" if the | 78 | * invalid buffer, or the empty string "" if the |
118 | 79 | * connection is valid. | 79 | * connection is valid. |
119 | 80 | **/ | 80 | **/ |
121 | 81 | char const *mir_buffer_get_error_message(MirBuffer* buffer); | 81 | char const *mir_buffer_get_error_message(MirBuffer const* buffer); |
122 | 82 | 82 | ||
123 | 83 | /** | 83 | /** |
124 | 84 | * Access the MirBufferPackage | 84 | * Access the MirBufferPackage |
125 | @@ -111,21 +111,21 @@ | |||
126 | 111 | * \param [in] buffer The buffer | 111 | * \param [in] buffer The buffer |
127 | 112 | * \return The width of the buffer in pixels | 112 | * \return The width of the buffer in pixels |
128 | 113 | **/ | 113 | **/ |
130 | 114 | unsigned int mir_buffer_get_width(MirBuffer* buffer); | 114 | unsigned int mir_buffer_get_width(MirBuffer const* buffer); |
131 | 115 | 115 | ||
132 | 116 | /** Retrieve the height of the buffer in pixels. | 116 | /** Retrieve the height of the buffer in pixels. |
133 | 117 | * | 117 | * |
134 | 118 | * \param [in] buffer The buffer | 118 | * \param [in] buffer The buffer |
135 | 119 | * \return The height of the buffer in pixels | 119 | * \return The height of the buffer in pixels |
136 | 120 | **/ | 120 | **/ |
138 | 121 | unsigned int mir_buffer_get_height(MirBuffer* buffer); | 121 | unsigned int mir_buffer_get_height(MirBuffer const* buffer); |
139 | 122 | 122 | ||
140 | 123 | /** Retrieve the pixel format of the buffer. | 123 | /** Retrieve the pixel format of the buffer. |
141 | 124 | * | 124 | * |
142 | 125 | * \param [in] buffer The buffer | 125 | * \param [in] buffer The buffer |
143 | 126 | * \return The pixel format of the buffer | 126 | * \return The pixel format of the buffer |
144 | 127 | **/ | 127 | **/ |
146 | 128 | MirPixelFormat mir_buffer_get_pixel_format(MirBuffer* buffer); | 128 | MirPixelFormat mir_buffer_get_pixel_format(MirBuffer const* buffer); |
147 | 129 | 129 | ||
148 | 130 | /** @} */ | 130 | /** @} */ |
149 | 131 | 131 | ||
150 | 132 | 132 | ||
151 | === modified file 'src/client/mir_buffer_api.cpp' | |||
152 | --- src/client/mir_buffer_api.cpp 2017-03-10 19:47:57 +0000 | |||
153 | +++ src/client/mir_buffer_api.cpp 2017-03-14 12:31:32 +0000 | |||
154 | @@ -129,11 +129,11 @@ | |||
155 | 129 | MIR_LOG_UNCAUGHT_EXCEPTION(ex); | 129 | MIR_LOG_UNCAUGHT_EXCEPTION(ex); |
156 | 130 | } | 130 | } |
157 | 131 | 131 | ||
159 | 132 | unsigned int mir_buffer_get_width(MirBuffer* b) | 132 | unsigned int mir_buffer_get_width(MirBuffer const* b) |
160 | 133 | try | 133 | try |
161 | 134 | { | 134 | { |
162 | 135 | mir::require(b); | 135 | mir::require(b); |
164 | 136 | auto buffer = reinterpret_cast<mcl::MirBuffer*>(b); | 136 | auto const buffer = reinterpret_cast<mcl::MirBuffer const*>(b); |
165 | 137 | return buffer->size().width.as_uint32_t(); | 137 | return buffer->size().width.as_uint32_t(); |
166 | 138 | } | 138 | } |
167 | 139 | catch (std::exception const& ex) | 139 | catch (std::exception const& ex) |
168 | @@ -142,11 +142,11 @@ | |||
169 | 142 | return 0; | 142 | return 0; |
170 | 143 | } | 143 | } |
171 | 144 | 144 | ||
173 | 145 | unsigned int mir_buffer_get_height(MirBuffer* b) | 145 | unsigned int mir_buffer_get_height(MirBuffer const* b) |
174 | 146 | try | 146 | try |
175 | 147 | { | 147 | { |
176 | 148 | mir::require(b); | 148 | mir::require(b); |
178 | 149 | auto buffer = reinterpret_cast<mcl::MirBuffer*>(b); | 149 | auto const buffer = reinterpret_cast<mcl::MirBuffer const*>(b); |
179 | 150 | return buffer->size().height.as_uint32_t(); | 150 | return buffer->size().height.as_uint32_t(); |
180 | 151 | } | 151 | } |
181 | 152 | catch (std::exception const& ex) | 152 | catch (std::exception const& ex) |
182 | @@ -155,11 +155,11 @@ | |||
183 | 155 | return 0; | 155 | return 0; |
184 | 156 | } | 156 | } |
185 | 157 | 157 | ||
187 | 158 | MirPixelFormat mir_buffer_get_pixel_format(MirBuffer* b) | 158 | MirPixelFormat mir_buffer_get_pixel_format(MirBuffer const* b) |
188 | 159 | try | 159 | try |
189 | 160 | { | 160 | { |
190 | 161 | mir::require(b); | 161 | mir::require(b); |
192 | 162 | auto buffer = reinterpret_cast<mcl::MirBuffer*>(b); | 162 | auto const buffer = reinterpret_cast<mcl::MirBuffer const*>(b); |
193 | 163 | return buffer->pixel_format(); | 163 | return buffer->pixel_format(); |
194 | 164 | } | 164 | } |
195 | 165 | catch (std::exception const& ex) | 165 | catch (std::exception const& ex) |
196 | @@ -168,10 +168,10 @@ | |||
197 | 168 | return mir_pixel_format_invalid; | 168 | return mir_pixel_format_invalid; |
198 | 169 | } | 169 | } |
199 | 170 | 170 | ||
201 | 171 | bool mir_buffer_is_valid(MirBuffer* b) | 171 | bool mir_buffer_is_valid(MirBuffer const* b) |
202 | 172 | try | 172 | try |
203 | 173 | { | 173 | { |
205 | 174 | auto buffer = reinterpret_cast<mcl::MirBuffer*>(b); | 174 | auto const buffer = reinterpret_cast<mcl::MirBuffer const*>(b); |
206 | 175 | return buffer->valid(); | 175 | return buffer->valid(); |
207 | 176 | } | 176 | } |
208 | 177 | catch (std::exception const& ex) | 177 | catch (std::exception const& ex) |
209 | @@ -180,10 +180,10 @@ | |||
210 | 180 | return false; | 180 | return false; |
211 | 181 | } | 181 | } |
212 | 182 | 182 | ||
214 | 183 | char const *mir_buffer_get_error_message(MirBuffer* b) | 183 | char const *mir_buffer_get_error_message(MirBuffer const* b) |
215 | 184 | try | 184 | try |
216 | 185 | { | 185 | { |
218 | 186 | auto buffer = reinterpret_cast<mcl::MirBuffer*>(b); | 186 | auto const buffer = reinterpret_cast<mcl::MirBuffer const*>(b); |
219 | 187 | return buffer->error_message(); | 187 | return buffer->error_message(); |
220 | 188 | } | 188 | } |
221 | 189 | catch (std::exception const& ex) | 189 | catch (std::exception const& ex) |
222 | 190 | 190 | ||
223 | === modified file 'src/platforms/android/client/android_client_platform.cpp' | |||
224 | --- src/platforms/android/client/android_client_platform.cpp 2017-03-14 04:41:33 +0000 | |||
225 | +++ src/platforms/android/client/android_client_platform.cpp 2017-03-14 12:31:32 +0000 | |||
226 | @@ -232,18 +232,18 @@ | |||
227 | 232 | return nullptr; | 232 | return nullptr; |
228 | 233 | } | 233 | } |
229 | 234 | 234 | ||
231 | 235 | ANativeWindowBuffer* to_anwb(MirBuffer* b) | 235 | ANativeWindowBuffer* to_anwb(MirBuffer const* b) |
232 | 236 | { | 236 | { |
233 | 237 | if (!b) | 237 | if (!b) |
234 | 238 | std::abort(); | 238 | std::abort(); |
236 | 239 | auto buffer = reinterpret_cast<mcl::MirBuffer*>(b); | 239 | auto const buffer = reinterpret_cast<mcl::MirBuffer const*>(b); |
237 | 240 | auto native = dynamic_cast<mga::NativeBuffer*>(buffer->client_buffer()->native_buffer_handle().get()); | 240 | auto native = dynamic_cast<mga::NativeBuffer*>(buffer->client_buffer()->native_buffer_handle().get()); |
238 | 241 | if (!native) | 241 | if (!native) |
239 | 242 | return nullptr; | 242 | return nullptr; |
240 | 243 | return native->anwb(); | 243 | return native->anwb(); |
241 | 244 | } | 244 | } |
242 | 245 | 245 | ||
244 | 246 | bool is_android_compatible(MirBuffer* b) | 246 | bool is_android_compatible(MirBuffer const* b) |
245 | 247 | try | 247 | try |
246 | 248 | { | 248 | { |
247 | 249 | return to_anwb(b); | 249 | return to_anwb(b); |
248 | @@ -255,7 +255,7 @@ | |||
249 | 255 | } | 255 | } |
250 | 256 | 256 | ||
251 | 257 | void android_native_handle( | 257 | void android_native_handle( |
253 | 258 | MirBuffer* b, | 258 | MirBuffer const* b, |
254 | 259 | int* num_fds, int const** fds, | 259 | int* num_fds, int const** fds, |
255 | 260 | int* num_data, int const** data) | 260 | int* num_data, int const** data) |
256 | 261 | try | 261 | try |
257 | @@ -277,7 +277,7 @@ | |||
258 | 277 | MIR_LOG_UNCAUGHT_EXCEPTION(ex); | 277 | MIR_LOG_UNCAUGHT_EXCEPTION(ex); |
259 | 278 | } | 278 | } |
260 | 279 | 279 | ||
262 | 280 | unsigned int hal_pixel_format(MirBuffer* b) | 280 | unsigned int hal_pixel_format(MirBuffer const* b) |
263 | 281 | try | 281 | try |
264 | 282 | { | 282 | { |
265 | 283 | if (auto anwb = to_anwb(b)) | 283 | if (auto anwb = to_anwb(b)) |
266 | @@ -290,7 +290,7 @@ | |||
267 | 290 | return std::numeric_limits<unsigned int>::max(); | 290 | return std::numeric_limits<unsigned int>::max(); |
268 | 291 | } | 291 | } |
269 | 292 | 292 | ||
271 | 293 | unsigned int gralloc_usage(MirBuffer* b) | 293 | unsigned int gralloc_usage(MirBuffer const* b) |
272 | 294 | try | 294 | try |
273 | 295 | { | 295 | { |
274 | 296 | if (auto anwb = to_anwb(b)) | 296 | if (auto anwb = to_anwb(b)) |
275 | @@ -303,7 +303,7 @@ | |||
276 | 303 | return std::numeric_limits<unsigned int>::max(); | 303 | return std::numeric_limits<unsigned int>::max(); |
277 | 304 | } | 304 | } |
278 | 305 | 305 | ||
280 | 306 | unsigned int android_stride(MirBuffer* b) | 306 | unsigned int android_stride(MirBuffer const* b) |
281 | 307 | try | 307 | try |
282 | 308 | { | 308 | { |
283 | 309 | if (auto anwb = to_anwb(b)) | 309 | if (auto anwb = to_anwb(b)) |
284 | 310 | 310 | ||
285 | === modified file 'src/platforms/mesa/client/client_platform.cpp' | |||
286 | --- src/platforms/mesa/client/client_platform.cpp 2017-03-14 12:31:32 +0000 | |||
287 | +++ src/platforms/mesa/client/client_platform.cpp 2017-03-14 12:31:32 +0000 | |||
288 | @@ -189,12 +189,12 @@ | |||
289 | 189 | return nullptr; | 189 | return nullptr; |
290 | 190 | } | 190 | } |
291 | 191 | 191 | ||
293 | 192 | bool is_gbm_importable(MirBuffer* b) | 192 | bool is_gbm_importable(MirBuffer const* b) |
294 | 193 | try | 193 | try |
295 | 194 | { | 194 | { |
296 | 195 | if (!b) | 195 | if (!b) |
297 | 196 | return false; | 196 | return false; |
299 | 197 | auto buffer = reinterpret_cast<mcl::MirBuffer*>(b); | 197 | auto const buffer = reinterpret_cast<mcl::MirBuffer const*>(b); |
300 | 198 | auto native = dynamic_cast<mgm::NativeBuffer*>(buffer->client_buffer()->native_buffer_handle().get()); | 198 | auto native = dynamic_cast<mgm::NativeBuffer*>(buffer->client_buffer()->native_buffer_handle().get()); |
301 | 199 | if (!native) | 199 | if (!native) |
302 | 200 | return false; | 200 | return false; |
303 | @@ -205,12 +205,12 @@ | |||
304 | 205 | return false; | 205 | return false; |
305 | 206 | } | 206 | } |
306 | 207 | 207 | ||
308 | 208 | int import_fd(MirBuffer* b) | 208 | int import_fd(MirBuffer const* b) |
309 | 209 | try | 209 | try |
310 | 210 | { | 210 | { |
311 | 211 | if (!is_gbm_importable(b)) | 211 | if (!is_gbm_importable(b)) |
312 | 212 | return -1; | 212 | return -1; |
314 | 213 | auto buffer = reinterpret_cast<mcl::MirBuffer*>(b); | 213 | auto const buffer = reinterpret_cast<mcl::MirBuffer const*>(b); |
315 | 214 | auto native = dynamic_cast<mgm::NativeBuffer*>(buffer->client_buffer()->native_buffer_handle().get()); | 214 | auto native = dynamic_cast<mgm::NativeBuffer*>(buffer->client_buffer()->native_buffer_handle().get()); |
316 | 215 | return native->fd[0]; | 215 | return native->fd[0]; |
317 | 216 | } | 216 | } |
318 | @@ -219,12 +219,12 @@ | |||
319 | 219 | return -1; | 219 | return -1; |
320 | 220 | } | 220 | } |
321 | 221 | 221 | ||
323 | 222 | uint32_t buffer_stride(MirBuffer* b) | 222 | uint32_t buffer_stride(MirBuffer const* b) |
324 | 223 | try | 223 | try |
325 | 224 | { | 224 | { |
326 | 225 | if (!is_gbm_importable(b)) | 225 | if (!is_gbm_importable(b)) |
327 | 226 | return 0; | 226 | return 0; |
329 | 227 | auto buffer = reinterpret_cast<mcl::MirBuffer*>(b); | 227 | auto const buffer = reinterpret_cast<mcl::MirBuffer const*>(b); |
330 | 228 | auto native = dynamic_cast<mgm::NativeBuffer*>(buffer->client_buffer()->native_buffer_handle().get()); | 228 | auto native = dynamic_cast<mgm::NativeBuffer*>(buffer->client_buffer()->native_buffer_handle().get()); |
331 | 229 | return native->stride; | 229 | return native->stride; |
332 | 230 | } | 230 | } |
333 | @@ -233,12 +233,12 @@ | |||
334 | 233 | return 0; | 233 | return 0; |
335 | 234 | } | 234 | } |
336 | 235 | 235 | ||
338 | 236 | uint32_t buffer_format(MirBuffer* b) | 236 | uint32_t buffer_format(MirBuffer const* b) |
339 | 237 | try | 237 | try |
340 | 238 | { | 238 | { |
341 | 239 | if (!is_gbm_importable(b)) | 239 | if (!is_gbm_importable(b)) |
342 | 240 | return 0; | 240 | return 0; |
344 | 241 | auto buffer = reinterpret_cast<mcl::MirBuffer*>(b); | 241 | auto const buffer = reinterpret_cast<mcl::MirBuffer const*>(b); |
345 | 242 | auto native = dynamic_cast<mgm::NativeBuffer*>(buffer->client_buffer()->native_buffer_handle().get()); | 242 | auto native = dynamic_cast<mgm::NativeBuffer*>(buffer->client_buffer()->native_buffer_handle().get()); |
346 | 243 | return native->native_format; | 243 | return native->native_format; |
347 | 244 | } | 244 | } |
348 | @@ -247,12 +247,12 @@ | |||
349 | 247 | return 0; | 247 | return 0; |
350 | 248 | } | 248 | } |
351 | 249 | 249 | ||
353 | 250 | uint32_t buffer_flags(MirBuffer* b) | 250 | uint32_t buffer_flags(MirBuffer const* b) |
354 | 251 | try | 251 | try |
355 | 252 | { | 252 | { |
356 | 253 | if (!is_gbm_importable(b)) | 253 | if (!is_gbm_importable(b)) |
357 | 254 | return 0; | 254 | return 0; |
359 | 255 | auto buffer = reinterpret_cast<mcl::MirBuffer*>(b); | 255 | auto const buffer = reinterpret_cast<mcl::MirBuffer const*>(b); |
360 | 256 | auto native = dynamic_cast<mgm::NativeBuffer*>(buffer->client_buffer()->native_buffer_handle().get()); | 256 | auto native = dynamic_cast<mgm::NativeBuffer*>(buffer->client_buffer()->native_buffer_handle().get()); |
361 | 257 | return native->native_flags; | 257 | return native->native_flags; |
362 | 258 | } | 258 | } |
363 | @@ -261,12 +261,12 @@ | |||
364 | 261 | return 0; | 261 | return 0; |
365 | 262 | } | 262 | } |
366 | 263 | 263 | ||
368 | 264 | unsigned int buffer_age(MirBuffer* b) | 264 | unsigned int buffer_age(MirBuffer const* b) |
369 | 265 | try | 265 | try |
370 | 266 | { | 266 | { |
371 | 267 | if (!is_gbm_importable(b)) | 267 | if (!is_gbm_importable(b)) |
372 | 268 | return 0; | 268 | return 0; |
374 | 269 | auto buffer = reinterpret_cast<mcl::MirBuffer*>(b); | 269 | auto const buffer = reinterpret_cast<mcl::MirBuffer const*>(b); |
375 | 270 | auto native = dynamic_cast<mgm::NativeBuffer*>(buffer->client_buffer()->native_buffer_handle().get()); | 270 | auto native = dynamic_cast<mgm::NativeBuffer*>(buffer->client_buffer()->native_buffer_handle().get()); |
376 | 271 | return native->age; | 271 | return native->age; |
377 | 272 | } | 272 | } |
PASSED: Continuous integration, rev:4051 /mir-jenkins. ubuntu. com/job/ mir-ci/ 3152/ /mir-jenkins. ubuntu. com/job/ build-mir/ 4231 /mir-jenkins. ubuntu. com/job/ build-0- fetch/4318 /mir-jenkins. ubuntu. com/job/ build-1- sourcepkg/ release= vivid+overlay/ 4308 /mir-jenkins. ubuntu. com/job/ build-1- sourcepkg/ release= xenial+ overlay/ 4308 /mir-jenkins. ubuntu. com/job/ build-1- sourcepkg/ release= zesty/4308 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= clang,platform= mesa,release= zesty/4258 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= clang,platform= mesa,release= zesty/4258/ artifact/ output/ *zip*/output. zip /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= gcc,platform= mesa,release= xenial+ overlay/ 4258 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= gcc,platform= mesa,release= xenial+ overlay/ 4258/artifact/ output/ *zip*/output. zip /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= gcc,platform= mesa,release= zesty/4258 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= gcc,platform= mesa,release= zesty/4258/ artifact/ output/ *zip*/output. zip /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= cross-armhf, compiler= gcc,platform= android, release= vivid+overlay/ 4258 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= cross-armhf, compiler= gcc,platform= android, release= vivid+overlay/ 4258/artifact/ output/ *zip*/output. zip /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= i386,compiler= gcc,platform= android, release= vivid+overlay/ 4258 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= i386,compiler= gcc,platform= android, release= vivid+overlay/ 4258/artifact/ output/ *zip*/output. zip /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= i386,compiler= gcc,platform= mesa,release= xenial+ overlay/ 4258 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= i386,compiler= gcc,platform= mesa,release= xenial+ overlay/ 4258/artifact/ output/ *zip*/output. zip
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: /mir-jenkins. ubuntu. com/job/ mir-ci/ 3152/rebuild
https:/