Mir

Merge lp:~vanvugt/mir/one-PixelFormat-type into lp:mir

Proposed by Daniel van Vugt
Status: Merged
Merged at revision: 1267
Proposed branch: lp:~vanvugt/mir/one-PixelFormat-type
Merge into: lp:mir
Diff against target: 3281 lines (+355/-434)
135 files modified
debian/control (+2/-2)
debian/libmirserver12.install (+1/-1)
examples/demo-inprocess-surface-client/inprocess_egl_client.cpp (+1/-1)
examples/eglapp.c (+1/-18)
include/platform/mir/graphics/buffer.h (+2/-2)
include/platform/mir/graphics/buffer_properties.h (+4/-4)
include/platform/mir/graphics/display_configuration.h (+1/-2)
include/platform/mir/graphics/graphic_buffer_allocator.h (+1/-1)
include/server/mir/compositor/buffer_stream.h (+2/-2)
include/server/mir/frontend/surface.h (+1/-2)
include/server/mir/shell/surface_creation_parameters.h (+3/-3)
include/shared/mir/geometry/pixel_format.h (+0/-54)
include/shared/mir_toolkit/client_types.h (+0/-20)
include/shared/mir_toolkit/common.h (+24/-0)
include/test/mir_test/draw/draw_pattern_checkered-inl.h (+3/-4)
include/test/mir_test_doubles/mock_alloc_adaptor.h (+1/-1)
include/test/mir_test_doubles/mock_buffer.h (+2/-2)
include/test/mir_test_doubles/mock_buffer_stream.h (+1/-1)
include/test/mir_test_doubles/mock_framebuffer_bundle.h (+1/-1)
include/test/mir_test_doubles/mock_frontend_surface.h (+1/-1)
include/test/mir_test_doubles/mock_surface.h (+1/-1)
include/test/mir_test_doubles/stub_buffer.h (+3/-3)
include/test/mir_test_doubles/stub_buffer_allocator.h (+1/-1)
include/test/mir_test_doubles/stub_buffer_stream.h (+2/-2)
include/test/mir_test_doubles/stub_display_builder.h (+2/-2)
include/test/mir_test_doubles/stub_display_configuration.h (+6/-6)
src/client/android/android_client_buffer.cpp (+3/-3)
src/client/android/android_client_buffer.h (+3/-3)
src/client/android/android_client_buffer_factory.cpp (+1/-1)
src/client/android/android_client_buffer_factory.h (+2/-2)
src/client/android/android_registrar_gralloc.h (+1/-1)
src/client/client_buffer.h (+2/-3)
src/client/client_buffer_depository.cpp (+1/-1)
src/client/client_buffer_depository.h (+2/-2)
src/client/client_buffer_factory.h (+2/-2)
src/client/gbm/gbm_client_buffer.cpp (+3/-3)
src/client/gbm/gbm_client_buffer.h (+3/-3)
src/client/gbm/gbm_client_buffer_factory.cpp (+1/-1)
src/client/gbm/gbm_client_buffer_factory.h (+1/-1)
src/client/mir_surface.cpp (+3/-3)
src/client/mir_surface.h (+1/-2)
src/platform/graphics/android/android_alloc_adaptor.cpp (+1/-1)
src/platform/graphics/android/android_alloc_adaptor.h (+1/-1)
src/platform/graphics/android/android_buffer_allocator.cpp (+6/-6)
src/platform/graphics/android/android_display_configuration.cpp (+1/-1)
src/platform/graphics/android/android_format_conversion-inl.h (+15/-15)
src/platform/graphics/android/android_graphic_buffer_allocator.h (+2/-2)
src/platform/graphics/android/buffer.cpp (+2/-2)
src/platform/graphics/android/buffer.h (+1/-1)
src/platform/graphics/android/display_builder.h (+2/-2)
src/platform/graphics/android/framebuffer_bundle.h (+2/-2)
src/platform/graphics/android/framebuffers.cpp (+4/-4)
src/platform/graphics/android/framebuffers.h (+2/-2)
src/platform/graphics/android/gl_context.cpp (+2/-3)
src/platform/graphics/android/gl_context.h (+2/-2)
src/platform/graphics/android/graphic_alloc_adaptor.h (+2/-2)
src/platform/graphics/android/graphic_buffer_allocator.h (+2/-2)
src/platform/graphics/android/hwc11_device.h (+2/-2)
src/platform/graphics/android/internal_client_window.cpp (+1/-1)
src/platform/graphics/android/internal_client_window.h (+1/-1)
src/platform/graphics/android/output_builder.cpp (+1/-1)
src/platform/graphics/android/output_builder.h (+1/-1)
src/platform/graphics/android/server_render_window.h (+1/-1)
src/platform/graphics/gbm/buffer_allocator.cpp (+6/-6)
src/platform/graphics/gbm/buffer_allocator.h (+2/-2)
src/platform/graphics/gbm/gbm_buffer.cpp (+9/-9)
src/platform/graphics/gbm/gbm_buffer.h (+3/-3)
src/platform/graphics/gbm/real_kms_display_configuration.cpp (+2/-2)
src/platform/graphics/gbm/shm_buffer.cpp (+3/-3)
src/platform/graphics/gbm/shm_buffer.h (+4/-4)
src/server/CMakeLists.txt (+1/-1)
src/server/compositor/buffer_stream_surfaces.cpp (+1/-1)
src/server/compositor/buffer_stream_surfaces.h (+1/-1)
src/server/compositor/temporary_buffers.cpp (+1/-1)
src/server/compositor/temporary_buffers.h (+1/-1)
src/server/frontend/session_mediator.cpp (+2/-2)
src/server/frontend/session_mediator.h (+3/-3)
src/server/graphics/nested/nested_display_configuration.cpp (+2/-2)
src/server/graphics/offscreen/display_configuration.cpp (+1/-1)
src/server/scene/basic_surface.h (+2/-2)
src/server/scene/surface.cpp (+1/-1)
src/server/scene/surface.h (+1/-1)
src/server/scene/surface_allocator.cpp (+6/-0)
src/server/scene/surface_impl.cpp (+1/-1)
src/server/scene/surface_impl.h (+1/-1)
src/server/shell/surface_creation_parameters.cpp (+2/-2)
tests/acceptance-tests/test_surfaceloop.cpp (+1/-1)
tests/draw/android_graphics.cpp (+2/-2)
tests/draw/patterns.cpp (+3/-4)
tests/integration-tests/client/test_client_render.cpp (+5/-5)
tests/integration-tests/compositor/test_buffer_stream.cpp (+1/-1)
tests/integration-tests/compositor/test_swapping_swappers.cpp (+1/-1)
tests/integration-tests/graphics/android/test_buffer_integration.cpp (+2/-2)
tests/integration-tests/graphics/android/test_internal_client.cpp (+1/-1)
tests/integration-tests/graphics/gbm/test_buffer_integration.cpp (+2/-2)
tests/integration-tests/test_display_info.cpp (+8/-8)
tests/integration-tests/test_surfaceloop.cpp (+1/-1)
tests/integration-tests/test_swapinterval.cpp (+1/-1)
tests/mir_test/display_config_matchers.cpp (+4/-5)
tests/mir_test_framework/testing_client_options.cpp (+3/-3)
tests/mir_test_framework/testing_server_options.cpp (+1/-1)
tests/unit-tests/client/android/test_client_android_buffer.cpp (+3/-3)
tests/unit-tests/client/android/test_client_surface_interpreter.cpp (+1/-1)
tests/unit-tests/client/gbm/test_gbm_client_buffer.cpp (+2/-2)
tests/unit-tests/client/gbm/test_native_surface.cpp (+1/-1)
tests/unit-tests/client/test_aging_buffer.cpp (+1/-1)
tests/unit-tests/client/test_android_client_buffer_factory.cpp (+2/-2)
tests/unit-tests/client/test_client_buffer_depository.cpp (+5/-5)
tests/unit-tests/client/test_client_mir_surface.cpp (+8/-8)
tests/unit-tests/client/test_mir_connection.cpp (+1/-1)
tests/unit-tests/compositor/test_buffer_stream.cpp (+2/-2)
tests/unit-tests/compositor/test_switching_bundle.cpp (+2/-2)
tests/unit-tests/compositor/test_temporary_buffers.cpp (+3/-3)
tests/unit-tests/frontend/test_session_mediator.cpp (+7/-7)
tests/unit-tests/frontend/test_session_mediator_android.cpp (+2/-2)
tests/unit-tests/frontend/test_session_mediator_gbm.cpp (+2/-2)
tests/unit-tests/graphics/android/test_android_alloc_adaptor.cpp (+3/-3)
tests/unit-tests/graphics/android/test_android_buffer_allocator.cpp (+6/-6)
tests/unit-tests/graphics/android/test_buffer.cpp (+4/-4)
tests/unit-tests/graphics/android/test_buffer_tex_bind.cpp (+2/-2)
tests/unit-tests/graphics/android/test_fb_simple_swapper.cpp (+5/-5)
tests/unit-tests/graphics/android/test_hwc10_device.cpp (+2/-2)
tests/unit-tests/graphics/android/test_output_builder.cpp (+1/-1)
tests/unit-tests/graphics/android/test_pixel_format.cpp (+9/-10)
tests/unit-tests/graphics/android/test_server_interpreter.cpp (+2/-2)
tests/unit-tests/graphics/gbm/test_gbm_buffer.cpp (+2/-2)
tests/unit-tests/graphics/gbm/test_gbm_buffer_allocator.cpp (+12/-12)
tests/unit-tests/graphics/gbm/test_internal_native_display.cpp (+0/-9)
tests/unit-tests/graphics/gbm/test_shm_buffer.cpp (+4/-4)
tests/unit-tests/graphics/test_buffer_properties.cpp (+6/-6)
tests/unit-tests/graphics/test_default_display_configuration_policy.cpp (+3/-3)
tests/unit-tests/graphics/test_display_configuration.cpp (+1/-1)
tests/unit-tests/graphics/test_graphics_platform.cpp (+1/-1)
tests/unit-tests/scene/test_surface.cpp (+7/-7)
tests/unit-tests/scene/test_surface_impl.cpp (+1/-1)
To merge this branch: bzr merge lp:~vanvugt/mir/one-PixelFormat-type
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Needs Fixing
Robert Carr (community) Approve
Alexandros Frantzis (community) Approve
Alan Griffiths Approve
Review via email: mp+196852@code.launchpad.net

Commit message

Unify redundant PixelFormat typedefs into one: MirPixelFormat (LP: #1110115)

Description of the change

It's not a high priority change, but it had to happen eventually. And being a clear ABI+API break, we should do it ASAP.

To post a comment you must log in.
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

ok

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

Looks good.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

Needs resync with development-branch.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Fixed. Try again.

Revision history for this message
Robert Carr (robertcarr) :
review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/control'
2--- debian/control 2013-11-25 07:59:56 +0000
3+++ debian/control 2013-12-02 16:56:54 +0000
4@@ -69,7 +69,7 @@
5 .
6 Contains the protocol's definition files.
7
8-Package: libmirserver11
9+Package: libmirserver12
10 Section: libs
11 Architecture: i386 amd64 armhf arm64
12 Multi-Arch: same
13@@ -115,7 +115,7 @@
14 Architecture: i386 amd64 armhf arm64
15 Multi-Arch: same
16 Pre-Depends: ${misc:Pre-Depends}
17-Depends: libmirserver11 (= ${binary:Version}),
18+Depends: libmirserver12 (= ${binary:Version}),
19 libmirprotobuf-dev (= ${binary:Version}),
20 mircommon-dev (= ${binary:Version}),
21 libglm-dev,
22
23=== renamed file 'debian/libmirserver11.install' => 'debian/libmirserver12.install'
24--- debian/libmirserver11.install 2013-11-25 07:59:56 +0000
25+++ debian/libmirserver12.install 2013-12-02 16:56:54 +0000
26@@ -1,1 +1,1 @@
27-usr/lib/*/libmirserver.so.11
28+usr/lib/*/libmirserver.so.12
29
30=== modified file 'examples/demo-inprocess-surface-client/inprocess_egl_client.cpp'
31--- examples/demo-inprocess-surface-client/inprocess_egl_client.cpp 2013-11-25 07:59:56 +0000
32+++ examples/demo-inprocess-surface-client/inprocess_egl_client.cpp 2013-12-02 16:56:54 +0000
33@@ -92,7 +92,7 @@
34 auto params = msh::a_surface().of_name("Inprocess EGL Demo")
35 .of_size(surface_size)
36 .of_buffer_usage(mg::BufferUsage::hardware)
37- .of_pixel_format(geom::PixelFormat::argb_8888);
38+ .of_pixel_format(mir_pixel_format_argb_8888);
39 auto session = shell->open_session("Inprocess client", std::make_shared<NullEventSink>());
40 // TODO: Why do we get an ID? ~racarr
41 auto surface = session->get_surface(shell->create_surface_for(session, params));
42
43=== modified file 'examples/eglapp.c'
44--- examples/eglapp.c 2013-11-26 08:39:00 +0000
45+++ examples/eglapp.c 2013-12-02 16:56:54 +0000
46@@ -129,23 +129,6 @@
47 }
48 }
49
50-static unsigned int get_bpp(MirPixelFormat pf)
51-{
52- switch (pf)
53- {
54- case mir_pixel_format_abgr_8888:
55- case mir_pixel_format_xbgr_8888:
56- case mir_pixel_format_argb_8888:
57- case mir_pixel_format_xrgb_8888:
58- return 32;
59- case mir_pixel_format_bgr_888:
60- return 24;
61- case mir_pixel_format_invalid:
62- default:
63- return 0;
64- }
65-}
66-
67 static const MirDisplayOutput *find_active_output(
68 const MirDisplayConfiguration *conf)
69 {
70@@ -357,7 +340,7 @@
71
72 printf("Server supports %d of %d surface pixel formats. Using format: %d\n",
73 nformats, mir_pixel_formats, surfaceparm.pixel_format);
74- unsigned int bpp = get_bpp(surfaceparm.pixel_format);
75+ unsigned int bpp = 8 * MIR_BYTES_PER_PIXEL(surfaceparm.pixel_format);
76 EGLint attribs[] =
77 {
78 EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
79
80=== modified file 'include/platform/mir/graphics/buffer.h'
81--- include/platform/mir/graphics/buffer.h 2013-10-15 08:53:10 +0000
82+++ include/platform/mir/graphics/buffer.h 2013-12-02 16:56:54 +0000
83@@ -21,7 +21,7 @@
84
85 #include "mir/graphics/native_buffer.h"
86 #include "mir/geometry/size.h"
87-#include "mir/geometry/pixel_format.h"
88+#include "mir_toolkit/common.h"
89
90 #include <memory>
91
92@@ -40,7 +40,7 @@
93 virtual BufferID id() const = 0;
94 virtual geometry::Size size() const = 0;
95 virtual geometry::Stride stride() const = 0;
96- virtual geometry::PixelFormat pixel_format() const = 0;
97+ virtual MirPixelFormat pixel_format() const = 0;
98 virtual void bind_to_texture() = 0;
99 virtual bool can_bypass() const = 0;
100
101
102=== modified file 'include/platform/mir/graphics/buffer_properties.h'
103--- include/platform/mir/graphics/buffer_properties.h 2013-08-28 03:41:48 +0000
104+++ include/platform/mir/graphics/buffer_properties.h 2013-12-02 16:56:54 +0000
105@@ -20,7 +20,7 @@
106 #define MIR_GRAPHICS_BUFFER_PROPERTIES_H_
107
108 #include "mir/geometry/size.h"
109-#include "mir/geometry/pixel_format.h"
110+#include "mir_toolkit/common.h"
111
112 namespace mir
113 {
114@@ -49,13 +49,13 @@
115 {
116 BufferProperties() :
117 size(),
118- format(geometry::PixelFormat::invalid),
119+ format(mir_pixel_format_invalid),
120 usage(BufferUsage::undefined)
121 {
122 }
123
124 BufferProperties(const geometry::Size& size,
125- const geometry::PixelFormat& format,
126+ const MirPixelFormat& format,
127 BufferUsage usage) :
128 size{size},
129 format{format},
130@@ -64,7 +64,7 @@
131 }
132
133 geometry::Size size;
134- geometry::PixelFormat format;
135+ MirPixelFormat format;
136 BufferUsage usage;
137 };
138
139
140=== modified file 'include/platform/mir/graphics/display_configuration.h'
141--- include/platform/mir/graphics/display_configuration.h 2013-09-12 21:36:55 +0000
142+++ include/platform/mir/graphics/display_configuration.h 2013-12-02 16:56:54 +0000
143@@ -22,7 +22,6 @@
144 #include "mir/int_wrapper.h"
145 #include "mir/geometry/size.h"
146 #include "mir/geometry/point.h"
147-#include "mir/geometry/pixel_format.h"
148 #include "mir_toolkit/common.h"
149
150 #include <functional>
151@@ -89,7 +88,7 @@
152 /** The type of the output. */
153 DisplayConfigurationOutputType type;
154 /** The pixel formats supported by the output */
155- std::vector<geometry::PixelFormat> pixel_formats;
156+ std::vector<MirPixelFormat> pixel_formats;
157 /** The modes supported by the output. */
158 std::vector<DisplayConfigurationMode> modes;
159 /** The index in the 'modes' vector of the preferred output mode. */
160
161=== modified file 'include/platform/mir/graphics/graphic_buffer_allocator.h'
162--- include/platform/mir/graphics/graphic_buffer_allocator.h 2013-08-28 03:41:48 +0000
163+++ include/platform/mir/graphics/graphic_buffer_allocator.h 2013-12-02 16:56:54 +0000
164@@ -50,7 +50,7 @@
165 /**
166 * The supported buffer pixel formats.
167 */
168- virtual std::vector<geometry::PixelFormat> supported_pixel_formats() = 0;
169+ virtual std::vector<MirPixelFormat> supported_pixel_formats() = 0;
170
171 protected:
172 GraphicBufferAllocator() = default;
173
174=== modified file 'include/server/mir/compositor/buffer_stream.h'
175--- include/server/mir/compositor/buffer_stream.h 2013-11-27 12:28:24 +0000
176+++ include/server/mir/compositor/buffer_stream.h 2013-12-02 16:56:54 +0000
177@@ -21,7 +21,7 @@
178 #define MIR_COMPOSITOR_BUFFER_STREAM_H_
179
180 #include "mir/geometry/size.h"
181-#include "mir/geometry/pixel_format.h"
182+#include "mir_toolkit/common.h"
183 #include "mir/graphics/buffer_id.h"
184
185 #include <memory>
186@@ -46,7 +46,7 @@
187 virtual std::shared_ptr<graphics::Buffer>
188 lock_compositor_buffer(unsigned long frameno) = 0;
189 virtual std::shared_ptr<graphics::Buffer> lock_snapshot_buffer() = 0;
190- virtual geometry::PixelFormat get_stream_pixel_format() = 0;
191+ virtual MirPixelFormat get_stream_pixel_format() = 0;
192 virtual geometry::Size stream_size() = 0;
193 virtual void resize(geometry::Size const& size) = 0;
194 virtual void allow_framedropping(bool) = 0;
195
196=== modified file 'include/server/mir/frontend/surface.h'
197--- include/server/mir/frontend/surface.h 2013-11-27 12:28:24 +0000
198+++ include/server/mir/frontend/surface.h 2013-12-02 16:56:54 +0000
199@@ -20,7 +20,6 @@
200 #ifndef MIR_FRONTEND_SURFACE_H_
201 #define MIR_FRONTEND_SURFACE_H_
202
203-#include "mir/geometry/pixel_format.h"
204 #include "mir/geometry/point.h"
205 #include "mir/geometry/size.h"
206 #include "mir_toolkit/common.h"
207@@ -55,7 +54,7 @@
208 virtual void force_requests_to_complete() = 0;
209
210 virtual geometry::Size size() const = 0;
211- virtual geometry::PixelFormat pixel_format() const = 0;
212+ virtual MirPixelFormat pixel_format() const = 0;
213
214 virtual void swap_buffers(std::shared_ptr<graphics::Buffer>&) = 0;
215
216
217=== modified file 'include/server/mir/shell/surface_creation_parameters.h'
218--- include/server/mir/shell/surface_creation_parameters.h 2013-11-27 12:28:24 +0000
219+++ include/server/mir/shell/surface_creation_parameters.h 2013-12-02 16:56:54 +0000
220@@ -19,7 +19,7 @@
221 #ifndef MIR_SHELL_SURFACE_CREATION_PARAMETERS_H_
222 #define MIR_SHELL_SURFACE_CREATION_PARAMETERS_H_
223
224-#include "mir/geometry/pixel_format.h"
225+#include "mir_toolkit/common.h"
226 #include "mir/geometry/point.h"
227 #include "mir/geometry/size.h"
228 #include "mir/graphics/buffer_properties.h"
229@@ -49,7 +49,7 @@
230
231 SurfaceCreationParameters& of_buffer_usage(graphics::BufferUsage new_buffer_usage);
232
233- SurfaceCreationParameters& of_pixel_format(geometry::PixelFormat new_pixel_format);
234+ SurfaceCreationParameters& of_pixel_format(MirPixelFormat new_pixel_format);
235
236 SurfaceCreationParameters& of_depth(scene::DepthId const& new_depth);
237
238@@ -61,7 +61,7 @@
239 geometry::Size size;
240 geometry::Point top_left;
241 graphics::BufferUsage buffer_usage;
242- geometry::PixelFormat pixel_format;
243+ MirPixelFormat pixel_format;
244 scene::DepthId depth;
245 input::InputReceptionMode input_mode;
246 graphics::DisplayConfigurationOutputId output_id;
247
248=== removed file 'include/shared/mir/geometry/pixel_format.h'
249--- include/shared/mir/geometry/pixel_format.h 2013-10-07 08:25:04 +0000
250+++ include/shared/mir/geometry/pixel_format.h 1970-01-01 00:00:00 +0000
251@@ -1,54 +0,0 @@
252-/*
253- * Copyright © 2012 Canonical Ltd.
254- *
255- * This program is free software: you can redistribute it and/or modify it
256- * under the terms of the GNU Lesser General Public License version 3,
257- * as published by the Free Software Foundation.
258- *
259- * This program is distributed in the hope that it will be useful,
260- * but WITHOUT ANY WARRANTY; without even the implied warranty of
261- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
262- * GNU Lesser General Public License for more details.
263- *
264- * You should have received a copy of the GNU Lesser General Public License
265- * along with this program. If not, see <http://www.gnu.org/licenses/>.
266- *
267- * Authored by: Alan Griffiths <alan@octopull.co.uk>
268- */
269-
270-
271-#ifndef MIR_COMPOSITOR_PIXEL_FORMAT_H_
272-#define MIR_COMPOSITOR_PIXEL_FORMAT_H_
273-
274-#include <cstdint>
275-#include <cstddef>
276-
277-namespace mir
278-{
279-namespace geometry
280-{
281-enum class PixelFormat : uint32_t
282-{
283- invalid,
284- abgr_8888,
285- xbgr_8888,
286- argb_8888,
287- xrgb_8888,
288- bgr_888
289-};
290-
291-static inline size_t bytes_per_pixel(PixelFormat fmt)
292-{
293- return (fmt == PixelFormat::bgr_888) ? 3 : 4;
294-}
295-
296-static inline bool has_alpha(PixelFormat fmt)
297-{
298- return (fmt == PixelFormat::abgr_8888) ||
299- (fmt == PixelFormat::argb_8888);
300-}
301-
302-}
303-}
304-
305-#endif /* MIR_COMPOSITOR_PIXEL_FORMAT_H_ */
306
307=== modified file 'include/shared/mir_toolkit/client_types.h'
308--- include/shared/mir_toolkit/client_types.h 2013-11-27 12:28:24 +0000
309+++ include/shared/mir_toolkit/client_types.h 2013-12-02 16:56:54 +0000
310@@ -103,26 +103,6 @@
311 MirConnection* connection, void* context);
312
313 /**
314- * The order of components in a format enum matches the
315- * order of the components as they would be written in an
316- * integer representing a pixel value of that format.
317- *
318- * For example, abgr_8888 corresponds to 0xAABBGGRR, which will
319- * end up as R,G,B,A in memory in a little endian system, and
320- * as A,B,G,R in memory in a big endian system.
321- */
322-typedef enum MirPixelFormat
323-{
324- mir_pixel_format_invalid,
325- mir_pixel_format_abgr_8888,
326- mir_pixel_format_xbgr_8888,
327- mir_pixel_format_argb_8888,
328- mir_pixel_format_xrgb_8888,
329- mir_pixel_format_bgr_888,
330- mir_pixel_formats
331-} MirPixelFormat;
332-
333-/**
334 * MirBufferUsage specifies how a surface can and will be used. A "hardware"
335 * surface can be used for OpenGL accelerated rendering. A "software" surface
336 * is one that can be addressed in main memory and blitted to directly.
337
338=== modified file 'include/shared/mir_toolkit/common.h'
339--- include/shared/mir_toolkit/common.h 2013-11-26 08:10:57 +0000
340+++ include/shared/mir_toolkit/common.h 2013-12-02 16:56:54 +0000
341@@ -86,6 +86,30 @@
342 mir_power_mode_suspend, /* Blanked, lowest power. */
343 mir_power_mode_off /* Powered down. */
344 } MirPowerMode;
345+
346+/**
347+ * The order of components in a format enum matches the
348+ * order of the components as they would be written in an
349+ * integer representing a pixel value of that format.
350+ *
351+ * For example, abgr_8888 corresponds to 0xAABBGGRR, which will
352+ * end up as R,G,B,A in memory in a little endian system, and
353+ * as A,B,G,R in memory in a big endian system.
354+ */
355+typedef enum MirPixelFormat
356+{
357+ mir_pixel_format_invalid,
358+ mir_pixel_format_abgr_8888,
359+ mir_pixel_format_xbgr_8888,
360+ mir_pixel_format_argb_8888,
361+ mir_pixel_format_xrgb_8888,
362+ mir_pixel_format_bgr_888,
363+ mir_pixel_formats
364+} MirPixelFormat;
365+
366+/* This could be improved... https://bugs.launchpad.net/mir/+bug/1236254 */
367+#define MIR_BYTES_PER_PIXEL(f) (((f) == mir_pixel_format_bgr_888) ? 3 : 4)
368+
369 /**@}*/
370
371 #endif
372
373=== modified file 'include/test/mir_test/draw/draw_pattern_checkered-inl.h'
374--- include/test/mir_test/draw/draw_pattern_checkered-inl.h 2013-11-27 12:28:24 +0000
375+++ include/test/mir_test/draw/draw_pattern_checkered-inl.h 2013-12-02 16:56:54 +0000
376@@ -16,8 +16,7 @@
377 * Authored by: Kevin DuBois <kevin.dubois@canonical.com>
378 */
379
380-#include "mir/geometry/pixel_format.h"
381-namespace geom = mir::geometry;
382+#include "mir_toolkit/common.h"
383
384 template<size_t Rows, size_t Cols>
385 DrawPatternCheckered<Rows,Cols>::DrawPatternCheckered(uint32_t (&pattern) [Rows][Cols])
386@@ -32,7 +31,7 @@
387 if (region.pixel_format != mir_pixel_format_abgr_8888)
388 throw(std::runtime_error("cannot draw region, incorrect format"));
389
390- auto bpp = geom::bytes_per_pixel(geom::PixelFormat::abgr_8888);
391+ auto bpp = MIR_BYTES_PER_PIXEL(mir_pixel_format_abgr_8888);
392 for(int i=0; i < region.width; i++)
393 {
394 for(int j=0; j<region.height; j++)
395@@ -51,7 +50,7 @@
396 if (region.pixel_format != mir_pixel_format_abgr_8888)
397 throw(std::runtime_error("cannot check region, incorrect format"));
398
399- auto bpp = geom::bytes_per_pixel(geom::PixelFormat::abgr_8888);
400+ auto bpp = MIR_BYTES_PER_PIXEL(mir_pixel_format_abgr_8888);
401 for(int i=0; i< region.width; i++)
402 {
403 for(int j=0; j<region.height; j++)
404
405=== modified file 'include/test/mir_test_doubles/mock_alloc_adaptor.h'
406--- include/test/mir_test_doubles/mock_alloc_adaptor.h 2013-11-28 14:17:01 +0000
407+++ include/test/mir_test_doubles/mock_alloc_adaptor.h 2013-12-02 16:56:54 +0000
408@@ -35,7 +35,7 @@
409 {
410 public:
411 MOCK_METHOD3(alloc_buffer,
412- std::shared_ptr<graphics::NativeBuffer>(geometry::Size, geometry::PixelFormat, graphics::android::BufferUsage));
413+ std::shared_ptr<graphics::NativeBuffer>(geometry::Size, MirPixelFormat, graphics::android::BufferUsage));
414 };
415
416 }
417
418=== modified file 'include/test/mir_test_doubles/mock_buffer.h'
419--- include/test/mir_test_doubles/mock_buffer.h 2013-10-15 08:53:10 +0000
420+++ include/test/mir_test_doubles/mock_buffer.h 2013-12-02 16:56:54 +0000
421@@ -42,7 +42,7 @@
422
423 MockBuffer(geometry::Size size,
424 geometry::Stride s,
425- geometry::PixelFormat pf)
426+ MirPixelFormat pf)
427 {
428 using namespace testing;
429 ON_CALL(*this, size())
430@@ -60,7 +60,7 @@
431
432 MOCK_CONST_METHOD0(size, geometry::Size());
433 MOCK_CONST_METHOD0(stride, geometry::Stride());
434- MOCK_CONST_METHOD0(pixel_format, geometry::PixelFormat());
435+ MOCK_CONST_METHOD0(pixel_format, MirPixelFormat());
436 MOCK_CONST_METHOD0(native_buffer_handle, std::shared_ptr<graphics::NativeBuffer>());
437
438 MOCK_METHOD0(bind_to_texture, void());
439
440=== modified file 'include/test/mir_test_doubles/mock_buffer_stream.h'
441--- include/test/mir_test_doubles/mock_buffer_stream.h 2013-11-27 12:28:24 +0000
442+++ include/test/mir_test_doubles/mock_buffer_stream.h 2013-12-02 16:56:54 +0000
443@@ -37,7 +37,7 @@
444 std::shared_ptr<graphics::Buffer>(unsigned long));
445 MOCK_METHOD0(lock_snapshot_buffer, std::shared_ptr<graphics::Buffer>());
446
447- MOCK_METHOD0(get_stream_pixel_format, geometry::PixelFormat());
448+ MOCK_METHOD0(get_stream_pixel_format, MirPixelFormat());
449 MOCK_METHOD0(stream_size, geometry::Size());
450 MOCK_METHOD1(resize, void(geometry::Size const&));
451 MOCK_METHOD0(force_client_completion, void());
452
453=== modified file 'include/test/mir_test_doubles/mock_framebuffer_bundle.h'
454--- include/test/mir_test_doubles/mock_framebuffer_bundle.h 2013-11-28 14:17:01 +0000
455+++ include/test/mir_test_doubles/mock_framebuffer_bundle.h 2013-12-02 16:56:54 +0000
456@@ -38,7 +38,7 @@
457 ON_CALL(*this, last_rendered_buffer())
458 .WillByDefault(Return(std::make_shared<StubBuffer>()));
459 }
460- MOCK_METHOD0(fb_format, geometry::PixelFormat());
461+ MOCK_METHOD0(fb_format, MirPixelFormat());
462 MOCK_METHOD0(fb_size, geometry::Size());
463 MOCK_METHOD0(buffer_for_render, std::shared_ptr<graphics::Buffer>());
464 MOCK_METHOD0(last_rendered_buffer, std::shared_ptr<graphics::Buffer>());
465
466=== modified file 'include/test/mir_test_doubles/mock_frontend_surface.h'
467--- include/test/mir_test_doubles/mock_frontend_surface.h 2013-11-27 12:28:24 +0000
468+++ include/test/mir_test_doubles/mock_frontend_surface.h 2013-12-02 16:56:54 +0000
469@@ -42,7 +42,7 @@
470 MOCK_METHOD1(swap_buffers, void(std::shared_ptr<graphics::Buffer>&));
471
472 MOCK_CONST_METHOD0(size, geometry::Size());
473- MOCK_CONST_METHOD0(pixel_format, geometry::PixelFormat());
474+ MOCK_CONST_METHOD0(pixel_format, MirPixelFormat());
475
476 MOCK_CONST_METHOD0(supports_input, bool());
477 MOCK_CONST_METHOD0(client_input_fd, int());
478
479=== modified file 'include/test/mir_test_doubles/mock_surface.h'
480--- include/test/mir_test_doubles/mock_surface.h 2013-11-25 07:59:56 +0000
481+++ include/test/mir_test_doubles/mock_surface.h 2013-12-02 16:56:54 +0000
482@@ -56,7 +56,7 @@
483
484 MOCK_CONST_METHOD0(name, std::string());
485 MOCK_CONST_METHOD0(size, geometry::Size());
486- MOCK_CONST_METHOD0(pixel_format, geometry::PixelFormat());
487+ MOCK_CONST_METHOD0(pixel_format, MirPixelFormat());
488
489 MOCK_CONST_METHOD0(supports_input, bool());
490 MOCK_CONST_METHOD0(client_input_fd, int());
491
492=== modified file 'include/test/mir_test_doubles/stub_buffer.h'
493--- include/test/mir_test_doubles/stub_buffer.h 2013-10-15 08:53:10 +0000
494+++ include/test/mir_test_doubles/stub_buffer.h 2013-12-02 16:56:54 +0000
495@@ -40,7 +40,7 @@
496 public:
497 StubBuffer()
498 : buf_size{0, 0},
499- buf_pixel_format{geometry::PixelFormat::abgr_8888}
500+ buf_pixel_format{mir_pixel_format_abgr_8888}
501 {
502 }
503
504@@ -54,7 +54,7 @@
505
506 virtual geometry::Stride stride() const { return geometry::Stride(); }
507
508- virtual geometry::PixelFormat pixel_format() const { return buf_pixel_format; }
509+ virtual MirPixelFormat pixel_format() const { return buf_pixel_format; }
510
511 virtual std::shared_ptr<graphics::NativeBuffer> native_buffer_handle() const
512 {
513@@ -69,7 +69,7 @@
514 virtual bool can_bypass() const override { return false; }
515
516 geometry::Size const buf_size;
517- geometry::PixelFormat const buf_pixel_format;
518+ MirPixelFormat const buf_pixel_format;
519 };
520 }
521 }
522
523=== modified file 'include/test/mir_test_doubles/stub_buffer_allocator.h'
524--- include/test/mir_test_doubles/stub_buffer_allocator.h 2013-11-25 07:59:56 +0000
525+++ include/test/mir_test_doubles/stub_buffer_allocator.h 2013-12-02 16:56:54 +0000
526@@ -43,7 +43,7 @@
527 return std::make_shared<StubBuffer>(properties);
528 }
529
530- std::vector<geometry::PixelFormat> supported_pixel_formats()
531+ std::vector<MirPixelFormat> supported_pixel_formats()
532 {
533 return {};
534 }
535
536=== modified file 'include/test/mir_test_doubles/stub_buffer_stream.h'
537--- include/test/mir_test_doubles/stub_buffer_stream.h 2013-11-27 12:28:24 +0000
538+++ include/test/mir_test_doubles/stub_buffer_stream.h 2013-12-02 16:56:54 +0000
539@@ -55,9 +55,9 @@
540 return stub_compositor_buffer;
541 }
542
543- geometry::PixelFormat get_stream_pixel_format() override
544+ MirPixelFormat get_stream_pixel_format() override
545 {
546- return geometry::PixelFormat();
547+ return MirPixelFormat();
548 }
549
550 geometry::Size stream_size() override
551
552=== modified file 'include/test/mir_test_doubles/stub_display_builder.h'
553--- include/test/mir_test_doubles/stub_display_builder.h 2013-11-28 14:17:01 +0000
554+++ include/test/mir_test_doubles/stub_display_builder.h 2013-12-02 16:56:54 +0000
555@@ -52,9 +52,9 @@
556 {
557 }
558
559- geometry::PixelFormat display_format()
560+ MirPixelFormat display_format()
561 {
562- return geometry::PixelFormat::abgr_8888;
563+ return mir_pixel_format_abgr_8888;
564 }
565
566 std::unique_ptr<graphics::DisplayBuffer> create_display_buffer(
567
568=== modified file 'include/test/mir_test_doubles/stub_display_configuration.h'
569--- include/test/mir_test_doubles/stub_display_configuration.h 2013-11-27 12:28:24 +0000
570+++ include/test/mir_test_doubles/stub_display_configuration.h 2013-12-02 16:56:54 +0000
571@@ -21,7 +21,7 @@
572
573 #include "mir/graphics/display_configuration.h"
574 #include "mir/geometry/rectangle.h"
575-#include "mir/geometry/pixel_format.h"
576+#include "mir_toolkit/common.h"
577
578 #include <vector>
579
580@@ -43,15 +43,15 @@
581 StubDisplayConfig(unsigned int num_displays)
582 : StubDisplayConfig(num_displays,
583 {
584- geometry::PixelFormat::bgr_888,
585- geometry::PixelFormat::abgr_8888,
586- geometry::PixelFormat::xbgr_8888
587+ mir_pixel_format_bgr_888,
588+ mir_pixel_format_abgr_8888,
589+ mir_pixel_format_xbgr_8888
590 })
591 {
592 }
593
594 StubDisplayConfig(unsigned int num_displays,
595- std::vector<geometry::PixelFormat> const& pfs)
596+ std::vector<MirPixelFormat> const& pfs)
597 {
598 /* construct a non-trivial dummy display config to send */
599 int mode_index = 0;
600@@ -105,7 +105,7 @@
601 graphics::DisplayConfigurationOutputId{id},
602 graphics::DisplayConfigurationCardId{0},
603 graphics::DisplayConfigurationOutputType::vga,
604- std::vector<geometry::PixelFormat>{geometry::PixelFormat::abgr_8888},
605+ std::vector<MirPixelFormat>{mir_pixel_format_abgr_8888},
606 {{rect.size, 60.0}},
607 0, geometry::Size{}, true, true, rect.top_left, 0, 0, mir_power_mode_on
608 };
609
610=== modified file 'src/client/android/android_client_buffer.cpp'
611--- src/client/android/android_client_buffer.cpp 2013-11-25 07:59:56 +0000
612+++ src/client/android/android_client_buffer.cpp 2013-12-02 16:56:54 +0000
613@@ -29,7 +29,7 @@
614
615 mcla::AndroidClientBuffer::AndroidClientBuffer(std::shared_ptr<AndroidRegistrar> const& registrar,
616 std::shared_ptr<const native_handle_t> const& handle,
617- geom::Size size, geom::PixelFormat pf, geometry::Stride stride)
618+ geom::Size size, MirPixelFormat pf, geometry::Stride stride)
619 : buffer_registrar(registrar),
620 native_handle(handle),
621 buffer_pf(pf), buffer_stride{stride}, buffer_size(size)
622@@ -48,7 +48,7 @@
623 //note: mir uses stride in bytes, ANativeWindowBuffer needs it in pixel units. some drivers care
624 //about byte-stride, they will pass stride via ANativeWindowBuffer::handle (which is opaque to us)
625 anwb->stride = stride.as_uint32_t() /
626- geom::bytes_per_pixel(buffer_pf);
627+ MIR_BYTES_PER_PIXEL(buffer_pf);
628 anwb->usage = GRALLOC_USAGE_HW_TEXTURE | GRALLOC_USAGE_HW_RENDER;
629 anwb->handle = native_handle.get();
630
631@@ -82,7 +82,7 @@
632 return buffer_stride;
633 }
634
635-geom::PixelFormat mcla::AndroidClientBuffer::pixel_format() const
636+MirPixelFormat mcla::AndroidClientBuffer::pixel_format() const
637 {
638 return buffer_pf;
639 }
640
641=== modified file 'src/client/android/android_client_buffer.h'
642--- src/client/android/android_client_buffer.h 2013-11-25 07:59:56 +0000
643+++ src/client/android/android_client_buffer.h 2013-12-02 16:56:54 +0000
644@@ -39,13 +39,13 @@
645 public:
646 AndroidClientBuffer(std::shared_ptr<AndroidRegistrar> const&,
647 std::shared_ptr<const native_handle_t> const&,
648- geometry::Size size, geometry::PixelFormat pf, geometry::Stride stride);
649+ geometry::Size size, MirPixelFormat pf, geometry::Stride stride);
650 ~AndroidClientBuffer() noexcept;
651
652 std::shared_ptr<MemoryRegion> secure_for_cpu_write();
653 geometry::Size size() const;
654 geometry::Stride stride() const;
655- geometry::PixelFormat pixel_format() const;
656+ MirPixelFormat pixel_format() const;
657 std::shared_ptr<mir::graphics::NativeBuffer> native_buffer_handle() const;
658
659 AndroidClientBuffer(const AndroidClientBuffer&) = delete;
660@@ -56,7 +56,7 @@
661 std::shared_ptr<AndroidRegistrar> buffer_registrar;
662 std::shared_ptr<graphics::android::AndroidNativeBuffer> native_window_buffer;
663 std::shared_ptr<const native_handle_t> native_handle;
664- const geometry::PixelFormat buffer_pf;
665+ const MirPixelFormat buffer_pf;
666 geometry::Stride const buffer_stride;
667 geometry::Size const buffer_size;
668 };
669
670=== modified file 'src/client/android/android_client_buffer_factory.cpp'
671--- src/client/android/android_client_buffer_factory.cpp 2013-11-25 07:59:56 +0000
672+++ src/client/android/android_client_buffer_factory.cpp 2013-12-02 16:56:54 +0000
673@@ -29,7 +29,7 @@
674 {
675 }
676
677-std::shared_ptr<mcl::ClientBuffer> mcla::AndroidClientBufferFactory::create_buffer(std::shared_ptr<MirBufferPackage> const& package, geom::Size size, geom::PixelFormat pf)
678+std::shared_ptr<mcl::ClientBuffer> mcla::AndroidClientBufferFactory::create_buffer(std::shared_ptr<MirBufferPackage> const& package, geom::Size size, MirPixelFormat pf)
679 {
680 (void)size; // TODO: remove this unused parameter
681 auto handle = registrar->register_buffer(package);
682
683=== modified file 'src/client/android/android_client_buffer_factory.h'
684--- src/client/android/android_client_buffer_factory.h 2013-04-24 05:22:20 +0000
685+++ src/client/android/android_client_buffer_factory.h 2013-12-02 16:56:54 +0000
686@@ -23,7 +23,7 @@
687 #include <memory>
688
689 #include "mir_toolkit/mir_client_library.h"
690-#include "mir/geometry/pixel_format.h"
691+#include "mir_toolkit/common.h"
692 #include "mir/geometry/size.h"
693
694 #include "../client_buffer_factory.h"
695@@ -44,7 +44,7 @@
696 explicit AndroidClientBufferFactory(std::shared_ptr<AndroidRegistrar> const&);
697
698 virtual std::shared_ptr<ClientBuffer> create_buffer(std::shared_ptr<MirBufferPackage> const& package,
699- geometry::Size size, geometry::PixelFormat pf);
700+ geometry::Size size, MirPixelFormat pf);
701 private:
702 std::shared_ptr<AndroidRegistrar> registrar;
703 };
704
705=== modified file 'src/client/android/android_registrar_gralloc.h'
706--- src/client/android/android_registrar_gralloc.h 2013-06-21 23:24:37 +0000
707+++ src/client/android/android_registrar_gralloc.h 2013-12-02 16:56:54 +0000
708@@ -20,7 +20,7 @@
709 #ifndef MIR_CLIENT_ANDROID_ANDROID_REGISTRAR_GRALLOC_H_
710 #define MIR_CLIENT_ANDROID_ANDROID_REGISTRAR_GRALLOC_H_
711
712-#include "mir/geometry/pixel_format.h"
713+#include "mir_toolkit/common.h"
714 #include "android_registrar.h"
715 #include <hardware/gralloc.h>
716
717
718=== modified file 'src/client/client_buffer.h'
719--- src/client/client_buffer.h 2013-11-26 13:09:31 +0000
720+++ src/client/client_buffer.h 2013-12-02 16:56:54 +0000
721@@ -22,7 +22,6 @@
722
723 #include "mir/graphics/native_buffer.h"
724 #include "mir_toolkit/common.h"
725-#include "mir/geometry/pixel_format.h"
726 #include "mir/geometry/size.h"
727
728 #include <memory>
729@@ -46,7 +45,7 @@
730 geometry::Width width;
731 geometry::Height height;
732 geometry::Stride stride;
733- geometry::PixelFormat format;
734+ MirPixelFormat format;
735 std::shared_ptr<char> vaddr;
736 };
737
738@@ -58,7 +57,7 @@
739 virtual std::shared_ptr<MemoryRegion> secure_for_cpu_write() = 0;
740 virtual geometry::Size size() const = 0;
741 virtual geometry::Stride stride() const = 0;
742- virtual geometry::PixelFormat pixel_format() const = 0;
743+ virtual MirPixelFormat pixel_format() const = 0;
744 virtual uint32_t age() const = 0;
745 virtual void increment_age() = 0;
746 virtual void mark_as_submitted() = 0;
747
748=== modified file 'src/client/client_buffer_depository.cpp'
749--- src/client/client_buffer_depository.cpp 2013-08-28 03:41:48 +0000
750+++ src/client/client_buffer_depository.cpp 2013-12-02 16:56:54 +0000
751@@ -33,7 +33,7 @@
752 {
753 }
754
755-void mcl::ClientBufferDepository::deposit_package(std::shared_ptr<MirBufferPackage> const& package, int id, geometry::Size size, geometry::PixelFormat pf)
756+void mcl::ClientBufferDepository::deposit_package(std::shared_ptr<MirBufferPackage> const& package, int id, geometry::Size size, MirPixelFormat pf)
757 {
758 auto existing_buffer_id_pair = buffers.end();
759 for (auto pair = buffers.begin(); pair != buffers.end(); ++pair)
760
761=== modified file 'src/client/client_buffer_depository.h'
762--- src/client/client_buffer_depository.h 2013-08-28 03:41:48 +0000
763+++ src/client/client_buffer_depository.h 2013-12-02 16:56:54 +0000
764@@ -23,7 +23,7 @@
765 #include <list>
766 #include <memory>
767
768-#include "mir/geometry/pixel_format.h"
769+#include "mir_toolkit/common.h"
770 #include "mir/geometry/size.h"
771
772 namespace mir
773@@ -59,7 +59,7 @@
774 /// This also marks the previous current buffer (if any) as being submitted to the server.
775 /// \post current_buffer() will return a ClientBuffer constructed from this IPC data.
776 void deposit_package(std::shared_ptr<MirBufferPackage> const&, int id,
777- geometry::Size, geometry::PixelFormat);
778+ geometry::Size, MirPixelFormat);
779 std::shared_ptr<ClientBuffer> current_buffer();
780 uint32_t current_buffer_id() const;
781
782
783=== modified file 'src/client/client_buffer_factory.h'
784--- src/client/client_buffer_factory.h 2013-06-17 09:51:42 +0000
785+++ src/client/client_buffer_factory.h 2013-12-02 16:56:54 +0000
786@@ -23,7 +23,7 @@
787 #include <memory>
788
789 #include "mir_toolkit/mir_client_library.h"
790-#include "mir/geometry/pixel_format.h"
791+#include "mir_toolkit/common.h"
792 #include "mir/geometry/size.h"
793
794 namespace mir
795@@ -46,7 +46,7 @@
796 * \param [in] pf the buffer's pixel format
797 */
798 virtual std::shared_ptr<ClientBuffer> create_buffer(std::shared_ptr<MirBufferPackage> const& package,
799- geometry::Size size, geometry::PixelFormat pf) = 0;
800+ geometry::Size size, MirPixelFormat pf) = 0;
801
802 protected:
803 ClientBufferFactory() = default;
804
805=== modified file 'src/client/gbm/gbm_client_buffer.cpp'
806--- src/client/gbm/gbm_client_buffer.cpp 2013-11-27 15:25:10 +0000
807+++ src/client/gbm/gbm_client_buffer.cpp 2013-12-02 16:56:54 +0000
808@@ -44,7 +44,7 @@
809 {
810 ShmMemoryRegion(std::shared_ptr<mclg::BufferFileOps> const& buffer_file_ops,
811 int buffer_fd, geom::Size const& size_param,
812- geom::Stride stride_param, geom::PixelFormat format_param)
813+ geom::Stride stride_param, MirPixelFormat format_param)
814 : buffer_file_ops{buffer_file_ops},
815 size_in_bytes{size_param.height.as_uint32_t() * stride_param.as_uint32_t()}
816 {
817@@ -80,7 +80,7 @@
818 mclg::GBMClientBuffer::GBMClientBuffer(
819 std::shared_ptr<mclg::BufferFileOps> const& buffer_file_ops,
820 std::shared_ptr<MirBufferPackage> const& package,
821- geom::Size size, geom::PixelFormat pf)
822+ geom::Size size, MirPixelFormat pf)
823 : buffer_file_ops{buffer_file_ops},
824 creation_package{package},
825 rect({geom::Point{0, 0}, size}),
826@@ -116,7 +116,7 @@
827 return geom::Stride{creation_package->stride};
828 }
829
830-geom::PixelFormat mclg::GBMClientBuffer::pixel_format() const
831+MirPixelFormat mclg::GBMClientBuffer::pixel_format() const
832 {
833 return buffer_pf;
834 }
835
836=== modified file 'src/client/gbm/gbm_client_buffer.h'
837--- src/client/gbm/gbm_client_buffer.h 2013-11-27 15:25:10 +0000
838+++ src/client/gbm/gbm_client_buffer.h 2013-12-02 16:56:54 +0000
839@@ -41,21 +41,21 @@
840 GBMClientBuffer(std::shared_ptr<BufferFileOps> const& buffer_file_ops,
841 std::shared_ptr<MirBufferPackage> const& buffer_package,
842 geometry::Size size,
843- geometry::PixelFormat pf);
844+ MirPixelFormat pf);
845
846 ~GBMClientBuffer() noexcept;
847
848 std::shared_ptr<MemoryRegion> secure_for_cpu_write();
849 geometry::Size size() const;
850 geometry::Stride stride() const;
851- geometry::PixelFormat pixel_format() const;
852+ MirPixelFormat pixel_format() const;
853 std::shared_ptr<MirNativeBuffer> native_buffer_handle() const;
854
855 private:
856 std::shared_ptr<BufferFileOps> const buffer_file_ops;
857 std::shared_ptr<MirBufferPackage> const creation_package;
858 geometry::Rectangle const rect;
859- geometry::PixelFormat const buffer_pf;
860+ MirPixelFormat const buffer_pf;
861 };
862
863 }
864
865=== modified file 'src/client/gbm/gbm_client_buffer_factory.cpp'
866--- src/client/gbm/gbm_client_buffer_factory.cpp 2013-11-27 15:25:10 +0000
867+++ src/client/gbm/gbm_client_buffer_factory.cpp 2013-12-02 16:56:54 +0000
868@@ -29,7 +29,7 @@
869 {
870 }
871
872-std::shared_ptr<mcl::ClientBuffer> mclg::GBMClientBufferFactory::create_buffer(std::shared_ptr<MirBufferPackage> const& package, geometry::Size size, geometry::PixelFormat pf)
873+std::shared_ptr<mcl::ClientBuffer> mclg::GBMClientBufferFactory::create_buffer(std::shared_ptr<MirBufferPackage> const& package, geometry::Size size, MirPixelFormat pf)
874 {
875 (void)size; // TODO: remove this unused parameter
876 return std::make_shared<mclg::GBMClientBuffer>(
877
878=== modified file 'src/client/gbm/gbm_client_buffer_factory.h'
879--- src/client/gbm/gbm_client_buffer_factory.h 2013-11-26 13:09:31 +0000
880+++ src/client/gbm/gbm_client_buffer_factory.h 2013-12-02 16:56:54 +0000
881@@ -40,7 +40,7 @@
882 explicit GBMClientBufferFactory(std::shared_ptr<BufferFileOps> const& buffer_file_ops);
883
884 std::shared_ptr<ClientBuffer> create_buffer(std::shared_ptr<MirBufferPackage> const& package,
885- geometry::Size size, geometry::PixelFormat pf);
886+ geometry::Size size, MirPixelFormat pf);
887 private:
888 std::shared_ptr<BufferFileOps> const buffer_file_ops;
889 };
890
891=== modified file 'src/client/mir_surface.cpp'
892--- src/client/mir_surface.cpp 2013-11-27 12:28:24 +0000
893+++ src/client/mir_surface.cpp 2013-12-02 16:56:54 +0000
894@@ -159,10 +159,10 @@
895 }
896
897 /* todo: all these conversion functions are a bit of a kludge, probably
898- better to have a more developed geometry::PixelFormat that can handle this */
899-geom::PixelFormat MirSurface::convert_ipc_pf_to_geometry(gp::int32 pf)
900+ better to have a more developed MirPixelFormat that can handle this */
901+MirPixelFormat MirSurface::convert_ipc_pf_to_geometry(gp::int32 pf)
902 {
903- return static_cast<geom::PixelFormat>(pf);
904+ return static_cast<MirPixelFormat>(pf);
905 }
906
907 void MirSurface::process_incoming_buffer()
908
909=== modified file 'src/client/mir_surface.h'
910--- src/client/mir_surface.h 2013-11-25 07:59:56 +0000
911+++ src/client/mir_surface.h 2013-12-02 16:56:54 +0000
912@@ -20,7 +20,6 @@
913
914 #include "mir_protobuf.pb.h"
915
916-#include "mir/geometry/pixel_format.h"
917 #include "mir/geometry/dimensions.h"
918 #include "mir_toolkit/mir_client_library.h"
919 #include "mir_toolkit/common.h"
920@@ -101,7 +100,7 @@
921 void populate(MirBufferPackage& buffer_package);
922 void created(mir_surface_callback callback, void * context);
923 void new_buffer(mir_surface_callback callback, void * context);
924- mir::geometry::PixelFormat convert_ipc_pf_to_geometry(google::protobuf::int32 pf);
925+ MirPixelFormat convert_ipc_pf_to_geometry(google::protobuf::int32 pf);
926
927 /* todo: race condition. protobuf does not guarantee that callbacks will be synchronized. potential
928 race in surface, last_buffer_id */
929
930=== modified file 'src/platform/graphics/android/android_alloc_adaptor.cpp'
931--- src/platform/graphics/android/android_alloc_adaptor.cpp 2013-11-28 14:02:22 +0000
932+++ src/platform/graphics/android/android_alloc_adaptor.cpp 2013-12-02 16:56:54 +0000
933@@ -52,7 +52,7 @@
934 }
935
936 std::shared_ptr<mg::NativeBuffer> mga::AndroidAllocAdaptor::alloc_buffer(
937- geometry::Size size, geometry::PixelFormat pf, BufferUsage usage)
938+ geometry::Size size, MirPixelFormat pf, BufferUsage usage)
939 {
940 buffer_handle_t buf_handle = NULL;
941 auto stride = 0;
942
943=== modified file 'src/platform/graphics/android/android_alloc_adaptor.h'
944--- src/platform/graphics/android/android_alloc_adaptor.h 2013-11-28 14:02:22 +0000
945+++ src/platform/graphics/android/android_alloc_adaptor.h 2013-12-02 16:56:54 +0000
946@@ -36,7 +36,7 @@
947 public:
948 explicit AndroidAllocAdaptor(const std::shared_ptr<struct alloc_device_t>& alloc_device);
949 std::shared_ptr<NativeBuffer> alloc_buffer(geometry::Size,
950- geometry::PixelFormat, BufferUsage usage);
951+ MirPixelFormat, BufferUsage usage);
952
953 /* note: alloc_device_t has a third method (dump) that isn't needed by us. it can be used to check buffer contents */
954
955
956=== modified file 'src/platform/graphics/android/android_buffer_allocator.cpp'
957--- src/platform/graphics/android/android_buffer_allocator.cpp 2013-11-28 14:02:22 +0000
958+++ src/platform/graphics/android/android_buffer_allocator.cpp 2013-12-02 16:56:54 +0000
959@@ -78,7 +78,7 @@
960 }
961
962 std::shared_ptr<mg::Buffer> mga::AndroidGraphicBufferAllocator::alloc_buffer_platform(
963- geom::Size sz, geom::PixelFormat pf, mga::BufferUsage use)
964+ geom::Size sz, MirPixelFormat pf, mga::BufferUsage use)
965 {
966 auto native_handle = alloc_device->alloc_buffer(sz, pf, use);
967 auto buffer = std::make_shared<Buffer>(native_handle, egl_extensions);
968@@ -86,12 +86,12 @@
969 return buffer;
970 }
971
972-std::vector<geom::PixelFormat> mga::AndroidGraphicBufferAllocator::supported_pixel_formats()
973+std::vector<MirPixelFormat> mga::AndroidGraphicBufferAllocator::supported_pixel_formats()
974 {
975- static std::vector<geom::PixelFormat> const pixel_formats{
976- geom::PixelFormat::abgr_8888,
977- geom::PixelFormat::xbgr_8888,
978- geom::PixelFormat::bgr_888
979+ static std::vector<MirPixelFormat> const pixel_formats{
980+ mir_pixel_format_abgr_8888,
981+ mir_pixel_format_xbgr_8888,
982+ mir_pixel_format_bgr_888
983 };
984
985 return pixel_formats;
986
987=== modified file 'src/platform/graphics/android/android_display_configuration.cpp'
988--- src/platform/graphics/android/android_display_configuration.cpp 2013-11-28 14:02:22 +0000
989+++ src/platform/graphics/android/android_display_configuration.cpp 2013-12-02 16:56:54 +0000
990@@ -24,7 +24,7 @@
991 : configuration{mg::DisplayConfigurationOutputId{1},
992 mg::DisplayConfigurationCardId{0},
993 mg::DisplayConfigurationOutputType::lvds,
994- {geom::PixelFormat::abgr_8888},
995+ {mir_pixel_format_abgr_8888},
996 {mg::DisplayConfigurationMode{display_size,0.0f}},
997 0,
998 geom::Size{0,0},
999
1000=== modified file 'src/platform/graphics/android/android_format_conversion-inl.h'
1001--- src/platform/graphics/android/android_format_conversion-inl.h 2013-11-28 14:02:22 +0000
1002+++ src/platform/graphics/android/android_format_conversion-inl.h 2013-12-02 16:56:54 +0000
1003@@ -19,7 +19,7 @@
1004 #ifndef MIR_GRAPHICS_ANDROID_ANDROID_FORMAT_CONVERSION_INL_H_
1005 #define MIR_GRAPHICS_ANDROID_ANDROID_FORMAT_CONVERSION_INL_H_
1006
1007-#include "mir/geometry/pixel_format.h"
1008+#include "mir_toolkit/common.h"
1009 #include <system/graphics.h>
1010
1011 namespace mir
1012@@ -29,39 +29,39 @@
1013 namespace android
1014 {
1015
1016-inline static int to_android_format(geometry::PixelFormat format)
1017+inline static int to_android_format(MirPixelFormat format)
1018 {
1019 switch(format)
1020 {
1021- case geometry::PixelFormat::abgr_8888:
1022+ case mir_pixel_format_abgr_8888:
1023 return HAL_PIXEL_FORMAT_RGBA_8888;
1024- case geometry::PixelFormat::xbgr_8888:
1025+ case mir_pixel_format_xbgr_8888:
1026 return HAL_PIXEL_FORMAT_RGBX_8888;
1027- case geometry::PixelFormat::argb_8888:
1028- return HAL_PIXEL_FORMAT_BGRA_8888;
1029- case geometry::PixelFormat::xrgb_8888:
1030- return HAL_PIXEL_FORMAT_BGRA_8888;
1031- case geometry::PixelFormat::bgr_888:
1032+ case mir_pixel_format_argb_8888:
1033+ return HAL_PIXEL_FORMAT_BGRA_8888;
1034+ case mir_pixel_format_xrgb_8888:
1035+ return HAL_PIXEL_FORMAT_BGRA_8888;
1036+ case mir_pixel_format_bgr_888:
1037 return HAL_PIXEL_FORMAT_RGB_888;
1038 default:
1039 return 0;
1040 }
1041 }
1042
1043-inline static mir::geometry::PixelFormat to_mir_format(int format)
1044+inline static MirPixelFormat to_mir_format(int format)
1045 {
1046 switch(format)
1047 {
1048 case HAL_PIXEL_FORMAT_RGBA_8888:
1049- return geometry::PixelFormat::abgr_8888;
1050+ return mir_pixel_format_abgr_8888;
1051 case HAL_PIXEL_FORMAT_RGBX_8888:
1052- return geometry::PixelFormat::xbgr_8888;
1053+ return mir_pixel_format_xbgr_8888;
1054 case HAL_PIXEL_FORMAT_BGRA_8888:
1055- return geometry::PixelFormat::argb_8888;
1056+ return mir_pixel_format_argb_8888;
1057 case HAL_PIXEL_FORMAT_RGB_888:
1058- return geometry::PixelFormat::bgr_888;
1059+ return mir_pixel_format_bgr_888;
1060 default:
1061- return geometry::PixelFormat::invalid;
1062+ return mir_pixel_format_invalid;
1063 }
1064 }
1065
1066
1067=== modified file 'src/platform/graphics/android/android_graphic_buffer_allocator.h'
1068--- src/platform/graphics/android/android_graphic_buffer_allocator.h 2013-11-28 14:02:22 +0000
1069+++ src/platform/graphics/android/android_graphic_buffer_allocator.h 2013-12-02 16:56:54 +0000
1070@@ -49,9 +49,9 @@
1071 graphics::BufferProperties const& buffer_properties);
1072
1073 std::shared_ptr<graphics::Buffer> alloc_buffer_platform(
1074- geometry::Size sz, geometry::PixelFormat pf, BufferUsage use);
1075+ geometry::Size sz, MirPixelFormat pf, BufferUsage use);
1076
1077- std::vector<geometry::PixelFormat> supported_pixel_formats();
1078+ std::vector<MirPixelFormat> supported_pixel_formats();
1079
1080 static BufferUsage convert_from_compositor_usage(graphics::BufferUsage usage);
1081
1082
1083=== modified file 'src/platform/graphics/android/buffer.cpp'
1084--- src/platform/graphics/android/buffer.cpp 2013-11-28 14:02:22 +0000
1085+++ src/platform/graphics/android/buffer.cpp 2013-12-02 16:56:54 +0000
1086@@ -60,10 +60,10 @@
1087 {
1088 ANativeWindowBuffer *anwb = native_buffer->anwb();
1089 return geom::Stride{anwb->stride *
1090- geom::bytes_per_pixel(pixel_format())};
1091+ MIR_BYTES_PER_PIXEL(pixel_format())};
1092 }
1093
1094-geom::PixelFormat mga::Buffer::pixel_format() const
1095+MirPixelFormat mga::Buffer::pixel_format() const
1096 {
1097 ANativeWindowBuffer *anwb = native_buffer->anwb();
1098 return mga::to_mir_format(anwb->format);
1099
1100=== modified file 'src/platform/graphics/android/buffer.h'
1101--- src/platform/graphics/android/buffer.h 2013-11-28 14:02:22 +0000
1102+++ src/platform/graphics/android/buffer.h 2013-12-02 16:56:54 +0000
1103@@ -49,7 +49,7 @@
1104
1105 geometry::Size size() const;
1106 geometry::Stride stride() const;
1107- geometry::PixelFormat pixel_format() const;
1108+ MirPixelFormat pixel_format() const;
1109 void bind_to_texture();
1110 bool can_bypass() const override;
1111
1112
1113=== modified file 'src/platform/graphics/android/display_builder.h'
1114--- src/platform/graphics/android/display_builder.h 2013-11-28 14:02:22 +0000
1115+++ src/platform/graphics/android/display_builder.h 2013-12-02 16:56:54 +0000
1116@@ -20,7 +20,7 @@
1117 #define MIR_GRAPHICS_ANDROID_DISPLAY_BUILDER_H_
1118
1119 #include "mir/graphics/display_buffer.h"
1120-#include "mir/geometry/pixel_format.h"
1121+#include "mir_toolkit/common.h"
1122 #include <memory>
1123
1124 namespace mir
1125@@ -37,7 +37,7 @@
1126 public:
1127 virtual ~DisplayBuilder() = default;
1128
1129- virtual geometry::PixelFormat display_format() = 0;
1130+ virtual MirPixelFormat display_format() = 0;
1131 virtual std::shared_ptr<DisplayDevice> create_display_device() = 0;
1132 virtual std::unique_ptr<graphics::DisplayBuffer> create_display_buffer(
1133 std::shared_ptr<DisplayDevice> const& display_device,
1134
1135=== modified file 'src/platform/graphics/android/framebuffer_bundle.h'
1136--- src/platform/graphics/android/framebuffer_bundle.h 2013-11-28 14:02:22 +0000
1137+++ src/platform/graphics/android/framebuffer_bundle.h 2013-12-02 16:56:54 +0000
1138@@ -20,7 +20,7 @@
1139 #ifndef MIR_GRAPHICS_ANDROID_FRAMEBUFFER_BUNDLE_H_
1140 #define MIR_GRAPHICS_ANDROID_FRAMEBUFFER_BUNDLE_H_
1141
1142-#include "mir/geometry/pixel_format.h"
1143+#include "mir_toolkit/common.h"
1144 #include "mir/geometry/size.h"
1145 #include <memory>
1146
1147@@ -37,7 +37,7 @@
1148 public:
1149 virtual ~FramebufferBundle() = default;
1150
1151- virtual geometry::PixelFormat fb_format() = 0;
1152+ virtual MirPixelFormat fb_format() = 0;
1153 virtual geometry::Size fb_size() = 0;
1154 virtual std::shared_ptr<Buffer> buffer_for_render() = 0;
1155 virtual std::shared_ptr<Buffer> last_rendered_buffer() = 0;
1156
1157=== modified file 'src/platform/graphics/android/framebuffers.cpp'
1158--- src/platform/graphics/android/framebuffers.cpp 2013-11-28 14:02:22 +0000
1159+++ src/platform/graphics/android/framebuffers.cpp 2013-12-02 16:56:54 +0000
1160@@ -33,7 +33,7 @@
1161
1162 namespace
1163 {
1164-geom::PixelFormat determine_hwc11_fb_format()
1165+MirPixelFormat determine_hwc11_fb_format()
1166 {
1167 static EGLint const fb_egl_config_attr [] =
1168 {
1169@@ -50,7 +50,7 @@
1170 eglInitialize(egl_display, &major, &minor);
1171 eglChooseConfig(egl_display, fb_egl_config_attr, &fb_egl_config, 1, &matching_configs);
1172
1173- geom::PixelFormat fb_format;
1174+ MirPixelFormat fb_format;
1175 if (matching_configs)
1176 {
1177 int visual_id;
1178@@ -61,7 +61,7 @@
1179 {
1180 //we couldn't figure out the fb format via egl. In this case, we
1181 //assume abgr_8888. HWC api really should provide this information directly.
1182- fb_format = geom::PixelFormat::abgr_8888;
1183+ fb_format = mir_pixel_format_abgr_8888;
1184 }
1185
1186 eglTerminate(egl_display);
1187@@ -117,7 +117,7 @@
1188 }
1189 }
1190
1191-geom::PixelFormat mga::Framebuffers::fb_format()
1192+MirPixelFormat mga::Framebuffers::fb_format()
1193 {
1194 return format;
1195 }
1196
1197=== modified file 'src/platform/graphics/android/framebuffers.h'
1198--- src/platform/graphics/android/framebuffers.h 2013-11-28 14:02:22 +0000
1199+++ src/platform/graphics/android/framebuffers.h 2013-12-02 16:56:54 +0000
1200@@ -46,14 +46,14 @@
1201 Framebuffers(std::shared_ptr<GraphicBufferAllocator> const& buffer_allocator,
1202 std::shared_ptr<framebuffer_device_t> const& fb);
1203
1204- geometry::PixelFormat fb_format();
1205+ MirPixelFormat fb_format();
1206 geometry::Size fb_size();
1207 std::shared_ptr<Buffer> buffer_for_render();
1208 std::shared_ptr<Buffer> last_rendered_buffer();
1209 void wait_for_consumed_buffer(bool);
1210
1211 private:
1212- geometry::PixelFormat const format;
1213+ MirPixelFormat const format;
1214 geometry::Size const size;
1215
1216 std::mutex queue_lock;
1217
1218=== modified file 'src/platform/graphics/android/gl_context.cpp'
1219--- src/platform/graphics/android/gl_context.cpp 2013-11-28 14:02:22 +0000
1220+++ src/platform/graphics/android/gl_context.cpp 2013-12-02 16:56:54 +0000
1221@@ -26,7 +26,6 @@
1222
1223 namespace mg=mir::graphics;
1224 namespace mga=mir::graphics::android;
1225-namespace geom=mir::geometry;
1226
1227 namespace
1228 {
1229@@ -69,7 +68,7 @@
1230
1231 /* the minimum requirement is to have EGL_WINDOW_BIT and EGL_OPENGL_ES2_BIT, and to select a config
1232 whose pixel format matches that of the framebuffer. */
1233-static EGLConfig select_egl_config_with_format(EGLDisplay egl_display, geom::PixelFormat display_format)
1234+static EGLConfig select_egl_config_with_format(EGLDisplay egl_display, MirPixelFormat display_format)
1235 {
1236 int required_visual_id = mga::to_android_format(display_format);
1237 int num_potential_configs;
1238@@ -107,7 +106,7 @@
1239 return eglCreateWindowSurface(disp, config, native, NULL);
1240 }
1241
1242-mga::GLContext::GLContext(geom::PixelFormat display_format, mg::DisplayReport& report)
1243+mga::GLContext::GLContext(MirPixelFormat display_format, mg::DisplayReport& report)
1244 : egl_display(create_and_initialize_display()),
1245 own_display(true),
1246 egl_config(select_egl_config_with_format(egl_display, display_format)),
1247
1248=== modified file 'src/platform/graphics/android/gl_context.h'
1249--- src/platform/graphics/android/gl_context.h 2013-11-28 14:02:22 +0000
1250+++ src/platform/graphics/android/gl_context.h 2013-12-02 16:56:54 +0000
1251@@ -21,7 +21,7 @@
1252
1253 #include "mir/graphics/gl_context.h"
1254 #include "mir/graphics/egl_resources.h"
1255-#include "mir/geometry/pixel_format.h"
1256+#include "mir_toolkit/common.h"
1257 #include <functional>
1258
1259 namespace mir
1260@@ -40,7 +40,7 @@
1261 {
1262 public:
1263 //For creating a gl context
1264- GLContext(geometry::PixelFormat display_format, DisplayReport& report);
1265+ GLContext(MirPixelFormat display_format, DisplayReport& report);
1266
1267 //For creating a gl context shared with another GLContext
1268 GLContext(GLContext const& shared_gl_context,
1269
1270=== modified file 'src/platform/graphics/android/graphic_alloc_adaptor.h'
1271--- src/platform/graphics/android/graphic_alloc_adaptor.h 2013-11-28 14:02:22 +0000
1272+++ src/platform/graphics/android/graphic_alloc_adaptor.h 2013-12-02 16:56:54 +0000
1273@@ -20,7 +20,7 @@
1274 #define MIR_GRAPHICS_ANDROID_GRAPHIC_ALLOC_ADAPTOR_H_
1275
1276 #include "mir/geometry/size.h"
1277-#include "mir/geometry/pixel_format.h"
1278+#include "mir_toolkit/common.h"
1279 #include "buffer_usage.h"
1280 #include <memory>
1281
1282@@ -37,7 +37,7 @@
1283 {
1284 public:
1285 virtual std::shared_ptr<NativeBuffer> alloc_buffer(geometry::Size size,
1286- geometry::PixelFormat, BufferUsage usage) = 0;
1287+ MirPixelFormat, BufferUsage usage) = 0;
1288 protected:
1289 GraphicAllocAdaptor() = default;
1290 virtual ~GraphicAllocAdaptor() {}
1291
1292=== modified file 'src/platform/graphics/android/graphic_buffer_allocator.h'
1293--- src/platform/graphics/android/graphic_buffer_allocator.h 2013-11-28 14:02:22 +0000
1294+++ src/platform/graphics/android/graphic_buffer_allocator.h 2013-12-02 16:56:54 +0000
1295@@ -23,7 +23,7 @@
1296 #include "buffer_usage.h"
1297
1298 #include "mir/geometry/size.h"
1299-#include "mir/geometry/pixel_format.h"
1300+#include "mir_toolkit/common.h"
1301
1302 #include <memory>
1303
1304@@ -39,7 +39,7 @@
1305 {
1306 public:
1307 virtual std::shared_ptr<graphics::Buffer> alloc_buffer_platform(
1308- geometry::Size sz, geometry::PixelFormat pf, BufferUsage use) = 0;
1309+ geometry::Size sz, MirPixelFormat pf, BufferUsage use) = 0;
1310
1311 protected:
1312 GraphicBufferAllocator() = default;
1313
1314=== modified file 'src/platform/graphics/android/hwc11_device.h'
1315--- src/platform/graphics/android/hwc11_device.h 2013-11-28 14:02:22 +0000
1316+++ src/platform/graphics/android/hwc11_device.h 2013-12-02 16:56:54 +0000
1317@@ -19,7 +19,7 @@
1318 #ifndef MIR_GRAPHICS_ANDROID_HWC11_DEVICE_H_
1319 #define MIR_GRAPHICS_ANDROID_HWC11_DEVICE_H_
1320
1321-#include "mir/geometry/pixel_format.h"
1322+#include "mir_toolkit/common.h"
1323 #include "hwc_common_device.h"
1324 #include "hwc_layerlist.h"
1325 #include <memory>
1326@@ -52,7 +52,7 @@
1327 std::shared_ptr<SyncFence> last_display_fence;
1328 std::shared_ptr<SyncFileOps> const sync_ops;
1329 unsigned int primary_display_config;
1330- geometry::PixelFormat fb_format;
1331+ MirPixelFormat fb_format;
1332 };
1333
1334 }
1335
1336=== modified file 'src/platform/graphics/android/internal_client_window.cpp'
1337--- src/platform/graphics/android/internal_client_window.cpp 2013-11-28 14:02:22 +0000
1338+++ src/platform/graphics/android/internal_client_window.cpp 2013-12-02 16:56:54 +0000
1339@@ -35,7 +35,7 @@
1340 : surface(surface),
1341 resource_cache(cache)
1342 {
1343- format = mga::to_android_format(geometry::PixelFormat(surface->pixel_format()));
1344+ format = mga::to_android_format(MirPixelFormat(surface->pixel_format()));
1345 }
1346
1347 mg::NativeBuffer* mga::InternalClientWindow::driver_requests_buffer()
1348
1349=== modified file 'src/platform/graphics/android/internal_client_window.h'
1350--- src/platform/graphics/android/internal_client_window.h 2013-11-28 14:02:22 +0000
1351+++ src/platform/graphics/android/internal_client_window.h 2013-12-02 16:56:54 +0000
1352@@ -21,7 +21,7 @@
1353
1354 #include "mir/graphics/android/android_driver_interpreter.h"
1355 #include "mir/geometry/size.h"
1356-#include "mir/geometry/pixel_format.h"
1357+#include "mir_toolkit/common.h"
1358 #include <memory>
1359
1360 namespace mir
1361
1362=== modified file 'src/platform/graphics/android/output_builder.cpp'
1363--- src/platform/graphics/android/output_builder.cpp 2013-11-28 14:02:22 +0000
1364+++ src/platform/graphics/android/output_builder.cpp 2013-12-02 16:56:54 +0000
1365@@ -68,7 +68,7 @@
1366 }
1367 }
1368
1369-geom::PixelFormat mga::OutputBuilder::display_format()
1370+MirPixelFormat mga::OutputBuilder::display_format()
1371 {
1372 return framebuffers->fb_format();
1373 }
1374
1375=== modified file 'src/platform/graphics/android/output_builder.h'
1376--- src/platform/graphics/android/output_builder.h 2013-11-28 14:02:22 +0000
1377+++ src/platform/graphics/android/output_builder.h 2013-12-02 16:56:54 +0000
1378@@ -43,7 +43,7 @@
1379 std::shared_ptr<DisplayReport> const& display_report,
1380 bool should_use_fb_fallback);
1381
1382- geometry::PixelFormat display_format();
1383+ MirPixelFormat display_format();
1384 std::shared_ptr<DisplayDevice> create_display_device();
1385 std::unique_ptr<graphics::DisplayBuffer> create_display_buffer(
1386 std::shared_ptr<DisplayDevice> const& display_device,
1387
1388=== modified file 'src/platform/graphics/android/server_render_window.h'
1389--- src/platform/graphics/android/server_render_window.h 2013-11-28 14:02:22 +0000
1390+++ src/platform/graphics/android/server_render_window.h 2013-12-02 16:56:54 +0000
1391@@ -21,7 +21,7 @@
1392 #define MIR_GRAPHICS_ANDROID_SERVER_RENDER_WINDOW_H_
1393
1394 #include "mir/graphics/android/android_driver_interpreter.h"
1395-#include "mir/geometry/pixel_format.h"
1396+#include "mir_toolkit/common.h"
1397
1398 #include <memory>
1399
1400
1401=== modified file 'src/platform/graphics/gbm/buffer_allocator.cpp'
1402--- src/platform/graphics/gbm/buffer_allocator.cpp 2013-11-28 14:02:22 +0000
1403+++ src/platform/graphics/gbm/buffer_allocator.cpp 2013-12-02 16:56:54 +0000
1404@@ -202,7 +202,7 @@
1405 }
1406
1407 auto const stride = geom::Stride{
1408- geom::bytes_per_pixel(buffer_properties.format) *
1409+ MIR_BYTES_PER_PIXEL(buffer_properties.format) *
1410 buffer_properties.size.width.as_uint32_t()};
1411 size_t const size_in_bytes =
1412 stride.as_int() * buffer_properties.size.height.as_int();
1413@@ -218,17 +218,17 @@
1414 return buffer;
1415 }
1416
1417-std::vector<geom::PixelFormat> mgg::BufferAllocator::supported_pixel_formats()
1418+std::vector<MirPixelFormat> mgg::BufferAllocator::supported_pixel_formats()
1419 {
1420- static std::vector<geom::PixelFormat> const pixel_formats{
1421- geom::PixelFormat::argb_8888,
1422- geom::PixelFormat::xrgb_8888
1423+ static std::vector<MirPixelFormat> const pixel_formats{
1424+ mir_pixel_format_argb_8888,
1425+ mir_pixel_format_xrgb_8888
1426 };
1427
1428 return pixel_formats;
1429 }
1430
1431-bool mgg::BufferAllocator::is_pixel_format_supported(geom::PixelFormat format)
1432+bool mgg::BufferAllocator::is_pixel_format_supported(MirPixelFormat format)
1433 {
1434 auto formats = supported_pixel_formats();
1435
1436
1437=== modified file 'src/platform/graphics/gbm/buffer_allocator.h'
1438--- src/platform/graphics/gbm/buffer_allocator.h 2013-11-28 14:02:22 +0000
1439+++ src/platform/graphics/gbm/buffer_allocator.h 2013-12-02 16:56:54 +0000
1440@@ -47,10 +47,10 @@
1441 virtual std::shared_ptr<Buffer> alloc_buffer(
1442 graphics::BufferProperties const& buffer_properties);
1443
1444- std::vector<geometry::PixelFormat> supported_pixel_formats();
1445+ std::vector<MirPixelFormat> supported_pixel_formats();
1446
1447 private:
1448- bool is_pixel_format_supported(geometry::PixelFormat format);
1449+ bool is_pixel_format_supported(MirPixelFormat format);
1450 std::shared_ptr<Buffer> alloc_hardware_buffer(
1451 graphics::BufferProperties const& buffer_properties);
1452 std::shared_ptr<Buffer> alloc_software_buffer(
1453
1454=== modified file 'src/platform/graphics/gbm/gbm_buffer.cpp'
1455--- src/platform/graphics/gbm/gbm_buffer.cpp 2013-11-28 14:02:22 +0000
1456+++ src/platform/graphics/gbm/gbm_buffer.cpp 2013-12-02 16:56:54 +0000
1457@@ -32,38 +32,38 @@
1458 namespace mgg=mir::graphics::gbm;
1459 namespace geom=mir::geometry;
1460
1461-geom::PixelFormat mgg::gbm_format_to_mir_format(uint32_t format)
1462+MirPixelFormat mgg::gbm_format_to_mir_format(uint32_t format)
1463 {
1464- geom::PixelFormat pf;
1465+ MirPixelFormat pf;
1466
1467 switch (format)
1468 {
1469 case GBM_BO_FORMAT_ARGB8888:
1470 case GBM_FORMAT_ARGB8888:
1471- pf = geom::PixelFormat::argb_8888;
1472+ pf = mir_pixel_format_argb_8888;
1473 break;
1474 case GBM_BO_FORMAT_XRGB8888:
1475 case GBM_FORMAT_XRGB8888:
1476- pf = geom::PixelFormat::xrgb_8888;
1477+ pf = mir_pixel_format_xrgb_8888;
1478 break;
1479 default:
1480- pf = geom::PixelFormat::invalid;
1481+ pf = mir_pixel_format_invalid;
1482 break;
1483 }
1484
1485 return pf;
1486 }
1487
1488-uint32_t mgg::mir_format_to_gbm_format(geom::PixelFormat format)
1489+uint32_t mgg::mir_format_to_gbm_format(MirPixelFormat format)
1490 {
1491 uint32_t gbm_pf;
1492
1493 switch (format)
1494 {
1495- case geom::PixelFormat::argb_8888:
1496+ case mir_pixel_format_argb_8888:
1497 gbm_pf = GBM_FORMAT_ARGB8888;
1498 break;
1499- case geom::PixelFormat::xrgb_8888:
1500+ case mir_pixel_format_xrgb_8888:
1501 gbm_pf = GBM_FORMAT_XRGB8888;
1502 break;
1503 default:
1504@@ -113,7 +113,7 @@
1505 return geom::Stride(gbm_bo_get_stride(gbm_handle.get()));
1506 }
1507
1508-geom::PixelFormat mgg::GBMBuffer::pixel_format() const
1509+MirPixelFormat mgg::GBMBuffer::pixel_format() const
1510 {
1511 return gbm_format_to_mir_format(gbm_bo_get_format(gbm_handle.get()));
1512 }
1513
1514=== modified file 'src/platform/graphics/gbm/gbm_buffer.h'
1515--- src/platform/graphics/gbm/gbm_buffer.h 2013-11-28 14:02:22 +0000
1516+++ src/platform/graphics/gbm/gbm_buffer.h 2013-12-02 16:56:54 +0000
1517@@ -39,8 +39,8 @@
1518 struct gbm_bo *bo;
1519 };
1520
1521-geometry::PixelFormat gbm_format_to_mir_format(uint32_t format);
1522-uint32_t mir_format_to_gbm_format(geometry::PixelFormat format);
1523+MirPixelFormat gbm_format_to_mir_format(uint32_t format);
1524+uint32_t mir_format_to_gbm_format(MirPixelFormat format);
1525 enum : uint32_t { invalid_gbm_format = std::numeric_limits<uint32_t>::max() };
1526
1527 class BufferTextureBinder;
1528@@ -60,7 +60,7 @@
1529
1530 virtual geometry::Stride stride() const;
1531
1532- virtual geometry::PixelFormat pixel_format() const;
1533+ virtual MirPixelFormat pixel_format() const;
1534
1535 virtual std::shared_ptr<MirNativeBuffer> native_buffer_handle() const;
1536
1537
1538=== modified file 'src/platform/graphics/gbm/real_kms_display_configuration.cpp'
1539--- src/platform/graphics/gbm/real_kms_display_configuration.cpp 2013-11-28 14:02:22 +0000
1540+++ src/platform/graphics/gbm/real_kms_display_configuration.cpp 2013-12-02 16:56:54 +0000
1541@@ -185,8 +185,8 @@
1542 size_t current_mode_index{std::numeric_limits<size_t>::max()};
1543 size_t preferred_mode_index{std::numeric_limits<size_t>::max()};
1544 std::vector<DisplayConfigurationMode> modes;
1545- std::vector<geom::PixelFormat> formats {geom::PixelFormat::argb_8888,
1546- geom::PixelFormat::xrgb_8888};
1547+ std::vector<MirPixelFormat> formats {mir_pixel_format_argb_8888,
1548+ mir_pixel_format_xrgb_8888};
1549
1550 drmModeModeInfo current_mode_info = drmModeModeInfo();
1551
1552
1553=== modified file 'src/platform/graphics/gbm/shm_buffer.cpp'
1554--- src/platform/graphics/gbm/shm_buffer.cpp 2013-11-28 14:02:22 +0000
1555+++ src/platform/graphics/gbm/shm_buffer.cpp 2013-12-02 16:56:54 +0000
1556@@ -29,11 +29,11 @@
1557 mgg::ShmBuffer::ShmBuffer(
1558 std::shared_ptr<ShmFile> const& shm_file,
1559 geom::Size const& size,
1560- geom::PixelFormat const& pixel_format)
1561+ MirPixelFormat const& pixel_format)
1562 : shm_file{shm_file},
1563 size_{size},
1564 pixel_format_{pixel_format},
1565- stride_{geom::bytes_per_pixel(pixel_format_) * size_.width.as_uint32_t()},
1566+ stride_{MIR_BYTES_PER_PIXEL(pixel_format_) * size_.width.as_uint32_t()},
1567 pixels{shm_file->base_ptr()}
1568 {
1569 }
1570@@ -52,7 +52,7 @@
1571 return stride_;
1572 }
1573
1574-geom::PixelFormat mgg::ShmBuffer::pixel_format() const
1575+MirPixelFormat mgg::ShmBuffer::pixel_format() const
1576 {
1577 return pixel_format_;
1578 }
1579
1580=== modified file 'src/platform/graphics/gbm/shm_buffer.h'
1581--- src/platform/graphics/gbm/shm_buffer.h 2013-11-28 14:02:22 +0000
1582+++ src/platform/graphics/gbm/shm_buffer.h 2013-12-02 16:56:54 +0000
1583@@ -23,7 +23,7 @@
1584 #include "mir/graphics/buffer_basic.h"
1585 #include "mir/geometry/dimensions.h"
1586 #include "mir/geometry/size.h"
1587-#include "mir/geometry/pixel_format.h"
1588+#include "mir_toolkit/common.h"
1589
1590 namespace mir
1591 {
1592@@ -39,12 +39,12 @@
1593 public:
1594 ShmBuffer(std::shared_ptr<ShmFile> const& shm_file,
1595 geometry::Size const& size,
1596- geometry::PixelFormat const& pixel_format);
1597+ MirPixelFormat const& pixel_format);
1598 ~ShmBuffer() noexcept;
1599
1600 geometry::Size size() const;
1601 geometry::Stride stride() const;
1602- geometry::PixelFormat pixel_format() const;
1603+ MirPixelFormat pixel_format() const;
1604 std::shared_ptr<MirNativeBuffer> native_buffer_handle() const;
1605 void bind_to_texture();
1606 bool can_bypass() const;
1607@@ -55,7 +55,7 @@
1608
1609 std::shared_ptr<ShmFile> const shm_file;
1610 geometry::Size const size_;
1611- geometry::PixelFormat const pixel_format_;
1612+ MirPixelFormat const pixel_format_;
1613 geometry::Stride const stride_;
1614 void* const pixels;
1615 };
1616
1617=== modified file 'src/server/CMakeLists.txt'
1618--- src/server/CMakeLists.txt 2013-11-25 07:59:56 +0000
1619+++ src/server/CMakeLists.txt 2013-12-02 16:56:54 +0000
1620@@ -92,7 +92,7 @@
1621 )
1622 endif()
1623
1624-set(MIRSERVER_ABI 11)
1625+set(MIRSERVER_ABI 12)
1626
1627 set_target_properties(
1628 mirserver
1629
1630=== modified file 'src/server/compositor/buffer_stream_surfaces.cpp'
1631--- src/server/compositor/buffer_stream_surfaces.cpp 2013-11-27 12:28:24 +0000
1632+++ src/server/compositor/buffer_stream_surfaces.cpp 2013-12-02 16:56:54 +0000
1633@@ -64,7 +64,7 @@
1634 }
1635 }
1636
1637-geom::PixelFormat mc::BufferStreamSurfaces::get_stream_pixel_format()
1638+MirPixelFormat mc::BufferStreamSurfaces::get_stream_pixel_format()
1639 {
1640 return buffer_bundle->properties().format;
1641 }
1642
1643=== modified file 'src/server/compositor/buffer_stream_surfaces.h'
1644--- src/server/compositor/buffer_stream_surfaces.h 2013-11-27 12:28:24 +0000
1645+++ src/server/compositor/buffer_stream_surfaces.h 2013-12-02 16:56:54 +0000
1646@@ -46,7 +46,7 @@
1647 lock_compositor_buffer(unsigned long frameno) override;
1648 std::shared_ptr<graphics::Buffer> lock_snapshot_buffer() override;
1649
1650- geometry::PixelFormat get_stream_pixel_format() override;
1651+ MirPixelFormat get_stream_pixel_format() override;
1652 geometry::Size stream_size() override;
1653 void resize(geometry::Size const& size) override;
1654 void allow_framedropping(bool) override;
1655
1656=== modified file 'src/server/compositor/temporary_buffers.cpp'
1657--- src/server/compositor/temporary_buffers.cpp 2013-11-27 12:28:24 +0000
1658+++ src/server/compositor/temporary_buffers.cpp 2013-12-02 16:56:54 +0000
1659@@ -62,7 +62,7 @@
1660 return buffer->stride();
1661 }
1662
1663-geom::PixelFormat mc::TemporaryBuffer::pixel_format() const
1664+MirPixelFormat mc::TemporaryBuffer::pixel_format() const
1665 {
1666 return buffer->pixel_format();
1667 }
1668
1669=== modified file 'src/server/compositor/temporary_buffers.h'
1670--- src/server/compositor/temporary_buffers.h 2013-11-27 12:28:24 +0000
1671+++ src/server/compositor/temporary_buffers.h 2013-12-02 16:56:54 +0000
1672@@ -37,7 +37,7 @@
1673 public:
1674 geometry::Size size() const;
1675 geometry::Stride stride() const;
1676- geometry::PixelFormat pixel_format() const;
1677+ MirPixelFormat pixel_format() const;
1678 mg::BufferID id() const;
1679 void bind_to_texture();
1680 std::shared_ptr<mg::NativeBuffer> native_buffer_handle() const;
1681
1682=== modified file 'src/server/frontend/session_mediator.cpp'
1683--- src/server/frontend/session_mediator.cpp 2013-11-27 12:28:24 +0000
1684+++ src/server/frontend/session_mediator.cpp 2013-12-02 16:56:54 +0000
1685@@ -57,7 +57,7 @@
1686 std::shared_ptr<frontend::Shell> const& shell,
1687 std::shared_ptr<graphics::Platform> const & graphics_platform,
1688 std::shared_ptr<mf::DisplayChanger> const& display_changer,
1689- std::vector<geom::PixelFormat> const& surface_pixel_formats,
1690+ std::vector<MirPixelFormat> const& surface_pixel_formats,
1691 std::shared_ptr<SessionMediatorReport> const& report,
1692 std::shared_ptr<EventSink> const& sender,
1693 std::shared_ptr<ResourceCache> const& resource_cache) :
1694@@ -155,7 +155,7 @@
1695 .of_name(request->surface_name())
1696 .of_size(request->width(), request->height())
1697 .of_buffer_usage(static_cast<graphics::BufferUsage>(request->buffer_usage()))
1698- .of_pixel_format(static_cast<geometry::PixelFormat>(request->pixel_format()))
1699+ .of_pixel_format(static_cast<MirPixelFormat>(request->pixel_format()))
1700 .with_output_id(graphics::DisplayConfigurationOutputId(request->output_id())));
1701
1702 auto surface = session->get_surface(surf_id);
1703
1704=== modified file 'src/server/frontend/session_mediator.h'
1705--- src/server/frontend/session_mediator.h 2013-11-25 07:59:56 +0000
1706+++ src/server/frontend/session_mediator.h 2013-12-02 16:56:54 +0000
1707@@ -22,7 +22,7 @@
1708
1709 #include "mir_protobuf.pb.h"
1710 #include "mir/frontend/surface_id.h"
1711-#include "mir/geometry/pixel_format.h"
1712+#include "mir_toolkit/common.h"
1713
1714 #include <unordered_map>
1715 #include <memory>
1716@@ -61,7 +61,7 @@
1717 std::shared_ptr<Shell> const& shell,
1718 std::shared_ptr<graphics::Platform> const& graphics_platform,
1719 std::shared_ptr<frontend::DisplayChanger> const& display_changer,
1720- std::vector<geometry::PixelFormat> const& surface_pixel_formats,
1721+ std::vector<MirPixelFormat> const& surface_pixel_formats,
1722 std::shared_ptr<SessionMediatorReport> const& report,
1723 std::shared_ptr<EventSink> const& event_sink,
1724 std::shared_ptr<ResourceCache> const& resource_cache);
1725@@ -120,7 +120,7 @@
1726 std::shared_ptr<Shell> const shell;
1727 std::shared_ptr<graphics::Platform> const graphics_platform;
1728
1729- std::vector<geometry::PixelFormat> const surface_pixel_formats;
1730+ std::vector<MirPixelFormat> const surface_pixel_formats;
1731
1732 std::shared_ptr<frontend::DisplayChanger> const display_changer;
1733 std::shared_ptr<SessionMediatorReport> const report;
1734
1735=== modified file 'src/server/graphics/nested/nested_display_configuration.cpp'
1736--- src/server/graphics/nested/nested_display_configuration.cpp 2013-11-27 12:28:24 +0000
1737+++ src/server/graphics/nested/nested_display_configuration.cpp 2013-12-02 16:56:54 +0000
1738@@ -55,10 +55,10 @@
1739 display_config->outputs+display_config->num_outputs,
1740 [&f](MirDisplayOutput const& mir_output)
1741 {
1742- std::vector<geometry::PixelFormat> formats;
1743+ std::vector<MirPixelFormat> formats;
1744 formats.reserve(mir_output.num_output_formats);
1745 for (auto p = mir_output.output_formats; p != mir_output.output_formats+mir_output.num_output_formats; ++p)
1746- formats.push_back(geometry::PixelFormat(*p));
1747+ formats.push_back(MirPixelFormat(*p));
1748
1749 std::vector<DisplayConfigurationMode> modes;
1750 modes.reserve(mir_output.num_modes);
1751
1752=== modified file 'src/server/graphics/offscreen/display_configuration.cpp'
1753--- src/server/graphics/offscreen/display_configuration.cpp 2013-11-12 17:23:53 +0000
1754+++ src/server/graphics/offscreen/display_configuration.cpp 2013-12-02 16:56:54 +0000
1755@@ -24,7 +24,7 @@
1756 : output{mg::DisplayConfigurationOutputId{1},
1757 mg::DisplayConfigurationCardId{0},
1758 mg::DisplayConfigurationOutputType::lvds,
1759- {geom::PixelFormat::xrgb_8888},
1760+ {mir_pixel_format_xrgb_8888},
1761 {mg::DisplayConfigurationMode{display_size,0.0f}},
1762 0,
1763 geom::Size{0,0},
1764
1765=== modified file 'src/server/scene/basic_surface.h'
1766--- src/server/scene/basic_surface.h 2013-11-27 12:28:24 +0000
1767+++ src/server/scene/basic_surface.h 2013-12-02 16:56:54 +0000
1768@@ -19,7 +19,7 @@
1769 #ifndef MIR_SCENE_BASIC_SURFACE_H_
1770 #define MIR_SCENE_BASIC_SURFACE_H_
1771
1772-#include "mir/geometry/pixel_format.h"
1773+#include "mir_toolkit/common.h"
1774 #include "mir/geometry/rectangle.h"
1775 #include "mir/graphics/buffer_properties.h"
1776
1777@@ -62,7 +62,7 @@
1778 virtual geometry::Point top_left() const = 0;
1779 virtual geometry::Size size() const = 0;
1780
1781- virtual geometry::PixelFormat pixel_format() const = 0;
1782+ virtual MirPixelFormat pixel_format() const = 0;
1783
1784 virtual std::shared_ptr<graphics::Buffer> snapshot_buffer() const = 0;
1785 virtual void swap_buffers(std::shared_ptr<graphics::Buffer>&) = 0;
1786
1787=== modified file 'src/server/scene/surface.cpp'
1788--- src/server/scene/surface.cpp 2013-11-27 12:28:24 +0000
1789+++ src/server/scene/surface.cpp 2013-12-02 16:56:54 +0000
1790@@ -104,7 +104,7 @@
1791 return surface_state->size();
1792 }
1793
1794-geom::PixelFormat ms::Surface::pixel_format() const
1795+MirPixelFormat ms::Surface::pixel_format() const
1796 {
1797 return surface_buffer_stream->get_stream_pixel_format();
1798 }
1799
1800=== modified file 'src/server/scene/surface.h'
1801--- src/server/scene/surface.h 2013-11-27 12:28:24 +0000
1802+++ src/server/scene/surface.h 2013-12-02 16:56:54 +0000
1803@@ -47,7 +47,7 @@
1804 geometry::Point top_left() const;
1805 geometry::Size size() const;
1806
1807- geometry::PixelFormat pixel_format() const;
1808+ MirPixelFormat pixel_format() const;
1809
1810 std::shared_ptr<graphics::Buffer> snapshot_buffer() const;
1811 void swap_buffers(std::shared_ptr<graphics::Buffer>& buffer);
1812
1813=== modified file 'src/server/scene/surface_allocator.cpp'
1814--- src/server/scene/surface_allocator.cpp 2013-11-25 07:59:56 +0000
1815+++ src/server/scene/surface_allocator.cpp 2013-12-02 16:56:54 +0000
1816@@ -30,6 +30,12 @@
1817 namespace msh=mir::shell;
1818 namespace mi=mir::input;
1819
1820+static inline bool has_alpha(MirPixelFormat fmt)
1821+{
1822+ return (fmt == mir_pixel_format_abgr_8888) ||
1823+ (fmt == mir_pixel_format_argb_8888);
1824+}
1825+
1826 ms::SurfaceAllocator::SurfaceAllocator(
1827 std::shared_ptr<BufferStreamFactory> const& stream_factory,
1828 std::shared_ptr<input::InputChannelFactory> const& input_factory,
1829
1830=== modified file 'src/server/scene/surface_impl.cpp'
1831--- src/server/scene/surface_impl.cpp 2013-11-27 12:28:24 +0000
1832+++ src/server/scene/surface_impl.cpp 2013-12-02 16:56:54 +0000
1833@@ -99,7 +99,7 @@
1834 return surface->name();
1835 }
1836
1837-mir::geometry::PixelFormat ms::SurfaceImpl::pixel_format() const
1838+MirPixelFormat ms::SurfaceImpl::pixel_format() const
1839 {
1840 return surface->pixel_format();
1841 }
1842
1843=== modified file 'src/server/scene/surface_impl.h'
1844--- src/server/scene/surface_impl.h 2013-11-27 12:28:24 +0000
1845+++ src/server/scene/surface_impl.h 2013-12-02 16:56:54 +0000
1846@@ -68,7 +68,7 @@
1847 virtual geometry::Size size() const;
1848 virtual geometry::Point top_left() const;
1849
1850- virtual geometry::PixelFormat pixel_format() const;
1851+ virtual MirPixelFormat pixel_format() const;
1852
1853 virtual void with_most_recent_buffer_do(
1854 std::function<void(graphics::Buffer&)> const& exec);
1855
1856=== modified file 'src/server/shell/surface_creation_parameters.cpp'
1857--- src/server/shell/surface_creation_parameters.cpp 2013-11-27 12:28:24 +0000
1858+++ src/server/shell/surface_creation_parameters.cpp 2013-12-02 16:56:54 +0000
1859@@ -25,7 +25,7 @@
1860
1861 msh::SurfaceCreationParameters::SurfaceCreationParameters()
1862 : name(), size(), top_left(), buffer_usage(mg::BufferUsage::undefined),
1863- pixel_format(geom::PixelFormat::invalid),
1864+ pixel_format(mir_pixel_format_invalid),
1865 depth{0}, input_mode(mi::InputReceptionMode::normal)
1866 {
1867 }
1868@@ -68,7 +68,7 @@
1869 }
1870
1871 msh::SurfaceCreationParameters& msh::SurfaceCreationParameters::of_pixel_format(
1872- geom::PixelFormat new_pixel_format)
1873+ MirPixelFormat new_pixel_format)
1874 {
1875 pixel_format = new_pixel_format;
1876
1877
1878=== modified file 'tests/acceptance-tests/test_surfaceloop.cpp'
1879--- tests/acceptance-tests/test_surfaceloop.cpp 2013-11-25 07:59:56 +0000
1880+++ tests/acceptance-tests/test_surfaceloop.cpp 2013-12-02 16:56:54 +0000
1881@@ -16,7 +16,7 @@
1882 * Authored by: Alan Griffiths <alan@octopull.co.uk>
1883 */
1884
1885-#include "mir/geometry/pixel_format.h"
1886+#include "mir_toolkit/common.h"
1887 #include "mir/geometry/size.h"
1888
1889 #include "mir_toolkit/mir_client_library.h"
1890
1891=== modified file 'tests/draw/android_graphics.cpp'
1892--- tests/draw/android_graphics.cpp 2013-11-25 07:59:56 +0000
1893+++ tests/draw/android_graphics.cpp 2013-12-02 16:56:54 +0000
1894@@ -18,7 +18,7 @@
1895
1896
1897 #include "mir_test/draw/android_graphics.h"
1898-#include "mir/geometry/pixel_format.h"
1899+#include "mir_toolkit/common.h"
1900
1901 #include <fstream>
1902 #include <stdexcept>
1903@@ -107,7 +107,7 @@
1904 RegionDeleter del(module, package->handle);
1905
1906 region->vaddr = (char*) vaddr;
1907- region->stride = package->stride * geom::bytes_per_pixel(geom::PixelFormat::abgr_8888);
1908+ region->stride = package->stride * MIR_BYTES_PER_PIXEL(mir_pixel_format_abgr_8888);
1909 region->width = package->width;
1910 region->height = package->height;
1911 region->pixel_format = mir_pixel_format_abgr_8888;
1912
1913=== modified file 'tests/draw/patterns.cpp'
1914--- tests/draw/patterns.cpp 2013-11-25 07:59:56 +0000
1915+++ tests/draw/patterns.cpp 2013-12-02 16:56:54 +0000
1916@@ -16,11 +16,10 @@
1917 * Authored by: Kevin DuBois <kevin.dubois@canonical.com>
1918 */
1919
1920-#include "mir/geometry/pixel_format.h"
1921+#include "mir_toolkit/common.h"
1922 #include "mir_test/draw/patterns.h"
1923
1924 namespace mtd=mir::test::draw;
1925-namespace geom=mir::geometry;
1926
1927 mtd::DrawPatternSolid::DrawPatternSolid(uint32_t color_value)
1928 : color_value(color_value)
1929@@ -32,7 +31,7 @@
1930 if (region.pixel_format != mir_pixel_format_abgr_8888 )
1931 throw(std::runtime_error("cannot draw region, incorrect format"));
1932
1933- auto bpp = geom::bytes_per_pixel(geom::PixelFormat::abgr_8888);
1934+ auto bpp = MIR_BYTES_PER_PIXEL(mir_pixel_format_abgr_8888);
1935 for(auto i = 0; i < region.height; i++)
1936 {
1937 for(auto j = 0; j < region.width; j++)
1938@@ -48,7 +47,7 @@
1939 if (region.pixel_format != mir_pixel_format_abgr_8888 )
1940 throw(std::runtime_error("cannot check region, incorrect format"));
1941
1942- auto bpp = geom::bytes_per_pixel(geom::PixelFormat::abgr_8888);
1943+ auto bpp = MIR_BYTES_PER_PIXEL(mir_pixel_format_abgr_8888);
1944 for(auto i = 0; i < region.height; i++)
1945 {
1946 for(auto j = 0; j < region.width; j++)
1947
1948=== modified file 'tests/integration-tests/client/test_client_render.cpp'
1949--- tests/integration-tests/client/test_client_render.cpp 2013-11-28 14:17:01 +0000
1950+++ tests/integration-tests/client/test_client_render.cpp 2013-12-02 16:56:54 +0000
1951@@ -192,7 +192,7 @@
1952 auto initializer = std::make_shared<mg::NullBufferInitializer>();
1953 allocator = std::make_shared<mga::AndroidGraphicBufferAllocator> (initializer);
1954 auto size = geom::Size{test_width, test_height};
1955- surface_pf = geom::PixelFormat::abgr_8888;
1956+ surface_pf = mir_pixel_format_abgr_8888;
1957 last_posted = allocator->alloc_buffer_platform(size, surface_pf, mga::BufferUsage::use_hardware);
1958 client_buffer = allocator->alloc_buffer_platform(size, surface_pf, mga::BufferUsage::use_hardware);
1959 }
1960@@ -205,7 +205,7 @@
1961 response->mutable_id()->set_value(13);
1962 response->set_width(test_width);
1963 response->set_height(test_height);
1964- surface_pf = geom::PixelFormat(request->pixel_format());
1965+ surface_pf = MirPixelFormat(request->pixel_format());
1966 response->set_pixel_format(request->pixel_format());
1967 response->mutable_buffer()->set_buffer_id(client_buffer->id().as_uint32_t());
1968
1969@@ -260,10 +260,10 @@
1970
1971 uint32_t red_value_for_surface()
1972 {
1973- if ((surface_pf == geom::PixelFormat::abgr_8888) || (surface_pf == geom::PixelFormat::xbgr_8888))
1974+ if ((surface_pf == mir_pixel_format_abgr_8888) || (surface_pf == mir_pixel_format_xbgr_8888))
1975 return 0xFF0000FF;
1976
1977- if ((surface_pf == geom::PixelFormat::argb_8888) || (surface_pf == geom::PixelFormat::xrgb_8888))
1978+ if ((surface_pf == mir_pixel_format_argb_8888) || (surface_pf == mir_pixel_format_xrgb_8888))
1979 return 0xFFFF0000;
1980
1981 return 0x0;
1982@@ -291,7 +291,7 @@
1983 std::shared_ptr<mg::Buffer> client_buffer;
1984 std::shared_ptr<mg::Buffer> last_posted;
1985 std::mutex buffer_mutex;
1986- geom::PixelFormat surface_pf;
1987+ MirPixelFormat surface_pf;
1988 };
1989
1990 }
1991
1992=== modified file 'tests/integration-tests/compositor/test_buffer_stream.cpp'
1993--- tests/integration-tests/compositor/test_buffer_stream.cpp 2013-11-27 12:28:24 +0000
1994+++ tests/integration-tests/compositor/test_buffer_stream.cpp 2013-12-02 16:56:54 +0000
1995@@ -51,7 +51,7 @@
1996 {
1997 auto allocator = std::make_shared<mtd::StubBufferAllocator>();
1998 mg::BufferProperties properties{geom::Size{380, 210},
1999- geom::PixelFormat::abgr_8888,
2000+ mir_pixel_format_abgr_8888,
2001 mg::BufferUsage::hardware};
2002
2003 return std::make_shared<mc::SwitchingBundle>(nbuffers,
2004
2005=== modified file 'tests/integration-tests/compositor/test_swapping_swappers.cpp'
2006--- tests/integration-tests/compositor/test_swapping_swappers.cpp 2013-11-27 12:28:24 +0000
2007+++ tests/integration-tests/compositor/test_swapping_swappers.cpp 2013-12-02 16:56:54 +0000
2008@@ -43,7 +43,7 @@
2009 {
2010 auto allocator = std::make_shared<mtd::StubBufferAllocator>();
2011 auto properties = mg::BufferProperties{geom::Size{380, 210},
2012- geom::PixelFormat::abgr_8888,
2013+ mir_pixel_format_abgr_8888,
2014 mg::BufferUsage::hardware};
2015 switching_bundle = std::make_shared<mc::SwitchingBundle>(3, allocator, properties);
2016 }
2017
2018=== modified file 'tests/integration-tests/graphics/android/test_buffer_integration.cpp'
2019--- tests/integration-tests/graphics/android/test_buffer_integration.cpp 2013-11-28 14:17:01 +0000
2020+++ tests/integration-tests/graphics/android/test_buffer_integration.cpp 2013-12-02 16:56:54 +0000
2021@@ -43,14 +43,14 @@
2022 virtual void SetUp()
2023 {
2024 size = geom::Size{334, 122};
2025- pf = geom::PixelFormat::abgr_8888;
2026+ pf = mir_pixel_format_abgr_8888;
2027 buffer_properties = mg::BufferProperties{size, pf, mg::BufferUsage::software};
2028 null_buffer_initializer = std::make_shared<mg::NullBufferInitializer>();
2029 }
2030
2031 std::shared_ptr<mg::BufferInitializer> null_buffer_initializer;
2032 geom::Size size;
2033- geom::PixelFormat pf;
2034+ MirPixelFormat pf;
2035 mg::BufferProperties buffer_properties;
2036 mtd::TestGrallocMapper sw_renderer;
2037 };
2038
2039=== modified file 'tests/integration-tests/graphics/android/test_internal_client.cpp'
2040--- tests/integration-tests/graphics/android/test_internal_client.cpp 2013-11-28 14:17:01 +0000
2041+++ tests/integration-tests/graphics/android/test_internal_client.cpp 2013-12-02 16:56:54 +0000
2042@@ -80,7 +80,7 @@
2043 TEST_F(AndroidInternalClient, internal_client_creation_and_use)
2044 {
2045 auto size = geom::Size{334, 122};
2046- auto pf = geom::PixelFormat::abgr_8888;
2047+ auto pf = mir_pixel_format_abgr_8888;
2048 msh::SurfaceCreationParameters params;
2049 params.name = std::string("test");
2050 params.size = size;
2051
2052=== modified file 'tests/integration-tests/graphics/gbm/test_buffer_integration.cpp'
2053--- tests/integration-tests/graphics/gbm/test_buffer_integration.cpp 2013-11-28 14:17:01 +0000
2054+++ tests/integration-tests/graphics/gbm/test_buffer_integration.cpp 2013-12-02 16:56:54 +0000
2055@@ -105,7 +105,7 @@
2056 auto buffer_initializer = std::make_shared<mg::NullBufferInitializer>();
2057 allocator = platform->create_buffer_allocator(buffer_initializer);
2058 size = geom::Size{100, 100};
2059- pf = geom::PixelFormat::abgr_8888;
2060+ pf = mir_pixel_format_abgr_8888;
2061 usage = mg::BufferUsage::hardware;
2062 buffer_properties = mg::BufferProperties{size, pf, usage};
2063 }
2064@@ -114,7 +114,7 @@
2065 std::shared_ptr<mg::Display> display;
2066 std::shared_ptr<mg::GraphicBufferAllocator> allocator;
2067 geom::Size size;
2068- geom::PixelFormat pf;
2069+ MirPixelFormat pf;
2070 mg::BufferUsage usage;
2071 mg::BufferProperties buffer_properties;
2072 };
2073
2074=== modified file 'tests/integration-tests/test_display_info.cpp'
2075--- tests/integration-tests/test_display_info.cpp 2013-11-27 12:28:24 +0000
2076+++ tests/integration-tests/test_display_info.cpp 2013-12-02 16:56:54 +0000
2077@@ -85,7 +85,7 @@
2078
2079 mtd::StubDisplayConfig StubChanger::stub_display_config{
2080 2,
2081- { geom::PixelFormat::xrgb_8888 }
2082+ { mir_pixel_format_xrgb_8888 }
2083 };
2084
2085 char const* const mir_test_socket = mtf::test_socket_file().c_str();
2086@@ -93,18 +93,18 @@
2087 class StubGraphicBufferAllocator : public mtd::StubBufferAllocator
2088 {
2089 public:
2090- std::vector<geom::PixelFormat> supported_pixel_formats() override
2091+ std::vector<MirPixelFormat> supported_pixel_formats() override
2092 {
2093 return pixel_formats;
2094 }
2095
2096- static std::vector<geom::PixelFormat> const pixel_formats;
2097+ static std::vector<MirPixelFormat> const pixel_formats;
2098 };
2099
2100-std::vector<geom::PixelFormat> const StubGraphicBufferAllocator::pixel_formats{
2101- geom::PixelFormat::argb_8888,
2102- geom::PixelFormat::xbgr_8888,
2103- geom::PixelFormat::bgr_888
2104+std::vector<MirPixelFormat> const StubGraphicBufferAllocator::pixel_formats{
2105+ mir_pixel_format_argb_8888,
2106+ mir_pixel_format_xbgr_8888,
2107+ mir_pixel_format_bgr_888
2108 };
2109
2110 class StubPlatform : public mtd::NullPlatform
2111@@ -174,7 +174,7 @@
2112 for (auto i=0u; i < returned_format_size; ++i)
2113 {
2114 EXPECT_EQ(StubGraphicBufferAllocator::pixel_formats[i],
2115- static_cast<geom::PixelFormat>(formats[i])) << "i=" << i;
2116+ formats[i]) << "i=" << i;
2117 }
2118
2119 mir_connection_release(connection);
2120
2121=== modified file 'tests/integration-tests/test_surfaceloop.cpp'
2122--- tests/integration-tests/test_surfaceloop.cpp 2013-11-25 07:59:56 +0000
2123+++ tests/integration-tests/test_surfaceloop.cpp 2013-12-02 16:56:54 +0000
2124@@ -49,7 +49,7 @@
2125 char const* const mir_test_socket = mtf::test_socket_file().c_str();
2126
2127 geom::Size const size{640, 480};
2128-geom::PixelFormat const format{geom::PixelFormat::abgr_8888};
2129+MirPixelFormat const format{mir_pixel_format_abgr_8888};
2130 mg::BufferUsage const usage{mg::BufferUsage::hardware};
2131 mg::BufferProperties const buffer_properties{size, format, usage};
2132
2133
2134=== modified file 'tests/integration-tests/test_swapinterval.cpp'
2135--- tests/integration-tests/test_swapinterval.cpp 2013-11-27 12:28:24 +0000
2136+++ tests/integration-tests/test_swapinterval.cpp 2013-12-02 16:56:54 +0000
2137@@ -60,7 +60,7 @@
2138 void release_client_buffer(std::shared_ptr<mg::Buffer>& buffer) { buffer.reset(); }
2139 std::shared_ptr<mg::Buffer> lock_compositor_buffer(unsigned long) { return std::make_shared<mtd::StubBuffer>(); }
2140 std::shared_ptr<mg::Buffer> lock_snapshot_buffer() { return std::make_shared<mtd::StubBuffer>(); }
2141- geom::PixelFormat get_stream_pixel_format() { return geom::PixelFormat::abgr_8888; }
2142+ MirPixelFormat get_stream_pixel_format() { return mir_pixel_format_abgr_8888; }
2143 geom::Size stream_size() { return geom::Size{}; }
2144 void resize(geom::Size const&) override {}
2145 void force_requests_to_complete() {}
2146
2147=== modified file 'tests/mir_test/display_config_matchers.cpp'
2148--- tests/mir_test/display_config_matchers.cpp 2013-09-12 21:36:55 +0000
2149+++ tests/mir_test/display_config_matchers.cpp 2013-12-02 16:56:54 +0000
2150@@ -86,11 +86,11 @@
2151 display_output.modes = modes;
2152
2153 /* Pixel formats */
2154- std::vector<geom::PixelFormat> pixel_formats;
2155+ std::vector<MirPixelFormat> pixel_formats;
2156 for (int n = 0; n < protobuf_output.pixel_format_size(); n++)
2157 {
2158 pixel_formats.push_back(
2159- static_cast<geom::PixelFormat>(protobuf_output.pixel_format(n)));
2160+ static_cast<MirPixelFormat>(protobuf_output.pixel_format(n)));
2161 }
2162 display_output.pixel_formats = pixel_formats;
2163
2164@@ -151,11 +151,10 @@
2165 display_output.modes = modes;
2166
2167 /* Pixel formats */
2168- std::vector<geom::PixelFormat> pixel_formats;
2169+ std::vector<MirPixelFormat> pixel_formats;
2170 for (size_t n = 0; n < client_output.num_output_formats; n++)
2171 {
2172- pixel_formats.push_back(
2173- static_cast<geom::PixelFormat>(client_output.output_formats[n]));
2174+ pixel_formats.push_back(client_output.output_formats[n]);
2175 }
2176 display_output.pixel_formats = pixel_formats;
2177
2178
2179=== modified file 'tests/mir_test_framework/testing_client_options.cpp'
2180--- tests/mir_test_framework/testing_client_options.cpp 2013-11-27 12:28:24 +0000
2181+++ tests/mir_test_framework/testing_client_options.cpp 2013-12-02 16:56:54 +0000
2182@@ -50,9 +50,9 @@
2183 return geom::Stride{};
2184 }
2185
2186- geom::PixelFormat pixel_format() const
2187+ MirPixelFormat pixel_format() const
2188 {
2189- return geom::PixelFormat::abgr_8888;
2190+ return mir_pixel_format_abgr_8888;
2191 }
2192
2193 uint32_t age() const
2194@@ -74,7 +74,7 @@
2195 struct StubClientBufferFactory : public mcl::ClientBufferFactory
2196 {
2197 std::shared_ptr<mcl::ClientBuffer> create_buffer(std::shared_ptr<MirBufferPackage> const&,
2198- geom::Size, geom::PixelFormat)
2199+ geom::Size, MirPixelFormat)
2200 {
2201 return std::make_shared<StubClientBuffer>();
2202 }
2203
2204=== modified file 'tests/mir_test_framework/testing_server_options.cpp'
2205--- tests/mir_test_framework/testing_server_options.cpp 2013-11-27 12:28:24 +0000
2206+++ tests/mir_test_framework/testing_server_options.cpp 2013-12-02 16:56:54 +0000
2207@@ -137,7 +137,7 @@
2208 mg::DisplayConfigurationOutputId{1},
2209 mg::DisplayConfigurationCardId{0},
2210 mg::DisplayConfigurationOutputType::vga,
2211- std::vector<geom::PixelFormat>{geom::PixelFormat::abgr_8888},
2212+ std::vector<MirPixelFormat>{mir_pixel_format_abgr_8888},
2213 modes, 0, geom::Size{}, true, true, geom::Point{0,0}, 0, 0, mir_power_mode_on};
2214
2215 f(dummy_output_config);
2216
2217=== modified file 'tests/unit-tests/client/android/test_client_android_buffer.cpp'
2218--- tests/unit-tests/client/android/test_client_android_buffer.cpp 2013-11-25 07:59:56 +0000
2219+++ tests/unit-tests/client/android/test_client_android_buffer.cpp 2013-12-02 16:56:54 +0000
2220@@ -43,7 +43,7 @@
2221 width = geom::Width(248);
2222 size = geom::Size{width, height};
2223 stride = geom::Stride{66};
2224- pf = geom::PixelFormat::abgr_8888;
2225+ pf = mir_pixel_format_abgr_8888;
2226
2227 mock_android_registrar = std::make_shared<NiceMock<mtd::MockAndroidRegistrar>>();
2228
2229@@ -55,7 +55,7 @@
2230 geom::Height height;
2231 geom::Width width;
2232 geom::Stride stride;
2233- geom::PixelFormat pf;
2234+ MirPixelFormat pf;
2235 std::shared_ptr<mcla::AndroidClientBuffer> buffer;
2236 std::shared_ptr<mtd::MockAndroidRegistrar> mock_android_registrar;
2237 };
2238@@ -139,7 +139,7 @@
2239 {
2240 int correct_usage = GRALLOC_USAGE_HW_TEXTURE | GRALLOC_USAGE_HW_RENDER;
2241 int32_t const expected_stride_in_pixels =
2242- static_cast<int32_t>(stride.as_uint32_t() / geom::bytes_per_pixel(pf));
2243+ static_cast<int32_t>(stride.as_uint32_t() / MIR_BYTES_PER_PIXEL(pf));
2244 mcla::AndroidClientBuffer buffer(mock_android_registrar, package, size, pf, stride);
2245 auto native_handle = buffer.native_buffer_handle();
2246 ASSERT_NE(nullptr, native_handle);
2247
2248=== modified file 'tests/unit-tests/client/android/test_client_surface_interpreter.cpp'
2249--- tests/unit-tests/client/android/test_client_surface_interpreter.cpp 2013-11-27 12:28:24 +0000
2250+++ tests/unit-tests/client/android/test_client_surface_interpreter.cpp 2013-12-02 16:56:54 +0000
2251@@ -48,7 +48,7 @@
2252 MOCK_METHOD0(secure_for_cpu_write, std::shared_ptr<mcl::MemoryRegion>());
2253 MOCK_CONST_METHOD0(size, geom::Size());
2254 MOCK_CONST_METHOD0(stride, geom::Stride());
2255- MOCK_CONST_METHOD0(pixel_format, geom::PixelFormat());
2256+ MOCK_CONST_METHOD0(pixel_format, MirPixelFormat());
2257
2258 MOCK_CONST_METHOD0(age, uint32_t());
2259 MOCK_METHOD0(mark_as_submitted, void());
2260
2261=== modified file 'tests/unit-tests/client/gbm/test_gbm_client_buffer.cpp'
2262--- tests/unit-tests/client/gbm/test_gbm_client_buffer.cpp 2013-11-27 15:25:10 +0000
2263+++ tests/unit-tests/client/gbm/test_gbm_client_buffer.cpp 2013-12-02 16:56:54 +0000
2264@@ -48,7 +48,7 @@
2265 width = geom::Width(12);
2266 height =geom::Height(14);
2267 stride = geom::Stride(66);
2268- pf = geom::PixelFormat::abgr_8888;
2269+ pf = mir_pixel_format_abgr_8888;
2270 size = geom::Size{width, height};
2271 buffer_file_ops = std::make_shared<testing::NiceMock<MockBufferFileOps>>();
2272
2273@@ -64,7 +64,7 @@
2274 geom::Width width;
2275 geom::Height height;
2276 geom::Stride stride;
2277- geom::PixelFormat pf;
2278+ MirPixelFormat pf;
2279 geom::Size size;
2280
2281 std::shared_ptr<testing::NiceMock<MockBufferFileOps>> buffer_file_ops;
2282
2283=== modified file 'tests/unit-tests/client/gbm/test_native_surface.cpp'
2284--- tests/unit-tests/client/gbm/test_native_surface.cpp 2013-06-28 00:24:30 +0000
2285+++ tests/unit-tests/client/gbm/test_native_surface.cpp 2013-12-02 16:56:54 +0000
2286@@ -44,7 +44,7 @@
2287 MOCK_METHOD0(secure_for_cpu_write, std::shared_ptr<mcl::MemoryRegion>());
2288 MOCK_CONST_METHOD0(size, geom::Size());
2289 MOCK_CONST_METHOD0(stride, geom::Stride());
2290- MOCK_CONST_METHOD0(pixel_format, geom::PixelFormat());
2291+ MOCK_CONST_METHOD0(pixel_format, MirPixelFormat());
2292
2293 MOCK_CONST_METHOD0(age, uint32_t());
2294 MOCK_METHOD0(mark_as_submitted, void());
2295
2296=== modified file 'tests/unit-tests/client/test_aging_buffer.cpp'
2297--- tests/unit-tests/client/test_aging_buffer.cpp 2013-10-15 08:53:10 +0000
2298+++ tests/unit-tests/client/test_aging_buffer.cpp 2013-12-02 16:56:54 +0000
2299@@ -46,7 +46,7 @@
2300 exit(1);
2301 }
2302
2303- geom::PixelFormat pixel_format() const
2304+ MirPixelFormat pixel_format() const
2305 {
2306 exit(1);
2307 }
2308
2309=== modified file 'tests/unit-tests/client/test_android_client_buffer_factory.cpp'
2310--- tests/unit-tests/client/test_android_client_buffer_factory.cpp 2013-11-25 07:59:56 +0000
2311+++ tests/unit-tests/client/test_android_client_buffer_factory.cpp 2013-12-02 16:56:54 +0000
2312@@ -36,7 +36,7 @@
2313 width = geom::Width(12);
2314 height =geom::Height(14);
2315 size = geom::Size{width, height};
2316- pf = geom::PixelFormat::abgr_8888;
2317+ pf = mir_pixel_format_abgr_8888;
2318
2319 mock_registrar = std::make_shared<mtd::MockAndroidRegistrar>();
2320
2321@@ -46,7 +46,7 @@
2322 }
2323 geom::Width width;
2324 geom::Height height;
2325- geom::PixelFormat pf;
2326+ MirPixelFormat pf;
2327 geom::Size size;
2328
2329 std::shared_ptr<mtd::MockAndroidRegistrar> mock_registrar;
2330
2331=== modified file 'tests/unit-tests/client/test_client_buffer_depository.cpp'
2332--- tests/unit-tests/client/test_client_buffer_depository.cpp 2013-10-15 08:53:10 +0000
2333+++ tests/unit-tests/client/test_client_buffer_depository.cpp 2013-12-02 16:56:54 +0000
2334@@ -20,7 +20,7 @@
2335 #include "src/client/client_buffer_depository.h"
2336 #include "src/client/client_buffer_factory.h"
2337 #include "src/client/aging_buffer.h"
2338-#include "mir/geometry/pixel_format.h"
2339+#include "mir_toolkit/common.h"
2340 #include "mir/geometry/size.h"
2341
2342 #include <gtest/gtest.h>
2343@@ -51,7 +51,7 @@
2344 MOCK_METHOD0(secure_for_cpu_write, std::shared_ptr<mcl::MemoryRegion>());
2345 MOCK_CONST_METHOD0(size, geom::Size());
2346 MOCK_CONST_METHOD0(stride, geom::Stride());
2347- MOCK_CONST_METHOD0(pixel_format, geom::PixelFormat());
2348+ MOCK_CONST_METHOD0(pixel_format, MirPixelFormat());
2349 MOCK_CONST_METHOD0(native_buffer_handle, std::shared_ptr<mir::graphics::NativeBuffer>());
2350 };
2351
2352@@ -70,7 +70,7 @@
2353
2354 MOCK_METHOD3(create_buffer,
2355 std::shared_ptr<mcl::ClientBuffer>(std::shared_ptr<MirBufferPackage> const&,
2356- geom::Size, geom::PixelFormat));
2357+ geom::Size, MirPixelFormat));
2358
2359 std::shared_ptr<mcl::ClientBuffer> buffer;
2360 };
2361@@ -81,7 +81,7 @@
2362 {
2363 width = geom::Width(12);
2364 height =geom::Height(14);
2365- pf = geom::PixelFormat::abgr_8888;
2366+ pf = mir_pixel_format_abgr_8888;
2367 size = geom::Size{width, height};
2368
2369 package = std::make_shared<MirBufferPackage>();
2370@@ -89,7 +89,7 @@
2371 }
2372 geom::Width width;
2373 geom::Height height;
2374- geom::PixelFormat pf;
2375+ MirPixelFormat pf;
2376 geom::Size size;
2377
2378 std::shared_ptr<MirBufferPackage> package;
2379
2380=== modified file 'tests/unit-tests/client/test_client_mir_surface.cpp'
2381--- tests/unit-tests/client/test_client_mir_surface.cpp 2013-11-27 12:28:24 +0000
2382+++ tests/unit-tests/client/test_client_mir_surface.cpp 2013-12-02 16:56:54 +0000
2383@@ -180,7 +180,7 @@
2384 MOCK_METHOD0(secure_for_cpu_write, std::shared_ptr<mcl::MemoryRegion>());
2385 MOCK_CONST_METHOD0(size, geom::Size());
2386 MOCK_CONST_METHOD0(stride, geom::Stride());
2387- MOCK_CONST_METHOD0(pixel_format, geom::PixelFormat());
2388+ MOCK_CONST_METHOD0(pixel_format, MirPixelFormat());
2389 MOCK_CONST_METHOD0(age, uint32_t());
2390 MOCK_METHOD0(increment_age, void());
2391 MOCK_METHOD0(mark_as_submitted, void());
2392@@ -203,7 +203,7 @@
2393
2394 MOCK_METHOD3(create_buffer,
2395 std::shared_ptr<mcl::ClientBuffer>(std::shared_ptr<MirBufferPackage> const&,
2396- geom::Size, geom::PixelFormat));
2397+ geom::Size, MirPixelFormat));
2398
2399 std::shared_ptr<MirBufferPackage> current_package;
2400 std::shared_ptr<mcl::ClientBuffer> current_buffer;
2401@@ -469,7 +469,7 @@
2402 {
2403 using namespace testing;
2404
2405- geom::PixelFormat pf;
2406+ MirPixelFormat pf;
2407 std::shared_ptr<MirBufferPackage> submitted_package;
2408
2409 EXPECT_CALL(*mock_buffer_factory, create_buffer(_,_,_))
2410@@ -482,7 +482,7 @@
2411 auto wait_handle = surface->get_create_wait_handle();
2412 wait_handle->wait_for_all();
2413
2414- EXPECT_EQ(pf, geom::PixelFormat::abgr_8888);
2415+ EXPECT_EQ(pf, mir_pixel_format_abgr_8888);
2416 }
2417
2418
2419@@ -637,7 +637,7 @@
2420
2421 struct StubBuffer : public mcl::ClientBuffer
2422 {
2423- StubBuffer(geom::Size size, geom::Stride stride, geom::PixelFormat pf)
2424+ StubBuffer(geom::Size size, geom::Stride stride, MirPixelFormat pf)
2425 : size_{size}, stride_{stride}, pf_{pf}
2426 {
2427 }
2428@@ -655,7 +655,7 @@
2429
2430 geom::Size size() const { return size_; }
2431 geom::Stride stride() const { return stride_; }
2432- geom::PixelFormat pixel_format() const { return pf_; }
2433+ MirPixelFormat pixel_format() const { return pf_; }
2434 uint32_t age() const { return 0; }
2435 void increment_age() {}
2436 void mark_as_submitted() {}
2437@@ -667,14 +667,14 @@
2438
2439 geom::Size size_;
2440 geom::Stride stride_;
2441- geom::PixelFormat pf_;
2442+ MirPixelFormat pf_;
2443 };
2444
2445 struct StubClientBufferFactory : public mcl::ClientBufferFactory
2446 {
2447 std::shared_ptr<mcl::ClientBuffer> create_buffer(
2448 std::shared_ptr<MirBufferPackage> const& package,
2449- geom::Size size, geom::PixelFormat pf)
2450+ geom::Size size, MirPixelFormat pf)
2451 {
2452 return std::make_shared<StubBuffer>(size,
2453 geom::Stride{package->stride},
2454
2455=== modified file 'tests/unit-tests/client/test_mir_connection.cpp'
2456--- tests/unit-tests/client/test_mir_connection.cpp 2013-11-27 12:28:24 +0000
2457+++ tests/unit-tests/client/test_mir_connection.cpp 2013-12-02 16:56:54 +0000
2458@@ -78,7 +78,7 @@
2459 struct StubClientBufferFactory : public mcl::ClientBufferFactory
2460 {
2461 std::shared_ptr<mcl::ClientBuffer> create_buffer(std::shared_ptr<MirBufferPackage> const& /* package */,
2462- geom::Size /*size*/, geom::PixelFormat /*pf*/) override
2463+ geom::Size /*size*/, MirPixelFormat /*pf*/) override
2464 {
2465 return std::shared_ptr<mcl::ClientBuffer>();
2466 }
2467
2468=== modified file 'tests/unit-tests/compositor/test_buffer_stream.cpp'
2469--- tests/unit-tests/compositor/test_buffer_stream.cpp 2013-11-27 12:28:24 +0000
2470+++ tests/unit-tests/compositor/test_buffer_stream.cpp 2013-12-02 16:56:54 +0000
2471@@ -50,7 +50,7 @@
2472 TEST_F(BufferStreamTest, size_query)
2473 {
2474 geom::Size size{4, 5};
2475- mg::BufferProperties properties {size, geom::PixelFormat::abgr_8888, mg::BufferUsage::hardware};
2476+ mg::BufferProperties properties {size, mir_pixel_format_abgr_8888, mg::BufferUsage::hardware};
2477 EXPECT_CALL(*mock_bundle, properties())
2478 .Times(1)
2479 .WillOnce(testing::Return(properties));
2480@@ -62,7 +62,7 @@
2481
2482 TEST_F(BufferStreamTest, pixel_format_query)
2483 {
2484- geom::PixelFormat format{geom::PixelFormat::abgr_8888};
2485+ MirPixelFormat format{mir_pixel_format_abgr_8888};
2486 mg::BufferProperties properties {geom::Size{4, 5}, format, mg::BufferUsage::hardware};
2487 EXPECT_CALL(*mock_bundle, properties())
2488 .Times(1)
2489
2490=== modified file 'tests/unit-tests/compositor/test_switching_bundle.cpp'
2491--- tests/unit-tests/compositor/test_switching_bundle.cpp 2013-11-27 12:28:24 +0000
2492+++ tests/unit-tests/compositor/test_switching_bundle.cpp 2013-12-02 16:56:54 +0000
2493@@ -42,7 +42,7 @@
2494 basic_properties =
2495 {
2496 geom::Size{3, 4},
2497- geom::PixelFormat::abgr_8888,
2498+ mir_pixel_format_abgr_8888,
2499 mg::BufferUsage::hardware
2500 };
2501 }
2502@@ -55,7 +55,7 @@
2503 TEST_F(SwitchingBundleTest, sync_swapper_by_default)
2504 {
2505 mg::BufferProperties properties{geom::Size{7, 8},
2506- geom::PixelFormat::argb_8888,
2507+ mir_pixel_format_argb_8888,
2508 mg::BufferUsage::software};
2509
2510 for (int nbuffers = mc::SwitchingBundle::min_buffers;
2511
2512=== modified file 'tests/unit-tests/compositor/test_temporary_buffers.cpp'
2513--- tests/unit-tests/compositor/test_temporary_buffers.cpp 2013-11-27 12:28:24 +0000
2514+++ tests/unit-tests/compositor/test_temporary_buffers.cpp 2013-12-02 16:56:54 +0000
2515@@ -45,7 +45,7 @@
2516 TemporaryBuffersTest()
2517 : buffer_size{1024, 768},
2518 buffer_stride{1024},
2519- buffer_pixel_format{geom::PixelFormat::abgr_8888},
2520+ buffer_pixel_format{mir_pixel_format_abgr_8888},
2521 mock_buffer{std::make_shared<testing::NiceMock<mtd::MockBuffer>>(
2522 buffer_size, buffer_stride, buffer_pixel_format)},
2523 mock_bundle{std::make_shared<testing::NiceMock<mtd::MockBufferBundle>>()}
2524@@ -60,7 +60,7 @@
2525
2526 geom::Size const buffer_size;
2527 geom::Stride const buffer_stride;
2528- geom::PixelFormat const buffer_pixel_format;
2529+ MirPixelFormat const buffer_pixel_format;
2530 std::shared_ptr<mtd::MockBuffer> const mock_buffer;
2531 std::shared_ptr<mtd::MockBufferBundle> mock_bundle;
2532 };
2533@@ -116,7 +116,7 @@
2534 EXPECT_CALL(*mock_buffer, pixel_format())
2535 .Times(1);
2536
2537- geom::PixelFormat pixel_format;
2538+ MirPixelFormat pixel_format;
2539 pixel_format = proxy_buffer.pixel_format();
2540 EXPECT_EQ(buffer_pixel_format, pixel_format);
2541 }
2542
2543=== modified file 'tests/unit-tests/frontend/test_session_mediator.cpp'
2544--- tests/unit-tests/frontend/test_session_mediator.cpp 2013-11-27 12:28:24 +0000
2545+++ tests/unit-tests/frontend/test_session_mediator.cpp 2013-12-02 16:56:54 +0000
2546@@ -99,10 +99,10 @@
2547
2548 mock_surface = std::make_shared<mtd::MockFrontendSurface>();
2549 mock_surfaces[mf::SurfaceId{1}] = mock_surface;
2550- mock_buffer = std::make_shared<NiceMock<mtd::MockBuffer>>(geom::Size(), geom::Stride(), geom::PixelFormat());
2551+ mock_buffer = std::make_shared<NiceMock<mtd::MockBuffer>>(geom::Size(), geom::Stride(), MirPixelFormat());
2552
2553 EXPECT_CALL(*mock_surface, size()).Times(AnyNumber()).WillRepeatedly(Return(geom::Size()));
2554- EXPECT_CALL(*mock_surface, pixel_format()).Times(AnyNumber()).WillRepeatedly(Return(geom::PixelFormat()));
2555+ EXPECT_CALL(*mock_surface, pixel_format()).Times(AnyNumber()).WillRepeatedly(Return(MirPixelFormat()));
2556 EXPECT_CALL(*mock_surface, swap_buffers(_)).Times(AnyNumber()).WillRepeatedly(SetArg<0>(mock_buffer));
2557
2558 EXPECT_CALL(*mock_surface, supports_input()).Times(AnyNumber()).WillRepeatedly(Return(true));
2559@@ -122,7 +122,7 @@
2560 mock_surfaces[id] = std::make_shared<mtd::MockFrontendSurface>();
2561
2562 EXPECT_CALL(*mock_surfaces[id], size()).Times(AnyNumber()).WillRepeatedly(Return(geom::Size()));
2563- EXPECT_CALL(*mock_surfaces[id], pixel_format()).Times(AnyNumber()).WillRepeatedly(Return(geom::PixelFormat()));
2564+ EXPECT_CALL(*mock_surfaces[id], pixel_format()).Times(AnyNumber()).WillRepeatedly(Return(MirPixelFormat()));
2565 EXPECT_CALL(*mock_surfaces[id], swap_buffers(_)).Times(AnyNumber()).WillRepeatedly(SetArg<0>(mock_buffer));
2566
2567 EXPECT_CALL(*mock_surfaces[id], supports_input()).Times(AnyNumber()).WillRepeatedly(Return(true));
2568@@ -153,10 +153,10 @@
2569 MockGraphicBufferAllocator()
2570 {
2571 ON_CALL(*this, supported_pixel_formats())
2572- .WillByDefault(testing::Return(std::vector<geom::PixelFormat>()));
2573+ .WillByDefault(testing::Return(std::vector<MirPixelFormat>()));
2574 }
2575
2576- MOCK_METHOD0(supported_pixel_formats, std::vector<geom::PixelFormat>());
2577+ MOCK_METHOD0(supported_pixel_formats, std::vector<MirPixelFormat>());
2578 };
2579
2580 class MockPlatform : public mg::Platform
2581@@ -189,7 +189,7 @@
2582 : shell{std::make_shared<testing::NiceMock<mtd::MockShell>>()},
2583 graphics_platform{std::make_shared<testing::NiceMock<MockPlatform>>()},
2584 graphics_changer{std::make_shared<mtd::NullDisplayChanger>()},
2585- surface_pixel_formats{geom::PixelFormat::argb_8888, geom::PixelFormat::xrgb_8888},
2586+ surface_pixel_formats{mir_pixel_format_argb_8888, mir_pixel_format_xrgb_8888},
2587 report{std::make_shared<mf::NullSessionMediatorReport>()},
2588 resource_cache{std::make_shared<mf::ResourceCache>()},
2589 mediator{shell, graphics_platform, graphics_changer,
2590@@ -209,7 +209,7 @@
2591 std::shared_ptr<testing::NiceMock<mtd::MockShell>> const shell;
2592 std::shared_ptr<MockPlatform> const graphics_platform;
2593 std::shared_ptr<mf::DisplayChanger> const graphics_changer;
2594- std::vector<geom::PixelFormat> const surface_pixel_formats;
2595+ std::vector<MirPixelFormat> const surface_pixel_formats;
2596 std::shared_ptr<mf::SessionMediatorReport> const report;
2597 std::shared_ptr<mf::ResourceCache> const resource_cache;
2598 mf::SessionMediator mediator;
2599
2600=== modified file 'tests/unit-tests/frontend/test_session_mediator_android.cpp'
2601--- tests/unit-tests/frontend/test_session_mediator_android.cpp 2013-11-25 07:59:56 +0000
2602+++ tests/unit-tests/frontend/test_session_mediator_android.cpp 2013-12-02 16:56:54 +0000
2603@@ -53,7 +53,7 @@
2604 : shell{std::make_shared<mtd::StubShell>()},
2605 graphics_platform{std::make_shared<mtd::NullPlatform>()},
2606 display_changer{std::make_shared<mtd::NullDisplayChanger>()},
2607- surface_pixel_formats{geom::PixelFormat::argb_8888, geom::PixelFormat::xrgb_8888},
2608+ surface_pixel_formats{mir_pixel_format_argb_8888, mir_pixel_format_xrgb_8888},
2609 report{std::make_shared<mf::NullSessionMediatorReport>()},
2610 resource_cache{std::make_shared<mf::ResourceCache>()},
2611 mediator{shell, graphics_platform, display_changer,
2612@@ -67,7 +67,7 @@
2613 std::shared_ptr<mtd::StubShell> const shell;
2614 std::shared_ptr<mtd::NullPlatform> const graphics_platform;
2615 std::shared_ptr<mf::DisplayChanger> const display_changer;
2616- std::vector<geom::PixelFormat> const surface_pixel_formats;
2617+ std::vector<MirPixelFormat> const surface_pixel_formats;
2618 std::shared_ptr<mf::SessionMediatorReport> const report;
2619 std::shared_ptr<mf::ResourceCache> const resource_cache;
2620 mf::SessionMediator mediator;
2621
2622=== modified file 'tests/unit-tests/frontend/test_session_mediator_gbm.cpp'
2623--- tests/unit-tests/frontend/test_session_mediator_gbm.cpp 2013-11-25 07:59:56 +0000
2624+++ tests/unit-tests/frontend/test_session_mediator_gbm.cpp 2013-12-02 16:56:54 +0000
2625@@ -66,7 +66,7 @@
2626 : shell{std::make_shared<mtd::StubShell>()},
2627 mock_platform{std::make_shared<MockAuthenticatingPlatform>()},
2628 display_changer{std::make_shared<mtd::NullDisplayChanger>()},
2629- surface_pixel_formats{geom::PixelFormat::argb_8888, geom::PixelFormat::xrgb_8888},
2630+ surface_pixel_formats{mir_pixel_format_argb_8888, mir_pixel_format_xrgb_8888},
2631 report{std::make_shared<mf::NullSessionMediatorReport>()},
2632 resource_cache{std::make_shared<mf::ResourceCache>()},
2633 mediator{shell, mock_platform, display_changer,
2634@@ -80,7 +80,7 @@
2635 std::shared_ptr<mtd::StubShell> const shell;
2636 std::shared_ptr<MockAuthenticatingPlatform> const mock_platform;
2637 std::shared_ptr<mf::DisplayChanger> const display_changer;
2638- std::vector<geom::PixelFormat> const surface_pixel_formats;
2639+ std::vector<MirPixelFormat> const surface_pixel_formats;
2640 std::shared_ptr<mf::SessionMediatorReport> const report;
2641 std::shared_ptr<mf::ResourceCache> const resource_cache;
2642 mf::SessionMediator mediator;
2643
2644=== modified file 'tests/unit-tests/graphics/android/test_android_alloc_adaptor.cpp'
2645--- tests/unit-tests/graphics/android/test_android_alloc_adaptor.cpp 2013-11-28 14:17:01 +0000
2646+++ tests/unit-tests/graphics/android/test_android_alloc_adaptor.cpp 2013-12-02 16:56:54 +0000
2647@@ -48,7 +48,7 @@
2648
2649 alloc_adaptor = std::make_shared<mga::AndroidAllocAdaptor>(mock_alloc_device);
2650
2651- pf = geom::PixelFormat::abgr_8888;
2652+ pf = mir_pixel_format_abgr_8888;
2653 size = geom::Size{300, 200};
2654 usage = mga::BufferUsage::use_hardware;
2655 }
2656@@ -56,7 +56,7 @@
2657 std::shared_ptr<mtd::MockAllocDevice> mock_alloc_device;
2658 std::shared_ptr<mga::AndroidAllocAdaptor> alloc_adaptor;
2659
2660- geom::PixelFormat pf;
2661+ MirPixelFormat pf;
2662 geom::Size size;
2663 mga::BufferUsage usage;
2664 int const fb_usage_flags;
2665@@ -197,7 +197,7 @@
2666
2667 TEST_F(AdaptorICSTest, handle_buffer_pf_is_converted_to_android_xbgr_8888)
2668 {
2669- auto native_handle = alloc_adaptor->alloc_buffer(size, geom::PixelFormat::xbgr_8888, usage);
2670+ auto native_handle = alloc_adaptor->alloc_buffer(size, mir_pixel_format_xbgr_8888, usage);
2671 auto anwb = native_handle->anwb();
2672 EXPECT_EQ(HAL_PIXEL_FORMAT_RGBX_8888, anwb->format);
2673 }
2674
2675=== modified file 'tests/unit-tests/graphics/android/test_android_buffer_allocator.cpp'
2676--- tests/unit-tests/graphics/android/test_android_buffer_allocator.cpp 2013-11-28 14:17:01 +0000
2677+++ tests/unit-tests/graphics/android/test_android_buffer_allocator.cpp 2013-12-02 16:56:54 +0000
2678@@ -62,15 +62,15 @@
2679
2680 auto abgr_8888_count = std::count(supported_pixel_formats.begin(),
2681 supported_pixel_formats.end(),
2682- geom::PixelFormat::abgr_8888);
2683+ mir_pixel_format_abgr_8888);
2684
2685 auto xbgr_8888_count = std::count(supported_pixel_formats.begin(),
2686 supported_pixel_formats.end(),
2687- geom::PixelFormat::xbgr_8888);
2688+ mir_pixel_format_xbgr_8888);
2689
2690 auto bgr_888_count = std::count(supported_pixel_formats.begin(),
2691 supported_pixel_formats.end(),
2692- geom::PixelFormat::bgr_888);
2693+ mir_pixel_format_bgr_888);
2694
2695 EXPECT_EQ(1, abgr_8888_count);
2696 EXPECT_EQ(1, xbgr_8888_count);
2697@@ -83,7 +83,7 @@
2698 auto supported_pixel_formats = allocator.supported_pixel_formats();
2699
2700 ASSERT_FALSE(supported_pixel_formats.empty());
2701- EXPECT_EQ(geom::PixelFormat::abgr_8888, supported_pixel_formats[0]);
2702+ EXPECT_EQ(mir_pixel_format_abgr_8888, supported_pixel_formats[0]);
2703 }
2704
2705 TEST_F(AndroidGraphicBufferAllocatorTest, alloc_buffer_calls_initializer)
2706@@ -93,7 +93,7 @@
2707 auto buffer_initializer = std::make_shared<mtd::MockBufferInitializer>();
2708
2709 mg::BufferProperties properties{geom::Size{2, 2},
2710- geom::PixelFormat::abgr_8888,
2711+ mir_pixel_format_abgr_8888,
2712 mg::BufferUsage::hardware};
2713 mga::AndroidGraphicBufferAllocator allocator{buffer_initializer};
2714 EXPECT_CALL(*buffer_initializer, operator_call(_))
2715@@ -110,7 +110,7 @@
2716
2717 mga::AndroidGraphicBufferAllocator allocator{buffer_initializer};
2718 auto size = geom::Size{2, 2};
2719- auto pf = geom::PixelFormat::abgr_8888;
2720+ auto pf = mir_pixel_format_abgr_8888;
2721
2722 EXPECT_CALL(*buffer_initializer, operator_call(_))
2723 .Times(1);
2724
2725=== modified file 'tests/unit-tests/graphics/android/test_buffer.cpp'
2726--- tests/unit-tests/graphics/android/test_buffer.cpp 2013-11-28 14:17:01 +0000
2727+++ tests/unit-tests/graphics/android/test_buffer.cpp 2013-12-02 16:56:54 +0000
2728@@ -51,7 +51,7 @@
2729 anwb->format = HAL_PIXEL_FORMAT_RGBA_8888;
2730
2731 default_use = mga::BufferUsage::use_hardware;
2732- pf = geom::PixelFormat::abgr_8888;
2733+ pf = mir_pixel_format_abgr_8888;
2734 size = geom::Size{300, 200};
2735 extensions = std::make_shared<mg::EGLExtensions>();
2736 }
2737@@ -59,7 +59,7 @@
2738 ANativeWindowBuffer *anwb;
2739 testing::NiceMock<mtd::MockEGL> mock_egl;
2740 std::shared_ptr<mtd::MockAndroidNativeBuffer> mock_native_buffer;
2741- geom::PixelFormat pf;
2742+ MirPixelFormat pf;
2743 geom::Size size;
2744 mga::BufferUsage default_use;
2745 std::shared_ptr<mg::EGLExtensions> extensions;
2746@@ -80,7 +80,7 @@
2747 using namespace testing;
2748
2749 mga::Buffer buffer(mock_native_buffer, extensions);
2750- EXPECT_EQ(geom::PixelFormat::abgr_8888, buffer.pixel_format());
2751+ EXPECT_EQ(mir_pixel_format_abgr_8888, buffer.pixel_format());
2752 }
2753
2754 TEST_F(AndroidGraphicBufferBasic, returns_native_buffer_times_two)
2755@@ -112,7 +112,7 @@
2756 using namespace testing;
2757
2758 geom::Stride expected_stride{anwb->stride *
2759- geom::bytes_per_pixel(pf)};
2760+ MIR_BYTES_PER_PIXEL(pf)};
2761 mga::Buffer buffer(mock_native_buffer, extensions);
2762 EXPECT_EQ(expected_stride, buffer.stride());
2763 }
2764
2765=== modified file 'tests/unit-tests/graphics/android/test_buffer_tex_bind.cpp'
2766--- tests/unit-tests/graphics/android/test_buffer_tex_bind.cpp 2013-11-28 14:17:01 +0000
2767+++ tests/unit-tests/graphics/android/test_buffer_tex_bind.cpp 2013-12-02 16:56:54 +0000
2768@@ -40,12 +40,12 @@
2769
2770 mock_native_buffer = std::make_shared<NiceMock<mtd::MockAndroidNativeBuffer>>();
2771 size = geom::Size{300, 220};
2772- pf = geom::PixelFormat::abgr_8888;
2773+ pf = mir_pixel_format_abgr_8888;
2774 extensions = std::make_shared<mg::EGLExtensions>();
2775 };
2776
2777 geom::Size size;
2778- geom::PixelFormat pf;
2779+ MirPixelFormat pf;
2780
2781 testing::NiceMock<mtd::MockEGL> mock_egl;
2782 std::shared_ptr<mg::EGLExtensions> extensions;
2783
2784=== modified file 'tests/unit-tests/graphics/android/test_fb_simple_swapper.cpp'
2785--- tests/unit-tests/graphics/android/test_fb_simple_swapper.cpp 2013-11-28 14:17:01 +0000
2786+++ tests/unit-tests/graphics/android/test_fb_simple_swapper.cpp 2013-12-02 16:56:54 +0000
2787@@ -40,7 +40,7 @@
2788 struct MockGraphicBufferAllocator : public mga::GraphicBufferAllocator
2789 {
2790 MOCK_METHOD3(alloc_buffer_platform, std::shared_ptr<mg::Buffer>(
2791- geom::Size, geom::PixelFormat, mga::BufferUsage use));
2792+ geom::Size, MirPixelFormat, mga::BufferUsage use));
2793 };
2794
2795 static int const display_width = 180;
2796@@ -143,7 +143,7 @@
2797 .InSequence(seq);
2798
2799 mga::Framebuffers framebuffers(mock_allocator, mock_hwc_device);
2800- EXPECT_EQ(geom::PixelFormat::argb_8888, framebuffers.fb_format());
2801+ EXPECT_EQ(mir_pixel_format_argb_8888, framebuffers.fb_format());
2802 }
2803
2804 //apparently this can happen if the display is in the 'unplugged state'
2805@@ -180,20 +180,20 @@
2806 .InSequence(seq);
2807
2808 mga::Framebuffers framebuffers(mock_allocator, mock_hwc_device);
2809- EXPECT_EQ(geom::PixelFormat::abgr_8888, framebuffers.fb_format());
2810+ EXPECT_EQ(mir_pixel_format_abgr_8888, framebuffers.fb_format());
2811 }
2812
2813 TEST_F(PostingFBBundleTest, bundle_from_fb)
2814 {
2815 using namespace testing;
2816 auto display_size = geom::Size{display_width, display_height};
2817- EXPECT_CALL(*mock_allocator, alloc_buffer_platform(display_size, geom::PixelFormat::abgr_8888, mga::BufferUsage::use_framebuffer_gles))
2818+ EXPECT_CALL(*mock_allocator, alloc_buffer_platform(display_size, mir_pixel_format_abgr_8888, mga::BufferUsage::use_framebuffer_gles))
2819 .Times(fbnum)
2820 .WillRepeatedly(Return(nullptr));
2821
2822 mga::Framebuffers framebuffers(mock_allocator, mock_fb_hal);
2823 EXPECT_EQ(display_size, framebuffers.fb_size());
2824- EXPECT_EQ(geom::PixelFormat::abgr_8888, framebuffers.fb_format());
2825+ EXPECT_EQ(mir_pixel_format_abgr_8888, framebuffers.fb_format());
2826 }
2827
2828 //some drivers incorrectly report 0 buffers available. if this is true, we should alloc 2, the minimum requirement
2829
2830=== modified file 'tests/unit-tests/graphics/android/test_hwc10_device.cpp'
2831--- tests/unit-tests/graphics/android/test_hwc10_device.cpp 2013-11-28 14:17:01 +0000
2832+++ tests/unit-tests/graphics/android/test_hwc10_device.cpp 2013-12-02 16:56:54 +0000
2833@@ -40,7 +40,7 @@
2834 int width = 88;
2835 int height = 4;
2836 test_size = geom::Size{width, height};
2837- test_pf = geom::PixelFormat::abgr_8888;
2838+ test_pf = mir_pixel_format_abgr_8888;
2839 int fbnum = 558;
2840 mock_hwc_device = std::make_shared<testing::NiceMock<mtd::MockHWCComposerDevice1>>();
2841 mock_fb_device = std::make_shared<mtd::MockFBHalDevice>(
2842@@ -49,7 +49,7 @@
2843 mock_buffer = std::make_shared<NiceMock<mtd::MockBuffer>>();
2844 }
2845
2846- geom::PixelFormat test_pf;
2847+ MirPixelFormat test_pf;
2848 geom::Size test_size;
2849 std::shared_ptr<mtd::MockHWCComposerDevice1> mock_hwc_device;
2850 std::shared_ptr<mtd::MockFBHalDevice> mock_fb_device;
2851
2852=== modified file 'tests/unit-tests/graphics/android/test_output_builder.cpp'
2853--- tests/unit-tests/graphics/android/test_output_builder.cpp 2013-11-28 14:17:01 +0000
2854+++ tests/unit-tests/graphics/android/test_output_builder.cpp 2013-12-02 16:56:54 +0000
2855@@ -51,7 +51,7 @@
2856 .WillByDefault(Return(nullptr));
2857 }
2858 MOCK_METHOD3(alloc_buffer_platform,
2859- std::shared_ptr<mg::Buffer>(geom::Size, geom::PixelFormat, mga::BufferUsage));
2860+ std::shared_ptr<mg::Buffer>(geom::Size, MirPixelFormat, mga::BufferUsage));
2861 };
2862
2863 struct MockResourceFactory: public mga::DisplayResourceFactory
2864
2865=== modified file 'tests/unit-tests/graphics/android/test_pixel_format.cpp'
2866--- tests/unit-tests/graphics/android/test_pixel_format.cpp 2013-11-28 14:17:01 +0000
2867+++ tests/unit-tests/graphics/android/test_pixel_format.cpp 2013-12-02 16:56:54 +0000
2868@@ -21,22 +21,21 @@
2869 #include <gtest/gtest.h>
2870
2871 namespace mga=mir::graphics::android;
2872-namespace geom=mir::geometry;
2873
2874 TEST(PixelFormatConversion, conversion_to_android_test)
2875 {
2876- EXPECT_EQ(HAL_PIXEL_FORMAT_RGBA_8888, mga::to_android_format(geom::PixelFormat::abgr_8888));
2877- EXPECT_EQ(HAL_PIXEL_FORMAT_RGBX_8888, mga::to_android_format(geom::PixelFormat::xbgr_8888));
2878- EXPECT_EQ(HAL_PIXEL_FORMAT_BGRA_8888, mga::to_android_format(geom::PixelFormat::argb_8888));
2879+ EXPECT_EQ(HAL_PIXEL_FORMAT_RGBA_8888, mga::to_android_format(mir_pixel_format_abgr_8888));
2880+ EXPECT_EQ(HAL_PIXEL_FORMAT_RGBX_8888, mga::to_android_format(mir_pixel_format_xbgr_8888));
2881+ EXPECT_EQ(HAL_PIXEL_FORMAT_BGRA_8888, mga::to_android_format(mir_pixel_format_argb_8888));
2882 //note X to A conversion!
2883- EXPECT_EQ(HAL_PIXEL_FORMAT_BGRA_8888, mga::to_android_format(geom::PixelFormat::xrgb_8888));
2884- EXPECT_EQ(HAL_PIXEL_FORMAT_RGB_888, mga::to_android_format(geom::PixelFormat::bgr_888));
2885+ EXPECT_EQ(HAL_PIXEL_FORMAT_BGRA_8888, mga::to_android_format(mir_pixel_format_xrgb_8888));
2886+ EXPECT_EQ(HAL_PIXEL_FORMAT_RGB_888, mga::to_android_format(mir_pixel_format_bgr_888));
2887 }
2888
2889 TEST(PixelFormatConversion, conversion_to_mir_test)
2890 {
2891- EXPECT_EQ(geom::PixelFormat::abgr_8888, mga::to_mir_format(HAL_PIXEL_FORMAT_RGBA_8888));
2892- EXPECT_EQ(geom::PixelFormat::xbgr_8888, mga::to_mir_format(HAL_PIXEL_FORMAT_RGBX_8888));
2893- EXPECT_EQ(geom::PixelFormat::argb_8888, mga::to_mir_format(HAL_PIXEL_FORMAT_BGRA_8888));
2894- EXPECT_EQ(geom::PixelFormat::bgr_888, mga::to_mir_format(HAL_PIXEL_FORMAT_RGB_888));
2895+ EXPECT_EQ(mir_pixel_format_abgr_8888, mga::to_mir_format(HAL_PIXEL_FORMAT_RGBA_8888));
2896+ EXPECT_EQ(mir_pixel_format_xbgr_8888, mga::to_mir_format(HAL_PIXEL_FORMAT_RGBX_8888));
2897+ EXPECT_EQ(mir_pixel_format_argb_8888, mga::to_mir_format(HAL_PIXEL_FORMAT_BGRA_8888));
2898+ EXPECT_EQ(mir_pixel_format_bgr_888, mga::to_mir_format(HAL_PIXEL_FORMAT_RGB_888));
2899 }
2900
2901=== modified file 'tests/unit-tests/graphics/android/test_server_interpreter.cpp'
2902--- tests/unit-tests/graphics/android/test_server_interpreter.cpp 2013-11-28 14:17:01 +0000
2903+++ tests/unit-tests/graphics/android/test_server_interpreter.cpp 2013-12-02 16:56:54 +0000
2904@@ -48,7 +48,7 @@
2905 mock_fb_bundle = std::make_shared<NiceMock<mtd::MockFBBundle>>();
2906 mock_cache = std::make_shared<NiceMock<mtd::MockInterpreterResourceCache>>();
2907 ON_CALL(*mock_fb_bundle, fb_format())
2908- .WillByDefault(Return(geom::PixelFormat::abgr_8888));
2909+ .WillByDefault(Return(mir_pixel_format_abgr_8888));
2910 }
2911
2912 std::shared_ptr<mtd::MockBuffer> mock_buffer1;
2913@@ -118,7 +118,7 @@
2914
2915 EXPECT_CALL(*mock_fb_bundle, fb_format())
2916 .Times(1)
2917- .WillOnce(Return(geom::PixelFormat::abgr_8888));
2918+ .WillOnce(Return(mir_pixel_format_abgr_8888));
2919
2920 mga::ServerRenderWindow render_window(mock_fb_bundle, mock_cache);
2921
2922
2923=== modified file 'tests/unit-tests/graphics/gbm/test_gbm_buffer.cpp'
2924--- tests/unit-tests/graphics/gbm/test_gbm_buffer.cpp 2013-11-28 14:17:01 +0000
2925+++ tests/unit-tests/graphics/gbm/test_gbm_buffer.cpp 2013-12-02 16:56:54 +0000
2926@@ -56,7 +56,7 @@
2927 fake_devices.add_standard_drm_devices();
2928
2929 size = geom::Size{300, 200};
2930- pf = geom::PixelFormat::argb_8888;
2931+ pf = mir_pixel_format_argb_8888;
2932 stride = geom::Stride{4 * size.width.as_uint32_t()};
2933 usage = mg::BufferUsage::hardware;
2934 buffer_properties = mg::BufferProperties{size, pf, usage};
2935@@ -88,7 +88,7 @@
2936 std::unique_ptr<mgg::BufferAllocator> allocator;
2937
2938 // Defaults
2939- geom::PixelFormat pf;
2940+ MirPixelFormat pf;
2941 geom::Size size;
2942 geom::Stride stride;
2943 mg::BufferUsage usage;
2944
2945=== modified file 'tests/unit-tests/graphics/gbm/test_gbm_buffer_allocator.cpp'
2946--- tests/unit-tests/graphics/gbm/test_gbm_buffer_allocator.cpp 2013-11-28 14:17:01 +0000
2947+++ tests/unit-tests/graphics/gbm/test_gbm_buffer_allocator.cpp 2013-12-02 16:56:54 +0000
2948@@ -56,7 +56,7 @@
2949 fake_devices.add_standard_drm_devices();
2950
2951 size = geom::Size{300, 200};
2952- pf = geom::PixelFormat::argb_8888;
2953+ pf = mir_pixel_format_argb_8888;
2954 usage = mg::BufferUsage::hardware;
2955 buffer_properties = mg::BufferProperties{size, pf, usage};
2956
2957@@ -71,7 +71,7 @@
2958
2959 // Defaults
2960 geom::Size size;
2961- geom::PixelFormat pf;
2962+ MirPixelFormat pf;
2963 mg::BufferUsage usage;
2964 mg::BufferProperties buffer_properties;
2965
2966@@ -101,7 +101,7 @@
2967 EXPECT_CALL(mock_gbm, gbm_bo_destroy(_));
2968
2969 const mg::BufferProperties properties(geom::Size{1280, 800},
2970- geom::PixelFormat::argb_8888,
2971+ mir_pixel_format_argb_8888,
2972 mg::BufferUsage::hardware);
2973
2974 auto buf = allocator->alloc_buffer(properties);
2975@@ -116,7 +116,7 @@
2976 EXPECT_CALL(mock_gbm, gbm_bo_destroy(_));
2977
2978 const mg::BufferProperties properties(geom::Size{100, 100},
2979- geom::PixelFormat::argb_8888,
2980+ mir_pixel_format_argb_8888,
2981 mg::BufferUsage::hardware);
2982
2983 auto buf = allocator->alloc_buffer(properties);
2984@@ -129,7 +129,7 @@
2985 using namespace testing;
2986
2987 const mg::BufferProperties properties(geom::Size{1920, 1200},
2988- geom::PixelFormat::argb_8888,
2989+ mir_pixel_format_argb_8888,
2990 mg::BufferUsage::software);
2991
2992 auto buf = allocator->alloc_buffer(properties);
2993@@ -144,7 +144,7 @@
2994 EXPECT_CALL(mock_gbm, gbm_bo_destroy(_));
2995
2996 const mg::BufferProperties properties(geom::Size{1280, 800},
2997- geom::PixelFormat::argb_8888,
2998+ mir_pixel_format_argb_8888,
2999 mg::BufferUsage::hardware);
3000
3001 setenv("MIR_BYPASS", "0", 1);
3002@@ -163,7 +163,7 @@
3003 EXPECT_CALL(mock_gbm, gbm_bo_create(_,_,_,GBM_FORMAT_ARGB8888,_));
3004 EXPECT_CALL(mock_gbm, gbm_bo_destroy(_));
3005
3006- allocator->alloc_buffer(mg::BufferProperties{size, geom::PixelFormat::argb_8888, usage});
3007+ allocator->alloc_buffer(mg::BufferProperties{size, mir_pixel_format_argb_8888, usage});
3008 }
3009
3010 TEST_F(GBMBufferAllocatorTest, correct_buffer_format_translation_xrgb_8888)
3011@@ -173,7 +173,7 @@
3012 EXPECT_CALL(mock_gbm, gbm_bo_create(_,_,_,GBM_FORMAT_XRGB8888,_));
3013 EXPECT_CALL(mock_gbm, gbm_bo_destroy(_));
3014
3015- allocator->alloc_buffer(mg::BufferProperties{size, geom::PixelFormat::xrgb_8888, usage});
3016+ allocator->alloc_buffer(mg::BufferProperties{size, mir_pixel_format_xrgb_8888, usage});
3017 }
3018
3019 MATCHER_P(has_flag_set, flag, "")
3020@@ -280,11 +280,11 @@
3021
3022 auto argb_8888_count = std::count(supported_pixel_formats.begin(),
3023 supported_pixel_formats.end(),
3024- geom::PixelFormat::argb_8888);
3025+ mir_pixel_format_argb_8888);
3026
3027 auto xrgb_8888_count = std::count(supported_pixel_formats.begin(),
3028 supported_pixel_formats.end(),
3029- geom::PixelFormat::xrgb_8888);
3030+ mir_pixel_format_xrgb_8888);
3031
3032 EXPECT_EQ(1, argb_8888_count);
3033 EXPECT_EQ(1, xrgb_8888_count);
3034@@ -295,7 +295,7 @@
3035 auto supported_pixel_formats = allocator->supported_pixel_formats();
3036
3037 ASSERT_FALSE(supported_pixel_formats.empty());
3038- EXPECT_EQ(geom::PixelFormat::argb_8888, supported_pixel_formats[0]);
3039+ EXPECT_EQ(mir_pixel_format_argb_8888, supported_pixel_formats[0]);
3040 }
3041
3042 TEST_F(GBMBufferAllocatorTest, alloc_with_unsupported_pixel_format_throws)
3043@@ -306,6 +306,6 @@
3044 EXPECT_CALL(mock_gbm, gbm_bo_create(_,_,_,_,_)).Times(0);
3045
3046 EXPECT_THROW({
3047- allocator->alloc_buffer(mg::BufferProperties{size, geom::PixelFormat::abgr_8888, usage});
3048+ allocator->alloc_buffer(mg::BufferProperties{size, mir_pixel_format_abgr_8888, usage});
3049 }, std::runtime_error);
3050 }
3051
3052=== modified file 'tests/unit-tests/graphics/gbm/test_internal_native_display.cpp'
3053--- tests/unit-tests/graphics/gbm/test_internal_native_display.cpp 2013-11-28 14:17:01 +0000
3054+++ tests/unit-tests/graphics/gbm/test_internal_native_display.cpp 2013-12-02 16:56:54 +0000
3055@@ -85,12 +85,3 @@
3056 EXPECT_THAT(test_package, PackageMatches(platform_package));
3057 }
3058
3059-TEST(MirServerMesaEGLNativeDisplayInvariants, pixel_format_formats_are_castable)
3060-{
3061- EXPECT_EQ(static_cast<MirPixelFormat>(geom::PixelFormat::invalid), mir_pixel_format_invalid);
3062- EXPECT_EQ(static_cast<MirPixelFormat>(geom::PixelFormat::abgr_8888), mir_pixel_format_abgr_8888);
3063- EXPECT_EQ(static_cast<MirPixelFormat>(geom::PixelFormat::xbgr_8888), mir_pixel_format_xbgr_8888);
3064- EXPECT_EQ(static_cast<MirPixelFormat>(geom::PixelFormat::argb_8888), mir_pixel_format_argb_8888);
3065- EXPECT_EQ(static_cast<MirPixelFormat>(geom::PixelFormat::xrgb_8888), mir_pixel_format_xrgb_8888);
3066- EXPECT_EQ(static_cast<MirPixelFormat>(geom::PixelFormat::bgr_888), mir_pixel_format_bgr_888);
3067-}
3068
3069=== modified file 'tests/unit-tests/graphics/gbm/test_shm_buffer.cpp'
3070--- tests/unit-tests/graphics/gbm/test_shm_buffer.cpp 2013-11-28 14:17:01 +0000
3071+++ tests/unit-tests/graphics/gbm/test_shm_buffer.cpp 2013-12-02 16:56:54 +0000
3072@@ -45,14 +45,14 @@
3073 {
3074 ShmBufferTest()
3075 : size{150,340},
3076- pixel_format{geom::PixelFormat::bgr_888},
3077+ pixel_format{mir_pixel_format_bgr_888},
3078 stub_shm_file{std::make_shared<StubShmFile>()},
3079 shm_buffer{stub_shm_file, size, pixel_format}
3080 {
3081 }
3082
3083 geom::Size const size;
3084- geom::PixelFormat const pixel_format;
3085+ MirPixelFormat const pixel_format;
3086 std::shared_ptr<StubShmFile> const stub_shm_file;
3087 mgg::ShmBuffer shm_buffer;
3088 testing::NiceMock<mtd::MockGL> mock_gl;
3089@@ -62,7 +62,7 @@
3090
3091 TEST_F(ShmBufferTest, has_correct_properties)
3092 {
3093- size_t const bytes_per_pixel{geom::bytes_per_pixel(pixel_format)};
3094+ size_t const bytes_per_pixel = MIR_BYTES_PER_PIXEL(pixel_format);
3095 size_t const expected_stride{bytes_per_pixel * size.width.as_uint32_t()};
3096
3097 EXPECT_EQ(size, shm_buffer.size());
3098@@ -72,7 +72,7 @@
3099
3100 TEST_F(ShmBufferTest, native_buffer_contains_correct_data)
3101 {
3102- size_t const bytes_per_pixel{geom::bytes_per_pixel(pixel_format)};
3103+ size_t const bytes_per_pixel = MIR_BYTES_PER_PIXEL(pixel_format);
3104 size_t const expected_stride{bytes_per_pixel * size.width.as_uint32_t()};
3105
3106 auto native_buffer = shm_buffer.native_buffer_handle();
3107
3108=== modified file 'tests/unit-tests/graphics/test_buffer_properties.cpp'
3109--- tests/unit-tests/graphics/test_buffer_properties.cpp 2013-08-28 03:41:48 +0000
3110+++ tests/unit-tests/graphics/test_buffer_properties.cpp 2013-12-02 16:56:54 +0000
3111@@ -27,7 +27,7 @@
3112 TEST(buffer_properties, default_create)
3113 {
3114 geom::Size size;
3115- geom::PixelFormat pixel_format{geom::PixelFormat::invalid};
3116+ MirPixelFormat pixel_format{mir_pixel_format_invalid};
3117 mg::BufferUsage usage{mg::BufferUsage::undefined};
3118
3119 mg::BufferProperties prop;
3120@@ -40,7 +40,7 @@
3121 TEST(buffer_properties, custom_create)
3122 {
3123 geom::Size size{66, 166};
3124- geom::PixelFormat pixel_format{geom::PixelFormat::abgr_8888};
3125+ MirPixelFormat pixel_format{mir_pixel_format_abgr_8888};
3126 mg::BufferUsage usage{mg::BufferUsage::hardware};
3127
3128 mg::BufferProperties prop{size, pixel_format, usage};
3129@@ -53,7 +53,7 @@
3130 TEST(buffer_properties, equal_properties_test_equal)
3131 {
3132 geom::Size size{66, 166};
3133- geom::PixelFormat pixel_format{geom::PixelFormat::abgr_8888};
3134+ MirPixelFormat pixel_format{mir_pixel_format_abgr_8888};
3135 mg::BufferUsage usage{mg::BufferUsage::hardware};
3136
3137 mg::BufferProperties prop0{size, pixel_format, usage};
3138@@ -73,10 +73,10 @@
3139 {geom::Width{67}, geom::Height{166}}
3140 };
3141
3142- geom::PixelFormat pixel_format[2] =
3143+ MirPixelFormat pixel_format[2] =
3144 {
3145- geom::PixelFormat::abgr_8888,
3146- geom::PixelFormat::bgr_888
3147+ mir_pixel_format_abgr_8888,
3148+ mir_pixel_format_bgr_888
3149 };
3150
3151 mg::BufferUsage usage[2] =
3152
3153=== modified file 'tests/unit-tests/graphics/test_default_display_configuration_policy.cpp'
3154--- tests/unit-tests/graphics/test_default_display_configuration_policy.cpp 2013-11-25 07:59:56 +0000
3155+++ tests/unit-tests/graphics/test_default_display_configuration_policy.cpp 2013-12-02 16:56:54 +0000
3156@@ -41,7 +41,7 @@
3157 card_id,
3158 mg::DisplayConfigurationOutputType::vga,
3159 {
3160- geom::PixelFormat::abgr_8888
3161+ mir_pixel_format_abgr_8888
3162 },
3163 {
3164 {geom::Size{123, 111}, 59.9},
3165@@ -81,7 +81,7 @@
3166 card_id,
3167 mg::DisplayConfigurationOutputType::vga,
3168 {
3169- geom::PixelFormat::abgr_8888
3170+ mir_pixel_format_abgr_8888
3171 },
3172 {
3173 {geom::Size{523, 555}, 60.0},
3174@@ -102,7 +102,7 @@
3175 card_id,
3176 mg::DisplayConfigurationOutputType::vga,
3177 {
3178- geom::PixelFormat::abgr_8888
3179+ mir_pixel_format_abgr_8888
3180 },
3181 {},
3182 0,
3183
3184=== modified file 'tests/unit-tests/graphics/test_display_configuration.cpp'
3185--- tests/unit-tests/graphics/test_display_configuration.cpp 2013-09-12 21:36:55 +0000
3186+++ tests/unit-tests/graphics/test_display_configuration.cpp 2013-12-02 16:56:54 +0000
3187@@ -32,7 +32,7 @@
3188 mg::DisplayConfigurationCardId{2},
3189 mg::DisplayConfigurationOutputType::dvid,
3190 {
3191- geom::PixelFormat::abgr_8888
3192+ mir_pixel_format_abgr_8888
3193 },
3194 {
3195 {geom::Size{10, 20}, 60.0},
3196
3197=== modified file 'tests/unit-tests/graphics/test_graphics_platform.cpp'
3198--- tests/unit-tests/graphics/test_graphics_platform.cpp 2013-11-28 14:17:01 +0000
3199+++ tests/unit-tests/graphics/test_graphics_platform.cpp 2013-12-02 16:56:54 +0000
3200@@ -126,7 +126,7 @@
3201 ASSERT_NE(0u, supported_pixel_formats.size());
3202
3203 geom::Size size{320, 240};
3204- geom::PixelFormat const pf{supported_pixel_formats[0]};
3205+ MirPixelFormat const pf{supported_pixel_formats[0]};
3206 mg::BufferUsage usage{mg::BufferUsage::hardware};
3207 mg::BufferProperties buffer_properties{size, pf, usage};
3208
3209
3210=== modified file 'tests/unit-tests/scene/test_surface.cpp'
3211--- tests/unit-tests/scene/test_surface.cpp 2013-11-27 12:28:24 +0000
3212+++ tests/unit-tests/scene/test_surface.cpp 2013-12-02 16:56:54 +0000
3213@@ -63,7 +63,7 @@
3214 EXPECT_EQ(Height(0), params.size.height);
3215 EXPECT_EQ(default_point, params.top_left);
3216 EXPECT_EQ(mg::BufferUsage::undefined, params.buffer_usage);
3217- EXPECT_EQ(geom::PixelFormat::invalid, params.pixel_format);
3218+ EXPECT_EQ(mir_pixel_format_invalid, params.pixel_format);
3219
3220 EXPECT_EQ(msh::a_surface(), params);
3221 }
3222@@ -73,7 +73,7 @@
3223 using namespace geom;
3224 Size const size{1024, 768};
3225 mg::BufferUsage const usage{mg::BufferUsage::hardware};
3226- geom::PixelFormat const format{geom::PixelFormat::abgr_8888};
3227+ MirPixelFormat const format{mir_pixel_format_abgr_8888};
3228 std::string name{"surface"};
3229
3230 auto params = msh::a_surface().of_name(name)
3231@@ -92,7 +92,7 @@
3232 using namespace geom;
3233 Size const size{1024, 768};
3234 mg::BufferUsage const usage{mg::BufferUsage::hardware};
3235- geom::PixelFormat const format{geom::PixelFormat::abgr_8888};
3236+ MirPixelFormat const format{mir_pixel_format_abgr_8888};
3237
3238 auto params0 = msh::a_surface().of_name("surface")
3239 .of_size(size)
3240@@ -118,8 +118,8 @@
3241 std::vector<mg::BufferUsage> const usages{mg::BufferUsage::hardware,
3242 mg::BufferUsage::software};
3243
3244- std::vector<geom::PixelFormat> const formats{geom::PixelFormat::abgr_8888,
3245- geom::PixelFormat::bgr_888};
3246+ std::vector<MirPixelFormat> const formats{mir_pixel_format_abgr_8888,
3247+ mir_pixel_format_bgr_888};
3248
3249 std::vector<msh::SurfaceCreationParameters> params_vec;
3250
3251@@ -161,7 +161,7 @@
3252 using namespace testing;
3253
3254 surface_name = "test_surfaceA";
3255- pf = geom::PixelFormat::abgr_8888;
3256+ pf = mir_pixel_format_abgr_8888;
3257 size = geom::Size{43, 420};
3258 rect = geom::Rectangle{geom::Point{geom::X{0}, geom::Y{0}}, size};
3259 stride = geom::Stride{4 * size.width.as_uint32_t()};
3260@@ -179,7 +179,7 @@
3261 std::shared_ptr<mtd::MockSurfaceState> mock_basic_state;
3262 std::string surface_name;
3263 std::shared_ptr<testing::NiceMock<mtd::MockBufferStream>> mock_buffer_stream;
3264- geom::PixelFormat pf;
3265+ MirPixelFormat pf;
3266 geom::Stride stride;
3267 geom::Size size;
3268 geom::Rectangle rect;
3269
3270=== modified file 'tests/unit-tests/scene/test_surface_impl.cpp'
3271--- tests/unit-tests/scene/test_surface_impl.cpp 2013-11-27 12:28:24 +0000
3272+++ tests/unit-tests/scene/test_surface_impl.cpp 2013-12-02 16:56:54 +0000
3273@@ -147,7 +147,7 @@
3274 using namespace testing;
3275
3276 ON_CALL(*buffer_stream, stream_size()).WillByDefault(Return(geom::Size()));
3277- ON_CALL(*buffer_stream, get_stream_pixel_format()).WillByDefault(Return(geom::PixelFormat::abgr_8888));
3278+ ON_CALL(*buffer_stream, get_stream_pixel_format()).WillByDefault(Return(mir_pixel_format_abgr_8888));
3279 ON_CALL(*buffer_stream, swap_client_buffers(_)).WillByDefault(SetArg<0>(std::shared_ptr<mtd::StubBuffer>()));
3280 }
3281 mf::SurfaceId stub_id;

Subscribers

People subscribed via source and target branches