Mir

Merge lp:~alan-griffiths/mir/move-graphicsplatform-dependencies-to-graphics into lp:~mir-team/mir/trunk

Proposed by Alan Griffiths
Status: Work in progress
Proposed branch: lp:~alan-griffiths/mir/move-graphicsplatform-dependencies-to-graphics
Merge into: lp:~mir-team/mir/trunk
Diff against target: 3976 lines (+494/-482)
133 files modified
examples/buffer_render_target.cpp (+4/-4)
examples/buffer_render_target.h (+4/-4)
examples/render_surfaces.cpp (+1/-1)
include/server/mir/compositor/back_buffer_strategy.h (+4/-5)
include/server/mir/compositor/buffer_allocation_strategy.h (+2/-2)
include/server/mir/compositor/buffer_basic.h (+5/-5)
include/server/mir/compositor/buffer_stream_factory.h (+1/-1)
include/server/mir/compositor/buffer_stream_surfaces.h (+2/-2)
include/server/mir/compositor/buffer_swapper.h (+7/-7)
include/server/mir/compositor/buffer_swapper_multi.h (+8/-10)
include/server/mir/compositor/buffer_swapper_spin.h (+7/-7)
include/server/mir/compositor/graphic_buffer_allocator.h (+2/-2)
include/server/mir/compositor/multi_acquisition_back_buffer_strategy.h (+4/-6)
include/server/mir/compositor/swapper_factory.h (+2/-2)
include/server/mir/default_server_configuration.h (+3/-3)
include/server/mir/frontend/session_mediator.h (+2/-2)
include/server/mir/frontend/surface.h (+2/-2)
include/server/mir/graphics/buffer.h (+1/-2)
include/server/mir/graphics/buffer_id.h (+4/-4)
include/server/mir/graphics/buffer_initializer.h (+3/-6)
include/server/mir/graphics/gl_pixel_buffer.h (+4/-4)
include/server/mir/graphics/pixel_buffer.h (+5/-8)
include/server/mir/graphics/platform.h (+2/-2)
include/server/mir/shell/surface.h (+2/-2)
include/server/mir/shell/surface_buffer_access.h (+2/-2)
include/server/mir/shell/threaded_snapshot_strategy.h (+7/-4)
include/server/mir/surfaces/buffer_stream.h (+4/-4)
include/server/mir/surfaces/surface.h (+6/-4)
include/shared/mir/int_wrapper.h (+6/-6)
include/test/mir_test_doubles/mock_buffer.h (+4/-4)
include/test/mir_test_doubles/mock_buffer_bundle.h (+4/-4)
include/test/mir_test_doubles/mock_buffer_initializer.h (+2/-2)
include/test/mir_test_doubles/mock_buffer_stream.h (+2/-2)
include/test/mir_test_doubles/mock_display_support_provider.h (+1/-1)
include/test/mir_test_doubles/mock_hwc_interface.h (+1/-1)
include/test/mir_test_doubles/mock_hwc_organizer.h (+1/-1)
include/test/mir_test_doubles/mock_interpreter_resource_cache.h (+2/-2)
include/test/mir_test_doubles/mock_surface.h (+1/-1)
include/test/mir_test_doubles/mock_swapper.h (+7/-7)
include/test/mir_test_doubles/mock_swapper_factory.h (+1/-1)
include/test/mir_test_doubles/null_platform.h (+1/-1)
include/test/mir_test_doubles/stub_buffer.h (+1/-1)
include/test/mir_test_doubles/stub_buffer_stream.h (+4/-4)
include/test/mir_test_doubles/stub_surface.h (+2/-2)
src/server/compositor/buffer_basic.cpp (+5/-3)
src/server/compositor/buffer_bundle.h (+6/-5)
src/server/compositor/buffer_stream_factory.cpp (+2/-2)
src/server/compositor/buffer_stream_surfaces.cpp (+3/-2)
src/server/compositor/buffer_swapper_multi.cpp (+8/-7)
src/server/compositor/buffer_swapper_spin.cpp (+7/-7)
src/server/compositor/multi_acquisition_back_buffer_strategy.cpp (+5/-4)
src/server/compositor/swapper_factory.cpp (+5/-4)
src/server/compositor/switching_bundle.cpp (+7/-6)
src/server/compositor/switching_bundle.h (+4/-4)
src/server/compositor/temporary_buffers.cpp (+3/-2)
src/server/compositor/temporary_buffers.h (+8/-7)
src/server/default_server_configuration.cpp (+1/-1)
src/server/frontend/client_buffer_tracker.cpp (+4/-4)
src/server/frontend/client_buffer_tracker.h (+4/-4)
src/server/frontend/session_mediator.cpp (+2/-2)
src/server/graphics/android/android_buffer_allocator.cpp (+1/-1)
src/server/graphics/android/android_graphic_buffer_allocator.h (+1/-1)
src/server/graphics/android/android_platform.cpp (+2/-2)
src/server/graphics/android/android_platform.h (+1/-1)
src/server/graphics/android/default_framebuffer_factory.cpp (+4/-3)
src/server/graphics/android/default_framebuffer_factory.h (+4/-3)
src/server/graphics/android/display_support_provider.h (+3/-5)
src/server/graphics/android/fb_device.cpp (+4/-4)
src/server/graphics/android/fb_device.h (+1/-1)
src/server/graphics/android/fb_simple_swapper.cpp (+3/-3)
src/server/graphics/android/fb_simple_swapper.h (+3/-3)
src/server/graphics/android/fb_swapper.h (+4/-9)
src/server/graphics/android/hwc10_device.cpp (+2/-2)
src/server/graphics/android/hwc10_device.h (+1/-1)
src/server/graphics/android/hwc11_device.cpp (+3/-3)
src/server/graphics/android/hwc11_device.h (+3/-1)
src/server/graphics/android/hwc_common_device.h (+1/-1)
src/server/graphics/android/hwc_device.h (+1/-1)
src/server/graphics/android/hwc_layerlist.cpp (+2/-2)
src/server/graphics/android/hwc_layerlist.h (+4/-7)
src/server/graphics/android/internal_client_window.cpp (+1/-1)
src/server/graphics/android/interpreter_cache.cpp (+3/-3)
src/server/graphics/android/interpreter_cache.h (+3/-3)
src/server/graphics/android/interpreter_resource_cache.h (+4/-6)
src/server/graphics/android/server_render_window.cpp (+1/-1)
src/server/graphics/gbm/gbm_buffer_allocator.cpp (+2/-2)
src/server/graphics/gbm/gbm_buffer_allocator.h (+2/-2)
src/server/graphics/gbm/gbm_platform.cpp (+1/-1)
src/server/graphics/gbm/gbm_platform.h (+1/-1)
src/server/graphics/gbm/internal_native_display.cpp (+1/-1)
src/server/graphics/gbm/internal_native_surface.cpp (+1/-1)
src/server/graphics/gbm/internal_native_surface.h (+2/-2)
src/server/graphics/gl_pixel_buffer.cpp (+2/-3)
src/server/graphics/gl_renderer.cpp (+1/-1)
src/server/shell/surface.cpp (+3/-2)
src/server/shell/threaded_snapshot_strategy.cpp (+5/-5)
src/server/surfaces/surface.cpp (+3/-3)
tests/integration-tests/client/test_client_render.cpp (+4/-4)
tests/integration-tests/compositor/test_buffer_stream.cpp (+4/-3)
tests/integration-tests/compositor/test_stress_buffer_swapper.cpp (+29/-28)
tests/integration-tests/compositor/test_swapping_swappers.cpp (+2/-1)
tests/integration-tests/graphics/gbm/test_buffer_integration.cpp (+8/-8)
tests/integration-tests/shell/test_session.cpp (+5/-5)
tests/integration-tests/test_display_info.cpp (+3/-3)
tests/integration-tests/test_drm_auth_magic.cpp (+2/-2)
tests/integration-tests/test_surfaceloop.cpp (+7/-7)
tests/integration-tests/test_swapinterval.cpp (+2/-2)
tests/mir_test_framework/testing_server_options.cpp (+2/-2)
tests/unit-tests/compositor/test_buffer_id.cpp (+9/-8)
tests/unit-tests/compositor/test_buffer_swapper.cpp (+13/-12)
tests/unit-tests/compositor/test_buffer_swapper_double.cpp (+5/-4)
tests/unit-tests/compositor/test_buffer_swapper_spin_triple.cpp (+10/-9)
tests/unit-tests/compositor/test_buffer_swapper_triple.cpp (+6/-5)
tests/unit-tests/compositor/test_swapper_factory.cpp (+7/-6)
tests/unit-tests/compositor/test_switching_bundle.cpp (+2/-1)
tests/unit-tests/compositor/test_temporary_buffers.cpp (+4/-3)
tests/unit-tests/frontend/test_client_buffer_tracker.cpp (+15/-15)
tests/unit-tests/frontend/test_session_mediator.cpp (+8/-8)
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_fb_simple_swapper.cpp (+9/-8)
tests/unit-tests/graphics/android/test_framebuffer_factory.cpp (+2/-1)
tests/unit-tests/graphics/android/test_hwc10_device.cpp (+2/-1)
tests/unit-tests/graphics/android/test_hwc11_device.cpp (+4/-3)
tests/unit-tests/graphics/android/test_internal_client.cpp (+3/-3)
tests/unit-tests/graphics/android/test_internal_client_interpreter.cpp (+3/-3)
tests/unit-tests/graphics/android/test_server_interpreter.cpp (+7/-6)
tests/unit-tests/graphics/gbm/test_internal_client.cpp (+0/-1)
tests/unit-tests/graphics/gbm/test_internal_native_surface.cpp (+1/-1)
tests/unit-tests/shell/test_application_session.cpp (+1/-1)
tests/unit-tests/shell/test_surface.cpp (+3/-2)
tests/unit-tests/shell/test_threaded_snapshot_strategy.cpp (+6/-5)
tests/unit-tests/surfaces/test_surface_stack.cpp (+4/-4)
To merge this branch: bzr merge lp:~alan-griffiths/mir/move-graphicsplatform-dependencies-to-graphics
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Daniel van Vugt Needs Fixing
Review via email: mp+175078@code.launchpad.net

Commit message

graphics, conpositor: Move dependencies of graphics platform into graphics.

Description of the change

graphics, conpositor: Move dependencies of graphics platform into graphics.

This is preparatory to splitting graphics off into an LGPL library that breaks the current dependency of graphicsplatform implementations on GPL code.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

1. So the graphics namespace would no longer be used inside libmirserver right? Because everything remaining in libmirserver would ideally be moved into mir::server:: or grouped more logically in future.

2. Can we think of a better namespace than "mir::graphics::"? It seems silly to imply that other components of Mir are not graphics-related. It's all graphics-related. So calling the namespace "graphics" does not communicate the intention at all. Maybe use "driver" or "platform"...

review: Needs Information
Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

One concern I have is that we move some interfaces away from their consumers (e.g. msh::PixelBuffer). Although the consumer can still conceptually stay in control of the interface, the dissociation makes it less intuitive to do so. An alternative would be to change the license in files without moving them, but that's arguably more complicated and confusing for interested parties. So I guess this dissociation is something we will need to live with :/

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

There's a very simple (albeit initially labour intensive) solution I mentioned a while back: Just define a bare interface that is "a graphics driver" header, which has zero dependencies on anything else. Then both the server and the driver can use that interface without any license mixture.

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

> 1. So the graphics namespace would no longer be used inside libmirserver
> right? Because everything remaining in libmirserver would ideally be moved
> into mir::server:: or grouped more logically in future.

No. Like the protobuf namespace the graphics namespace will be consumed in libmirserver, but implemented in another library.

> 2. Can we think of a better namespace than "mir::graphics::"? It seems silly
> to imply that other components of Mir are not graphics-related. It's all
> graphics-related. So calling the namespace "graphics" does not communicate the
> intention at all. Maybe use "driver" or "platform"...

Possibly, the name originates from the the project startup meeting (and I'm used to it).

I don't think this MP is the right place to change it though - an MP dedicated to changing the name would be far easier to review.

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

OK, it sounds quite plausible, and I hope reasonable, that the "graphics" namespace should go away. So I think it might be a bad idea to move everything into "graphics" if it should/might go away soon.

I think this MP is the correct place to fix it.

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

Now I look in more detail, there is a bigger issue - We are moving platform independent classes out of mir::compositor:: and into mir::graphics::. So the mir::graphics:: you see here is actually a superset of what will be the "platform" or driver". Much of it however is platform independent.

I'm now wondering if the whole exercise makes sense. Dividing the server library into 3 eventual parts seems a bit messy:

1. Existing GPL server code
2. Server code which has to become LGPL
3. The platform/driver code

I don't think designating 2 and 3 as mir::graphics:: is helpful. Particularly when 2 is more closely related to 1.

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

I suggest two possible solutions:

(a) Define a clear and completely independent driver interface which has no dependencies; or
(b) Move the whole libmirserver to LGPL, as a temporary step in the absence of (a).

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

> I suggest two possible solutions:
>
> (a) Define a clear and completely independent driver interface which has no
> dependencies; or
> (b) Move the whole libmirserver to LGPL, as a temporary step in the absence of
> (a).

(c) Define a clear driver interface which only has dependencies on LGPL code, not on libmirserver. (This MP moves "graphics" a step in that direction - "graphics" will become that interface and new LGPL library.)

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

> Now I look in more detail, there is a bigger issue - We are moving platform
> independent classes out of mir::compositor:: and into mir::graphics::. So the
> mir::graphics:: you see here is actually a superset of what will be the
> "platform" or driver". Much of it however is platform independent.
>
> I'm now wondering if the whole exercise makes sense. Dividing the server
> library into 3 eventual parts seems a bit messy:
>
> 1. Existing GPL server code
> 2. Server code which has to become LGPL
> 3. The platform/driver code
>
> I don't think designating 2 and 3 as mir::graphics:: is helpful. Particularly
> when 2 is more closely related to 1.

No-one is proposing to move 3 into graphics

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

I think dividing libmirserver into more libraries is just going to make maintenance more difficult. Plus we won't get it right first time and more classes will drift from GPL into LGPL over time. There's no reason to maintain any GPL server code if so much of it needs to be LGPL.

But again, if your "driver interface" is carefully designed to have zero dependencies, then the server library can stay full GPL.

859. By Alan Griffiths

merge lp:mir

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
860. By Alan Griffiths

merge lp:mir

861. By Alan Griffiths

merge lp:mir

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
862. By Alan Griffiths

Move IntWrapper to LGPL

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

Note that everything moved in this MP is a header. All parts of the "graphics platform" interface that we are using.

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

> One concern I have is that we move some interfaces away from their consumers
> (e.g. msh::PixelBuffer). Although the consumer can still conceptually stay in
> control of the interface, the dissociation makes it less intuitive to do so.
> An alternative would be to change the license in files without moving them,
> but that's arguably more complicated and confusing for interested parties. So
> I guess this dissociation is something we will need to live with :/

In the specific case of PixelBuffer it would also be possible to move the gl_pixel_buffer.cpp/.h code out of graphics as it is platform independent gl code.

Perhaps the same is true of the other implementations in graphics? I need to think about this (and where, if anywhere, to put them).

Buffer however is implemented differently across gbm and android.

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

Unmerged revisions

862. By Alan Griffiths

Move IntWrapper to LGPL

861. By Alan Griffiths

merge lp:mir

860. By Alan Griffiths

merge lp:mir

859. By Alan Griffiths

merge lp:mir

858. By Alan Griffiths

Move buffer.h and buffer_id.h to graphics

857. By Alan Griffiths

Move Buffer interface and BufferID to graphics

856. By Alan Griffiths

Simpler and more flexible IntWrapper

855. By Alan Griffiths

merge lp:mir

854. By Alan Griffiths

Move shell/pixel_buffer.h to graphics

853. By Alan Griffiths

Move PixelBuffer to graphics

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'examples/buffer_render_target.cpp'
--- examples/buffer_render_target.cpp 2013-03-21 03:32:59 +0000
+++ examples/buffer_render_target.cpp 2013-07-17 14:20:33 +0000
@@ -17,16 +17,16 @@
17 */17 */
1818
19#include "buffer_render_target.h"19#include "buffer_render_target.h"
20#include "mir/compositor/buffer.h"20#include "mir/graphics/buffer.h"
2121
22#include <GLES2/gl2ext.h>22#include <GLES2/gl2ext.h>
23#include <stdexcept>23#include <stdexcept>
2424
25namespace geom = mir::geometry;25namespace geom = mir::geometry;
26namespace mc = mir::compositor;26namespace mg = mir::graphics;
27namespace mt = mir::tools;27namespace mt = mir::tools;
2828
29mt::BufferRenderTarget::BufferRenderTarget(mc::Buffer& buffer)29mt::BufferRenderTarget::BufferRenderTarget(mg::Buffer& buffer)
30 : buffer(buffer)30 : buffer(buffer)
31{31{
32 resources.setup(buffer);32 resources.setup(buffer);
@@ -55,7 +55,7 @@
55 glDeleteFramebuffers(1, &fbo);55 glDeleteFramebuffers(1, &fbo);
56}56}
5757
58void mt::BufferRenderTarget::Resources::setup(mc::Buffer& buffer)58void mt::BufferRenderTarget::Resources::setup(mg::Buffer& buffer)
59{59{
60 geom::Size buf_size = buffer.size();60 geom::Size buf_size = buffer.size();
6161
6262
=== modified file 'examples/buffer_render_target.h'
--- examples/buffer_render_target.h 2013-03-21 03:32:59 +0000
+++ examples/buffer_render_target.h 2013-07-17 14:20:33 +0000
@@ -25,7 +25,7 @@
2525
26namespace mir26namespace mir
27{27{
28namespace compositor28namespace graphics
29{29{
30class Buffer;30class Buffer;
31}31}
@@ -35,7 +35,7 @@
35class BufferRenderTarget35class BufferRenderTarget
36{36{
37public:37public:
38 BufferRenderTarget(mir::compositor::Buffer& buffer);38 BufferRenderTarget(mir::graphics::Buffer& buffer);
39 ~BufferRenderTarget();39 ~BufferRenderTarget();
4040
41 void make_current();41 void make_current();
@@ -49,7 +49,7 @@
49 {49 {
50 }50 }
51 ~Resources();51 ~Resources();
52 void setup(mir::compositor::Buffer& buffer);52 void setup(mir::graphics::Buffer& buffer);
5353
54 GLuint fbo;54 GLuint fbo;
55 GLuint color_tex;55 GLuint color_tex;
@@ -57,7 +57,7 @@
57 };57 };
5858
59 Resources resources;59 Resources resources;
60 mir::compositor::Buffer& buffer;60 mir::graphics::Buffer& buffer;
61};61};
6262
63}63}
6464
=== modified file 'examples/render_surfaces.cpp'
--- examples/render_surfaces.cpp 2013-07-11 16:54:41 +0000
+++ examples/render_surfaces.cpp 2013-07-17 14:20:33 +0000
@@ -289,7 +289,7 @@
289 {289 {
290 }290 }
291291
292 void operator()(mc::Buffer& buffer)292 void operator()(mg::Buffer& buffer)
293 {293 {
294 mt::BufferRenderTarget brt{buffer};294 mt::BufferRenderTarget brt{buffer};
295 brt.make_current();295 brt.make_current();
296296
=== modified file 'include/server/mir/compositor/back_buffer_strategy.h'
--- include/server/mir/compositor/back_buffer_strategy.h 2013-06-17 15:55:04 +0000
+++ include/server/mir/compositor/back_buffer_strategy.h 2013-07-17 14:20:33 +0000
@@ -23,18 +23,17 @@
2323
24namespace mir24namespace mir
25{25{
26namespace graphics { class Buffer; }
27
26namespace compositor28namespace compositor
27{29{
28
29class Buffer;
30
31class BackBufferStrategy30class BackBufferStrategy
32{31{
33public:32public:
34 virtual ~BackBufferStrategy() = default;33 virtual ~BackBufferStrategy() = default;
3534
36 virtual std::shared_ptr<Buffer> acquire() = 0;35 virtual std::shared_ptr<graphics::Buffer> acquire() = 0;
37 virtual void release(std::shared_ptr<Buffer> const& buffer) = 0;36 virtual void release(std::shared_ptr<graphics::Buffer> const& buffer) = 0;
3837
39protected:38protected:
40 BackBufferStrategy() = default;39 BackBufferStrategy() = default;
4140
=== modified file 'include/server/mir/compositor/buffer_allocation_strategy.h'
--- include/server/mir/compositor/buffer_allocation_strategy.h 2013-06-21 23:40:49 +0000
+++ include/server/mir/compositor/buffer_allocation_strategy.h 2013-07-17 14:20:33 +0000
@@ -21,7 +21,7 @@
21#ifndef MIR_COMPOSITOR_BUFFER_ALLOCATION_STRATEGY_H_21#ifndef MIR_COMPOSITOR_BUFFER_ALLOCATION_STRATEGY_H_
22#define MIR_COMPOSITOR_BUFFER_ALLOCATION_STRATEGY_H_22#define MIR_COMPOSITOR_BUFFER_ALLOCATION_STRATEGY_H_
2323
24#include "mir/compositor/buffer.h"24#include "mir/graphics/buffer.h"
2525
26#include <vector>26#include <vector>
27#include <memory>27#include <memory>
@@ -46,7 +46,7 @@
46{46{
47public:47public:
48 virtual std::shared_ptr<BufferSwapper> create_swapper_reuse_buffers(BufferProperties const&,48 virtual std::shared_ptr<BufferSwapper> create_swapper_reuse_buffers(BufferProperties const&,
49 std::vector<std::shared_ptr<Buffer>>&, size_t, SwapperType) const = 0;49 std::vector<std::shared_ptr<graphics::Buffer>>&, size_t, SwapperType) const = 0;
50 virtual std::shared_ptr<BufferSwapper> create_swapper_new_buffers(50 virtual std::shared_ptr<BufferSwapper> create_swapper_new_buffers(
51 BufferProperties& actual_properties, BufferProperties const& requested_properties, SwapperType) const = 0;51 BufferProperties& actual_properties, BufferProperties const& requested_properties, SwapperType) const = 0;
5252
5353
=== modified file 'include/server/mir/compositor/buffer_basic.h'
--- include/server/mir/compositor/buffer_basic.h 2013-04-24 05:22:20 +0000
+++ include/server/mir/compositor/buffer_basic.h 2013-07-17 14:20:33 +0000
@@ -18,26 +18,26 @@
18#ifndef MIR_COMPOSITOR_BUFFER_BASIC_H_18#ifndef MIR_COMPOSITOR_BUFFER_BASIC_H_
19#define MIR_COMPOSITOR_BUFFER_BASIC_H_19#define MIR_COMPOSITOR_BUFFER_BASIC_H_
2020
21#include "mir/compositor/buffer.h"21#include "mir/graphics/buffer.h"
22#include "mir/compositor/buffer_id.h"22#include "mir/graphics/buffer_id.h"
2323
24namespace mir24namespace mir
25{25{
26namespace compositor26namespace compositor
27{27{
2828
29class BufferBasic : public Buffer29class BufferBasic : public graphics::Buffer
30{30{
31public:31public:
32 BufferBasic();32 BufferBasic();
3333
34 BufferID id() const34 graphics::BufferID id() const
35 {35 {
36 return buffer_id;36 return buffer_id;
37 }37 }
3838
39private:39private:
40 BufferID const buffer_id;40 graphics::BufferID const buffer_id;
41};41};
4242
43}43}
4444
=== modified file 'include/server/mir/compositor/buffer_stream_factory.h'
--- include/server/mir/compositor/buffer_stream_factory.h 2013-06-12 15:36:31 +0000
+++ include/server/mir/compositor/buffer_stream_factory.h 2013-07-17 14:20:33 +0000
@@ -21,7 +21,7 @@
21#ifndef MIR_COMPOSITOR_BUFFER_STREAM_FACTORY_H_21#ifndef MIR_COMPOSITOR_BUFFER_STREAM_FACTORY_H_
22#define MIR_COMPOSITOR_BUFFER_STREAM_FACTORY_H_22#define MIR_COMPOSITOR_BUFFER_STREAM_FACTORY_H_
2323
24#include "mir/compositor/buffer.h"24#include "mir/graphics/buffer.h"
25#include "mir/surfaces/buffer_stream_factory.h"25#include "mir/surfaces/buffer_stream_factory.h"
2626
27#include <memory>27#include <memory>
2828
=== modified file 'include/server/mir/compositor/buffer_stream_surfaces.h'
--- include/server/mir/compositor/buffer_stream_surfaces.h 2013-06-21 23:40:49 +0000
+++ include/server/mir/compositor/buffer_stream_surfaces.h 2013-07-17 14:20:33 +0000
@@ -40,9 +40,9 @@
40 BufferStreamSurfaces(std::shared_ptr<BufferBundle> const& swapper);40 BufferStreamSurfaces(std::shared_ptr<BufferBundle> const& swapper);
41 ~BufferStreamSurfaces();41 ~BufferStreamSurfaces();
4242
43 std::shared_ptr<Buffer> secure_client_buffer();43 std::shared_ptr<graphics::Buffer> secure_client_buffer();
4444
45 std::shared_ptr<Buffer> lock_back_buffer();45 std::shared_ptr<graphics::Buffer> lock_back_buffer();
4646
47 geometry::PixelFormat get_stream_pixel_format();47 geometry::PixelFormat get_stream_pixel_format();
48 geometry::Size stream_size();48 geometry::Size stream_size();
4949
=== modified file 'include/server/mir/compositor/buffer_swapper.h'
--- include/server/mir/compositor/buffer_swapper.h 2013-06-19 09:57:32 +0000
+++ include/server/mir/compositor/buffer_swapper.h 2013-07-17 14:20:33 +0000
@@ -25,10 +25,10 @@
2525
26namespace mir26namespace mir
27{27{
28namespace graphics { class Buffer; }
29
28namespace compositor30namespace compositor
29{31{
30class Buffer;
31
32class BufferSwapper32class BufferSwapper
33{33{
34public:34public:
@@ -41,12 +41,12 @@
41 *41 *
42 * May throw a mc::BufferSwapperRequestAbortedException.42 * May throw a mc::BufferSwapperRequestAbortedException.
43 */43 */
44 virtual std::shared_ptr<Buffer> client_acquire() = 0;44 virtual std::shared_ptr<graphics::Buffer> client_acquire() = 0;
4545
46 /**46 /**
47 * Releases a client buffer, making it available to the compositor.47 * Releases a client buffer, making it available to the compositor.
48 */48 */
49 virtual void client_release(std::shared_ptr<Buffer> const& queued_buffer) = 0;49 virtual void client_release(std::shared_ptr<graphics::Buffer> const& queued_buffer) = 0;
5050
51 /**51 /**
52 * Acquires the last posted buffer.52 * Acquires the last posted buffer.
@@ -61,12 +61,12 @@
61 *61 *
62 * May throw a mc::BufferSwapperOutOfBuffersException.62 * May throw a mc::BufferSwapperOutOfBuffersException.
63 */63 */
64 virtual std::shared_ptr<Buffer> compositor_acquire() = 0;64 virtual std::shared_ptr<graphics::Buffer> compositor_acquire() = 0;
6565
66 /**66 /**
67 * Releases a compositor buffer, making it available to the client.67 * Releases a compositor buffer, making it available to the client.
68 */68 */
69 virtual void compositor_release(std::shared_ptr<Buffer> const& released_buffer) = 0;69 virtual void compositor_release(std::shared_ptr<graphics::Buffer> const& released_buffer) = 0;
7070
71 /**71 /**
72 * Forces client requests on the buffer swapper to abort.72 * Forces client requests on the buffer swapper to abort.
@@ -110,7 +110,7 @@
110 * After the completion of this call, neither the client, nor the compositor can110 * After the completion of this call, neither the client, nor the compositor can
111 * continue to request or return buffers to this swapper.111 * continue to request or return buffers to this swapper.
112 */112 */
113 virtual void end_responsibility(std::vector<std::shared_ptr<Buffer>>& buffers, size_t& original_size) = 0;113 virtual void end_responsibility(std::vector<std::shared_ptr<graphics::Buffer>>& buffers, size_t& original_size) = 0;
114114
115 /**115 /**
116 * If the swapper has been used, and you want to preserve the buffers that have been used, 116 * If the swapper has been used, and you want to preserve the buffers that have been used,
117117
=== modified file 'include/server/mir/compositor/buffer_swapper_multi.h'
--- include/server/mir/compositor/buffer_swapper_multi.h 2013-06-15 11:09:16 +0000
+++ include/server/mir/compositor/buffer_swapper_multi.h 2013-07-17 14:20:33 +0000
@@ -34,28 +34,26 @@
34namespace compositor34namespace compositor
35{35{
3636
37class Buffer;
38
39class BufferSwapperMulti : public BufferSwapper37class BufferSwapperMulti : public BufferSwapper
40{38{
41public:39public:
42 explicit BufferSwapperMulti(std::vector<std::shared_ptr<compositor::Buffer>>& buffer_list, size_t swapper_size);40 explicit BufferSwapperMulti(std::vector<std::shared_ptr<graphics::Buffer>>& buffer_list, size_t swapper_size);
4341
44 std::shared_ptr<Buffer> client_acquire();42 std::shared_ptr<graphics::Buffer> client_acquire();
45 void client_release(std::shared_ptr<Buffer> const& queued_buffer);43 void client_release(std::shared_ptr<graphics::Buffer> const& queued_buffer);
46 std::shared_ptr<Buffer> compositor_acquire();44 std::shared_ptr<graphics::Buffer> compositor_acquire();
47 void compositor_release(std::shared_ptr<Buffer> const& released_buffer);45 void compositor_release(std::shared_ptr<graphics::Buffer> const& released_buffer);
4846
49 void force_client_abort();47 void force_client_abort();
50 void force_requests_to_complete();48 void force_requests_to_complete();
51 void end_responsibility(std::vector<std::shared_ptr<Buffer>>&, size_t&);49 void end_responsibility(std::vector<std::shared_ptr<graphics::Buffer>>&, size_t&);
5250
53private:51private:
54 std::mutex swapper_mutex;52 std::mutex swapper_mutex;
55 std::condition_variable client_available_cv;53 std::condition_variable client_available_cv;
5654
57 std::deque<std::shared_ptr<Buffer>> client_queue;55 std::deque<std::shared_ptr<graphics::Buffer>> client_queue;
58 std::deque<std::shared_ptr<Buffer>> compositor_queue;56 std::deque<std::shared_ptr<graphics::Buffer>> compositor_queue;
59 unsigned int in_use_by_client;57 unsigned int in_use_by_client;
60 unsigned int const swapper_size;58 unsigned int const swapper_size;
61 int clients_trying_to_acquire;59 int clients_trying_to_acquire;
6260
=== modified file 'include/server/mir/compositor/buffer_swapper_spin.h'
--- include/server/mir/compositor/buffer_swapper_spin.h 2013-07-16 09:31:36 +0000
+++ include/server/mir/compositor/buffer_swapper_spin.h 2013-07-17 14:20:33 +0000
@@ -47,21 +47,21 @@
47class BufferSwapperSpin : public BufferSwapper47class BufferSwapperSpin : public BufferSwapper
48{48{
49public:49public:
50 BufferSwapperSpin(std::vector<std::shared_ptr<compositor::Buffer>>& buffer_list, size_t swapper_size);50 BufferSwapperSpin(std::vector<std::shared_ptr<graphics::Buffer>>& buffer_list, size_t swapper_size);
5151
52 std::shared_ptr<Buffer> client_acquire();52 std::shared_ptr<graphics::Buffer> client_acquire();
53 void client_release(std::shared_ptr<Buffer> const& queued_buffer);53 void client_release(std::shared_ptr<graphics::Buffer> const& queued_buffer);
54 std::shared_ptr<Buffer> compositor_acquire();54 std::shared_ptr<graphics::Buffer> compositor_acquire();
55 void compositor_release(std::shared_ptr<Buffer> const& released_buffer);55 void compositor_release(std::shared_ptr<graphics::Buffer> const& released_buffer);
5656
57 void force_client_abort();57 void force_client_abort();
58 void force_requests_to_complete();58 void force_requests_to_complete();
59 void end_responsibility(std::vector<std::shared_ptr<Buffer>>&, size_t&);59 void end_responsibility(std::vector<std::shared_ptr<graphics::Buffer>>&, size_t&);
6060
61private:61private:
62 std::mutex swapper_mutex;62 std::mutex swapper_mutex;
6363
64 std::deque<std::shared_ptr<Buffer>> buffer_queue;64 std::deque<std::shared_ptr<graphics::Buffer>> buffer_queue;
65 unsigned int in_use_by_client;65 unsigned int in_use_by_client;
66 bool client_submitted_new_buffer;66 bool client_submitted_new_buffer;
67 size_t const swapper_size;67 size_t const swapper_size;
6868
=== modified file 'include/server/mir/compositor/graphic_buffer_allocator.h'
--- include/server/mir/compositor/graphic_buffer_allocator.h 2013-06-17 09:51:42 +0000
+++ include/server/mir/compositor/graphic_buffer_allocator.h 2013-07-17 14:20:33 +0000
@@ -19,7 +19,7 @@
19#ifndef MIR_COMPOSITOR_GRAPHIC_BUFFER_ALLOCATOR_H_19#ifndef MIR_COMPOSITOR_GRAPHIC_BUFFER_ALLOCATOR_H_
20#define MIR_COMPOSITOR_GRAPHIC_BUFFER_ALLOCATOR_H_20#define MIR_COMPOSITOR_GRAPHIC_BUFFER_ALLOCATOR_H_
2121
22#include "mir/compositor/buffer.h"22#include "mir/graphics/buffer.h"
2323
24#include <vector>24#include <vector>
25#include <memory>25#include <memory>
@@ -44,7 +44,7 @@
44 *44 *
45 * \param [in] buffer_properties the properties the allocated buffer should have45 * \param [in] buffer_properties the properties the allocated buffer should have
46 */46 */
47 virtual std::shared_ptr<Buffer> alloc_buffer(47 virtual std::shared_ptr<graphics::Buffer> alloc_buffer(
48 BufferProperties const& buffer_properties) = 0;48 BufferProperties const& buffer_properties) = 0;
4949
50 /**50 /**
5151
=== modified file 'include/server/mir/compositor/multi_acquisition_back_buffer_strategy.h'
--- include/server/mir/compositor/multi_acquisition_back_buffer_strategy.h 2013-06-17 15:55:04 +0000
+++ include/server/mir/compositor/multi_acquisition_back_buffer_strategy.h 2013-07-17 14:20:33 +0000
@@ -29,8 +29,6 @@
29{29{
30namespace compositor30namespace compositor
31{31{
32
33class Buffer;
34class BufferBundle;32class BufferBundle;
3533
36namespace detail34namespace detail
@@ -38,7 +36,7 @@
3836
39struct AcquiredBufferInfo37struct AcquiredBufferInfo
40{38{
41 std::weak_ptr<Buffer> buffer;39 std::weak_ptr<graphics::Buffer> buffer;
42 bool partly_released;40 bool partly_released;
43 int use_count;41 int use_count;
44};42};
@@ -50,12 +48,12 @@
50public:48public:
51 MultiAcquisitionBackBufferStrategy(std::shared_ptr<BufferBundle> const& buffer_bundle);49 MultiAcquisitionBackBufferStrategy(std::shared_ptr<BufferBundle> const& buffer_bundle);
5250
53 std::shared_ptr<Buffer> acquire();51 std::shared_ptr<graphics::Buffer> acquire();
54 void release(std::shared_ptr<Buffer> const& buffer);52 void release(std::shared_ptr<graphics::Buffer> const& buffer);
5553
56private:54private:
57 std::vector<detail::AcquiredBufferInfo>::iterator find_info(55 std::vector<detail::AcquiredBufferInfo>::iterator find_info(
58 std::shared_ptr<Buffer> const& buffer);56 std::shared_ptr<graphics::Buffer> const& buffer);
5957
60 std::shared_ptr<BufferBundle> const buffer_bundle;58 std::shared_ptr<BufferBundle> const buffer_bundle;
61 std::vector<detail::AcquiredBufferInfo> acquired_buffers;59 std::vector<detail::AcquiredBufferInfo> acquired_buffers;
6260
=== modified file 'include/server/mir/compositor/swapper_factory.h'
--- include/server/mir/compositor/swapper_factory.h 2013-06-17 19:40:58 +0000
+++ include/server/mir/compositor/swapper_factory.h 2013-07-17 14:20:33 +0000
@@ -39,13 +39,13 @@
39 int number_of_buffers);39 int number_of_buffers);
4040
41 std::shared_ptr<BufferSwapper> create_swapper_reuse_buffers(BufferProperties const&,41 std::shared_ptr<BufferSwapper> create_swapper_reuse_buffers(BufferProperties const&,
42 std::vector<std::shared_ptr<Buffer>>&, size_t, SwapperType) const;42 std::vector<std::shared_ptr<graphics::Buffer>>&, size_t, SwapperType) const;
43 std::shared_ptr<BufferSwapper> create_swapper_new_buffers(43 std::shared_ptr<BufferSwapper> create_swapper_new_buffers(
44 BufferProperties& actual_properties, BufferProperties const& requested_properties, SwapperType) const;44 BufferProperties& actual_properties, BufferProperties const& requested_properties, SwapperType) const;
4545
46private:46private:
47 void change_swapper_size(47 void change_swapper_size(
48 std::vector<std::shared_ptr<Buffer>>&, size_t const, size_t, BufferProperties const&) const;48 std::vector<std::shared_ptr<graphics::Buffer>>&, size_t const, size_t, BufferProperties const&) const;
4949
50 std::shared_ptr<GraphicBufferAllocator> const gr_allocator;50 std::shared_ptr<GraphicBufferAllocator> const gr_allocator;
51 unsigned int const synchronous_number_of_buffers;51 unsigned int const synchronous_number_of_buffers;
5252
=== modified file 'include/server/mir/default_server_configuration.h'
--- include/server/mir/default_server_configuration.h 2013-07-15 09:29:14 +0000
+++ include/server/mir/default_server_configuration.h 2013-07-17 14:20:33 +0000
@@ -60,7 +60,6 @@
60class SessionListener;60class SessionListener;
61class FocusController;61class FocusController;
62class SessionManager;62class SessionManager;
63class PixelBuffer;
64class SnapshotStrategy;63class SnapshotStrategy;
65}64}
66namespace time65namespace time
@@ -82,6 +81,7 @@
82class Display;81class Display;
83class ViewableArea;82class ViewableArea;
84class BufferInitializer;83class BufferInitializer;
84class PixelBuffer;
85class DisplayReport;85class DisplayReport;
86}86}
87namespace input87namespace input
@@ -164,7 +164,7 @@
164 virtual std::shared_ptr<shell::FocusSequence> the_shell_focus_sequence();164 virtual std::shared_ptr<shell::FocusSequence> the_shell_focus_sequence();
165 virtual std::shared_ptr<shell::PlacementStrategy> the_shell_placement_strategy();165 virtual std::shared_ptr<shell::PlacementStrategy> the_shell_placement_strategy();
166 virtual std::shared_ptr<shell::SessionListener> the_shell_session_listener();166 virtual std::shared_ptr<shell::SessionListener> the_shell_session_listener();
167 virtual std::shared_ptr<shell::PixelBuffer> the_shell_pixel_buffer();167 virtual std::shared_ptr<graphics::PixelBuffer> the_shell_pixel_buffer();
168 virtual std::shared_ptr<shell::SnapshotStrategy> the_shell_snapshot_strategy();168 virtual std::shared_ptr<shell::SnapshotStrategy> the_shell_snapshot_strategy();
169 /** @} */169 /** @} */
170170
@@ -248,7 +248,7 @@
248 CachedPtr<shell::FocusSequence> shell_focus_sequence;248 CachedPtr<shell::FocusSequence> shell_focus_sequence;
249 CachedPtr<shell::PlacementStrategy> shell_placement_strategy;249 CachedPtr<shell::PlacementStrategy> shell_placement_strategy;
250 CachedPtr<shell::SessionListener> shell_session_listener;250 CachedPtr<shell::SessionListener> shell_session_listener;
251 CachedPtr<shell::PixelBuffer> shell_pixel_buffer;251 CachedPtr<graphics::PixelBuffer> shell_pixel_buffer;
252 CachedPtr<shell::SnapshotStrategy> shell_snapshot_strategy;252 CachedPtr<shell::SnapshotStrategy> shell_snapshot_strategy;
253 CachedPtr<compositor::CompositingStrategy> compositing_strategy;253 CachedPtr<compositor::CompositingStrategy> compositing_strategy;
254 CachedPtr<compositor::OverlayRenderer> overlay_renderer;254 CachedPtr<compositor::OverlayRenderer> overlay_renderer;
255255
=== modified file 'include/server/mir/frontend/session_mediator.h'
--- include/server/mir/frontend/session_mediator.h 2013-07-09 18:53:16 +0000
+++ include/server/mir/frontend/session_mediator.h 2013-07-17 14:20:33 +0000
@@ -34,13 +34,13 @@
34}34}
35namespace graphics35namespace graphics
36{36{
37class Buffer;
37class Platform;38class Platform;
38class ViewableArea;39class ViewableArea;
39}40}
4041
41namespace compositor42namespace compositor
42{43{
43class Buffer;
44class GraphicBufferAllocator;44class GraphicBufferAllocator;
45}45}
4646
@@ -123,7 +123,7 @@
123 std::shared_ptr<ResourceCache> const resource_cache;123 std::shared_ptr<ResourceCache> const resource_cache;
124 std::shared_ptr<ClientBufferTracker> const client_tracker;124 std::shared_ptr<ClientBufferTracker> const client_tracker;
125125
126 std::shared_ptr<compositor::Buffer> client_buffer_resource;126 std::shared_ptr<graphics::Buffer> client_buffer_resource;
127127
128 std::mutex session_mutex;128 std::mutex session_mutex;
129 std::shared_ptr<Session> session;129 std::shared_ptr<Session> session;
130130
=== modified file 'include/server/mir/frontend/surface.h'
--- include/server/mir/frontend/surface.h 2013-06-25 05:42:49 +0000
+++ include/server/mir/frontend/surface.h 2013-07-17 14:20:33 +0000
@@ -29,7 +29,7 @@
2929
30namespace mir30namespace mir
31{31{
32namespace compositor32namespace graphics
33{33{
34class Buffer;34class Buffer;
35}35}
@@ -53,7 +53,7 @@
53 virtual geometry::Size size() const = 0;53 virtual geometry::Size size() const = 0;
54 virtual geometry::PixelFormat pixel_format() const = 0;54 virtual geometry::PixelFormat pixel_format() const = 0;
5555
56 virtual std::shared_ptr<compositor::Buffer> advance_client_buffer() = 0;56 virtual std::shared_ptr<graphics::Buffer> advance_client_buffer() = 0;
5757
58 virtual bool supports_input() const = 0;58 virtual bool supports_input() const = 0;
59 virtual int client_input_fd() const = 0;59 virtual int client_input_fd() const = 0;
6060
=== renamed file 'include/server/mir/compositor/buffer.h' => 'include/server/mir/graphics/buffer.h'
--- include/server/mir/compositor/buffer.h 2013-05-14 17:39:25 +0000
+++ include/server/mir/graphics/buffer.h 2013-07-17 14:20:33 +0000
@@ -26,9 +26,8 @@
2626
27namespace mir27namespace mir
28{28{
29namespace compositor29namespace graphics
30{30{
31struct BufferIPCPackage;
32class BufferID;31class BufferID;
3332
34class Buffer : public surfaces::GraphicRegion33class Buffer : public surfaces::GraphicRegion
3534
=== renamed file 'include/server/mir/compositor/buffer_id.h' => 'include/server/mir/graphics/buffer_id.h'
--- include/server/mir/compositor/buffer_id.h 2013-04-24 05:22:20 +0000
+++ include/server/mir/graphics/buffer_id.h 2013-07-17 14:20:33 +0000
@@ -15,14 +15,14 @@
15 *15 *
16 * Authored by: Kevin DuBois <kevin.dubois@canonical.com>16 * Authored by: Kevin DuBois <kevin.dubois@canonical.com>
17 */17 */
18#ifndef MIR_COMPOSITOR_BUFFER_ID_H_18#ifndef MIR_GRAPHICS_BUFFER_ID_H_
19#define MIR_COMPOSITOR_BUFFER_ID_H_19#define MIR_GRAPHICS_BUFFER_ID_H_
2020
21#include <cstdint>21#include <cstdint>
2222
23namespace mir23namespace mir
24{24{
25namespace compositor25namespace graphics
26{26{
27class BufferID27class BufferID
28{28{
@@ -53,4 +53,4 @@
5353
54}54}
55}55}
56#endif /* MIR_COMPOSITOR_BUFFER_ID_H_ */56#endif /* MIR_GRAPHICS_BUFFER_ID_H_ */
5757
=== modified file 'include/server/mir/graphics/buffer_initializer.h'
--- include/server/mir/graphics/buffer_initializer.h 2013-06-18 08:49:16 +0000
+++ include/server/mir/graphics/buffer_initializer.h 2013-07-17 14:20:33 +0000
@@ -21,12 +21,9 @@
2121
22namespace mir22namespace mir
23{23{
24namespace compositor24namespace graphics
25{25{
26class Buffer;26class Buffer;
27}
28namespace graphics
29{
3027
31/**28/**
32 * Interface to buffer initialization.29 * Interface to buffer initialization.
@@ -37,7 +34,7 @@
37 virtual ~BufferInitializer() {}34 virtual ~BufferInitializer() {}
3835
39 /** Operator to call to initialize a buffer. */36 /** Operator to call to initialize a buffer. */
40 virtual void operator()(compositor::Buffer& buffer) = 0;37 virtual void operator()(Buffer& buffer) = 0;
4138
42protected:39protected:
43 BufferInitializer() = default;40 BufferInitializer() = default;
@@ -48,7 +45,7 @@
48class NullBufferInitializer : public BufferInitializer45class NullBufferInitializer : public BufferInitializer
49{46{
50public:47public:
51 void operator()(compositor::Buffer& /*buffer*/) {}48 void operator()(Buffer& /*buffer*/) {}
52};49};
5350
54}51}
5552
=== modified file 'include/server/mir/graphics/gl_pixel_buffer.h'
--- include/server/mir/graphics/gl_pixel_buffer.h 2013-06-25 10:44:13 +0000
+++ include/server/mir/graphics/gl_pixel_buffer.h 2013-07-17 14:20:33 +0000
@@ -19,7 +19,7 @@
19#ifndef MIR_GRAPHICS_GL_PIXEL_BUFFER_H_19#ifndef MIR_GRAPHICS_GL_PIXEL_BUFFER_H_
20#define MIR_GRAPHICS_GL_PIXEL_BUFFER_H_20#define MIR_GRAPHICS_GL_PIXEL_BUFFER_H_
2121
22#include "mir/shell/pixel_buffer.h"22#include "mir/graphics/pixel_buffer.h"
2323
24#include <memory>24#include <memory>
25#include <vector>25#include <vector>
@@ -30,17 +30,17 @@
30{30{
31namespace graphics31namespace graphics
32{32{
3333class Buffer;
34class GLContext;34class GLContext;
3535
36/** Extracts the pixels from a compositor::Buffer using GL facilities. */36/** Extracts the pixels from a compositor::Buffer using GL facilities. */
37class GLPixelBuffer : public shell::PixelBuffer37class GLPixelBuffer : public PixelBuffer
38{38{
39public:39public:
40 GLPixelBuffer(std::unique_ptr<GLContext> gl_context);40 GLPixelBuffer(std::unique_ptr<GLContext> gl_context);
41 ~GLPixelBuffer() noexcept;41 ~GLPixelBuffer() noexcept;
4242
43 void fill_from(compositor::Buffer& buffer);43 void fill_from(Buffer& buffer);
44 void const* as_argb_8888();44 void const* as_argb_8888();
45 geometry::Size size() const;45 geometry::Size size() const;
46 geometry::Stride stride() const;46 geometry::Stride stride() const;
4747
=== renamed file 'include/server/mir/shell/pixel_buffer.h' => 'include/server/mir/graphics/pixel_buffer.h'
--- include/server/mir/shell/pixel_buffer.h 2013-06-25 10:44:13 +0000
+++ include/server/mir/graphics/pixel_buffer.h 2013-07-17 14:20:33 +0000
@@ -16,20 +16,17 @@
16 * Authored By: Alexandros Frantzis <alexandros.frantzis@canonical.com>16 * Authored By: Alexandros Frantzis <alexandros.frantzis@canonical.com>
17 */17 */
1818
19#ifndef MIR_SHELL_PIXEL_BUFFER_H_19#ifndef MIR_GRAPHICS_PIXEL_BUFFER_H_
20#define MIR_SHELL_PIXEL_BUFFER_H_20#define MIR_GRAPHICS_PIXEL_BUFFER_H_
2121
22#include "mir/geometry/size.h"22#include "mir/geometry/size.h"
23#include "mir/geometry/dimensions.h"23#include "mir/geometry/dimensions.h"
2424
25namespace mir25namespace mir
26{26{
27namespace compositor27namespace graphics
28{28{
29class Buffer;29class Buffer;
30}
31namespace shell
32{
3330
34/**31/**
35 * Interface for extracting the pixels from a compositor::Buffer.32 * Interface for extracting the pixels from a compositor::Buffer.
@@ -44,7 +41,7 @@
44 *41 *
45 * \param [in] buffer the buffer to get the pixels of42 * \param [in] buffer the buffer to get the pixels of
46 */43 */
47 virtual void fill_from(compositor::Buffer& buffer) = 0;44 virtual void fill_from(Buffer& buffer) = 0;
4845
49 /**46 /**
50 * The pixels in 0xAARRGGBB format.47 * The pixels in 0xAARRGGBB format.
@@ -75,4 +72,4 @@
75}72}
76}73}
7774
78#endif /* MIR_SHELL_PIXEL_BUFFER_H_ */75#endif /* MIR_GRAPHICS_PIXEL_BUFFER_H_ */
7976
=== modified file 'include/server/mir/graphics/platform.h'
--- include/server/mir/graphics/platform.h 2013-07-10 08:50:53 +0000
+++ include/server/mir/graphics/platform.h 2013-07-17 14:20:33 +0000
@@ -31,7 +31,6 @@
31namespace compositor31namespace compositor
32{32{
33class GraphicBufferAllocator;33class GraphicBufferAllocator;
34class Buffer;
35class BufferIPCPacker;34class BufferIPCPacker;
36}35}
37namespace options36namespace options
@@ -44,6 +43,7 @@
44namespace graphics43namespace graphics
45{44{
4645
46class Buffer;
47class Display;47class Display;
48struct PlatformIPCPackage;48struct PlatformIPCPackage;
49class BufferInitializer;49class BufferInitializer;
@@ -102,7 +102,7 @@
102 * \param [in] buffer the buffer to fill the IPC package for102 * \param [in] buffer the buffer to fill the IPC package for
103 */103 */
104 virtual void fill_ipc_package(std::shared_ptr<compositor::BufferIPCPacker> const& packer,104 virtual void fill_ipc_package(std::shared_ptr<compositor::BufferIPCPacker> const& packer,
105 std::shared_ptr<compositor::Buffer> const& buffer) const = 0;105 std::shared_ptr<graphics::Buffer> const& buffer) const = 0;
106106
107 /**107 /**
108 * Creates the in-process client support object.108 * Creates the in-process client support object.
109109
=== modified file 'include/server/mir/shell/surface.h'
--- include/server/mir/shell/surface.h 2013-07-09 18:55:47 +0000
+++ include/server/mir/shell/surface.h 2013-07-17 14:20:33 +0000
@@ -78,8 +78,8 @@
78 virtual geometry::PixelFormat pixel_format() const;78 virtual geometry::PixelFormat pixel_format() const;
7979
80 virtual void with_most_recent_buffer_do(80 virtual void with_most_recent_buffer_do(
81 std::function<void(compositor::Buffer&)> const& exec);81 std::function<void(graphics::Buffer&)> const& exec);
82 virtual std::shared_ptr<compositor::Buffer> advance_client_buffer();82 virtual std::shared_ptr<graphics::Buffer> advance_client_buffer();
8383
84 virtual bool supports_input() const;84 virtual bool supports_input() const;
85 virtual int client_input_fd() const;85 virtual int client_input_fd() const;
8686
=== modified file 'include/server/mir/shell/surface_buffer_access.h'
--- include/server/mir/shell/surface_buffer_access.h 2013-06-25 13:19:14 +0000
+++ include/server/mir/shell/surface_buffer_access.h 2013-07-17 14:20:33 +0000
@@ -23,7 +23,7 @@
2323
24namespace mir24namespace mir
25{25{
26namespace compositor26namespace graphics
27{27{
28class Buffer;28class Buffer;
29}29}
@@ -36,7 +36,7 @@
36 virtual ~SurfaceBufferAccess() = default;36 virtual ~SurfaceBufferAccess() = default;
3737
38 virtual void with_most_recent_buffer_do(38 virtual void with_most_recent_buffer_do(
39 std::function<void(compositor::Buffer&)> const& exec) = 0;39 std::function<void(graphics::Buffer&)> const& exec) = 0;
4040
41protected:41protected:
42 SurfaceBufferAccess() = default;42 SurfaceBufferAccess() = default;
4343
=== modified file 'include/server/mir/shell/threaded_snapshot_strategy.h'
--- include/server/mir/shell/threaded_snapshot_strategy.h 2013-06-25 13:19:14 +0000
+++ include/server/mir/shell/threaded_snapshot_strategy.h 2013-07-17 14:20:33 +0000
@@ -27,16 +27,19 @@
2727
28namespace mir28namespace mir
29{29{
30namespace graphics
31{
32class PixelBuffer;
33}
34
30namespace shell35namespace shell
31{36{
32
33class PixelBuffer;
34class SnapshottingFunctor;37class SnapshottingFunctor;
3538
36class ThreadedSnapshotStrategy : public SnapshotStrategy39class ThreadedSnapshotStrategy : public SnapshotStrategy
37{40{
38public:41public:
39 ThreadedSnapshotStrategy(std::shared_ptr<PixelBuffer> const& pixels);42 ThreadedSnapshotStrategy(std::shared_ptr<graphics::PixelBuffer> const& pixels);
40 ~ThreadedSnapshotStrategy() noexcept;43 ~ThreadedSnapshotStrategy() noexcept;
4144
42 void take_snapshot_of(45 void take_snapshot_of(
@@ -44,7 +47,7 @@
44 SnapshotCallback const& snapshot_taken);47 SnapshotCallback const& snapshot_taken);
4548
46private:49private:
47 std::shared_ptr<PixelBuffer> const pixels;50 std::shared_ptr<graphics::PixelBuffer> const pixels;
48 std::unique_ptr<SnapshottingFunctor> functor;51 std::unique_ptr<SnapshottingFunctor> functor;
49 std::thread thread;52 std::thread thread;
50};53};
5154
=== modified file 'include/server/mir/surfaces/buffer_stream.h'
--- include/server/mir/surfaces/buffer_stream.h 2013-06-21 23:40:49 +0000
+++ include/server/mir/surfaces/buffer_stream.h 2013-07-17 14:20:33 +0000
@@ -22,13 +22,13 @@
2222
23#include "mir/geometry/size.h"23#include "mir/geometry/size.h"
24#include "mir/geometry/pixel_format.h"24#include "mir/geometry/pixel_format.h"
25#include "mir/compositor/buffer_id.h"25#include "mir/graphics/buffer_id.h"
2626
27#include <memory>27#include <memory>
2828
29namespace mir29namespace mir
30{30{
31namespace compositor31namespace graphics
32{32{
33class Buffer;33class Buffer;
34}34}
@@ -41,8 +41,8 @@
41public:41public:
42 virtual ~BufferStream() {/* TODO: make nothrow */}42 virtual ~BufferStream() {/* TODO: make nothrow */}
4343
44 virtual std::shared_ptr<compositor::Buffer> secure_client_buffer() = 0;44 virtual std::shared_ptr<graphics::Buffer> secure_client_buffer() = 0;
45 virtual std::shared_ptr<compositor::Buffer> lock_back_buffer() = 0;45 virtual std::shared_ptr<graphics::Buffer> lock_back_buffer() = 0;
46 virtual geometry::PixelFormat get_stream_pixel_format() = 0;46 virtual geometry::PixelFormat get_stream_pixel_format() = 0;
47 virtual geometry::Size stream_size() = 0;47 virtual geometry::Size stream_size() = 0;
48 virtual void allow_framedropping(bool) = 0;48 virtual void allow_framedropping(bool) = 0;
4949
=== modified file 'include/server/mir/surfaces/surface.h'
--- include/server/mir/surfaces/surface.h 2013-07-15 15:15:40 +0000
+++ include/server/mir/surfaces/surface.h 2013-07-17 14:20:33 +0000
@@ -32,10 +32,12 @@
32{32{
33namespace compositor33namespace compositor
34{34{
35class Buffer;
36class GraphicRegion;35class GraphicRegion;
37struct BufferIPCPackage;36struct BufferIPCPackage;
38class BufferID;37}
38namespace graphics
39{
40class Buffer;
39}41}
40namespace input42namespace input
41{43{
@@ -75,8 +77,8 @@
7577
76 geometry::PixelFormat pixel_format() const;78 geometry::PixelFormat pixel_format() const;
7779
78 std::shared_ptr<compositor::Buffer> compositor_buffer() const;80 std::shared_ptr<graphics::Buffer> compositor_buffer() const;
79 std::shared_ptr<compositor::Buffer> advance_client_buffer();81 std::shared_ptr<graphics::Buffer> advance_client_buffer();
80 void force_requests_to_complete();82 void force_requests_to_complete();
81 void flag_for_render();83 void flag_for_render();
8284
8385
=== renamed file 'include/server/mir/int_wrapper.h' => 'include/shared/mir/int_wrapper.h'
--- include/server/mir/int_wrapper.h 2013-07-16 12:00:39 +0000
+++ include/shared/mir/int_wrapper.h 2013-07-17 14:20:33 +0000
@@ -1,17 +1,17 @@
1/*1/*
2 * Copyright © 2012 Canonical Ltd.2 * Copyright © 2012, 2013 Canonical Ltd.
3 *3 *
4 * This program is free software: you can redistribute it and/or modify it4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3,5 * under the terms of the GNU Lesser General Public License version 3,
6 * as published by the Free Software Foundation.6 * as published by the Free Software Foundation.
7 *7 *
8 * This program is distributed in the hope that it will be useful,8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.11 * GNU Lesser General Public License for more details.
12 *12 *
13 * You should have received a copy of the GNU General Public License13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *15 *
16 * Authored By: Alan Griffiths <alan@octopull.co.uk>16 * Authored By: Alan Griffiths <alan@octopull.co.uk>
17 */17 */
1818
=== modified file 'include/test/mir_test_doubles/mock_buffer.h'
--- include/test/mir_test_doubles/mock_buffer.h 2013-05-14 21:39:52 +0000
+++ include/test/mir_test_doubles/mock_buffer.h 2013-07-17 14:20:33 +0000
@@ -21,7 +21,7 @@
2121
22#include "mir/compositor/buffer_basic.h"22#include "mir/compositor/buffer_basic.h"
23#include "mir/geometry/size.h"23#include "mir/geometry/size.h"
24#include "mir/compositor/buffer_id.h"24#include "mir/graphics/buffer_id.h"
2525
26#include <gmock/gmock.h>26#include <gmock/gmock.h>
27#include <gtest/gtest.h>27#include <gtest/gtest.h>
@@ -33,7 +33,7 @@
33namespace doubles33namespace doubles
34{34{
3535
36struct MockBuffer : public compositor::Buffer36struct MockBuffer : public graphics::Buffer
37{37{
38 public:38 public:
39 MockBuffer()39 MockBuffer()
@@ -53,7 +53,7 @@
53 .WillByDefault(Return(pf));53 .WillByDefault(Return(pf));
5454
55 ON_CALL(*this, id())55 ON_CALL(*this, id())
56 .WillByDefault(Return(compositor::BufferID{4}));56 .WillByDefault(Return(graphics::BufferID{4}));
57 ON_CALL(*this, native_buffer_handle())57 ON_CALL(*this, native_buffer_handle())
58 .WillByDefault(Return(std::shared_ptr<MirNativeBuffer>()));58 .WillByDefault(Return(std::shared_ptr<MirNativeBuffer>()));
59 }59 }
@@ -64,7 +64,7 @@
64 MOCK_CONST_METHOD0(native_buffer_handle, std::shared_ptr<MirNativeBuffer>());64 MOCK_CONST_METHOD0(native_buffer_handle, std::shared_ptr<MirNativeBuffer>());
6565
66 MOCK_METHOD0(bind_to_texture, void());66 MOCK_METHOD0(bind_to_texture, void());
67 MOCK_CONST_METHOD0(id, compositor::BufferID());67 MOCK_CONST_METHOD0(id, graphics::BufferID());
68};68};
6969
70}70}
7171
=== modified file 'include/test/mir_test_doubles/mock_buffer_bundle.h'
--- include/test/mir_test_doubles/mock_buffer_bundle.h 2013-06-13 08:59:25 +0000
+++ include/test/mir_test_doubles/mock_buffer_bundle.h 2013-07-17 14:20:33 +0000
@@ -37,10 +37,10 @@
37 ~MockBufferBundle() noexcept37 ~MockBufferBundle() noexcept
38 {}38 {}
3939
40 MOCK_METHOD0(client_acquire, std::shared_ptr<compositor::Buffer>());40 MOCK_METHOD0(client_acquire, std::shared_ptr<graphics::Buffer>());
41 MOCK_METHOD1(client_release, void(std::shared_ptr<compositor::Buffer> const&));41 MOCK_METHOD1(client_release, void(std::shared_ptr<graphics::Buffer> const&));
42 MOCK_METHOD0(compositor_acquire, std::shared_ptr<compositor::Buffer>());42 MOCK_METHOD0(compositor_acquire, std::shared_ptr<graphics::Buffer>());
43 MOCK_METHOD1(compositor_release, void(std::shared_ptr<compositor::Buffer> const&));43 MOCK_METHOD1(compositor_release, void(std::shared_ptr<graphics::Buffer> const&));
44 MOCK_METHOD1(allow_framedropping, void(bool));44 MOCK_METHOD1(allow_framedropping, void(bool));
45 MOCK_CONST_METHOD0(properties, compositor::BufferProperties());45 MOCK_CONST_METHOD0(properties, compositor::BufferProperties());
46 MOCK_METHOD0(force_client_abort, void());46 MOCK_METHOD0(force_client_abort, void());
4747
=== modified file 'include/test/mir_test_doubles/mock_buffer_initializer.h'
--- include/test/mir_test_doubles/mock_buffer_initializer.h 2013-04-24 05:22:20 +0000
+++ include/test/mir_test_doubles/mock_buffer_initializer.h 2013-07-17 14:20:33 +0000
@@ -33,9 +33,9 @@
33class MockBufferInitializer : public graphics::BufferInitializer33class MockBufferInitializer : public graphics::BufferInitializer
34{34{
35public:35public:
36 MOCK_METHOD1(operator_call, void(compositor::Buffer& buffer));36 MOCK_METHOD1(operator_call, void(graphics::Buffer& buffer));
3737
38 void operator()(compositor::Buffer& buffer)38 void operator()(graphics::Buffer& buffer)
39 {39 {
40 operator_call(buffer);40 operator_call(buffer);
41 }41 }
4242
=== modified file 'include/test/mir_test_doubles/mock_buffer_stream.h'
--- include/test/mir_test_doubles/mock_buffer_stream.h 2013-06-21 23:40:49 +0000
+++ include/test/mir_test_doubles/mock_buffer_stream.h 2013-07-17 14:20:33 +0000
@@ -31,8 +31,8 @@
31{31{
32struct MockBufferStream : public surfaces::BufferStream32struct MockBufferStream : public surfaces::BufferStream
33{33{
34 MOCK_METHOD0(secure_client_buffer, std::shared_ptr<compositor::Buffer>());34 MOCK_METHOD0(secure_client_buffer, std::shared_ptr<graphics::Buffer>());
35 MOCK_METHOD0(lock_back_buffer, std::shared_ptr<compositor::Buffer>());35 MOCK_METHOD0(lock_back_buffer, std::shared_ptr<graphics::Buffer>());
3636
37 MOCK_METHOD0(get_stream_pixel_format, geometry::PixelFormat());37 MOCK_METHOD0(get_stream_pixel_format, geometry::PixelFormat());
38 MOCK_METHOD0(stream_size, geometry::Size());38 MOCK_METHOD0(stream_size, geometry::Size());
3939
=== modified file 'include/test/mir_test_doubles/mock_display_support_provider.h'
--- include/test/mir_test_doubles/mock_display_support_provider.h 2013-05-16 20:04:58 +0000
+++ include/test/mir_test_doubles/mock_display_support_provider.h 2013-07-17 14:20:33 +0000
@@ -35,7 +35,7 @@
35 MOCK_CONST_METHOD0(display_size, geometry::Size());35 MOCK_CONST_METHOD0(display_size, geometry::Size());
36 MOCK_CONST_METHOD0(display_format, geometry::PixelFormat());36 MOCK_CONST_METHOD0(display_format, geometry::PixelFormat());
37 MOCK_CONST_METHOD0(number_of_framebuffers_available, unsigned int());37 MOCK_CONST_METHOD0(number_of_framebuffers_available, unsigned int());
38 MOCK_METHOD1(set_next_frontbuffer, void(std::shared_ptr<mir::compositor::Buffer> const&));38 MOCK_METHOD1(set_next_frontbuffer, void(std::shared_ptr<mir::graphics::Buffer> const&));
39 MOCK_METHOD1(sync_to_display, void(bool));39 MOCK_METHOD1(sync_to_display, void(bool));
40};40};
41}41}
4242
=== modified file 'include/test/mir_test_doubles/mock_hwc_interface.h'
--- include/test/mir_test_doubles/mock_hwc_interface.h 2013-05-16 20:04:58 +0000
+++ include/test/mir_test_doubles/mock_hwc_interface.h 2013-07-17 14:20:33 +0000
@@ -39,7 +39,7 @@
39 MOCK_CONST_METHOD0(display_size, geometry::Size());39 MOCK_CONST_METHOD0(display_size, geometry::Size());
40 MOCK_CONST_METHOD0(display_format, geometry::PixelFormat());40 MOCK_CONST_METHOD0(display_format, geometry::PixelFormat());
41 MOCK_CONST_METHOD0(number_of_framebuffers_available, unsigned int());41 MOCK_CONST_METHOD0(number_of_framebuffers_available, unsigned int());
42 MOCK_METHOD1(set_next_frontbuffer, void(std::shared_ptr<mir::compositor::Buffer> const&));42 MOCK_METHOD1(set_next_frontbuffer, void(std::shared_ptr<mir::graphics::Buffer> const&));
43 MOCK_METHOD1(sync_to_display, void(bool));43 MOCK_METHOD1(sync_to_display, void(bool));
44};44};
4545
4646
=== modified file 'include/test/mir_test_doubles/mock_hwc_organizer.h'
--- include/test/mir_test_doubles/mock_hwc_organizer.h 2013-05-02 00:34:03 +0000
+++ include/test/mir_test_doubles/mock_hwc_organizer.h 2013-07-17 14:20:33 +0000
@@ -34,7 +34,7 @@
34{34{
35 ~MockHWCOrganizer() noexcept {}35 ~MockHWCOrganizer() noexcept {}
36 MOCK_CONST_METHOD0(native_list, graphics::android::LayerList const&());36 MOCK_CONST_METHOD0(native_list, graphics::android::LayerList const&());
37 MOCK_METHOD1(set_fb_target, void(std::shared_ptr<compositor::Buffer> const&));37 MOCK_METHOD1(set_fb_target, void(std::shared_ptr<graphics::Buffer> const&));
38};38};
3939
40}40}
4141
=== modified file 'include/test/mir_test_doubles/mock_interpreter_resource_cache.h'
--- include/test/mir_test_doubles/mock_interpreter_resource_cache.h 2013-05-06 21:25:47 +0000
+++ include/test/mir_test_doubles/mock_interpreter_resource_cache.h 2013-07-17 14:20:33 +0000
@@ -28,8 +28,8 @@
28{28{
29struct MockInterpreterResourceCache : public graphics::android::InterpreterResourceCache29struct MockInterpreterResourceCache : public graphics::android::InterpreterResourceCache
30{30{
31 MOCK_METHOD2(store_buffer, void(std::shared_ptr<compositor::Buffer>const&, ANativeWindowBuffer*));31 MOCK_METHOD2(store_buffer, void(std::shared_ptr<graphics::Buffer>const&, ANativeWindowBuffer*));
32 MOCK_METHOD1(retrieve_buffer, std::shared_ptr<compositor::Buffer>(ANativeWindowBuffer*));32 MOCK_METHOD1(retrieve_buffer, std::shared_ptr<graphics::Buffer>(ANativeWindowBuffer*));
33};33};
34}34}
35}35}
3636
=== modified file 'include/test/mir_test_doubles/mock_surface.h'
--- include/test/mir_test_doubles/mock_surface.h 2013-07-03 22:10:48 +0000
+++ include/test/mir_test_doubles/mock_surface.h 2013-07-17 14:20:33 +0000
@@ -49,7 +49,7 @@
4949
50 MOCK_METHOD0(destroy, void());50 MOCK_METHOD0(destroy, void());
51 MOCK_METHOD0(force_requests_to_complete, void());51 MOCK_METHOD0(force_requests_to_complete, void());
52 MOCK_METHOD0(advance_client_buffer, std::shared_ptr<compositor::Buffer>());52 MOCK_METHOD0(advance_client_buffer, std::shared_ptr<graphics::Buffer>());
5353
54 MOCK_CONST_METHOD0(name, std::string());54 MOCK_CONST_METHOD0(name, std::string());
55 MOCK_CONST_METHOD0(size, geometry::Size());55 MOCK_CONST_METHOD0(size, geometry::Size());
5656
=== modified file 'include/test/mir_test_doubles/mock_swapper.h'
--- include/test/mir_test_doubles/mock_swapper.h 2013-06-12 16:56:32 +0000
+++ include/test/mir_test_doubles/mock_swapper.h 2013-07-17 14:20:33 +0000
@@ -35,7 +35,7 @@
35 MockSwapper() {}35 MockSwapper() {}
36 ~MockSwapper() noexcept {}36 ~MockSwapper() noexcept {}
3737
38 MockSwapper(std::shared_ptr<compositor::Buffer> buffer)38 MockSwapper(std::shared_ptr<graphics::Buffer> buffer)
39 : default_buffer(buffer)39 : default_buffer(buffer)
40 {40 {
41 using namespace testing;41 using namespace testing;
@@ -46,17 +46,17 @@
46 .WillByDefault(Return(default_buffer));46 .WillByDefault(Return(default_buffer));
47 }47 }
4848
49 MOCK_METHOD0(client_acquire, std::shared_ptr<compositor::Buffer>());49 MOCK_METHOD0(client_acquire, std::shared_ptr<graphics::Buffer>());
50 MOCK_METHOD1(client_release, void(std::shared_ptr<compositor::Buffer> const&));50 MOCK_METHOD1(client_release, void(std::shared_ptr<graphics::Buffer> const&));
51 MOCK_METHOD0(compositor_acquire, std::shared_ptr<compositor::Buffer>());51 MOCK_METHOD0(compositor_acquire, std::shared_ptr<graphics::Buffer>());
52 MOCK_METHOD1(compositor_release, void(std::shared_ptr<compositor::Buffer> const&));52 MOCK_METHOD1(compositor_release, void(std::shared_ptr<graphics::Buffer> const&));
53 MOCK_METHOD0(force_client_abort, void());53 MOCK_METHOD0(force_client_abort, void());
54 MOCK_METHOD0(force_requests_to_complete, void());54 MOCK_METHOD0(force_requests_to_complete, void());
5555
56 MOCK_METHOD2(end_responsibility, void(std::vector<std::shared_ptr<compositor::Buffer>>&, size_t&));56 MOCK_METHOD2(end_responsibility, void(std::vector<std::shared_ptr<graphics::Buffer>>&, size_t&));
5757
58private:58private:
59 std::shared_ptr<compositor::Buffer> default_buffer;59 std::shared_ptr<graphics::Buffer> default_buffer;
60};60};
6161
62}62}
6363
=== modified file 'include/test/mir_test_doubles/mock_swapper_factory.h'
--- include/test/mir_test_doubles/mock_swapper_factory.h 2013-06-13 23:31:56 +0000
+++ include/test/mir_test_doubles/mock_swapper_factory.h 2013-07-17 14:20:33 +0000
@@ -35,7 +35,7 @@
3535
36 MOCK_CONST_METHOD4(create_swapper_reuse_buffers,36 MOCK_CONST_METHOD4(create_swapper_reuse_buffers,
37 std::shared_ptr<compositor::BufferSwapper>(compositor::BufferProperties const&,37 std::shared_ptr<compositor::BufferSwapper>(compositor::BufferProperties const&,
38 std::vector<std::shared_ptr<compositor::Buffer>>&, size_t, compositor::SwapperType));38 std::vector<std::shared_ptr<graphics::Buffer>>&, size_t, compositor::SwapperType));
39 MOCK_CONST_METHOD3(create_swapper_new_buffers,39 MOCK_CONST_METHOD3(create_swapper_new_buffers,
40 std::shared_ptr<compositor::BufferSwapper>(40 std::shared_ptr<compositor::BufferSwapper>(
41 compositor::BufferProperties&, compositor::BufferProperties const&, compositor::SwapperType));41 compositor::BufferProperties&, compositor::BufferProperties const&, compositor::SwapperType));
4242
=== modified file 'include/test/mir_test_doubles/null_platform.h'
--- include/test/mir_test_doubles/null_platform.h 2013-07-10 08:50:53 +0000
+++ include/test/mir_test_doubles/null_platform.h 2013-07-17 14:20:33 +0000
@@ -55,7 +55,7 @@
55 }55 }
5656
57 void fill_ipc_package(std::shared_ptr<compositor::BufferIPCPacker> const&,57 void fill_ipc_package(std::shared_ptr<compositor::BufferIPCPacker> const&,
58 std::shared_ptr<compositor::Buffer> const&) const58 std::shared_ptr<graphics::Buffer> const&) const
59 {59 {
60 }60 }
61};61};
6262
=== modified file 'include/test/mir_test_doubles/stub_buffer.h'
--- include/test/mir_test_doubles/stub_buffer.h 2013-07-11 16:54:41 +0000
+++ include/test/mir_test_doubles/stub_buffer.h 2013-07-17 14:20:33 +0000
@@ -22,7 +22,7 @@
22#include "mir/compositor/buffer_basic.h"22#include "mir/compositor/buffer_basic.h"
23#include "mir/compositor/buffer_properties.h"23#include "mir/compositor/buffer_properties.h"
24#include "mir/geometry/size.h"24#include "mir/geometry/size.h"
25#include "mir/compositor/buffer_id.h"25#include "mir/graphics/buffer_id.h"
2626
27namespace mir27namespace mir
28{28{
2929
=== modified file 'include/test/mir_test_doubles/stub_buffer_stream.h'
--- include/test/mir_test_doubles/stub_buffer_stream.h 2013-06-21 23:40:49 +0000
+++ include/test/mir_test_doubles/stub_buffer_stream.h 2013-07-17 14:20:33 +0000
@@ -37,12 +37,12 @@
37 stub_client_buffer = std::make_shared<StubBuffer>();37 stub_client_buffer = std::make_shared<StubBuffer>();
38 stub_compositor_buffer = std::make_shared<StubBuffer>();38 stub_compositor_buffer = std::make_shared<StubBuffer>();
39 }39 }
40 std::shared_ptr<compositor::Buffer> secure_client_buffer()40 std::shared_ptr<graphics::Buffer> secure_client_buffer()
41 {41 {
42 return stub_client_buffer;42 return stub_client_buffer;
43 }43 }
4444
45 std::shared_ptr<compositor::Buffer> lock_back_buffer()45 std::shared_ptr<graphics::Buffer> lock_back_buffer()
46 {46 {
47 return stub_compositor_buffer;47 return stub_compositor_buffer;
48 }48 }
@@ -65,8 +65,8 @@
65 {65 {
66 }66 }
6767
68 std::shared_ptr<compositor::Buffer> stub_client_buffer;68 std::shared_ptr<graphics::Buffer> stub_client_buffer;
69 std::shared_ptr<compositor::Buffer> stub_compositor_buffer;69 std::shared_ptr<graphics::Buffer> stub_compositor_buffer;
70};70};
7171
72}72}
7373
=== modified file 'include/test/mir_test_doubles/stub_surface.h'
--- include/test/mir_test_doubles/stub_surface.h 2013-06-25 05:42:49 +0000
+++ include/test/mir_test_doubles/stub_surface.h 2013-07-17 14:20:33 +0000
@@ -47,9 +47,9 @@
47 return geometry::PixelFormat();47 return geometry::PixelFormat();
48 }48 }
4949
50 std::shared_ptr<compositor::Buffer> advance_client_buffer()50 std::shared_ptr<graphics::Buffer> advance_client_buffer()
51 {51 {
52 return std::shared_ptr<compositor::Buffer>();52 return std::shared_ptr<graphics::Buffer>();
53 }53 }
5454
55 virtual int configure(MirSurfaceAttrib, int)55 virtual int configure(MirSurfaceAttrib, int)
5656
=== modified file 'src/server/compositor/buffer_basic.cpp'
--- src/server/compositor/buffer_basic.cpp 2013-04-24 05:22:20 +0000
+++ src/server/compositor/buffer_basic.cpp 2013-07-17 14:20:33 +0000
@@ -19,20 +19,22 @@
19#include "mir/compositor/buffer_basic.h"19#include "mir/compositor/buffer_basic.h"
20#include <atomic>20#include <atomic>
2121
22namespace mg = mir::graphics;
23
22namespace mir24namespace mir
23{25{
24namespace compositor26namespace compositor
25{27{
26namespace28namespace
27{29{
28BufferID generate_next_buffer_id()30mg::BufferID generate_next_buffer_id()
29{31{
30 static std::atomic<uint32_t> next_id{0};32 static std::atomic<uint32_t> next_id{0};
3133
32 auto id = BufferID(next_id.fetch_add(1));34 auto id = mg::BufferID(next_id.fetch_add(1));
3335
34 // Avoid returning an "invalid" id. (Not sure we need invalid ids)36 // Avoid returning an "invalid" id. (Not sure we need invalid ids)
35 while (!id.is_valid()) id = BufferID(next_id.fetch_add(1));37 while (!id.is_valid()) id = mg::BufferID(next_id.fetch_add(1));
3638
37 return id;39 return id;
38}40}
3941
=== modified file 'src/server/compositor/buffer_bundle.h'
--- src/server/compositor/buffer_bundle.h 2013-06-19 09:57:32 +0000
+++ src/server/compositor/buffer_bundle.h 2013-07-17 14:20:33 +0000
@@ -25,18 +25,19 @@
2525
26namespace mir26namespace mir
27{27{
28namespace graphics { class Buffer; }
29
28namespace compositor30namespace compositor
29{31{
30class Buffer;
3132
32class BufferBundle33class BufferBundle
33{34{
34public:35public:
35 virtual ~BufferBundle() noexcept {}36 virtual ~BufferBundle() noexcept {}
36 virtual std::shared_ptr<Buffer> client_acquire() = 0;37 virtual std::shared_ptr<graphics::Buffer> client_acquire() = 0;
37 virtual void client_release(std::shared_ptr<Buffer> const&) = 0;38 virtual void client_release(std::shared_ptr<graphics::Buffer> const&) = 0;
38 virtual std::shared_ptr<Buffer> compositor_acquire() = 0;39 virtual std::shared_ptr<graphics::Buffer> compositor_acquire() = 0;
39 virtual void compositor_release(std::shared_ptr<Buffer> const&) = 0;40 virtual void compositor_release(std::shared_ptr<graphics::Buffer> const&) = 0;
4041
41 virtual BufferProperties properties() const = 0;42 virtual BufferProperties properties() const = 0;
42 virtual void allow_framedropping(bool dropping_allowed) = 0;43 virtual void allow_framedropping(bool dropping_allowed) = 0;
4344
=== modified file 'src/server/compositor/buffer_stream_factory.cpp'
--- src/server/compositor/buffer_stream_factory.cpp 2013-06-12 15:36:31 +0000
+++ src/server/compositor/buffer_stream_factory.cpp 2013-07-17 14:20:33 +0000
@@ -23,8 +23,8 @@
23#include "mir/compositor/buffer_stream_surfaces.h"23#include "mir/compositor/buffer_stream_surfaces.h"
24#include "mir/compositor/buffer_properties.h"24#include "mir/compositor/buffer_properties.h"
25#include "switching_bundle.h"25#include "switching_bundle.h"
26#include "mir/compositor/buffer.h"26#include "mir/graphics/buffer.h"
27#include "mir/compositor/buffer_id.h"27#include "mir/graphics/buffer_id.h"
28#include "mir/compositor/graphic_buffer_allocator.h"28#include "mir/compositor/graphic_buffer_allocator.h"
29#include "mir/graphics/display.h"29#include "mir/graphics/display.h"
3030
3131
=== modified file 'src/server/compositor/buffer_stream_surfaces.cpp'
--- src/server/compositor/buffer_stream_surfaces.cpp 2013-06-21 23:40:49 +0000
+++ src/server/compositor/buffer_stream_surfaces.cpp 2013-07-17 14:20:33 +0000
@@ -25,6 +25,7 @@
25#include "temporary_buffers.h"25#include "temporary_buffers.h"
2626
27namespace mc = mir::compositor;27namespace mc = mir::compositor;
28namespace mg = mir::graphics;
28namespace geom = mir::geometry;29namespace geom = mir::geometry;
2930
30mc::BufferStreamSurfaces::BufferStreamSurfaces(std::shared_ptr<BufferBundle> const& buffer_bundle)31mc::BufferStreamSurfaces::BufferStreamSurfaces(std::shared_ptr<BufferBundle> const& buffer_bundle)
@@ -38,12 +39,12 @@
38{39{
39}40}
4041
41std::shared_ptr<mc::Buffer> mc::BufferStreamSurfaces::lock_back_buffer()42std::shared_ptr<mg::Buffer> mc::BufferStreamSurfaces::lock_back_buffer()
42{43{
43 return std::make_shared<mc::TemporaryCompositorBuffer>(back_buffer_strategy);44 return std::make_shared<mc::TemporaryCompositorBuffer>(back_buffer_strategy);
44}45}
4546
46std::shared_ptr<mc::Buffer> mc::BufferStreamSurfaces::secure_client_buffer()47std::shared_ptr<mg::Buffer> mc::BufferStreamSurfaces::secure_client_buffer()
47{48{
48 return std::make_shared<mc::TemporaryClientBuffer>(buffer_bundle);49 return std::make_shared<mc::TemporaryClientBuffer>(buffer_bundle);
49}50}
5051
=== modified file 'src/server/compositor/buffer_swapper_multi.cpp'
--- src/server/compositor/buffer_swapper_multi.cpp 2013-06-15 11:09:16 +0000
+++ src/server/compositor/buffer_swapper_multi.cpp 2013-07-17 14:20:33 +0000
@@ -21,8 +21,9 @@
21#include <boost/throw_exception.hpp>21#include <boost/throw_exception.hpp>
2222
23namespace mc = mir::compositor;23namespace mc = mir::compositor;
24namespace mg = mir::graphics;
2425
25mc::BufferSwapperMulti::BufferSwapperMulti(std::vector<std::shared_ptr<compositor::Buffer>>& buffer_list, size_t swapper_size)26mc::BufferSwapperMulti::BufferSwapperMulti(std::vector<std::shared_ptr<mg::Buffer>>& buffer_list, size_t swapper_size)
26 : in_use_by_client(0),27 : in_use_by_client(0),
27 swapper_size(swapper_size),28 swapper_size(swapper_size),
28 clients_trying_to_acquire(0),29 clients_trying_to_acquire(0),
@@ -39,7 +40,7 @@
39 }40 }
40}41}
4142
42std::shared_ptr<mc::Buffer> mc::BufferSwapperMulti::client_acquire()43std::shared_ptr<mg::Buffer> mc::BufferSwapperMulti::client_acquire()
43{44{
44 std::unique_lock<std::mutex> lk(swapper_mutex);45 std::unique_lock<std::mutex> lk(swapper_mutex);
4546
@@ -71,7 +72,7 @@
71 return dequeued_buffer;72 return dequeued_buffer;
72}73}
7374
74void mc::BufferSwapperMulti::client_release(std::shared_ptr<Buffer> const& queued_buffer)75void mc::BufferSwapperMulti::client_release(std::shared_ptr<mg::Buffer> const& queued_buffer)
75{76{
76 std::unique_lock<std::mutex> lk(swapper_mutex);77 std::unique_lock<std::mutex> lk(swapper_mutex);
7778
@@ -87,11 +88,11 @@
87 */88 */
88}89}
8990
90std::shared_ptr<mc::Buffer> mc::BufferSwapperMulti::compositor_acquire()91std::shared_ptr<mg::Buffer> mc::BufferSwapperMulti::compositor_acquire()
91{92{
92 std::unique_lock<std::mutex> lk(swapper_mutex);93 std::unique_lock<std::mutex> lk(swapper_mutex);
9394
94 std::shared_ptr<mc::Buffer> dequeued_buffer;95 std::shared_ptr<mg::Buffer> dequeued_buffer;
9596
96 if (!compositor_queue.empty())97 if (!compositor_queue.empty())
97 {98 {
@@ -111,7 +112,7 @@
111 return dequeued_buffer;112 return dequeued_buffer;
112}113}
113114
114void mc::BufferSwapperMulti::compositor_release(std::shared_ptr<Buffer> const& released_buffer)115void mc::BufferSwapperMulti::compositor_release(std::shared_ptr<mg::Buffer> const& released_buffer)
115{116{
116 std::unique_lock<std::mutex> lk(swapper_mutex);117 std::unique_lock<std::mutex> lk(swapper_mutex);
117 client_queue.push_back(released_buffer);118 client_queue.push_back(released_buffer);
@@ -152,7 +153,7 @@
152}153}
153154
154155
155void mc::BufferSwapperMulti::end_responsibility(std::vector<std::shared_ptr<Buffer>>& buffers,156void mc::BufferSwapperMulti::end_responsibility(std::vector<std::shared_ptr<mg::Buffer>>& buffers,
156 size_t& size)157 size_t& size)
157{158{
158 std::unique_lock<std::mutex> lk(swapper_mutex);159 std::unique_lock<std::mutex> lk(swapper_mutex);
159160
=== modified file 'src/server/compositor/buffer_swapper_spin.cpp'
--- src/server/compositor/buffer_swapper_spin.cpp 2013-06-12 16:56:32 +0000
+++ src/server/compositor/buffer_swapper_spin.cpp 2013-07-17 14:20:33 +0000
@@ -19,10 +19,10 @@
19#include "mir/compositor/buffer_swapper_spin.h"19#include "mir/compositor/buffer_swapper_spin.h"
2020
21namespace mc = mir::compositor;21namespace mc = mir::compositor;
2222namespace mg = mir::graphics;
2323
24mc::BufferSwapperSpin::BufferSwapperSpin(24mc::BufferSwapperSpin::BufferSwapperSpin(
25 std::vector<std::shared_ptr<mc::Buffer>>& buffer_list, size_t swapper_size)25 std::vector<std::shared_ptr<mg::Buffer>>& buffer_list, size_t swapper_size)
26 : buffer_queue{buffer_list.begin(), buffer_list.end()},26 : buffer_queue{buffer_list.begin(), buffer_list.end()},
27 in_use_by_client{0},27 in_use_by_client{0},
28 swapper_size{swapper_size}28 swapper_size{swapper_size}
@@ -34,7 +34,7 @@
34 }34 }
35}35}
3636
37std::shared_ptr<mc::Buffer> mc::BufferSwapperSpin::client_acquire()37std::shared_ptr<mg::Buffer> mc::BufferSwapperSpin::client_acquire()
38{38{
39 std::lock_guard<std::mutex> lg{swapper_mutex};39 std::lock_guard<std::mutex> lg{swapper_mutex};
4040
@@ -54,7 +54,7 @@
54 return dequeued_buffer;54 return dequeued_buffer;
55}55}
5656
57void mc::BufferSwapperSpin::client_release(std::shared_ptr<Buffer> const& queued_buffer)57void mc::BufferSwapperSpin::client_release(std::shared_ptr<mg::Buffer> const& queued_buffer)
58{58{
59 std::lock_guard<std::mutex> lg{swapper_mutex};59 std::lock_guard<std::mutex> lg{swapper_mutex};
6060
@@ -63,7 +63,7 @@
63 client_submitted_new_buffer = true;63 client_submitted_new_buffer = true;
64}64}
6565
66std::shared_ptr<mc::Buffer> mc::BufferSwapperSpin::compositor_acquire()66std::shared_ptr<mg::Buffer> mc::BufferSwapperSpin::compositor_acquire()
67{67{
68 std::lock_guard<std::mutex> lg{swapper_mutex};68 std::lock_guard<std::mutex> lg{swapper_mutex};
6969
@@ -74,7 +74,7 @@
74 return dequeued_buffer;74 return dequeued_buffer;
75}75}
7676
77void mc::BufferSwapperSpin::compositor_release(std::shared_ptr<Buffer> const& released_buffer)77void mc::BufferSwapperSpin::compositor_release(std::shared_ptr<mg::Buffer> const& released_buffer)
78{78{
79 std::lock_guard<std::mutex> lg{swapper_mutex};79 std::lock_guard<std::mutex> lg{swapper_mutex};
8080
@@ -99,7 +99,7 @@
99}99}
100100
101101
102void mc::BufferSwapperSpin::end_responsibility(std::vector<std::shared_ptr<Buffer>>& buffers,102void mc::BufferSwapperSpin::end_responsibility(std::vector<std::shared_ptr<mg::Buffer>>& buffers,
103 size_t& size)103 size_t& size)
104{104{
105 std::lock_guard<std::mutex> lg{swapper_mutex};105 std::lock_guard<std::mutex> lg{swapper_mutex};
106106
=== modified file 'src/server/compositor/multi_acquisition_back_buffer_strategy.cpp'
--- src/server/compositor/multi_acquisition_back_buffer_strategy.cpp 2013-06-19 09:55:54 +0000
+++ src/server/compositor/multi_acquisition_back_buffer_strategy.cpp 2013-07-17 14:20:33 +0000
@@ -23,6 +23,7 @@
23#include <algorithm>23#include <algorithm>
2424
25namespace mc = mir::compositor;25namespace mc = mir::compositor;
26namespace mg = mir::graphics;
2627
27mc::MultiAcquisitionBackBufferStrategy::MultiAcquisitionBackBufferStrategy(28mc::MultiAcquisitionBackBufferStrategy::MultiAcquisitionBackBufferStrategy(
28 std::shared_ptr<BufferBundle> const& buffer_bundle)29 std::shared_ptr<BufferBundle> const& buffer_bundle)
@@ -30,7 +31,7 @@
30{31{
31}32}
3233
33std::shared_ptr<mc::Buffer> mc::MultiAcquisitionBackBufferStrategy::acquire()34std::shared_ptr<mg::Buffer> mc::MultiAcquisitionBackBufferStrategy::acquire()
34{35{
35 std::lock_guard<std::mutex> lg{mutex};36 std::lock_guard<std::mutex> lg{mutex};
3637
@@ -41,7 +42,7 @@
41 return info.partly_released == false;42 return info.partly_released == false;
42 });43 });
4344
44 std::shared_ptr<mc::Buffer> buffer;45 std::shared_ptr<mg::Buffer> buffer;
4546
46 if (iter != acquired_buffers.end())47 if (iter != acquired_buffers.end())
47 {48 {
@@ -78,7 +79,7 @@
78 return buffer;79 return buffer;
79}80}
8081
81void mc::MultiAcquisitionBackBufferStrategy::release(std::shared_ptr<Buffer> const& buffer)82void mc::MultiAcquisitionBackBufferStrategy::release(std::shared_ptr<mg::Buffer> const& buffer)
82{83{
83 std::lock_guard<std::mutex> lg{mutex};84 std::lock_guard<std::mutex> lg{mutex};
8485
@@ -108,7 +109,7 @@
108}109}
109110
110std::vector<mc::detail::AcquiredBufferInfo>::iterator111std::vector<mc::detail::AcquiredBufferInfo>::iterator
111mc::MultiAcquisitionBackBufferStrategy::find_info(std::shared_ptr<Buffer> const& buffer)112mc::MultiAcquisitionBackBufferStrategy::find_info(std::shared_ptr<mg::Buffer> const& buffer)
112{113{
113 return std::find_if(acquired_buffers.begin(), acquired_buffers.end(),114 return std::find_if(acquired_buffers.begin(), acquired_buffers.end(),
114 [&buffer] (detail::AcquiredBufferInfo const& info)115 [&buffer] (detail::AcquiredBufferInfo const& info)
115116
=== modified file 'src/server/compositor/swapper_factory.cpp'
--- src/server/compositor/swapper_factory.cpp 2013-06-22 00:25:47 +0000
+++ src/server/compositor/swapper_factory.cpp 2013-07-17 14:20:33 +0000
@@ -22,7 +22,7 @@
22#include "mir/compositor/graphic_buffer_allocator.h"22#include "mir/compositor/graphic_buffer_allocator.h"
23#include "mir/compositor/buffer_swapper_multi.h"23#include "mir/compositor/buffer_swapper_multi.h"
24#include "mir/compositor/buffer_swapper_spin.h"24#include "mir/compositor/buffer_swapper_spin.h"
25#include "mir/compositor/buffer_id.h"25#include "mir/graphics/buffer_id.h"
26#include "mir/geometry/dimensions.h"26#include "mir/geometry/dimensions.h"
27#include "switching_bundle.h"27#include "switching_bundle.h"
2828
@@ -31,6 +31,7 @@
31#include <cassert>31#include <cassert>
3232
33namespace mc = mir::compositor;33namespace mc = mir::compositor;
34namespace mg = mir::graphics;
3435
35mc::SwapperFactory::SwapperFactory(36mc::SwapperFactory::SwapperFactory(
36 std::shared_ptr<GraphicBufferAllocator> const& gr_alloc,37 std::shared_ptr<GraphicBufferAllocator> const& gr_alloc,
@@ -48,7 +49,7 @@
48}49}
4950
50void mc::SwapperFactory::change_swapper_size(51void mc::SwapperFactory::change_swapper_size(
51 std::vector<std::shared_ptr<mc::Buffer>>& list,52 std::vector<std::shared_ptr<mg::Buffer>>& list,
52 size_t const desired_size, size_t current_size, BufferProperties const& buffer_properties) const53 size_t const desired_size, size_t current_size, BufferProperties const& buffer_properties) const
53{54{
54 while (current_size < desired_size)55 while (current_size < desired_size)
@@ -72,7 +73,7 @@
72}73}
7374
74std::shared_ptr<mc::BufferSwapper> mc::SwapperFactory::create_swapper_reuse_buffers(75std::shared_ptr<mc::BufferSwapper> mc::SwapperFactory::create_swapper_reuse_buffers(
75 BufferProperties const& buffer_properties, std::vector<std::shared_ptr<Buffer>>& list,76 BufferProperties const& buffer_properties, std::vector<std::shared_ptr<mg::Buffer>>& list,
76 size_t buffer_num, SwapperType type) const77 size_t buffer_num, SwapperType type) const
77{78{
78 if (type == mc::SwapperType::synchronous)79 if (type == mc::SwapperType::synchronous)
@@ -91,7 +92,7 @@
91 BufferProperties& actual_buffer_properties,92 BufferProperties& actual_buffer_properties,
92 BufferProperties const& requested_buffer_properties, SwapperType type) const93 BufferProperties const& requested_buffer_properties, SwapperType type) const
93{94{
94 std::vector<std::shared_ptr<mc::Buffer>> list;95 std::vector<std::shared_ptr<mg::Buffer>> list;
95 std::shared_ptr<mc::BufferSwapper> new_swapper;96 std::shared_ptr<mc::BufferSwapper> new_swapper;
9697
97 if (type == mc::SwapperType::synchronous)98 if (type == mc::SwapperType::synchronous)
9899
=== modified file 'src/server/compositor/switching_bundle.cpp'
--- src/server/compositor/switching_bundle.cpp 2013-06-17 19:40:58 +0000
+++ src/server/compositor/switching_bundle.cpp 2013-07-17 14:20:33 +0000
@@ -25,6 +25,7 @@
25#include <boost/throw_exception.hpp>25#include <boost/throw_exception.hpp>
2626
27namespace mc=mir::compositor;27namespace mc=mir::compositor;
28namespace mg = mir::graphics;
2829
29mc::SwitchingBundle::SwitchingBundle(30mc::SwitchingBundle::SwitchingBundle(
30 std::shared_ptr<BufferAllocationStrategy> const& swapper_factory, BufferProperties const& property_request)31 std::shared_ptr<BufferAllocationStrategy> const& swapper_factory, BufferProperties const& property_request)
@@ -34,12 +35,12 @@
34{35{
35}36}
3637
37std::shared_ptr<mc::Buffer> mc::SwitchingBundle::client_acquire()38std::shared_ptr<mg::Buffer> mc::SwitchingBundle::client_acquire()
38{39{
39 /* lock is for use of 'swapper' below' */40 /* lock is for use of 'swapper' below' */
40 std::unique_lock<mc::ReadLock> lk(rw_lock);41 std::unique_lock<mc::ReadLock> lk(rw_lock);
4142
42 std::shared_ptr<mc::Buffer> buffer = nullptr;43 std::shared_ptr<mg::Buffer> buffer = nullptr;
43 while (!buffer) 44 while (!buffer)
44 {45 {
45 try46 try
@@ -55,19 +56,19 @@
55 return buffer;56 return buffer;
56}57}
5758
58void mc::SwitchingBundle::client_release(std::shared_ptr<mc::Buffer> const& released_buffer)59void mc::SwitchingBundle::client_release(std::shared_ptr<mg::Buffer> const& released_buffer)
59{60{
60 std::unique_lock<mc::ReadLock> lk(rw_lock);61 std::unique_lock<mc::ReadLock> lk(rw_lock);
61 return swapper->client_release(released_buffer);62 return swapper->client_release(released_buffer);
62}63}
6364
64std::shared_ptr<mc::Buffer> mc::SwitchingBundle::compositor_acquire()65std::shared_ptr<mg::Buffer> mc::SwitchingBundle::compositor_acquire()
65{66{
66 std::unique_lock<mc::ReadLock> lk(rw_lock);67 std::unique_lock<mc::ReadLock> lk(rw_lock);
67 return swapper->compositor_acquire();68 return swapper->compositor_acquire();
68}69}
6970
70void mc::SwitchingBundle::compositor_release(std::shared_ptr<mc::Buffer> const& released_buffer)71void mc::SwitchingBundle::compositor_release(std::shared_ptr<mg::Buffer> const& released_buffer)
71{72{
72 std::unique_lock<mc::ReadLock> lk(rw_lock);73 std::unique_lock<mc::ReadLock> lk(rw_lock);
73 return swapper->compositor_release(released_buffer);74 return swapper->compositor_release(released_buffer);
@@ -87,7 +88,7 @@
87 }88 }
8889
89 std::unique_lock<mc::WriteLock> lk(rw_lock);90 std::unique_lock<mc::WriteLock> lk(rw_lock);
90 std::vector<std::shared_ptr<mc::Buffer>> list{};91 std::vector<std::shared_ptr<mg::Buffer>> list{};
91 size_t size = 0;92 size_t size = 0;
92 swapper->end_responsibility(list, size);93 swapper->end_responsibility(list, size);
9394
9495
=== modified file 'src/server/compositor/switching_bundle.h'
--- src/server/compositor/switching_bundle.h 2013-06-15 11:09:16 +0000
+++ src/server/compositor/switching_bundle.h 2013-07-17 14:20:33 +0000
@@ -41,10 +41,10 @@
4141
42 BufferProperties properties() const;42 BufferProperties properties() const;
4343
44 std::shared_ptr<Buffer> client_acquire();44 std::shared_ptr<graphics::Buffer> client_acquire();
45 void client_release(std::shared_ptr<Buffer> const&);45 void client_release(std::shared_ptr<graphics::Buffer> const&);
46 std::shared_ptr<Buffer> compositor_acquire();46 std::shared_ptr<graphics::Buffer> compositor_acquire();
47 void compositor_release(std::shared_ptr<Buffer> const& released_buffer);47 void compositor_release(std::shared_ptr<graphics::Buffer> const& released_buffer);
48 void force_requests_to_complete();48 void force_requests_to_complete();
49 void allow_framedropping(bool dropping_allowed);49 void allow_framedropping(bool dropping_allowed);
5050
5151
=== modified file 'src/server/compositor/temporary_buffers.cpp'
--- src/server/compositor/temporary_buffers.cpp 2013-06-18 09:44:11 +0000
+++ src/server/compositor/temporary_buffers.cpp 2013-07-17 14:20:33 +0000
@@ -22,9 +22,10 @@
22#include "temporary_buffers.h"22#include "temporary_buffers.h"
2323
24namespace mc=mir::compositor;24namespace mc=mir::compositor;
25namespace mg=mir::graphics;
25namespace geom=mir::geometry;26namespace geom=mir::geometry;
2627
27mc::TemporaryBuffer::TemporaryBuffer(std::shared_ptr<Buffer> const& real_buffer)28mc::TemporaryBuffer::TemporaryBuffer(std::shared_ptr<mg::Buffer> const& real_buffer)
28 : buffer(real_buffer)29 : buffer(real_buffer)
29{30{
30}31}
@@ -69,7 +70,7 @@
69 return buffer->pixel_format();70 return buffer->pixel_format();
70}71}
7172
72mc::BufferID mc::TemporaryBuffer::id() const73mg::BufferID mc::TemporaryBuffer::id() const
73{74{
74 return buffer->id();75 return buffer->id();
75}76}
7677
=== modified file 'src/server/compositor/temporary_buffers.h'
--- src/server/compositor/temporary_buffers.h 2013-06-18 09:44:11 +0000
+++ src/server/compositor/temporary_buffers.h 2013-07-17 14:20:33 +0000
@@ -19,31 +19,32 @@
19#ifndef MIR_COMPOSITOR_TEMPORARY_BUFFERS_H_19#ifndef MIR_COMPOSITOR_TEMPORARY_BUFFERS_H_
20#define MIR_COMPOSITOR_TEMPORARY_BUFFERS_H_20#define MIR_COMPOSITOR_TEMPORARY_BUFFERS_H_
2121
22#include "mir/compositor/buffer.h"22#include "mir/graphics/buffer.h"
23#include "mir/compositor/buffer_id.h"23#include "mir/graphics/buffer_id.h"
24
25namespace mg = mir::graphics;
2426
25namespace mir27namespace mir
26{28{
27namespace compositor29namespace compositor
28{30{
2931
30class BufferID;
31class BufferBundle;32class BufferBundle;
32class BackBufferStrategy;33class BackBufferStrategy;
3334
34class TemporaryBuffer : public Buffer35class TemporaryBuffer : public mg::Buffer
35{36{
36public:37public:
37 geometry::Size size() const;38 geometry::Size size() const;
38 geometry::Stride stride() const;39 geometry::Stride stride() const;
39 geometry::PixelFormat pixel_format() const;40 geometry::PixelFormat pixel_format() const;
40 BufferID id() const;41 mg::BufferID id() const;
41 void bind_to_texture();42 void bind_to_texture();
42 std::shared_ptr<MirNativeBuffer> native_buffer_handle() const;43 std::shared_ptr<MirNativeBuffer> native_buffer_handle() const;
4344
44protected:45protected:
45 explicit TemporaryBuffer(std::shared_ptr<Buffer> const& real_buffer);46 explicit TemporaryBuffer(std::shared_ptr<mg::Buffer> const& real_buffer);
46 std::shared_ptr<Buffer> const buffer;47 std::shared_ptr<mg::Buffer> const buffer;
47};48};
4849
49class TemporaryClientBuffer : public TemporaryBuffer50class TemporaryClientBuffer : public TemporaryBuffer
5051
=== modified file 'src/server/default_server_configuration.cpp'
--- src/server/default_server_configuration.cpp 2013-07-16 18:34:20 +0000
+++ src/server/default_server_configuration.cpp 2013-07-17 14:20:33 +0000
@@ -405,7 +405,7 @@
405 });405 });
406}406}
407407
408std::shared_ptr<msh::PixelBuffer>408std::shared_ptr<mg::PixelBuffer>
409mir::DefaultServerConfiguration::the_shell_pixel_buffer()409mir::DefaultServerConfiguration::the_shell_pixel_buffer()
410{410{
411 return shell_pixel_buffer(411 return shell_pixel_buffer(
412412
=== modified file 'src/server/frontend/client_buffer_tracker.cpp'
--- src/server/frontend/client_buffer_tracker.cpp 2013-04-24 05:22:20 +0000
+++ src/server/frontend/client_buffer_tracker.cpp 2013-07-17 14:20:33 +0000
@@ -19,10 +19,10 @@
19#include <algorithm>19#include <algorithm>
2020
21#include "client_buffer_tracker.h"21#include "client_buffer_tracker.h"
22#include "mir/compositor/buffer_id.h"22#include "mir/graphics/buffer_id.h"
2323
24namespace mf = mir::frontend;24namespace mf = mir::frontend;
25namespace mc = mir::compositor;25namespace mg = mir::graphics;
2626
27mf::ClientBufferTracker::ClientBufferTracker(unsigned int client_cache_size)27mf::ClientBufferTracker::ClientBufferTracker(unsigned int client_cache_size)
28 : ids(),28 : ids(),
@@ -30,7 +30,7 @@
30{30{
31}31}
3232
33void mf::ClientBufferTracker::add(mc::BufferID const& id)33void mf::ClientBufferTracker::add(mg::BufferID const& id)
34{34{
35 auto existing_id = std::find(ids.begin(), ids.end(), id);35 auto existing_id = std::find(ids.begin(), ids.end(), id);
3636
@@ -47,7 +47,7 @@
47 ids.pop_back();47 ids.pop_back();
48}48}
4949
50bool mf::ClientBufferTracker::client_has(mc::BufferID const& id) const50bool mf::ClientBufferTracker::client_has(mg::BufferID const& id) const
51{51{
52 return std::find(ids.begin(), ids.end(), id) != ids.end();52 return std::find(ids.begin(), ids.end(), id) != ids.end();
53}53}
5454
=== modified file 'src/server/frontend/client_buffer_tracker.h'
--- src/server/frontend/client_buffer_tracker.h 2013-04-24 05:22:20 +0000
+++ src/server/frontend/client_buffer_tracker.h 2013-07-17 14:20:33 +0000
@@ -25,7 +25,7 @@
25namespace mir25namespace mir
26{26{
2727
28namespace compositor28namespace graphics
29{29{
30class BufferID;30class BufferID;
31}31}
@@ -48,11 +48,11 @@
48 /// Add a BufferID to the list of buffers known by the client.48 /// Add a BufferID to the list of buffers known by the client.
49 ///49 ///
50 /// Typically this should be done just prior to or just after sending the buffer information50 /// Typically this should be done just prior to or just after sending the buffer information
51 void add(compositor::BufferID const& id);51 void add(graphics::BufferID const& id);
52 bool client_has(compositor::BufferID const& id) const;52 bool client_has(graphics::BufferID const& id) const;
53private:53private:
5454
55 std::list<compositor::BufferID> ids;55 std::list<graphics::BufferID> ids;
56 unsigned int const cache_size;56 unsigned int const cache_size;
57};57};
5858
5959
=== modified file 'src/server/frontend/session_mediator.cpp'
--- src/server/frontend/session_mediator.cpp 2013-07-09 18:53:16 +0000
+++ src/server/frontend/session_mediator.cpp 2013-07-17 14:20:33 +0000
@@ -24,8 +24,8 @@
24#include "mir/shell/surface_creation_parameters.h"24#include "mir/shell/surface_creation_parameters.h"
25#include "mir/frontend/resource_cache.h"25#include "mir/frontend/resource_cache.h"
26#include "mir_toolkit/common.h"26#include "mir_toolkit/common.h"
27#include "mir/compositor/buffer_id.h"27#include "mir/graphics/buffer_id.h"
28#include "mir/compositor/buffer.h"28#include "mir/graphics/buffer.h"
29#include "mir/surfaces/buffer_stream.h"29#include "mir/surfaces/buffer_stream.h"
30#include "mir/compositor/graphic_buffer_allocator.h"30#include "mir/compositor/graphic_buffer_allocator.h"
31#include "mir/geometry/dimensions.h"31#include "mir/geometry/dimensions.h"
3232
=== modified file 'src/server/graphics/android/android_buffer_allocator.cpp'
--- src/server/graphics/android/android_buffer_allocator.cpp 2013-06-14 18:20:39 +0000
+++ src/server/graphics/android/android_buffer_allocator.cpp 2013-07-17 14:20:33 +0000
@@ -70,7 +70,7 @@
70 alloc_device = std::shared_ptr<mga::GraphicAllocAdaptor>(new AndroidAllocAdaptor(alloc_dev_ptr));70 alloc_device = std::shared_ptr<mga::GraphicAllocAdaptor>(new AndroidAllocAdaptor(alloc_dev_ptr));
71}71}
7272
73std::shared_ptr<mc::Buffer> mga::AndroidGraphicBufferAllocator::alloc_buffer(73std::shared_ptr<mg::Buffer> mga::AndroidGraphicBufferAllocator::alloc_buffer(
74 mc::BufferProperties const& buffer_properties)74 mc::BufferProperties const& buffer_properties)
75{75{
76 auto usage = convert_from_compositor_usage(buffer_properties.usage);76 auto usage = convert_from_compositor_usage(buffer_properties.usage);
7777
=== modified file 'src/server/graphics/android/android_graphic_buffer_allocator.h'
--- src/server/graphics/android/android_graphic_buffer_allocator.h 2013-06-14 18:20:39 +0000
+++ src/server/graphics/android/android_graphic_buffer_allocator.h 2013-07-17 14:20:33 +0000
@@ -45,7 +45,7 @@
45 AndroidGraphicBufferAllocator(45 AndroidGraphicBufferAllocator(
46 std::shared_ptr<BufferInitializer> const& buffer_initializer);46 std::shared_ptr<BufferInitializer> const& buffer_initializer);
4747
48 std::shared_ptr<compositor::Buffer> alloc_buffer(48 std::shared_ptr<graphics::Buffer> alloc_buffer(
49 compositor::BufferProperties const& buffer_properties);49 compositor::BufferProperties const& buffer_properties);
5050
51 std::shared_ptr<Buffer> alloc_buffer_platform(51 std::shared_ptr<Buffer> alloc_buffer_platform(
5252
=== modified file 'src/server/graphics/android/android_platform.cpp'
--- src/server/graphics/android/android_platform.cpp 2013-07-10 08:50:53 +0000
+++ src/server/graphics/android/android_platform.cpp 2013-07-17 14:20:33 +0000
@@ -26,7 +26,7 @@
26#include "internal_client.h"26#include "internal_client.h"
27#include "mir/graphics/platform_ipc_package.h"27#include "mir/graphics/platform_ipc_package.h"
28#include "mir/graphics/buffer_initializer.h"28#include "mir/graphics/buffer_initializer.h"
29#include "mir/compositor/buffer_id.h"29#include "mir/graphics/buffer_id.h"
30#include "mir/compositor/buffer_ipc_packer.h"30#include "mir/compositor/buffer_ipc_packer.h"
31#include "mir/options/option.h"31#include "mir/options/option.h"
3232
@@ -78,7 +78,7 @@
78}78}
7979
80void mga::AndroidPlatform::fill_ipc_package(std::shared_ptr<compositor::BufferIPCPacker> const& packer,80void mga::AndroidPlatform::fill_ipc_package(std::shared_ptr<compositor::BufferIPCPacker> const& packer,
81 std::shared_ptr<mc::Buffer> const& buffer) const81 std::shared_ptr<mg::Buffer> const& buffer) const
82{82{
83 auto native_buffer = buffer->native_buffer_handle();83 auto native_buffer = buffer->native_buffer_handle();
84 auto buffer_handle = native_buffer->handle;84 auto buffer_handle = native_buffer->handle;
8585
=== modified file 'src/server/graphics/android/android_platform.h'
--- src/server/graphics/android/android_platform.h 2013-07-10 08:50:53 +0000
+++ src/server/graphics/android/android_platform.h 2013-07-17 14:20:33 +0000
@@ -44,7 +44,7 @@
44 std::shared_ptr<PlatformIPCPackage> get_ipc_package();44 std::shared_ptr<PlatformIPCPackage> get_ipc_package();
45 std::shared_ptr<InternalClient> create_internal_client();45 std::shared_ptr<InternalClient> create_internal_client();
46 void fill_ipc_package(std::shared_ptr<compositor::BufferIPCPacker> const& packer,46 void fill_ipc_package(std::shared_ptr<compositor::BufferIPCPacker> const& packer,
47 std::shared_ptr<compositor::Buffer> const& buffer) const;47 std::shared_ptr<graphics::Buffer> const& buffer) const;
4848
49private:49private:
50 // TODO a design that has this and create_buffer_allocator is missing simplicity50 // TODO a design that has this and create_buffer_allocator is missing simplicity
5151
=== modified file 'src/server/graphics/android/default_framebuffer_factory.cpp'
--- src/server/graphics/android/default_framebuffer_factory.cpp 2013-05-29 15:28:27 +0000
+++ src/server/graphics/android/default_framebuffer_factory.cpp 2013-07-17 14:20:33 +0000
@@ -30,6 +30,7 @@
30#include <stdexcept>30#include <stdexcept>
31#include <vector>31#include <vector>
3232
33namespace mg = mir::graphics;
33namespace mga=mir::graphics::android;34namespace mga=mir::graphics::android;
34namespace mc=mir::compositor;35namespace mc=mir::compositor;
3536
@@ -39,13 +40,13 @@
39{40{
40}41}
4142
42std::vector<std::shared_ptr<mc::Buffer>> mga::DefaultFramebufferFactory::create_buffers(43std::vector<std::shared_ptr<mg::Buffer>> mga::DefaultFramebufferFactory::create_buffers(
43 std::shared_ptr<DisplaySupportProvider> const& info_provider) const44 std::shared_ptr<DisplaySupportProvider> const& info_provider) const
44{45{
45 auto size = info_provider->display_size();46 auto size = info_provider->display_size();
46 auto pf = info_provider->display_format();47 auto pf = info_provider->display_format();
47 auto num_framebuffers = info_provider->number_of_framebuffers_available();48 auto num_framebuffers = info_provider->number_of_framebuffers_available();
48 std::vector<std::shared_ptr<mc::Buffer>> buffers;49 std::vector<std::shared_ptr<mg::Buffer>> buffers;
49 for (auto i = 0u; i < num_framebuffers; ++i)50 for (auto i = 0u; i < num_framebuffers; ++i)
50 {51 {
51 buffers.push_back(buffer_allocator->alloc_buffer_platform(size, pf, mga::BufferUsage::use_framebuffer_gles));52 buffers.push_back(buffer_allocator->alloc_buffer_platform(size, pf, mga::BufferUsage::use_framebuffer_gles));
@@ -54,7 +55,7 @@
54}55}
5556
56std::shared_ptr<mga::FBSwapper> mga::DefaultFramebufferFactory::create_swapper(57std::shared_ptr<mga::FBSwapper> mga::DefaultFramebufferFactory::create_swapper(
57 std::vector<std::shared_ptr<mc::Buffer>> const& buffers) const58 std::vector<std::shared_ptr<mg::Buffer>> const& buffers) const
58{59{
59 return std::make_shared<mga::FBSimpleSwapper>(buffers);60 return std::make_shared<mga::FBSimpleSwapper>(buffers);
60}61}
6162
=== modified file 'src/server/graphics/android/default_framebuffer_factory.h'
--- src/server/graphics/android/default_framebuffer_factory.h 2013-05-29 15:28:27 +0000
+++ src/server/graphics/android/default_framebuffer_factory.h 2013-07-17 14:20:33 +0000
@@ -25,9 +25,10 @@
2525
26namespace mir26namespace mir
27{27{
28namespace compositor { class Buffer; }
29namespace graphics28namespace graphics
30{29{
30class Buffer;
31
31namespace android32namespace android
32{33{
3334
@@ -43,11 +44,11 @@
43private:44private:
44 std::shared_ptr<GraphicBufferAllocator> const buffer_allocator;45 std::shared_ptr<GraphicBufferAllocator> const buffer_allocator;
4546
46 virtual std::vector<std::shared_ptr<compositor::Buffer>> create_buffers(47 virtual std::vector<std::shared_ptr<graphics::Buffer>> create_buffers(
47 std::shared_ptr<DisplaySupportProvider> const& info_provider) const;48 std::shared_ptr<DisplaySupportProvider> const& info_provider) const;
4849
49 virtual std::shared_ptr<FBSwapper> create_swapper(50 virtual std::shared_ptr<FBSwapper> create_swapper(
50 std::vector<std::shared_ptr<compositor::Buffer>> const& buffers) const;51 std::vector<std::shared_ptr<graphics::Buffer>> const& buffers) const;
51};52};
5253
53}54}
5455
=== modified file 'src/server/graphics/android/display_support_provider.h'
--- src/server/graphics/android/display_support_provider.h 2013-05-16 20:04:58 +0000
+++ src/server/graphics/android/display_support_provider.h 2013-07-17 14:20:33 +0000
@@ -25,12 +25,10 @@
2525
26namespace mir26namespace mir
27{27{
28namespace compositor28namespace graphics
29{29{
30class Buffer;30class Buffer;
31}31
32namespace graphics
33{
34namespace android32namespace android
35{33{
3634
@@ -44,7 +42,7 @@
44 virtual unsigned int number_of_framebuffers_available() const = 0;42 virtual unsigned int number_of_framebuffers_available() const = 0;
45 //this function schedules the next frontbuffer to be "buffer" parameter. depending on implementation, it may43 //this function schedules the next frontbuffer to be "buffer" parameter. depending on implementation, it may
46 //post immediately, or be deferred.44 //post immediately, or be deferred.
47 virtual void set_next_frontbuffer(std::shared_ptr<compositor::Buffer> const& buffer) = 0;45 virtual void set_next_frontbuffer(std::shared_ptr<graphics::Buffer> const& buffer) = 0;
48 virtual void sync_to_display(bool sync) = 0;46 virtual void sync_to_display(bool sync) = 0;
49protected:47protected:
50 DisplaySupportProvider() = default;48 DisplaySupportProvider() = default;
5149
=== modified file 'src/server/graphics/android/fb_device.cpp'
--- src/server/graphics/android/fb_device.cpp 2013-07-11 16:54:41 +0000
+++ src/server/graphics/android/fb_device.cpp 2013-07-17 14:20:33 +0000
@@ -16,7 +16,7 @@
16 * Authored by: Kevin DuBois <kevin.dubois@canonical.com>16 * Authored by: Kevin DuBois <kevin.dubois@canonical.com>
17 */17 */
1818
19#include "mir/compositor/buffer.h"19#include "mir/graphics/buffer.h"
2020
21#include "fb_device.h"21#include "fb_device.h"
22#include "buffer.h"22#include "buffer.h"
@@ -26,10 +26,10 @@
26#include <boost/throw_exception.hpp>26#include <boost/throw_exception.hpp>
27#include <stdexcept>27#include <stdexcept>
2828
29namespace mc=mir::compositor;29namespace mg = mir::graphics;
30namespace mga=mir::graphics::android;30namespace mga=mir::graphics::android;
31namespace geom=mir::geometry;31namespace geom=mir::geometry;
32 32
33mga::FBDevice::FBDevice(std::shared_ptr<framebuffer_device_t> const& fbdev)33mga::FBDevice::FBDevice(std::shared_ptr<framebuffer_device_t> const& fbdev)
34 : fb_device(fbdev)34 : fb_device(fbdev)
35{35{
@@ -39,7 +39,7 @@
39 }39 }
40}40}
4141
42void mga::FBDevice::set_next_frontbuffer(std::shared_ptr<mc::Buffer> const& buffer)42void mga::FBDevice::set_next_frontbuffer(std::shared_ptr<mg::Buffer> const& buffer)
43{43{
44 auto handle = buffer->native_buffer_handle();44 auto handle = buffer->native_buffer_handle();
45 if (fb_device->post(fb_device.get(), handle->handle) != 0)45 if (fb_device->post(fb_device.get(), handle->handle) != 0)
4646
=== modified file 'src/server/graphics/android/fb_device.h'
--- src/server/graphics/android/fb_device.h 2013-05-16 20:04:58 +0000
+++ src/server/graphics/android/fb_device.h 2013-07-17 14:20:33 +0000
@@ -39,7 +39,7 @@
39 geometry::PixelFormat display_format() const; 39 geometry::PixelFormat display_format() const;
40 unsigned int number_of_framebuffers_available() const;40 unsigned int number_of_framebuffers_available() const;
4141
42 void set_next_frontbuffer(std::shared_ptr<compositor::Buffer> const& buffer);42 void set_next_frontbuffer(std::shared_ptr<graphics::Buffer> const& buffer);
43 void sync_to_display(bool sync);43 void sync_to_display(bool sync);
44private:44private:
45 std::shared_ptr<framebuffer_device_t> const fb_device;45 std::shared_ptr<framebuffer_device_t> const fb_device;
4646
=== modified file 'src/server/graphics/android/fb_simple_swapper.cpp'
--- src/server/graphics/android/fb_simple_swapper.cpp 2013-05-02 00:34:03 +0000
+++ src/server/graphics/android/fb_simple_swapper.cpp 2013-07-17 14:20:33 +0000
@@ -22,10 +22,10 @@
22#include <boost/throw_exception.hpp>22#include <boost/throw_exception.hpp>
23#include <stdexcept>23#include <stdexcept>
2424
25namespace mc=mir::compositor;25namespace mg = mir::graphics;
26namespace mga=mir::graphics::android;26namespace mga=mir::graphics::android;
2727
28std::shared_ptr<mc::Buffer> mga::FBSimpleSwapper::compositor_acquire()28std::shared_ptr<mg::Buffer> mga::FBSimpleSwapper::compositor_acquire()
29{29{
30 std::unique_lock<std::mutex> lk(queue_lock);30 std::unique_lock<std::mutex> lk(queue_lock);
31 while (queue.empty())31 while (queue.empty())
@@ -38,7 +38,7 @@
38 return buffer;38 return buffer;
39}39}
4040
41void mga::FBSimpleSwapper::compositor_release(std::shared_ptr<mc::Buffer> const& released_buffer)41void mga::FBSimpleSwapper::compositor_release(std::shared_ptr<mg::Buffer> const& released_buffer)
42{42{
43 std::unique_lock<std::mutex> lk(queue_lock);43 std::unique_lock<std::mutex> lk(queue_lock);
4444
4545
=== modified file 'src/server/graphics/android/fb_simple_swapper.h'
--- src/server/graphics/android/fb_simple_swapper.h 2013-05-02 00:34:03 +0000
+++ src/server/graphics/android/fb_simple_swapper.h 2013-07-17 14:20:33 +0000
@@ -46,14 +46,14 @@
46 }46 }
47 }47 }
4848
49 std::shared_ptr<compositor::Buffer> compositor_acquire();49 std::shared_ptr<Buffer> compositor_acquire();
50 void compositor_release(std::shared_ptr<compositor::Buffer> const& released_buffer);50 void compositor_release(std::shared_ptr<Buffer> const& released_buffer);
5151
52private:52private:
53 std::mutex queue_lock;53 std::mutex queue_lock;
54 std::condition_variable cv;54 std::condition_variable cv;
5555
56 std::queue<std::shared_ptr<compositor::Buffer>> queue;56 std::queue<std::shared_ptr<graphics::Buffer>> queue;
57};57};
5858
59}59}
6060
=== modified file 'src/server/graphics/android/fb_swapper.h'
--- src/server/graphics/android/fb_swapper.h 2013-05-02 16:29:48 +0000
+++ src/server/graphics/android/fb_swapper.h 2013-07-17 14:20:33 +0000
@@ -24,24 +24,19 @@
2424
25namespace mir25namespace mir
26{26{
27namespace compositor
28{
29class Buffer;
30}
31namespace graphics27namespace graphics
32{28{
29class Buffer;
30
33namespace android31namespace android
34{32{
35
36class Buffer;
37
38//TODO: remove this interface. FBSimpleSwapper should inherit from mc::BufferSwapper33//TODO: remove this interface. FBSimpleSwapper should inherit from mc::BufferSwapper
39class FBSwapper{34class FBSwapper{
40public:35public:
41 virtual ~FBSwapper() = default;36 virtual ~FBSwapper() = default;
4237
43 virtual std::shared_ptr<compositor::Buffer> compositor_acquire() = 0;38 virtual std::shared_ptr<Buffer> compositor_acquire() = 0;
44 virtual void compositor_release(std::shared_ptr<compositor::Buffer> const& released_buffer) = 0;39 virtual void compositor_release(std::shared_ptr<Buffer> const& released_buffer) = 0;
45protected:40protected:
46 FBSwapper() = default;41 FBSwapper() = default;
47 FBSwapper(FBSwapper const&) = delete;42 FBSwapper(FBSwapper const&) = delete;
4843
=== modified file 'src/server/graphics/android/hwc10_device.cpp'
--- src/server/graphics/android/hwc10_device.cpp 2013-05-17 20:43:23 +0000
+++ src/server/graphics/android/hwc10_device.cpp 2013-07-17 14:20:33 +0000
@@ -23,7 +23,7 @@
23#include <boost/throw_exception.hpp>23#include <boost/throw_exception.hpp>
24#include <stdexcept>24#include <stdexcept>
2525
26namespace mc=mir::compositor;26namespace mg = mir::graphics;
27namespace mga=mir::graphics::android;27namespace mga=mir::graphics::android;
28namespace geom=mir::geometry;28namespace geom=mir::geometry;
2929
@@ -55,7 +55,7 @@
55 return fb_device->number_of_framebuffers_available();55 return fb_device->number_of_framebuffers_available();
56}56}
5757
58void mga::HWC10Device::set_next_frontbuffer(std::shared_ptr<mc::Buffer> const& buffer)58void mga::HWC10Device::set_next_frontbuffer(std::shared_ptr<mg::Buffer> const& buffer)
59{59{
60 fb_device->set_next_frontbuffer(buffer);60 fb_device->set_next_frontbuffer(buffer);
61}61}
6262
=== modified file 'src/server/graphics/android/hwc10_device.h'
--- src/server/graphics/android/hwc10_device.h 2013-05-17 20:43:23 +0000
+++ src/server/graphics/android/hwc10_device.h 2013-07-17 14:20:33 +0000
@@ -40,7 +40,7 @@
40 geometry::Size display_size() const; 40 geometry::Size display_size() const;
41 geometry::PixelFormat display_format() const;41 geometry::PixelFormat display_format() const;
42 unsigned int number_of_framebuffers_available() const;42 unsigned int number_of_framebuffers_available() const;
43 void set_next_frontbuffer(std::shared_ptr<compositor::Buffer> const& buffer);43 void set_next_frontbuffer(std::shared_ptr<Buffer> const& buffer);
44 void sync_to_display(bool sync);44 void sync_to_display(bool sync);
45 45
46 void commit_frame(EGLDisplay dpy, EGLSurface sur);46 void commit_frame(EGLDisplay dpy, EGLSurface sur);
4747
=== modified file 'src/server/graphics/android/hwc11_device.cpp'
--- src/server/graphics/android/hwc11_device.cpp 2013-07-11 16:54:41 +0000
+++ src/server/graphics/android/hwc11_device.cpp 2013-07-17 14:20:33 +0000
@@ -23,7 +23,7 @@
23#include <boost/throw_exception.hpp>23#include <boost/throw_exception.hpp>
24#include <stdexcept>24#include <stdexcept>
2525
26namespace mc=mir::compositor;26namespace mg = mir::graphics;
27namespace mga=mir::graphics::android;27namespace mga=mir::graphics::android;
28namespace geom=mir::geometry;28namespace geom=mir::geometry;
2929
@@ -74,8 +74,8 @@
74 //us a hint to triple buffer. Taking this hint is currently not supported.74 //us a hint to triple buffer. Taking this hint is currently not supported.
75 return 2u;75 return 2u;
76}76}
77 77
78void mga::HWC11Device::set_next_frontbuffer(std::shared_ptr<mc::Buffer> const& buffer)78void mga::HWC11Device::set_next_frontbuffer(std::shared_ptr<mg::Buffer> const& buffer)
79{79{
80 layer_organizer->set_fb_target(buffer);80 layer_organizer->set_fb_target(buffer);
8181
8282
=== modified file 'src/server/graphics/android/hwc11_device.h'
--- src/server/graphics/android/hwc11_device.h 2013-05-17 20:17:16 +0000
+++ src/server/graphics/android/hwc11_device.h 2013-07-17 14:20:33 +0000
@@ -25,6 +25,8 @@
25{25{
26namespace graphics26namespace graphics
27{27{
28class Buffer;
29
28namespace android30namespace android
29{31{
30class HWCLayerOrganizer;32class HWCLayerOrganizer;
@@ -42,7 +44,7 @@
42 geometry::Size display_size() const; 44 geometry::Size display_size() const;
43 geometry::PixelFormat display_format() const;45 geometry::PixelFormat display_format() const;
44 unsigned int number_of_framebuffers_available() const;46 unsigned int number_of_framebuffers_available() const;
45 void set_next_frontbuffer(std::shared_ptr<compositor::Buffer> const& buffer);47 void set_next_frontbuffer(std::shared_ptr<Buffer> const& buffer);
46 void sync_to_display(bool sync);48 void sync_to_display(bool sync);
47 49
48 void commit_frame(EGLDisplay dpy, EGLSurface sur);50 void commit_frame(EGLDisplay dpy, EGLSurface sur);
4951
=== modified file 'src/server/graphics/android/hwc_common_device.h'
--- src/server/graphics/android/hwc_common_device.h 2013-05-16 19:04:50 +0000
+++ src/server/graphics/android/hwc_common_device.h 2013-07-17 14:20:33 +0000
@@ -47,7 +47,7 @@
47 unsigned int number_of_framebuffers_available() const; 47 unsigned int number_of_framebuffers_available() const;
4848
49 virtual geometry::Size display_size() const = 0;49 virtual geometry::Size display_size() const = 0;
50 virtual void set_next_frontbuffer(std::shared_ptr<compositor::Buffer> const& buffer) = 0;50 virtual void set_next_frontbuffer(std::shared_ptr<Buffer> const& buffer) = 0;
51 virtual void commit_frame(EGLDisplay dpy, EGLSurface sur) = 0;51 virtual void commit_frame(EGLDisplay dpy, EGLSurface sur) = 0;
5252
53 void notify_vsync();53 void notify_vsync();
5454
=== modified file 'src/server/graphics/android/hwc_device.h'
--- src/server/graphics/android/hwc_device.h 2013-05-16 18:40:30 +0000
+++ src/server/graphics/android/hwc_device.h 2013-07-17 14:20:33 +0000
@@ -39,7 +39,7 @@
39 virtual geometry::Size display_size() const = 0; 39 virtual geometry::Size display_size() const = 0;
40 virtual geometry::PixelFormat display_format() const = 0; 40 virtual geometry::PixelFormat display_format() const = 0;
41 virtual unsigned int number_of_framebuffers_available() const = 0;41 virtual unsigned int number_of_framebuffers_available() const = 0;
42 virtual void set_next_frontbuffer(std::shared_ptr<compositor::Buffer> const& buffer) = 0;42 virtual void set_next_frontbuffer(std::shared_ptr<Buffer> const& buffer) = 0;
4343
44 virtual void commit_frame(EGLDisplay dpy, EGLSurface sur) = 0;44 virtual void commit_frame(EGLDisplay dpy, EGLSurface sur) = 0;
45private:45private:
4646
=== modified file 'src/server/graphics/android/hwc_layerlist.cpp'
--- src/server/graphics/android/hwc_layerlist.cpp 2013-07-10 17:06:37 +0000
+++ src/server/graphics/android/hwc_layerlist.cpp 2013-07-17 14:20:33 +0000
@@ -21,7 +21,7 @@
2121
22#include <cstring>22#include <cstring>
2323
24namespace mc=mir::compositor;24namespace mg=mir::graphics;
25namespace mga=mir::graphics::android;25namespace mga=mir::graphics::android;
26namespace geom=mir::geometry;26namespace geom=mir::geometry;
2727
@@ -95,7 +95,7 @@
95 return layer_list;95 return layer_list;
96}96}
9797
98void mga::HWCLayerList::set_fb_target(std::shared_ptr<mc::Buffer> const& buffer)98void mga::HWCLayerList::set_fb_target(std::shared_ptr<mg::Buffer> const& buffer)
99{99{
100 auto handle = buffer->native_buffer_handle();100 auto handle = buffer->native_buffer_handle();
101101
102102
=== modified file 'src/server/graphics/android/hwc_layerlist.h'
--- src/server/graphics/android/hwc_layerlist.h 2013-05-03 22:53:42 +0000
+++ src/server/graphics/android/hwc_layerlist.h 2013-07-17 14:20:33 +0000
@@ -26,15 +26,12 @@
26#include <initializer_list>26#include <initializer_list>
27namespace mir27namespace mir
28{28{
29namespace compositor29namespace graphics
30{30{
31class Buffer;31class Buffer;
32}32
33namespace graphics
34{
35namespace android33namespace android
36{34{
37
38class HWCDefaultLayer;35class HWCDefaultLayer;
39typedef struct std::vector<std::shared_ptr<HWCDefaultLayer>> LayerList;36typedef struct std::vector<std::shared_ptr<HWCDefaultLayer>> LayerList;
40 37
@@ -75,7 +72,7 @@
75public:72public:
76 virtual ~HWCLayerOrganizer() = default;73 virtual ~HWCLayerOrganizer() = default;
77 virtual const LayerList& native_list() const = 0;74 virtual const LayerList& native_list() const = 0;
78 virtual void set_fb_target(std::shared_ptr<compositor::Buffer> const&) = 0;75 virtual void set_fb_target(std::shared_ptr<Buffer> const&) = 0;
7976
80protected:77protected:
81 HWCLayerOrganizer() = default;78 HWCLayerOrganizer() = default;
@@ -90,7 +87,7 @@
90 HWCLayerList();87 HWCLayerList();
91 const LayerList& native_list() const;88 const LayerList& native_list() const;
9289
93 void set_fb_target(std::shared_ptr<compositor::Buffer> const&);90 void set_fb_target(std::shared_ptr<Buffer> const&);
9491
95private:92private:
96 LayerList layer_list;93 LayerList layer_list;
9794
=== modified file 'src/server/graphics/android/internal_client_window.cpp'
--- src/server/graphics/android/internal_client_window.cpp 2013-06-25 05:42:49 +0000
+++ src/server/graphics/android/internal_client_window.cpp 2013-07-17 14:20:33 +0000
@@ -17,7 +17,7 @@
17 */17 */
1818
19#include "mir/frontend/surface.h"19#include "mir/frontend/surface.h"
20#include "mir/compositor/buffer.h"20#include "mir/graphics/buffer.h"
21#include "internal_client_window.h"21#include "internal_client_window.h"
22#include "interpreter_resource_cache.h"22#include "interpreter_resource_cache.h"
23#include "android_format_conversion-inl.h"23#include "android_format_conversion-inl.h"
2424
=== modified file 'src/server/graphics/android/interpreter_cache.cpp'
--- src/server/graphics/android/interpreter_cache.cpp 2013-05-06 22:35:54 +0000
+++ src/server/graphics/android/interpreter_cache.cpp 2013-07-17 14:20:33 +0000
@@ -20,15 +20,15 @@
20#include <boost/throw_exception.hpp>20#include <boost/throw_exception.hpp>
21#include <stdexcept>21#include <stdexcept>
2222
23namespace mg = mir::graphics;
23namespace mga=mir::graphics::android;24namespace mga=mir::graphics::android;
24namespace mc=mir::compositor;
2525
26void mga::InterpreterCache::store_buffer(std::shared_ptr<compositor::Buffer>const& buffer, ANativeWindowBuffer* key)26void mga::InterpreterCache::store_buffer(std::shared_ptr<mg::Buffer>const& buffer, ANativeWindowBuffer* key)
27{27{
28 buffers_in_driver[key] = buffer;28 buffers_in_driver[key] = buffer;
29}29}
3030
31std::shared_ptr<mc::Buffer> mga::InterpreterCache::retrieve_buffer(ANativeWindowBuffer* returned_handle)31std::shared_ptr<mg::Buffer> mga::InterpreterCache::retrieve_buffer(ANativeWindowBuffer* returned_handle)
32{32{
33 auto buffer_it = buffers_in_driver.find(returned_handle); 33 auto buffer_it = buffers_in_driver.find(returned_handle);
34 if (buffer_it == buffers_in_driver.end())34 if (buffer_it == buffers_in_driver.end())
3535
=== modified file 'src/server/graphics/android/interpreter_cache.h'
--- src/server/graphics/android/interpreter_cache.h 2013-05-09 18:46:57 +0000
+++ src/server/graphics/android/interpreter_cache.h 2013-07-17 14:20:33 +0000
@@ -33,11 +33,11 @@
33public:33public:
34 InterpreterCache() {}34 InterpreterCache() {}
3535
36 void store_buffer(std::shared_ptr<compositor::Buffer>const& buffer, ANativeWindowBuffer* key);36 void store_buffer(std::shared_ptr<graphics::Buffer>const& buffer, ANativeWindowBuffer* key);
37 std::shared_ptr<compositor::Buffer> retrieve_buffer(ANativeWindowBuffer* key);37 std::shared_ptr<graphics::Buffer> retrieve_buffer(ANativeWindowBuffer* key);
3838
39private:39private:
40 std::unordered_map<ANativeWindowBuffer*, std::shared_ptr<compositor::Buffer>> buffers_in_driver;40 std::unordered_map<ANativeWindowBuffer*, std::shared_ptr<graphics::Buffer>> buffers_in_driver;
41};41};
42}42}
43}43}
4444
=== modified file 'src/server/graphics/android/interpreter_resource_cache.h'
--- src/server/graphics/android/interpreter_resource_cache.h 2013-05-06 21:25:47 +0000
+++ src/server/graphics/android/interpreter_resource_cache.h 2013-07-17 14:20:33 +0000
@@ -23,12 +23,10 @@
2323
24namespace mir24namespace mir
25{25{
26namespace compositor26namespace graphics
27{27{
28class Buffer;28class Buffer;
29}29
30namespace graphics
31{
32namespace android30namespace android
33{31{
34class InterpreterResourceCache32class InterpreterResourceCache
@@ -36,8 +34,8 @@
36public:34public:
37 InterpreterResourceCache() {}35 InterpreterResourceCache() {}
3836
39 virtual void store_buffer(std::shared_ptr<compositor::Buffer>const& buffer, ANativeWindowBuffer* key) = 0;37 virtual void store_buffer(std::shared_ptr<graphics::Buffer>const& buffer, ANativeWindowBuffer* key) = 0;
40 virtual std::shared_ptr<compositor::Buffer> retrieve_buffer(ANativeWindowBuffer* key) = 0;38 virtual std::shared_ptr<graphics::Buffer> retrieve_buffer(ANativeWindowBuffer* key) = 0;
4139
42protected:40protected:
43 virtual ~InterpreterResourceCache() {}41 virtual ~InterpreterResourceCache() {}
4442
=== modified file 'src/server/graphics/android/server_render_window.cpp'
--- src/server/graphics/android/server_render_window.cpp 2013-05-17 20:17:16 +0000
+++ src/server/graphics/android/server_render_window.cpp 2013-07-17 14:20:33 +0000
@@ -17,7 +17,7 @@
17 * Kevin DuBois <kevin.dubois@canonical.com>17 * Kevin DuBois <kevin.dubois@canonical.com>
18 */18 */
1919
20#include "mir/compositor/buffer.h"20#include "mir/graphics/buffer.h"
21#include "server_render_window.h"21#include "server_render_window.h"
22#include "display_support_provider.h"22#include "display_support_provider.h"
23#include "fb_swapper.h"23#include "fb_swapper.h"
2424
=== modified file 'src/server/graphics/gbm/gbm_buffer_allocator.cpp'
--- src/server/graphics/gbm/gbm_buffer_allocator.cpp 2013-06-14 17:16:31 +0000
+++ src/server/graphics/gbm/gbm_buffer_allocator.cpp 2013-07-17 14:20:33 +0000
@@ -116,7 +116,7 @@
116 assert(buffer_initializer.get() != 0);116 assert(buffer_initializer.get() != 0);
117}117}
118118
119std::shared_ptr<mc::Buffer> mgg::GBMBufferAllocator::alloc_buffer(119std::shared_ptr<mg::Buffer> mgg::GBMBufferAllocator::alloc_buffer(
120 mc::BufferProperties const& buffer_properties)120 mc::BufferProperties const& buffer_properties)
121{121{
122 uint32_t bo_flags{GBM_BO_USE_RENDERING};122 uint32_t bo_flags{GBM_BO_USE_RENDERING};
@@ -141,7 +141,7 @@
141 new EGLImageBufferTextureBinder{bo, egl_extensions}};141 new EGLImageBufferTextureBinder{bo, egl_extensions}};
142142
143 /* Create the GBMBuffer */143 /* Create the GBMBuffer */
144 std::shared_ptr<mc::Buffer> buffer{new GBMBuffer{bo, std::move(texture_binder)}};144 std::shared_ptr<mg::Buffer> buffer{new GBMBuffer{bo, std::move(texture_binder)}};
145145
146 (*buffer_initializer)(*buffer);146 (*buffer_initializer)(*buffer);
147147
148148
=== modified file 'src/server/graphics/gbm/gbm_buffer_allocator.h'
--- src/server/graphics/gbm/gbm_buffer_allocator.h 2013-06-14 17:16:31 +0000
+++ src/server/graphics/gbm/gbm_buffer_allocator.h 2013-07-17 14:20:33 +0000
@@ -20,7 +20,7 @@
20#define MIR_PLATFORM_GBM_GBM_BUFFER_ALLOCATOR_H_20#define MIR_PLATFORM_GBM_GBM_BUFFER_ALLOCATOR_H_
2121
22#include "mir/compositor/graphic_buffer_allocator.h"22#include "mir/compositor/graphic_buffer_allocator.h"
23#include "mir/compositor/buffer_id.h"23#include "mir/graphics/buffer_id.h"
2424
25#include <memory>25#include <memory>
2626
@@ -41,7 +41,7 @@
41 GBMBufferAllocator(const std::shared_ptr<GBMPlatform>& platform,41 GBMBufferAllocator(const std::shared_ptr<GBMPlatform>& platform,
42 const std::shared_ptr<BufferInitializer>& buffer_initializer);42 const std::shared_ptr<BufferInitializer>& buffer_initializer);
4343
44 virtual std::shared_ptr<compositor::Buffer> alloc_buffer(44 virtual std::shared_ptr<Buffer> alloc_buffer(
45 compositor::BufferProperties const& buffer_properties);45 compositor::BufferProperties const& buffer_properties);
4646
47 std::vector<geometry::PixelFormat> supported_pixel_formats();47 std::vector<geometry::PixelFormat> supported_pixel_formats();
4848
=== modified file 'src/server/graphics/gbm/gbm_platform.cpp'
--- src/server/graphics/gbm/gbm_platform.cpp 2013-07-10 08:50:53 +0000
+++ src/server/graphics/gbm/gbm_platform.cpp 2013-07-17 14:20:33 +0000
@@ -120,7 +120,7 @@
120}120}
121121
122void mgg::GBMPlatform::fill_ipc_package(std::shared_ptr<compositor::BufferIPCPacker> const& packer,122void mgg::GBMPlatform::fill_ipc_package(std::shared_ptr<compositor::BufferIPCPacker> const& packer,
123 std::shared_ptr<compositor::Buffer> const& buffer) const123 std::shared_ptr<Buffer> const& buffer) const
124{124{
125 auto native_handle = buffer->native_buffer_handle();125 auto native_handle = buffer->native_buffer_handle();
126 for(auto i=0; i<native_handle->data_items; i++)126 for(auto i=0; i<native_handle->data_items; i++)
127127
=== modified file 'src/server/graphics/gbm/gbm_platform.h'
--- src/server/graphics/gbm/gbm_platform.h 2013-07-10 08:50:53 +0000
+++ src/server/graphics/gbm/gbm_platform.h 2013-07-17 14:20:33 +0000
@@ -52,7 +52,7 @@
52 std::shared_ptr<InternalClient> create_internal_client();52 std::shared_ptr<InternalClient> create_internal_client();
5353
54 void fill_ipc_package(std::shared_ptr<compositor::BufferIPCPacker> const& packer,54 void fill_ipc_package(std::shared_ptr<compositor::BufferIPCPacker> const& packer,
55 std::shared_ptr<compositor::Buffer> const& buffer) const;55 std::shared_ptr<Buffer> const& buffer) const;
5656
57 /* From DRMAuthenticator */57 /* From DRMAuthenticator */
58 void drm_auth_magic(drm_magic_t magic);58 void drm_auth_magic(drm_magic_t magic);
5959
=== modified file 'src/server/graphics/gbm/internal_native_display.cpp'
--- src/server/graphics/gbm/internal_native_display.cpp 2013-06-13 21:24:29 +0000
+++ src/server/graphics/gbm/internal_native_display.cpp 2013-07-17 14:20:33 +0000
@@ -21,7 +21,7 @@
21#include "mir/graphics/platform_ipc_package.h"21#include "mir/graphics/platform_ipc_package.h"
22#include "mir/graphics/platform.h"22#include "mir/graphics/platform.h"
23#include "mir/frontend/surface.h"23#include "mir/frontend/surface.h"
24#include "mir/compositor/buffer.h"24#include "mir/graphics/buffer.h"
2525
26#include "mir_toolkit/mesa/native_display.h"26#include "mir_toolkit/mesa/native_display.h"
2727
2828
=== modified file 'src/server/graphics/gbm/internal_native_surface.cpp'
--- src/server/graphics/gbm/internal_native_surface.cpp 2013-06-25 05:42:49 +0000
+++ src/server/graphics/gbm/internal_native_surface.cpp 2013-07-17 14:20:33 +0000
@@ -17,7 +17,7 @@
17 */17 */
1818
19#include "mir/frontend/surface.h"19#include "mir/frontend/surface.h"
20#include "mir/compositor/buffer.h"20#include "mir/graphics/buffer.h"
21#include "internal_native_surface.h"21#include "internal_native_surface.h"
22#include <cstring>22#include <cstring>
23namespace mgg = mir::graphics::gbm;23namespace mgg = mir::graphics::gbm;
2424
=== modified file 'src/server/graphics/gbm/internal_native_surface.h'
--- src/server/graphics/gbm/internal_native_surface.h 2013-06-18 00:21:15 +0000
+++ src/server/graphics/gbm/internal_native_surface.h 2013-07-17 14:20:33 +0000
@@ -28,7 +28,7 @@
28{28{
29class Surface;29class Surface;
30}30}
31namespace compositor31namespace graphics
32{32{
33class Buffer;33class Buffer;
34}34}
@@ -53,7 +53,7 @@
53 MirSurfaceParameters* parameters);53 MirSurfaceParameters* parameters);
5454
55 std::shared_ptr<frontend::Surface> surface;55 std::shared_ptr<frontend::Surface> surface;
56 std::shared_ptr<compositor::Buffer> current_buffer;56 std::shared_ptr<graphics::Buffer> current_buffer;
57};57};
5858
59}59}
6060
=== modified file 'src/server/graphics/gl_pixel_buffer.cpp'
--- src/server/graphics/gl_pixel_buffer.cpp 2013-06-25 10:44:13 +0000
+++ src/server/graphics/gl_pixel_buffer.cpp 2013-07-17 14:20:33 +0000
@@ -18,7 +18,7 @@
1818
19#include "mir/graphics/gl_context.h"19#include "mir/graphics/gl_context.h"
20#include "mir/graphics/gl_pixel_buffer.h"20#include "mir/graphics/gl_pixel_buffer.h"
21#include "mir/compositor/buffer.h"21#include "mir/graphics/buffer.h"
2222
23#include <stdexcept>23#include <stdexcept>
24#include <boost/throw_exception.hpp>24#include <boost/throw_exception.hpp>
@@ -26,7 +26,6 @@
26#include <GLES2/gl2ext.h>26#include <GLES2/gl2ext.h>
2727
28namespace mg = mir::graphics;28namespace mg = mir::graphics;
29namespace msh = mir::shell;
30namespace geom = mir::geometry;29namespace geom = mir::geometry;
3130
32namespace31namespace
@@ -79,7 +78,7 @@
79 glBindFramebuffer(GL_FRAMEBUFFER, fbo);78 glBindFramebuffer(GL_FRAMEBUFFER, fbo);
80}79}
8180
82void mg::GLPixelBuffer::fill_from(compositor::Buffer& buffer)81void mg::GLPixelBuffer::fill_from(Buffer& buffer)
83{82{
84 auto width = buffer.size().width.as_uint32_t();83 auto width = buffer.size().width.as_uint32_t();
85 auto height = buffer.size().height.as_uint32_t();84 auto height = buffer.size().height.as_uint32_t();
8685
=== modified file 'src/server/graphics/gl_renderer.cpp'
--- src/server/graphics/gl_renderer.cpp 2013-07-12 22:04:13 +0000
+++ src/server/graphics/gl_renderer.cpp 2013-07-17 14:20:33 +0000
@@ -1,7 +1,7 @@
1#include "mir/graphics/gl_renderer.h"1#include "mir/graphics/gl_renderer.h"
2#include "mir/graphics/compositing_criteria.h"2#include "mir/graphics/compositing_criteria.h"
3#include "mir/surfaces/buffer_stream.h"3#include "mir/surfaces/buffer_stream.h"
4#include "mir/compositor/buffer.h"4#include "mir/graphics/buffer.h"
55
6#include <glm/gtc/matrix_transform.hpp>6#include <glm/gtc/matrix_transform.hpp>
7#include <glm/gtc/type_ptr.hpp>7#include <glm/gtc/type_ptr.hpp>
88
=== modified file 'src/server/shell/surface.cpp'
--- src/server/shell/surface.cpp 2013-07-09 18:55:47 +0000
+++ src/server/shell/surface.cpp 2013-07-17 14:20:33 +0000
@@ -31,6 +31,7 @@
3131
32namespace msh = mir::shell;32namespace msh = mir::shell;
33namespace mc = mir::compositor;33namespace mc = mir::compositor;
34namespace mg = mir::graphics;
34namespace mi = mir::input;35namespace mi = mir::input;
35namespace ms = mir::surfaces;36namespace ms = mir::surfaces;
36namespace geom = mir::geometry;37namespace geom = mir::geometry;
@@ -166,7 +167,7 @@
166 }167 }
167}168}
168169
169std::shared_ptr<mc::Buffer> msh::Surface::advance_client_buffer()170std::shared_ptr<mg::Buffer> msh::Surface::advance_client_buffer()
170{171{
171 if (auto const& s = surface.lock())172 if (auto const& s = surface.lock())
172 {173 {
@@ -187,7 +188,7 @@
187}188}
188 189
189void msh::Surface::with_most_recent_buffer_do(190void msh::Surface::with_most_recent_buffer_do(
190 std::function<void(mc::Buffer&)> const& exec)191 std::function<void(mg::Buffer&)> const& exec)
191{192{
192 if (auto const& s = surface.lock())193 if (auto const& s = surface.lock())
193 {194 {
194195
=== modified file 'src/server/shell/threaded_snapshot_strategy.cpp'
--- src/server/shell/threaded_snapshot_strategy.cpp 2013-06-25 13:19:14 +0000
+++ src/server/shell/threaded_snapshot_strategy.cpp 2013-07-17 14:20:33 +0000
@@ -17,7 +17,7 @@
17 */17 */
1818
19#include "mir/shell/threaded_snapshot_strategy.h"19#include "mir/shell/threaded_snapshot_strategy.h"
20#include "mir/shell/pixel_buffer.h"20#include "mir/graphics/pixel_buffer.h"
21#include "mir/shell/surface_buffer_access.h"21#include "mir/shell/surface_buffer_access.h"
2222
23#include <deque>23#include <deque>
@@ -41,7 +41,7 @@
41class SnapshottingFunctor41class SnapshottingFunctor
42{42{
43public:43public:
44 SnapshottingFunctor(std::shared_ptr<PixelBuffer> const& pixels)44 SnapshottingFunctor(std::shared_ptr<graphics::PixelBuffer> const& pixels)
45 : running{true}, pixels{pixels}45 : running{true}, pixels{pixels}
46 {46 {
47 }47 }
@@ -72,7 +72,7 @@
72 void take_snapshot(WorkItem const& wi)72 void take_snapshot(WorkItem const& wi)
73 {73 {
74 wi.surface_buffer_access->with_most_recent_buffer_do(74 wi.surface_buffer_access->with_most_recent_buffer_do(
75 [this](compositor::Buffer& buffer)75 [this](graphics::Buffer& buffer)
76 {76 {
77 pixels->fill_from(buffer);77 pixels->fill_from(buffer);
78 });78 });
@@ -100,7 +100,7 @@
100100
101private:101private:
102 bool running;102 bool running;
103 std::shared_ptr<PixelBuffer> const pixels;103 std::shared_ptr<graphics::PixelBuffer> const pixels;
104 std::mutex work_mutex;104 std::mutex work_mutex;
105 std::condition_variable work_cv;105 std::condition_variable work_cv;
106 std::deque<WorkItem> work;106 std::deque<WorkItem> work;
@@ -110,7 +110,7 @@
110}110}
111111
112msh::ThreadedSnapshotStrategy::ThreadedSnapshotStrategy(112msh::ThreadedSnapshotStrategy::ThreadedSnapshotStrategy(
113 std::shared_ptr<PixelBuffer> const& pixels)113 std::shared_ptr<graphics::PixelBuffer> const& pixels)
114 : pixels{pixels},114 : pixels{pixels},
115 functor{new SnapshottingFunctor{pixels}},115 functor{new SnapshottingFunctor{pixels}},
116 thread{std::ref(*functor)}116 thread{std::ref(*functor)}
117117
=== modified file 'src/server/surfaces/surface.cpp'
--- src/server/surfaces/surface.cpp 2013-07-16 15:49:19 +0000
+++ src/server/surfaces/surface.cpp 2013-07-17 14:20:33 +0000
@@ -22,7 +22,7 @@
22#include "mir/surfaces/surface_state.h"22#include "mir/surfaces/surface_state.h"
23#include "mir/surfaces/buffer_stream.h"23#include "mir/surfaces/buffer_stream.h"
24#include "mir/input/input_channel.h"24#include "mir/input/input_channel.h"
25#include "mir/compositor/buffer.h"25#include "mir/graphics/buffer.h"
2626
27#include <boost/throw_exception.hpp>27#include <boost/throw_exception.hpp>
2828
@@ -104,7 +104,7 @@
104 return surface_buffer_stream->get_stream_pixel_format();104 return surface_buffer_stream->get_stream_pixel_format();
105}105}
106106
107std::shared_ptr<mc::Buffer> ms::Surface::advance_client_buffer()107std::shared_ptr<mg::Buffer> ms::Surface::advance_client_buffer()
108{108{
109 if (surface_in_startup)109 if (surface_in_startup)
110 {110 {
@@ -123,7 +123,7 @@
123 surface_buffer_stream->allow_framedropping(allow);123 surface_buffer_stream->allow_framedropping(allow);
124}124}
125125
126std::shared_ptr<mc::Buffer> ms::Surface::compositor_buffer() const126std::shared_ptr<mg::Buffer> ms::Surface::compositor_buffer() const
127{127{
128 return surface_buffer_stream->lock_back_buffer();128 return surface_buffer_stream->lock_back_buffer();
129}129}
130130
=== modified file 'tests/integration-tests/client/test_client_render.cpp'
--- tests/integration-tests/client/test_client_render.cpp 2013-07-11 16:54:41 +0000
+++ tests/integration-tests/client/test_client_render.cpp 2013-07-17 14:20:33 +0000
@@ -480,16 +480,16 @@
480480
481 geom::Size size;481 geom::Size size;
482 geom::PixelFormat pf;482 geom::PixelFormat pf;
483 mc::BufferID id1;483 mg::BufferID id1;
484 mc::BufferID id2;484 mg::BufferID id2;
485 std::shared_ptr<mtd::TestGrallocMapper> buffer_converter;485 std::shared_ptr<mtd::TestGrallocMapper> buffer_converter;
486 std::shared_ptr<mtf::Process> client_process;486 std::shared_ptr<mtf::Process> client_process;
487487
488 std::shared_ptr<MirNativeBuffer> handle;488 std::shared_ptr<MirNativeBuffer> handle;
489 std::shared_ptr<MirNativeBuffer> second_handle;489 std::shared_ptr<MirNativeBuffer> second_handle;
490490
491 std::shared_ptr<mc::Buffer> android_buffer;491 std::shared_ptr<mg::Buffer> android_buffer;
492 std::shared_ptr<mc::Buffer> second_android_buffer;492 std::shared_ptr<mg::Buffer> second_android_buffer;
493 std::shared_ptr<mga::AndroidGraphicBufferAllocator> allocator;493 std::shared_ptr<mga::AndroidGraphicBufferAllocator> allocator;
494494
495 static std::shared_ptr<mtf::Process> render_single_client_process;495 static std::shared_ptr<mtf::Process> render_single_client_process;
496496
=== modified file 'tests/integration-tests/compositor/test_buffer_stream.cpp'
--- tests/integration-tests/compositor/test_buffer_stream.cpp 2013-07-11 16:54:41 +0000
+++ tests/integration-tests/compositor/test_buffer_stream.cpp 2013-07-17 14:20:33 +0000
@@ -31,6 +31,7 @@
31#include <chrono>31#include <chrono>
3232
33namespace mc = mir::compositor;33namespace mc = mir::compositor;
34namespace mg = mir::graphics;
34namespace ms = mir::surfaces;35namespace ms = mir::surfaces;
35namespace mt = mir::testing;36namespace mt = mir::testing;
36namespace mtd = mir::test::doubles;37namespace mtd = mir::test::doubles;
@@ -43,7 +44,7 @@
43{44{
44 StubBufferAllocator() : id{1} {}45 StubBufferAllocator() : id{1} {}
4546
46 std::shared_ptr<mc::Buffer> alloc_buffer(mc::BufferProperties const&)47 std::shared_ptr<mg::Buffer> alloc_buffer(mc::BufferProperties const&)
47 {48 {
48 mc::BufferProperties properties{geom::Size{id, id},49 mc::BufferProperties properties{geom::Size{id, id},
49 geom::PixelFormat::abgr_8888,50 geom::PixelFormat::abgr_8888,
@@ -156,7 +157,7 @@
156namespace157namespace
157{158{
158159
159void client_request_loop(std::shared_ptr<mc::Buffer>& out_buffer,160void client_request_loop(std::shared_ptr<mg::Buffer>& out_buffer,
160 mt::SynchronizerSpawned& synchronizer,161 mt::SynchronizerSpawned& synchronizer,
161 ms::BufferStream& stream)162 ms::BufferStream& stream)
162{163{
@@ -210,7 +211,7 @@
210 std::vector<std::unique_ptr<CompositorInfo>> compositors;211 std::vector<std::unique_ptr<CompositorInfo>> compositors;
211212
212 mt::Synchronizer client_sync;213 mt::Synchronizer client_sync;
213 std::shared_ptr<mc::Buffer> client_buffer;214 std::shared_ptr<mg::Buffer> client_buffer;
214 auto client_thread = std::thread(client_request_loop, std::ref(client_buffer),215 auto client_thread = std::thread(client_request_loop, std::ref(client_buffer),
215 std::ref(client_sync), std::ref(buffer_stream));216 std::ref(client_sync), std::ref(buffer_stream));
216217
217218
=== modified file 'tests/integration-tests/compositor/test_stress_buffer_swapper.cpp'
--- tests/integration-tests/compositor/test_stress_buffer_swapper.cpp 2013-05-29 23:49:32 +0000
+++ tests/integration-tests/compositor/test_stress_buffer_swapper.cpp 2013-07-17 14:20:33 +0000
@@ -20,12 +20,13 @@
20#include "multithread_harness.h"20#include "multithread_harness.h"
2121
22#include "mir/compositor/buffer_swapper_multi.h"22#include "mir/compositor/buffer_swapper_multi.h"
23#include "mir/compositor/buffer_id.h"23#include "mir/graphics/buffer_id.h"
2424
25#include <thread>25#include <thread>
26#include <chrono>26#include <chrono>
2727
28namespace mc = mir::compositor;28namespace mc = mir::compositor;
29namespace mg = mir::graphics;
29namespace mt = mir::testing;30namespace mt = mir::testing;
30namespace geom = mir::geometry;31namespace geom = mir::geometry;
31namespace mtd = mir::test::doubles;32namespace mtd = mir::test::doubles;
@@ -60,15 +61,15 @@
6061
61 void test_distinct_buffers(mc::BufferSwapper& swapper);62 void test_distinct_buffers(mc::BufferSwapper& swapper);
62 void test_valid_buffers(mc::BufferSwapper& swapper);63 void test_valid_buffers(mc::BufferSwapper& swapper);
63 void test_wait_situation(std::vector<std::shared_ptr<mc::Buffer>>& compositor_output_buffers,64 void test_wait_situation(std::vector<std::shared_ptr<mg::Buffer>>& compositor_output_buffers,
64 std::vector<std::shared_ptr<mc::Buffer>>& client_output_buffers,65 std::vector<std::shared_ptr<mg::Buffer>>& client_output_buffers,
65 mc::BufferSwapper& swapper,66 mc::BufferSwapper& swapper,
66 unsigned int number_of_client_requests_to_make);67 unsigned int number_of_client_requests_to_make);
67 void test_last_posted(mc::BufferSwapper& swapper);68 void test_last_posted(mc::BufferSwapper& swapper);
6869
69 std::shared_ptr<mc::Buffer> buffer_a;70 std::shared_ptr<mg::Buffer> buffer_a;
70 std::shared_ptr<mc::Buffer> buffer_b;71 std::shared_ptr<mg::Buffer> buffer_b;
71 std::shared_ptr<mc::Buffer> buffer_c;72 std::shared_ptr<mg::Buffer> buffer_c;
72};73};
7374
74void main_test_loop_pause(std::chrono::microseconds duration)75void main_test_loop_pause(std::chrono::microseconds duration)
@@ -76,7 +77,7 @@
76 std::this_thread::sleep_for(duration);77 std::this_thread::sleep_for(duration);
77}78}
7879
79void client_request_loop(std::shared_ptr<mc::Buffer>& out_buffer, mt::SynchronizerSpawned& synchronizer,80void client_request_loop(std::shared_ptr<mg::Buffer>& out_buffer, mt::SynchronizerSpawned& synchronizer,
80 mc::BufferSwapper& swapper)81 mc::BufferSwapper& swapper)
81{82{
82 for(;;)83 for(;;)
@@ -92,7 +93,7 @@
92 }93 }
93}94}
9495
95void compositor_grab_loop(std::shared_ptr<mc::Buffer>& out_buffer, mt::SynchronizerSpawned& synchronizer,96void compositor_grab_loop(std::shared_ptr<mg::Buffer>& out_buffer, mt::SynchronizerSpawned& synchronizer,
96 mc::BufferSwapper& swapper)97 mc::BufferSwapper& swapper)
97{98{
98 for(;;)99 for(;;)
@@ -111,8 +112,8 @@
111 buffer */112 buffer */
112void BufferSwapperStress::test_distinct_buffers(mc::BufferSwapper& swapper)113void BufferSwapperStress::test_distinct_buffers(mc::BufferSwapper& swapper)
113{114{
114 std::shared_ptr<mc::Buffer> compositor_buffer;115 std::shared_ptr<mg::Buffer> compositor_buffer;
115 std::shared_ptr<mc::Buffer> client_buffer;116 std::shared_ptr<mg::Buffer> client_buffer;
116117
117 thread1 = std::thread(compositor_grab_loop, std::ref(compositor_buffer),118 thread1 = std::thread(compositor_grab_loop, std::ref(compositor_buffer),
118 std::ref(compositor_controller), std::ref(swapper));119 std::ref(compositor_controller), std::ref(swapper));
@@ -140,18 +141,18 @@
140141
141TEST_F(BufferSwapperStress, distinct_and_valid_double_buffers_in_client_and_compositor)142TEST_F(BufferSwapperStress, distinct_and_valid_double_buffers_in_client_and_compositor)
142{143{
143 auto double_list = std::vector<std::shared_ptr<mc::Buffer>>{buffer_a, buffer_b};144 auto double_list = std::vector<std::shared_ptr<mg::Buffer>>{buffer_a, buffer_b};
144 mc::BufferSwapperMulti double_swapper(double_list, double_list.size());145 mc::BufferSwapperMulti double_swapper(double_list, double_list.size());
145 test_distinct_buffers(double_swapper);146 test_distinct_buffers(double_swapper);
146}147}
147TEST_F(BufferSwapperStress, distinct_and_valid_triple_buffers_in_client_and_compositor)148TEST_F(BufferSwapperStress, distinct_and_valid_triple_buffers_in_client_and_compositor)
148{149{
149 auto triple_list = std::vector<std::shared_ptr<mc::Buffer>>{buffer_a, buffer_b, buffer_c};150 auto triple_list = std::vector<std::shared_ptr<mg::Buffer>>{buffer_a, buffer_b, buffer_c};
150 mc::BufferSwapperMulti triple_swapper(triple_list, triple_list.size());151 mc::BufferSwapperMulti triple_swapper(triple_list, triple_list.size());
151 test_distinct_buffers(triple_swapper);152 test_distinct_buffers(triple_swapper);
152}153}
153154
154void client_request_loop_finite(std::vector<std::shared_ptr<mc::Buffer>>& buffers,155void client_request_loop_finite(std::vector<std::shared_ptr<mg::Buffer>>& buffers,
155 mt::SynchronizerSpawned& synchronizer,156 mt::SynchronizerSpawned& synchronizer,
156 mc::BufferSwapper& swapper,157 mc::BufferSwapper& swapper,
157 int const number_of_requests_to_make)158 int const number_of_requests_to_make)
@@ -167,7 +168,7 @@
167 synchronizer.child_enter_wait();168 synchronizer.child_enter_wait();
168}169}
169170
170void compositor_grab(std::vector<std::shared_ptr<mc::Buffer>>& buffers,171void compositor_grab(std::vector<std::shared_ptr<mg::Buffer>>& buffers,
171 mt::SynchronizerSpawned& synchronizer,172 mt::SynchronizerSpawned& synchronizer,
172 mc::BufferSwapper& swapper)173 mc::BufferSwapper& swapper)
173{174{
@@ -180,8 +181,8 @@
180 synchronizer.child_enter_wait();181 synchronizer.child_enter_wait();
181}182}
182183
183void BufferSwapperStress::test_wait_situation(std::vector<std::shared_ptr<mc::Buffer>>& compositor_output_buffers,184void BufferSwapperStress::test_wait_situation(std::vector<std::shared_ptr<mg::Buffer>>& compositor_output_buffers,
184 std::vector<std::shared_ptr<mc::Buffer>>& client_output_buffers,185 std::vector<std::shared_ptr<mg::Buffer>>& client_output_buffers,
185 mc::BufferSwapper& swapper,186 mc::BufferSwapper& swapper,
186 unsigned int const number_of_client_requests_to_make)187 unsigned int const number_of_client_requests_to_make)
187{188{
@@ -209,10 +210,10 @@
209210
210TEST_F(BufferSwapperStress, double_test_wait_situation)211TEST_F(BufferSwapperStress, double_test_wait_situation)
211{212{
212 std::vector<std::shared_ptr<mc::Buffer>> client_buffers;213 std::vector<std::shared_ptr<mg::Buffer>> client_buffers;
213 std::vector<std::shared_ptr<mc::Buffer>> compositor_buffers;214 std::vector<std::shared_ptr<mg::Buffer>> compositor_buffers;
214 /* a double buffered client should stall on the second request without the compositor running */215 /* a double buffered client should stall on the second request without the compositor running */
215 auto double_list = std::vector<std::shared_ptr<mc::Buffer>>{buffer_a, buffer_b};216 auto double_list = std::vector<std::shared_ptr<mg::Buffer>>{buffer_a, buffer_b};
216 mc::BufferSwapperMulti double_swapper(double_list, double_list.size());217 mc::BufferSwapperMulti double_swapper(double_list, double_list.size());
217 test_wait_situation(compositor_buffers, client_buffers, double_swapper, 2);218 test_wait_situation(compositor_buffers, client_buffers, double_swapper, 2);
218219
@@ -221,9 +222,9 @@
221222
222TEST_F(BufferSwapperStress, triple_test_wait_situation)223TEST_F(BufferSwapperStress, triple_test_wait_situation)
223{224{
224 std::vector<std::shared_ptr<mc::Buffer>> client_buffers;225 std::vector<std::shared_ptr<mg::Buffer>> client_buffers;
225 std::vector<std::shared_ptr<mc::Buffer>> compositor_buffers;226 std::vector<std::shared_ptr<mg::Buffer>> compositor_buffers;
226 auto triple_list = std::vector<std::shared_ptr<mc::Buffer>>{buffer_a, buffer_b, buffer_c};227 auto triple_list = std::vector<std::shared_ptr<mg::Buffer>>{buffer_a, buffer_b, buffer_c};
227 mc::BufferSwapperMulti triple_swapper(triple_list, triple_list.size());228 mc::BufferSwapperMulti triple_swapper(triple_list, triple_list.size());
228 /* a triple buffered client should stall on the third request without the compositor running */229 /* a triple buffered client should stall on the third request without the compositor running */
229 test_wait_situation(compositor_buffers, client_buffers, triple_swapper, 3);230 test_wait_situation(compositor_buffers, client_buffers, triple_swapper, 3);
@@ -231,7 +232,7 @@
231 EXPECT_EQ(client_buffers.at(0), compositor_buffers.at(0));232 EXPECT_EQ(client_buffers.at(0), compositor_buffers.at(0));
232}233}
233234
234void client_request_loop_with_wait(std::shared_ptr<mc::Buffer>& out_buffer, mt::SynchronizerSpawned& synchronizer,235void client_request_loop_with_wait(std::shared_ptr<mg::Buffer>& out_buffer, mt::SynchronizerSpawned& synchronizer,
235 mc::BufferSwapper& swapper)236 mc::BufferSwapper& swapper)
236{237{
237 bool wait_request = false;238 bool wait_request = false;
@@ -249,10 +250,10 @@
249 }250 }
250}251}
251252
252void compositor_grab_loop_with_wait(std::shared_ptr<mc::Buffer>& out_buffer, mt::SynchronizerSpawned& synchronizer,253void compositor_grab_loop_with_wait(std::shared_ptr<mg::Buffer>& out_buffer, mt::SynchronizerSpawned& synchronizer,
253 mc::BufferSwapper& swapper)254 mc::BufferSwapper& swapper)
254{255{
255 std::shared_ptr<mc::Buffer> buffer_ref;256 std::shared_ptr<mg::Buffer> buffer_ref;
256 bool wait_request = false;257 bool wait_request = false;
257 for(;;)258 for(;;)
258 {259 {
@@ -274,8 +275,8 @@
274275
275void BufferSwapperStress::test_last_posted(mc::BufferSwapper& swapper)276void BufferSwapperStress::test_last_posted(mc::BufferSwapper& swapper)
276{277{
277 std::shared_ptr<mc::Buffer> compositor_buffer;278 std::shared_ptr<mg::Buffer> compositor_buffer;
278 std::shared_ptr<mc::Buffer> client_buffer;279 std::shared_ptr<mg::Buffer> client_buffer;
279280
280 thread1 = std::thread(compositor_grab_loop_with_wait, std::ref(compositor_buffer), std::ref(compositor_controller), std::ref(swapper));281 thread1 = std::thread(compositor_grab_loop_with_wait, std::ref(compositor_buffer), std::ref(compositor_controller), std::ref(swapper));
281 thread2 = std::thread(client_request_loop_with_wait, std::ref(client_buffer), std::ref(client_controller), std::ref(swapper));282 thread2 = std::thread(client_request_loop_with_wait, std::ref(client_buffer), std::ref(client_controller), std::ref(swapper));
@@ -301,7 +302,7 @@
301302
302TEST_F(BufferSwapperStress, double_test_last_posted)303TEST_F(BufferSwapperStress, double_test_last_posted)
303{304{
304 auto double_list = std::vector<std::shared_ptr<mc::Buffer>>{buffer_a, buffer_b};305 auto double_list = std::vector<std::shared_ptr<mg::Buffer>>{buffer_a, buffer_b};
305 mc::BufferSwapperMulti double_swapper(double_list, double_list.size());306 mc::BufferSwapperMulti double_swapper(double_list, double_list.size());
306 test_last_posted(double_swapper);307 test_last_posted(double_swapper);
307}308}
308309
=== modified file 'tests/integration-tests/compositor/test_swapping_swappers.cpp'
--- tests/integration-tests/compositor/test_swapping_swappers.cpp 2013-07-11 16:54:41 +0000
+++ tests/integration-tests/compositor/test_swapping_swappers.cpp 2013-07-17 14:20:33 +0000
@@ -32,6 +32,7 @@
32#include <chrono>32#include <chrono>
3333
34namespace mc = mir::compositor;34namespace mc = mir::compositor;
35namespace mg = mir::graphics;
35namespace mt = mir::testing;36namespace mt = mir::testing;
36namespace geom = mir::geometry;37namespace geom = mir::geometry;
37namespace mtd = mir::test::doubles;38namespace mtd = mir::test::doubles;
@@ -49,7 +50,7 @@
49 }50 }
50 ~MockBufferAllocator() noexcept{}51 ~MockBufferAllocator() noexcept{}
5152
52 MOCK_METHOD1(alloc_buffer, std::shared_ptr<mc::Buffer>(mc::BufferProperties const&));53 MOCK_METHOD1(alloc_buffer, std::shared_ptr<mg::Buffer>(mc::BufferProperties const&));
53 MOCK_METHOD0(supported_pixel_formats, std::vector<geom::PixelFormat>());54 MOCK_METHOD0(supported_pixel_formats, std::vector<geom::PixelFormat>());
54};55};
5556
5657
=== modified file 'tests/integration-tests/graphics/gbm/test_buffer_integration.cpp'
--- tests/integration-tests/graphics/gbm/test_buffer_integration.cpp 2013-07-11 16:54:41 +0000
+++ tests/integration-tests/graphics/gbm/test_buffer_integration.cpp 2013-07-17 14:20:33 +0000
@@ -20,7 +20,7 @@
20#include "src/server/graphics/gbm/gbm_display.h"20#include "src/server/graphics/gbm/gbm_display.h"
21#include "src/server/graphics/gbm/gbm_buffer_allocator.h"21#include "src/server/graphics/gbm/gbm_buffer_allocator.h"
22#include "mir/compositor/buffer_basic.h"22#include "mir/compositor/buffer_basic.h"
23#include "mir/compositor/buffer_id.h"23#include "mir/graphics/buffer_id.h"
24#include "mir/compositor/buffer_properties.h"24#include "mir/compositor/buffer_properties.h"
25#include "mir/graphics/buffer_initializer.h"25#include "mir/graphics/buffer_initializer.h"
26#include "mir_test_doubles/stub_buffer.h"26#include "mir_test_doubles/stub_buffer.h"
@@ -72,9 +72,9 @@
72class StubGraphicBufferAllocator : public mc::GraphicBufferAllocator72class StubGraphicBufferAllocator : public mc::GraphicBufferAllocator
73{73{
74 public:74 public:
75 std::shared_ptr<mc::Buffer> alloc_buffer(mc::BufferProperties const&)75 std::shared_ptr<mg::Buffer> alloc_buffer(mc::BufferProperties const&)
76 {76 {
77 return std::shared_ptr<mc::Buffer>(new StubBufferThread());77 return std::shared_ptr<mg::Buffer>(new StubBufferThread());
78 }78 }
7979
80 std::vector<geom::PixelFormat> supported_pixel_formats()80 std::vector<geom::PixelFormat> supported_pixel_formats()
@@ -139,13 +139,13 @@
139 }139 }
140140
141 std::shared_ptr<mc::GraphicBufferAllocator> allocator;141 std::shared_ptr<mc::GraphicBufferAllocator> allocator;
142 std::shared_ptr<mc::Buffer> buffer;142 std::shared_ptr<mg::Buffer> buffer;
143 mc::BufferProperties buffer_properties;143 mc::BufferProperties buffer_properties;
144};144};
145145
146struct BufferDestructorThread146struct BufferDestructorThread
147{147{
148 BufferDestructorThread(std::shared_ptr<mc::Buffer> buffer)148 BufferDestructorThread(std::shared_ptr<mg::Buffer> buffer)
149 : buffer{std::move(buffer)}149 : buffer{std::move(buffer)}
150 {150 {
151 }151 }
@@ -157,12 +157,12 @@
157 ASSERT_EQ(EGL_SUCCESS, eglGetError());157 ASSERT_EQ(EGL_SUCCESS, eglGetError());
158 }158 }
159159
160 std::shared_ptr<mc::Buffer> buffer;160 std::shared_ptr<mg::Buffer> buffer;
161};161};
162162
163struct BufferTextureInstantiatorThread163struct BufferTextureInstantiatorThread
164{164{
165 BufferTextureInstantiatorThread(const std::shared_ptr<mc::Buffer>& buffer)165 BufferTextureInstantiatorThread(const std::shared_ptr<mg::Buffer>& buffer)
166 : buffer(buffer), exception_thrown(false)166 : buffer(buffer), exception_thrown(false)
167 {167 {
168 }168 }
@@ -183,7 +183,7 @@
183 ASSERT_NE(EGL_SUCCESS, eglGetError());183 ASSERT_NE(EGL_SUCCESS, eglGetError());
184 }184 }
185185
186 const std::shared_ptr<mc::Buffer>& buffer;186 const std::shared_ptr<mg::Buffer>& buffer;
187 bool exception_thrown;187 bool exception_thrown;
188};188};
189189
190190
=== modified file 'tests/integration-tests/shell/test_session.cpp'
--- tests/integration-tests/shell/test_session.cpp 2013-07-12 20:18:19 +0000
+++ tests/integration-tests/shell/test_session.cpp 2013-07-17 14:20:33 +0000
@@ -21,7 +21,7 @@
21#include "mir/compositor/graphic_buffer_allocator.h"21#include "mir/compositor/graphic_buffer_allocator.h"
22#include "mir/compositor/compositor.h"22#include "mir/compositor/compositor.h"
23#include "mir/shell/application_session.h"23#include "mir/shell/application_session.h"
24#include "mir/shell/pixel_buffer.h"24#include "mir/graphics/pixel_buffer.h"
25#include "mir/shell/placement_strategy.h"25#include "mir/shell/placement_strategy.h"
26#include "mir/shell/surface.h"26#include "mir/shell/surface.h"
27#include "mir/shell/surface_creation_parameters.h"27#include "mir/shell/surface_creation_parameters.h"
@@ -73,7 +73,7 @@
73 {73 {
74 struct StubBufferAllocator : public mc::GraphicBufferAllocator74 struct StubBufferAllocator : public mc::GraphicBufferAllocator
75 {75 {
76 std::shared_ptr<mc::Buffer> alloc_buffer(mc::BufferProperties const& buffer_properties)76 std::shared_ptr<mg::Buffer> alloc_buffer(mc::BufferProperties const& buffer_properties)
77 {77 {
78 return std::make_shared<mtd::StubBuffer>(buffer_properties);78 return std::make_shared<mtd::StubBuffer>(buffer_properties);
79 }79 }
@@ -106,11 +106,11 @@
106 }106 }
107107
108108
109 std::shared_ptr<msh::PixelBuffer> the_shell_pixel_buffer() override109 std::shared_ptr<mg::PixelBuffer> the_shell_pixel_buffer() override
110 {110 {
111 struct StubPixelBuffer : public msh::PixelBuffer111 struct StubPixelBuffer : public mg::PixelBuffer
112 {112 {
113 void fill_from(mc::Buffer&) {}113 void fill_from(mg::Buffer&) {}
114 void const* as_argb_8888() { return nullptr; }114 void const* as_argb_8888() { return nullptr; }
115 geom::Size size() const { return geom::Size(); }115 geom::Size size() const { return geom::Size(); }
116 geom::Stride stride() const { return geom::Stride(); }116 geom::Stride stride() const { return geom::Stride(); }
117117
=== modified file 'tests/integration-tests/test_display_info.cpp'
--- tests/integration-tests/test_display_info.cpp 2013-07-11 16:54:41 +0000
+++ tests/integration-tests/test_display_info.cpp 2013-07-17 14:20:33 +0000
@@ -17,7 +17,7 @@
17 */17 */
1818
19#include "mir/graphics/display.h"19#include "mir/graphics/display.h"
20#include "mir/compositor/buffer.h"20#include "mir/graphics/buffer.h"
21#include "mir/compositor/graphic_buffer_allocator.h"21#include "mir/compositor/graphic_buffer_allocator.h"
2222
23#include "mir_test_framework/display_server_test_fixture.h"23#include "mir_test_framework/display_server_test_fixture.h"
@@ -65,9 +65,9 @@
65class StubGraphicBufferAllocator : public mc::GraphicBufferAllocator65class StubGraphicBufferAllocator : public mc::GraphicBufferAllocator
66{66{
67public:67public:
68 std::shared_ptr<mc::Buffer> alloc_buffer(mc::BufferProperties const&)68 std::shared_ptr<mg::Buffer> alloc_buffer(mc::BufferProperties const&)
69 {69 {
70 return std::shared_ptr<mc::Buffer>(new mtd::StubBuffer());70 return std::shared_ptr<mg::Buffer>(new mtd::StubBuffer());
71 }71 }
7272
73 std::vector<geom::PixelFormat> supported_pixel_formats()73 std::vector<geom::PixelFormat> supported_pixel_formats()
7474
=== modified file 'tests/integration-tests/test_drm_auth_magic.cpp'
--- tests/integration-tests/test_drm_auth_magic.cpp 2013-06-20 08:27:10 +0000
+++ tests/integration-tests/test_drm_auth_magic.cpp 2013-07-17 14:20:33 +0000
@@ -48,9 +48,9 @@
48class StubGraphicBufferAllocator : public mc::GraphicBufferAllocator48class StubGraphicBufferAllocator : public mc::GraphicBufferAllocator
49{49{
50 public:50 public:
51 std::shared_ptr<mc::Buffer> alloc_buffer(mc::BufferProperties const&)51 std::shared_ptr<mg::Buffer> alloc_buffer(mc::BufferProperties const&)
52 {52 {
53 return std::shared_ptr<mc::Buffer>(new mtd::StubBuffer());53 return std::shared_ptr<mg::Buffer>(new mtd::StubBuffer());
54 }54 }
5555
56 std::vector<geom::PixelFormat> supported_pixel_formats()56 std::vector<geom::PixelFormat> supported_pixel_formats()
5757
=== modified file 'tests/integration-tests/test_surfaceloop.cpp'
--- tests/integration-tests/test_surfaceloop.cpp 2013-07-11 16:54:41 +0000
+++ tests/integration-tests/test_surfaceloop.cpp 2013-07-17 14:20:33 +0000
@@ -21,7 +21,7 @@
21#include "src/server/compositor/switching_bundle.h"21#include "src/server/compositor/switching_bundle.h"
22#include "mir/compositor/buffer_swapper_multi.h"22#include "mir/compositor/buffer_swapper_multi.h"
23#include "mir/compositor/buffer_properties.h"23#include "mir/compositor/buffer_properties.h"
24#include "mir/compositor/buffer_id.h"24#include "mir/graphics/buffer_id.h"
25#include "mir/compositor/buffer_basic.h"25#include "mir/compositor/buffer_basic.h"
26#include "mir/graphics/display.h"26#include "mir/graphics/display.h"
2727
@@ -68,7 +68,7 @@
6868
69 MOCK_METHOD1(69 MOCK_METHOD1(
70 alloc_buffer,70 alloc_buffer,
71 std::shared_ptr<mc::Buffer> (mc::BufferProperties const&));71 std::shared_ptr<mg::Buffer> (mc::BufferProperties const&));
7272
7373
74 std::vector<geom::PixelFormat> supported_pixel_formats()74 std::vector<geom::PixelFormat> supported_pixel_formats()
@@ -76,9 +76,9 @@
76 return std::vector<geom::PixelFormat>();76 return std::vector<geom::PixelFormat>();
77 }77 }
7878
79 std::unique_ptr<mc::Buffer> on_create_swapper(mc::BufferProperties const&)79 std::unique_ptr<mg::Buffer> on_create_swapper(mc::BufferProperties const&)
80 {80 {
81 return std::unique_ptr<mc::Buffer>(new mtd::StubBuffer(::buffer_properties));81 return std::unique_ptr<mg::Buffer>(new mtd::StubBuffer(::buffer_properties));
82 }82 }
8383
84 ~MockGraphicBufferAllocator() noexcept {}84 ~MockGraphicBufferAllocator() noexcept {}
@@ -235,7 +235,7 @@
235 actual = requested;235 actual = requested;
236 auto stub_buffer_a = std::make_shared<mtd::StubBuffer>(::buffer_properties);236 auto stub_buffer_a = std::make_shared<mtd::StubBuffer>(::buffer_properties);
237 auto stub_buffer_b = std::make_shared<mtd::StubBuffer>(::buffer_properties);237 auto stub_buffer_b = std::make_shared<mtd::StubBuffer>(::buffer_properties);
238 std::vector<std::shared_ptr<mc::Buffer>> list = {stub_buffer_a, stub_buffer_b};238 std::vector<std::shared_ptr<mg::Buffer>> list = {stub_buffer_a, stub_buffer_b};
239 return std::make_shared<mc::BufferSwapperMulti>(list, list.size());239 return std::make_shared<mc::BufferSwapperMulti>(list, list.size());
240 }240 }
241241
@@ -416,10 +416,10 @@
416 class StubGraphicBufferAllocator : public mc::GraphicBufferAllocator416 class StubGraphicBufferAllocator : public mc::GraphicBufferAllocator
417 {417 {
418 public:418 public:
419 virtual std::shared_ptr<mc::Buffer> alloc_buffer(419 virtual std::shared_ptr<mg::Buffer> alloc_buffer(
420 mc::BufferProperties const&)420 mc::BufferProperties const&)
421 {421 {
422 return std::unique_ptr<mc::Buffer>(new CountingStubBuffer());422 return std::unique_ptr<mg::Buffer>(new CountingStubBuffer());
423 }423 }
424424
425 std::vector<geom::PixelFormat> supported_pixel_formats()425 std::vector<geom::PixelFormat> supported_pixel_formats()
426426
=== modified file 'tests/integration-tests/test_swapinterval.cpp'
--- tests/integration-tests/test_swapinterval.cpp 2013-07-09 21:59:01 +0000
+++ tests/integration-tests/test_swapinterval.cpp 2013-07-17 14:20:33 +0000
@@ -56,8 +56,8 @@
56 {56 {
57 }57 }
5858
59 std::shared_ptr<mc::Buffer> secure_client_buffer() { return std::make_shared<mtd::StubBuffer>(); }59 std::shared_ptr<mg::Buffer> secure_client_buffer() { return std::make_shared<mtd::StubBuffer>(); }
60 std::shared_ptr<mc::Buffer> lock_back_buffer() { return std::make_shared<mtd::StubBuffer>(); }60 std::shared_ptr<mg::Buffer> lock_back_buffer() { return std::make_shared<mtd::StubBuffer>(); }
61 geom::PixelFormat get_stream_pixel_format() { return geom::PixelFormat::abgr_8888; }61 geom::PixelFormat get_stream_pixel_format() { return geom::PixelFormat::abgr_8888; }
62 geom::Size stream_size() { return geom::Size{}; }62 geom::Size stream_size() { return geom::Size{}; }
63 void force_requests_to_complete() {}63 void force_requests_to_complete() {}
6464
=== modified file 'tests/mir_test_framework/testing_server_options.cpp'
--- tests/mir_test_framework/testing_server_options.cpp 2013-07-12 21:48:58 +0000
+++ tests/mir_test_framework/testing_server_options.cpp 2013-07-17 14:20:33 +0000
@@ -54,9 +54,9 @@
54class StubGraphicBufferAllocator : public mc::GraphicBufferAllocator54class StubGraphicBufferAllocator : public mc::GraphicBufferAllocator
55{55{
56 public:56 public:
57 std::shared_ptr<mc::Buffer> alloc_buffer(mc::BufferProperties const& properties)57 std::shared_ptr<mg::Buffer> alloc_buffer(mc::BufferProperties const& properties)
58 {58 {
59 return std::unique_ptr<mc::Buffer>(new mtd::StubBuffer(properties));59 return std::unique_ptr<mg::Buffer>(new mtd::StubBuffer(properties));
60 }60 }
6161
62 std::vector<geom::PixelFormat> supported_pixel_formats()62 std::vector<geom::PixelFormat> supported_pixel_formats()
6363
=== modified file 'tests/unit-tests/compositor/test_buffer_id.cpp'
--- tests/unit-tests/compositor/test_buffer_id.cpp 2013-04-24 05:22:20 +0000
+++ tests/unit-tests/compositor/test_buffer_id.cpp 2013-07-17 14:20:33 +0000
@@ -16,18 +16,19 @@
16 * Authored by: Kevin DuBois <kevin.dubois@canonical.com>16 * Authored by: Kevin DuBois <kevin.dubois@canonical.com>
17 */17 */
1818
19#include "mir/compositor/buffer_id.h"19#include "mir/graphics/buffer_id.h"
20#include "mir_test_doubles/stub_buffer.h"20#include "mir_test_doubles/stub_buffer.h"
2121
22#include <gmock/gmock.h>22#include <gmock/gmock.h>
23#include <gtest/gtest.h>23#include <gtest/gtest.h>
2424
25namespace mc=mir::compositor;25namespace mc=mir::compositor;
26namespace mg = mir::graphics;
2627
27TEST(buffer_id, value_set )28TEST(buffer_id, value_set )
28{29{
29 unsigned int id_as_int = 44;30 unsigned int id_as_int = 44;
30 mc::BufferID id{id_as_int};31 mg::BufferID id{id_as_int};
31 EXPECT_EQ(id_as_int, id.as_uint32_t());32 EXPECT_EQ(id_as_int, id.as_uint32_t());
32}33}
3334
@@ -36,8 +37,8 @@
36 unsigned int id_as_int0 = 44;37 unsigned int id_as_int0 = 44;
37 unsigned int id_as_int1 = 41;38 unsigned int id_as_int1 = 41;
3839
39 mc::BufferID id0{id_as_int0};40 mg::BufferID id0{id_as_int0};
40 mc::BufferID id1{id_as_int1};41 mg::BufferID id1{id_as_int1};
4142
42 EXPECT_EQ(id0, id0);43 EXPECT_EQ(id0, id0);
43 EXPECT_EQ(id1, id1);44 EXPECT_EQ(id1, id1);
@@ -50,8 +51,8 @@
50 unsigned int id_as_int0 = 44;51 unsigned int id_as_int0 = 44;
51 unsigned int id_as_int1 = 41;52 unsigned int id_as_int1 = 41;
5253
53 mc::BufferID id0{id_as_int0};54 mg::BufferID id0{id_as_int0};
54 mc::BufferID id1{id_as_int1};55 mg::BufferID id1{id_as_int1};
5556
56 EXPECT_LT(id1, id0);57 EXPECT_LT(id1, id0);
57}58}
@@ -60,14 +61,14 @@
60{61{
61 using mir::test::doubles::StubBuffer;62 using mir::test::doubles::StubBuffer;
62 int const ids = 542;63 int const ids = 542;
63 std::vector<mc::BufferID> generated_ids;64 std::vector<mg::BufferID> generated_ids;
6465
65 for (auto i=0; i < ids; i++)66 for (auto i=0; i < ids; i++)
66 generated_ids.push_back(StubBuffer().id());67 generated_ids.push_back(StubBuffer().id());
6768
68 while (!generated_ids.empty())69 while (!generated_ids.empty())
69 {70 {
70 mc::BufferID test_id = generated_ids.back();71 mg::BufferID test_id = generated_ids.back();
7172
72 generated_ids.pop_back();73 generated_ids.pop_back();
7374
7475
=== modified file 'tests/unit-tests/compositor/test_buffer_swapper.cpp'
--- tests/unit-tests/compositor/test_buffer_swapper.cpp 2013-06-12 16:15:05 +0000
+++ tests/unit-tests/compositor/test_buffer_swapper.cpp 2013-07-17 14:20:33 +0000
@@ -22,6 +22,7 @@
22#include <gtest/gtest.h>22#include <gtest/gtest.h>
2323
24namespace mc = mir::compositor;24namespace mc = mir::compositor;
25namespace mg = mir::graphics;
25namespace geom = mir::geometry;26namespace geom = mir::geometry;
26namespace mtd = mir::test::doubles;27namespace mtd = mir::test::doubles;
2728
@@ -34,14 +35,14 @@
34 buffer_c = std::make_shared<mtd::StubBuffer>();35 buffer_c = std::make_shared<mtd::StubBuffer>();
35 }36 }
3637
37 std::shared_ptr<mc::Buffer> buffer_a;38 std::shared_ptr<mg::Buffer> buffer_a;
38 std::shared_ptr<mc::Buffer> buffer_b;39 std::shared_ptr<mg::Buffer> buffer_b;
39 std::shared_ptr<mc::Buffer> buffer_c;40 std::shared_ptr<mg::Buffer> buffer_c;
40};41};
4142
42TEST_F(BufferSwapperConstruction, basic_double_construction_vector)43TEST_F(BufferSwapperConstruction, basic_double_construction_vector)
43{44{
44 std::vector<std::shared_ptr<mc::Buffer>> buffers{buffer_a, buffer_b, buffer_c};45 std::vector<std::shared_ptr<mg::Buffer>> buffers{buffer_a, buffer_b, buffer_c};
4546
46 auto use_count_before_a = buffer_a.use_count();47 auto use_count_before_a = buffer_a.use_count();
47 auto use_count_before_b = buffer_b.use_count();48 auto use_count_before_b = buffer_b.use_count();
@@ -56,7 +57,7 @@
5657
57TEST_F(BufferSwapperConstruction, basic_double_construction_initializer)58TEST_F(BufferSwapperConstruction, basic_double_construction_initializer)
58{59{
59 std::vector<std::shared_ptr<mc::Buffer>> buffers{buffer_a, buffer_b};60 std::vector<std::shared_ptr<mg::Buffer>> buffers{buffer_a, buffer_b};
6061
61 auto use_count_before_a = buffer_a.use_count();62 auto use_count_before_a = buffer_a.use_count();
62 auto use_count_before_b = buffer_b.use_count();63 auto use_count_before_b = buffer_b.use_count();
@@ -72,7 +73,7 @@
7273
73TEST_F(BufferSwapperConstruction, basic_triple_construction_initializer)74TEST_F(BufferSwapperConstruction, basic_triple_construction_initializer)
74{75{
75 std::vector<std::shared_ptr<mc::Buffer>> buffers{buffer_a, buffer_b, buffer_c};76 std::vector<std::shared_ptr<mg::Buffer>> buffers{buffer_a, buffer_b, buffer_c};
76 auto use_count_before_a = buffer_a.use_count();77 auto use_count_before_a = buffer_a.use_count();
77 auto use_count_before_b = buffer_b.use_count();78 auto use_count_before_b = buffer_b.use_count();
78 auto use_count_before_c = buffer_c.use_count();79 auto use_count_before_c = buffer_c.use_count();
@@ -88,7 +89,7 @@
8889
89TEST_F(BufferSwapperConstruction, buffers_out_come_from_init_double)90TEST_F(BufferSwapperConstruction, buffers_out_come_from_init_double)
90{91{
91 std::vector<std::shared_ptr<mc::Buffer>> buffers{buffer_a, buffer_b};92 std::vector<std::shared_ptr<mg::Buffer>> buffers{buffer_a, buffer_b};
92 mc::BufferSwapperMulti swapper(buffers, buffers.size());93 mc::BufferSwapperMulti swapper(buffers, buffers.size());
9394
94 auto buffer_1 = swapper.compositor_acquire();95 auto buffer_1 = swapper.compositor_acquire();
@@ -101,7 +102,7 @@
101102
102TEST_F(BufferSwapperConstruction, buffers_out_come_from_init_triple)103TEST_F(BufferSwapperConstruction, buffers_out_come_from_init_triple)
103{104{
104 std::vector<std::shared_ptr<mc::Buffer>> buffers{buffer_a, buffer_b, buffer_c};105 std::vector<std::shared_ptr<mg::Buffer>> buffers{buffer_a, buffer_b, buffer_c};
105 mc::BufferSwapperMulti swapper(buffers, buffers.size());106 mc::BufferSwapperMulti swapper(buffers, buffers.size());
106107
107 auto buffer_1 = swapper.compositor_acquire();108 auto buffer_1 = swapper.compositor_acquire();
@@ -118,11 +119,11 @@
118119
119TEST_F(BufferSwapperConstruction, buffer_transfer_triple_all_owned)120TEST_F(BufferSwapperConstruction, buffer_transfer_triple_all_owned)
120{121{
121 std::vector<std::shared_ptr<mc::Buffer>> buffers{buffer_a, buffer_b, buffer_c};122 std::vector<std::shared_ptr<mg::Buffer>> buffers{buffer_a, buffer_b, buffer_c};
122 mc::BufferSwapperMulti swapper(buffers, buffers.size());123 mc::BufferSwapperMulti swapper(buffers, buffers.size());
123124
124 size_t test_size;125 size_t test_size;
125 std::vector<std::shared_ptr<mc::Buffer>> list;126 std::vector<std::shared_ptr<mg::Buffer>> list;
126 swapper.end_responsibility(list, test_size);127 swapper.end_responsibility(list, test_size);
127128
128 auto res1 = std::find(list.begin(), list.end(), buffer_a);129 auto res1 = std::find(list.begin(), list.end(), buffer_a);
@@ -138,13 +139,13 @@
138139
139TEST_F(BufferSwapperConstruction, buffer_transfer_triple_some_not_owned)140TEST_F(BufferSwapperConstruction, buffer_transfer_triple_some_not_owned)
140{141{
141 std::vector<std::shared_ptr<mc::Buffer>> buffers{buffer_a, buffer_b, buffer_c};142 std::vector<std::shared_ptr<mg::Buffer>> buffers{buffer_a, buffer_b, buffer_c};
142 mc::BufferSwapperMulti swapper(buffers, buffers.size());143 mc::BufferSwapperMulti swapper(buffers, buffers.size());
143144
144 auto acquired_buffer = swapper.client_acquire();145 auto acquired_buffer = swapper.client_acquire();
145146
146 size_t test_size;147 size_t test_size;
147 std::vector<std::shared_ptr<mc::Buffer>> list;148 std::vector<std::shared_ptr<mg::Buffer>> list;
148 swapper.end_responsibility(list, test_size);149 swapper.end_responsibility(list, test_size);
149150
150 auto res1 = std::find(list.begin(), list.end(), acquired_buffer);151 auto res1 = std::find(list.begin(), list.end(), acquired_buffer);
151152
=== modified file 'tests/unit-tests/compositor/test_buffer_swapper_double.cpp'
--- tests/unit-tests/compositor/test_buffer_swapper_double.cpp 2013-06-15 11:09:16 +0000
+++ tests/unit-tests/compositor/test_buffer_swapper_double.cpp 2013-07-17 14:20:33 +0000
@@ -20,7 +20,7 @@
20#include "mir_test_doubles/stub_buffer.h"20#include "mir_test_doubles/stub_buffer.h"
2121
22#include "mir/compositor/buffer_swapper_multi.h"22#include "mir/compositor/buffer_swapper_multi.h"
23#include "mir/compositor/buffer_id.h"23#include "mir/graphics/buffer_id.h"
2424
25#include <gmock/gmock.h>25#include <gmock/gmock.h>
26#include <gtest/gtest.h>26#include <gtest/gtest.h>
@@ -29,6 +29,7 @@
29#include <thread>29#include <thread>
3030
31namespace mc = mir::compositor;31namespace mc = mir::compositor;
32namespace mg = mir::graphics;
32namespace geom = mir::geometry;33namespace geom = mir::geometry;
33namespace mtd = mir::test::doubles;34namespace mtd = mir::test::doubles;
3435
@@ -41,13 +42,13 @@
41 buffer_a = std::make_shared<mtd::StubBuffer>();42 buffer_a = std::make_shared<mtd::StubBuffer>();
42 buffer_b = std::make_shared<mtd::StubBuffer>();43 buffer_b = std::make_shared<mtd::StubBuffer>();
4344
44 auto double_list = std::vector<std::shared_ptr<mc::Buffer>>{buffer_a, buffer_b};45 auto double_list = std::vector<std::shared_ptr<mg::Buffer>>{buffer_a, buffer_b};
45 swapper = std::make_shared<mc::BufferSwapperMulti>(double_list, double_list.size());46 swapper = std::make_shared<mc::BufferSwapperMulti>(double_list, double_list.size());
4647
47 }48 }
4849
49 std::shared_ptr<mc::Buffer> buffer_a;50 std::shared_ptr<mg::Buffer> buffer_a;
50 std::shared_ptr<mc::Buffer> buffer_b;51 std::shared_ptr<mg::Buffer> buffer_b;
5152
52 std::shared_ptr<mc::BufferSwapper> swapper;53 std::shared_ptr<mc::BufferSwapper> swapper;
53};54};
5455
=== modified file 'tests/unit-tests/compositor/test_buffer_swapper_spin_triple.cpp'
--- tests/unit-tests/compositor/test_buffer_swapper_spin_triple.cpp 2013-05-29 23:55:41 +0000
+++ tests/unit-tests/compositor/test_buffer_swapper_spin_triple.cpp 2013-07-17 14:20:33 +0000
@@ -26,6 +26,7 @@
26#include <algorithm>26#include <algorithm>
2727
28namespace mc = mir::compositor;28namespace mc = mir::compositor;
29namespace mg = mir::graphics;
29namespace mtd = mir::test::doubles;30namespace mtd = mir::test::doubles;
3031
31namespace32namespace
@@ -38,13 +39,13 @@
38 buffer_b{std::make_shared<mtd::StubBuffer>()},39 buffer_b{std::make_shared<mtd::StubBuffer>()},
39 buffer_c{std::make_shared<mtd::StubBuffer>()}40 buffer_c{std::make_shared<mtd::StubBuffer>()}
40 {41 {
41 auto list = std::vector<std::shared_ptr<mc::Buffer>>{buffer_a, buffer_b, buffer_c};42 auto list = std::vector<std::shared_ptr<mg::Buffer>>{buffer_a, buffer_b, buffer_c};
42 swapper = std::make_shared<mc::BufferSwapperSpin>(list, list.size());43 swapper = std::make_shared<mc::BufferSwapperSpin>(list, list.size());
43 }44 }
4445
45 std::shared_ptr<mc::Buffer> const buffer_a;46 std::shared_ptr<mg::Buffer> const buffer_a;
46 std::shared_ptr<mc::Buffer> const buffer_b;47 std::shared_ptr<mg::Buffer> const buffer_b;
47 std::shared_ptr<mc::Buffer> const buffer_c;48 std::shared_ptr<mg::Buffer> const buffer_c;
4849
49 std::shared_ptr<mc::BufferSwapper> swapper;50 std::shared_ptr<mc::BufferSwapper> swapper;
50};51};
@@ -53,7 +54,7 @@
5354
54TEST_F(BufferSwapperSpinTriple, client_can_always_get_new_buffer)55TEST_F(BufferSwapperSpinTriple, client_can_always_get_new_buffer)
55{56{
56 std::vector<std::shared_ptr<mc::Buffer>> expected_buffers;57 std::vector<std::shared_ptr<mg::Buffer>> expected_buffers;
5758
58 for (unsigned int i = 0; i < 10; i++)59 for (unsigned int i = 0; i < 10; i++)
59 {60 {
@@ -81,7 +82,7 @@
8182
82TEST_F(BufferSwapperSpinTriple, client_can_always_get_new_buffer_while_compositor_has_one)83TEST_F(BufferSwapperSpinTriple, client_can_always_get_new_buffer_while_compositor_has_one)
83{84{
84 std::vector<std::shared_ptr<mc::Buffer>> expected_buffers;85 std::vector<std::shared_ptr<mg::Buffer>> expected_buffers;
8586
86 auto comp_buf = swapper->compositor_acquire();87 auto comp_buf = swapper->compositor_acquire();
8788
@@ -165,7 +166,7 @@
165 swapper->compositor_release(comp_buf);166 swapper->compositor_release(comp_buf);
166167
167 /* After the release, the compositor's buffer should be available to the client */168 /* After the release, the compositor's buffer should be available to the client */
168 std::vector<std::shared_ptr<mc::Buffer>> client_buffers;169 std::vector<std::shared_ptr<mg::Buffer>> client_buffers;
169170
170 for (auto i = 0; i < 3; i++)171 for (auto i = 0; i < 3; i++)
171 {172 {
@@ -182,7 +183,7 @@
182TEST_F(BufferSwapperSpinTriple, buffer_transfer_triple_all_owned)183TEST_F(BufferSwapperSpinTriple, buffer_transfer_triple_all_owned)
183{184{
184 size_t test_size;185 size_t test_size;
185 std::vector<std::shared_ptr<mc::Buffer>> list;186 std::vector<std::shared_ptr<mg::Buffer>> list;
186 swapper->end_responsibility(list, test_size);187 swapper->end_responsibility(list, test_size);
187188
188 auto res1 = std::find(list.begin(), list.end(), buffer_a);189 auto res1 = std::find(list.begin(), list.end(), buffer_a);
@@ -201,7 +202,7 @@
201 auto acquired_buffer = swapper->client_acquire();202 auto acquired_buffer = swapper->client_acquire();
202203
203 size_t test_size;204 size_t test_size;
204 std::vector<std::shared_ptr<mc::Buffer>> list;205 std::vector<std::shared_ptr<mg::Buffer>> list;
205 swapper->end_responsibility(list, test_size);206 swapper->end_responsibility(list, test_size);
206207
207 auto res1 = std::find(list.begin(), list.end(), acquired_buffer);208 auto res1 = std::find(list.begin(), list.end(), acquired_buffer);
208209
=== modified file 'tests/unit-tests/compositor/test_buffer_swapper_triple.cpp'
--- tests/unit-tests/compositor/test_buffer_swapper_triple.cpp 2013-05-29 23:49:32 +0000
+++ tests/unit-tests/compositor/test_buffer_swapper_triple.cpp 2013-07-17 14:20:33 +0000
@@ -19,12 +19,13 @@
19#include "mir_test_doubles/stub_buffer.h"19#include "mir_test_doubles/stub_buffer.h"
2020
21#include "mir/compositor/buffer_swapper_multi.h"21#include "mir/compositor/buffer_swapper_multi.h"
22#include "mir/compositor/buffer_id.h"22#include "mir/graphics/buffer_id.h"
2323
24#include <gmock/gmock.h>24#include <gmock/gmock.h>
25#include <gtest/gtest.h>25#include <gtest/gtest.h>
2626
27namespace mc = mir::compositor;27namespace mc = mir::compositor;
28namespace mg = mir::graphics;
28namespace geom = mir::geometry;29namespace geom = mir::geometry;
29namespace mtd = mir::test::doubles;30namespace mtd = mir::test::doubles;
30namespace31namespace
@@ -38,14 +39,14 @@
38 buffer_b = std::make_shared<mtd::StubBuffer>();39 buffer_b = std::make_shared<mtd::StubBuffer>();
39 buffer_c = std::make_shared<mtd::StubBuffer>();40 buffer_c = std::make_shared<mtd::StubBuffer>();
4041
41 auto triple_list = std::vector<std::shared_ptr<mc::Buffer>>{buffer_a, buffer_b, buffer_c};42 auto triple_list = std::vector<std::shared_ptr<mg::Buffer>>{buffer_a, buffer_b, buffer_c};
42 swapper = std::make_shared<mc::BufferSwapperMulti>(triple_list, triple_list.size());43 swapper = std::make_shared<mc::BufferSwapperMulti>(triple_list, triple_list.size());
4344
44 }45 }
4546
46 std::shared_ptr<mc::Buffer> buffer_a;47 std::shared_ptr<mg::Buffer> buffer_a;
47 std::shared_ptr<mc::Buffer> buffer_b;48 std::shared_ptr<mg::Buffer> buffer_b;
48 std::shared_ptr<mc::Buffer> buffer_c;49 std::shared_ptr<mg::Buffer> buffer_c;
4950
50 std::shared_ptr<mc::BufferSwapper> swapper;51 std::shared_ptr<mc::BufferSwapper> swapper;
51};52};
5253
=== modified file 'tests/unit-tests/compositor/test_swapper_factory.cpp'
--- tests/unit-tests/compositor/test_swapper_factory.cpp 2013-07-11 16:54:41 +0000
+++ tests/unit-tests/compositor/test_swapper_factory.cpp 2013-07-17 14:20:33 +0000
@@ -28,6 +28,7 @@
28#include <gtest/gtest.h>28#include <gtest/gtest.h>
2929
30namespace mc = mir::compositor;30namespace mc = mir::compositor;
31namespace mg = mir::graphics;
31namespace geom = mir::geometry;32namespace geom = mir::geometry;
32namespace mtd = mir::test::doubles;33namespace mtd = mir::test::doubles;
3334
@@ -46,7 +47,7 @@
46 ON_CALL(*this, alloc_buffer(_))47 ON_CALL(*this, alloc_buffer(_))
47 .WillByDefault(Return(std::make_shared<mtd::StubBuffer>(properties)));48 .WillByDefault(Return(std::make_shared<mtd::StubBuffer>(properties)));
48 }49 }
49 MOCK_METHOD1(alloc_buffer, std::shared_ptr<mc::Buffer>(mc::BufferProperties const&));50 MOCK_METHOD1(alloc_buffer, std::shared_ptr<mg::Buffer>(mc::BufferProperties const&));
50 MOCK_METHOD0(supported_pixel_formats, std::vector<geom::PixelFormat>());51 MOCK_METHOD0(supported_pixel_formats, std::vector<geom::PixelFormat>());
5152
52 ~MockGraphicBufferAllocator() noexcept {}53 ~MockGraphicBufferAllocator() noexcept {}
@@ -148,7 +149,7 @@
148 using namespace testing;149 using namespace testing;
149150
150 mc::BufferProperties properties;151 mc::BufferProperties properties;
151 std::vector<std::shared_ptr<mc::Buffer>> list {};152 std::vector<std::shared_ptr<mg::Buffer>> list {};
152 size_t size = 3;153 size_t size = 3;
153154
154 EXPECT_CALL(*mock_buffer_allocator, alloc_buffer(properties))155 EXPECT_CALL(*mock_buffer_allocator, alloc_buffer(properties))
@@ -163,7 +164,7 @@
163 using namespace testing;164 using namespace testing;
164165
165 mc::BufferProperties properties;166 mc::BufferProperties properties;
166 std::vector<std::shared_ptr<mc::Buffer>> list;167 std::vector<std::shared_ptr<mg::Buffer>> list;
167 size_t size = 3;168 size_t size = 3;
168169
169 EXPECT_CALL(*mock_buffer_allocator, alloc_buffer(properties))170 EXPECT_CALL(*mock_buffer_allocator, alloc_buffer(properties))
@@ -182,7 +183,7 @@
182 auto buffer = std::make_shared<mtd::StubBuffer>();183 auto buffer = std::make_shared<mtd::StubBuffer>();
183 {184 {
184 size_t size = 3;185 size_t size = 3;
185 std::vector<std::shared_ptr<mc::Buffer>> list{buffer};186 std::vector<std::shared_ptr<mg::Buffer>> list{buffer};
186187
187 auto swapper = strategy.create_swapper_reuse_buffers(188 auto swapper = strategy.create_swapper_reuse_buffers(
188 properties, list, size, mc::SwapperType::synchronous);189 properties, list, size, mc::SwapperType::synchronous);
@@ -197,7 +198,7 @@
197 mc::SwapperFactory strategy(mock_buffer_allocator, 2);198 mc::SwapperFactory strategy(mock_buffer_allocator, 2);
198199
199 size_t size = 3;200 size_t size = 3;
200 std::vector<std::shared_ptr<mc::Buffer>> list{};201 std::vector<std::shared_ptr<mg::Buffer>> list{};
201202
202 EXPECT_THROW({203 EXPECT_THROW({
203 strategy.create_swapper_reuse_buffers(204 strategy.create_swapper_reuse_buffers(
@@ -214,7 +215,7 @@
214 mc::SwapperFactory strategy(mock_buffer_allocator);215 mc::SwapperFactory strategy(mock_buffer_allocator);
215216
216 size_t size = 2;217 size_t size = 2;
217 std::vector<std::shared_ptr<mc::Buffer>> list{};218 std::vector<std::shared_ptr<mg::Buffer>> list{};
218 auto swapper = strategy.create_swapper_reuse_buffers(219 auto swapper = strategy.create_swapper_reuse_buffers(
219 properties, list, size, mc::SwapperType::framedropping);220 properties, list, size, mc::SwapperType::framedropping);
220}221}
221222
=== modified file 'tests/unit-tests/compositor/test_switching_bundle.cpp'
--- tests/unit-tests/compositor/test_switching_bundle.cpp 2013-07-11 16:54:41 +0000
+++ tests/unit-tests/compositor/test_switching_bundle.cpp 2013-07-17 14:20:33 +0000
@@ -27,6 +27,7 @@
27namespace geom=mir::geometry;27namespace geom=mir::geometry;
28namespace mtd=mir::test::doubles;28namespace mtd=mir::test::doubles;
29namespace mc=mir::compositor;29namespace mc=mir::compositor;
30namespace mg = mir::graphics;
3031
31struct SwitchingBundleTest : public ::testing::Test32struct SwitchingBundleTest : public ::testing::Test
32{33{
@@ -47,7 +48,7 @@
47 std::shared_ptr<mtd::MockSwapperFactory> mock_swapper_factory;48 std::shared_ptr<mtd::MockSwapperFactory> mock_swapper_factory;
48 std::shared_ptr<mtd::MockSwapper> mock_default_swapper;49 std::shared_ptr<mtd::MockSwapper> mock_default_swapper;
49 std::shared_ptr<mtd::MockSwapper> mock_secondary_swapper;50 std::shared_ptr<mtd::MockSwapper> mock_secondary_swapper;
50 std::shared_ptr<mc::Buffer> stub_buffer;51 std::shared_ptr<mg::Buffer> stub_buffer;
51 mc::BufferProperties properties;52 mc::BufferProperties properties;
52};53};
5354
5455
=== modified file 'tests/unit-tests/compositor/test_temporary_buffers.cpp'
--- tests/unit-tests/compositor/test_temporary_buffers.cpp 2013-07-11 16:54:41 +0000
+++ tests/unit-tests/compositor/test_temporary_buffers.cpp 2013-07-17 14:20:33 +0000
@@ -25,6 +25,7 @@
25#include <stdexcept>25#include <stdexcept>
2626
27namespace mtd=mir::test::doubles;27namespace mtd=mir::test::doubles;
28namespace mg = mir::graphics;
28namespace mc=mir::compositor;29namespace mc=mir::compositor;
29namespace geom=mir::geometry;30namespace geom=mir::geometry;
3031
@@ -33,7 +34,7 @@
33class TemporaryTestBuffer : public mc::TemporaryBuffer34class TemporaryTestBuffer : public mc::TemporaryBuffer
34{35{
35public:36public:
36 TemporaryTestBuffer(const std::shared_ptr<mc::Buffer>& buf)37 TemporaryTestBuffer(const std::shared_ptr<mg::Buffer>& buf)
37 : TemporaryBuffer(buf)38 : TemporaryBuffer(buf)
38 {39 {
39 }40 }
@@ -43,8 +44,8 @@
43{44{
44public:45public:
45 ~MockBackBufferStrategy() noexcept {}46 ~MockBackBufferStrategy() noexcept {}
46 MOCK_METHOD0(acquire, std::shared_ptr<mc::Buffer>());47 MOCK_METHOD0(acquire, std::shared_ptr<mg::Buffer>());
47 MOCK_METHOD1(release, void(std::shared_ptr<mc::Buffer> const&));48 MOCK_METHOD1(release, void(std::shared_ptr<mg::Buffer> const&));
48};49};
4950
50class TemporaryBuffersTest : public ::testing::Test51class TemporaryBuffersTest : public ::testing::Test
5152
=== modified file 'tests/unit-tests/frontend/test_client_buffer_tracker.cpp'
--- tests/unit-tests/frontend/test_client_buffer_tracker.cpp 2013-04-24 05:22:20 +0000
+++ tests/unit-tests/frontend/test_client_buffer_tracker.cpp 2013-07-17 14:20:33 +0000
@@ -17,17 +17,17 @@
17 */17 */
1818
19#include "../../src/server/frontend/client_buffer_tracker.h"19#include "../../src/server/frontend/client_buffer_tracker.h"
20#include "mir/compositor/buffer_id.h"20#include "mir/graphics/buffer_id.h"
2121
22#include <gtest/gtest.h>22#include <gtest/gtest.h>
2323
24namespace mf = mir::frontend;24namespace mf = mir::frontend;
25namespace mc = mir::compositor;25namespace mg = mir::graphics;
2626
27TEST(ClientBufferTracker, just_added_buffer_is_known_by_client)27TEST(ClientBufferTracker, just_added_buffer_is_known_by_client)
28{28{
29 mf::ClientBufferTracker tracker(3);29 mf::ClientBufferTracker tracker(3);
30 mc::BufferID const id{5};30 mg::BufferID const id{5};
3131
32 tracker.add(id);32 tracker.add(id);
33 EXPECT_TRUE(tracker.client_has(id));33 EXPECT_TRUE(tracker.client_has(id));
@@ -37,17 +37,17 @@
37{37{
38 mf::ClientBufferTracker tracker(3);38 mf::ClientBufferTracker tracker(3);
3939
40 tracker.add(mc::BufferID{5});40 tracker.add(mg::BufferID{5});
41 EXPECT_FALSE(tracker.client_has(mc::BufferID{6}));41 EXPECT_FALSE(tracker.client_has(mg::BufferID{6}));
42}42}
4343
44TEST(ClientBufferTracker, tracks_sequence_of_buffers)44TEST(ClientBufferTracker, tracks_sequence_of_buffers)
45{45{
46 mf::ClientBufferTracker tracker(3);46 mf::ClientBufferTracker tracker(3);
47 mc::BufferID const one{1};47 mg::BufferID const one{1};
48 mc::BufferID const two{2};48 mg::BufferID const two{2};
49 mc::BufferID const three{3};49 mg::BufferID const three{3};
50 mc::BufferID const four{4};50 mg::BufferID const four{4};
5151
52 tracker.add(one);52 tracker.add(one);
53 tracker.add(two);53 tracker.add(two);
@@ -63,10 +63,10 @@
63{63{
64 mf::ClientBufferTracker tracker(3);64 mf::ClientBufferTracker tracker(3);
6565
66 mc::BufferID const one{1};66 mg::BufferID const one{1};
67 mc::BufferID const two{2};67 mg::BufferID const two{2};
68 mc::BufferID const three{3};68 mg::BufferID const three{3};
69 mc::BufferID const four{4};69 mg::BufferID const four{4};
7070
71 tracker.add(one);71 tracker.add(one);
72 tracker.add(two);72 tracker.add(two);
@@ -88,9 +88,9 @@
8888
89TEST(ClientBufferTracker, tracks_correct_number_of_buffers)89TEST(ClientBufferTracker, tracks_correct_number_of_buffers)
90{90{
91 mc::BufferID ids[10];91 mg::BufferID ids[10];
92 for (unsigned int i = 0; i < 10; ++i)92 for (unsigned int i = 0; i < 10; ++i)
93 ids[i] = mc::BufferID{i};93 ids[i] = mg::BufferID{i};
9494
95 for (unsigned int tracker_size = 2; tracker_size < 10; ++tracker_size)95 for (unsigned int tracker_size = 2; tracker_size < 10; ++tracker_size)
96 {96 {
9797
=== modified file 'tests/unit-tests/frontend/test_session_mediator.cpp'
--- tests/unit-tests/frontend/test_session_mediator.cpp 2013-07-15 09:29:14 +0000
+++ tests/unit-tests/frontend/test_session_mediator.cpp 2013-07-17 14:20:33 +0000
@@ -95,9 +95,9 @@
95 .WillByDefault(testing::Return(std::vector<geom::PixelFormat>()));95 .WillByDefault(testing::Return(std::vector<geom::PixelFormat>()));
96 }96 }
9797
98 std::shared_ptr<mc::Buffer> alloc_buffer(mc::BufferProperties const&)98 std::shared_ptr<mg::Buffer> alloc_buffer(mc::BufferProperties const&)
99 {99 {
100 return std::shared_ptr<mc::Buffer>();100 return std::shared_ptr<mg::Buffer>();
101 }101 }
102102
103 MOCK_METHOD0(supported_pixel_formats, std::vector<geom::PixelFormat>());103 MOCK_METHOD0(supported_pixel_formats, std::vector<geom::PixelFormat>());
@@ -125,7 +125,7 @@
125 MOCK_METHOD0(get_ipc_package, std::shared_ptr<mg::PlatformIPCPackage>());125 MOCK_METHOD0(get_ipc_package, std::shared_ptr<mg::PlatformIPCPackage>());
126 MOCK_METHOD0(create_internal_client, std::shared_ptr<mg::InternalClient>());126 MOCK_METHOD0(create_internal_client, std::shared_ptr<mg::InternalClient>());
127 MOCK_CONST_METHOD2(fill_ipc_package, void(std::shared_ptr<mc::BufferIPCPacker> const&,127 MOCK_CONST_METHOD2(fill_ipc_package, void(std::shared_ptr<mc::BufferIPCPacker> const&,
128 std::shared_ptr<mc::Buffer> const&));128 std::shared_ptr<mg::Buffer> const&));
129};129};
130130
131class NullEventSink : public mir::events::EventSink131class NullEventSink : public mir::events::EventSink
@@ -377,16 +377,16 @@
377377
378 {378 {
379 EXPECT_CALL(*stubbed_session->mock_buffer, id())379 EXPECT_CALL(*stubbed_session->mock_buffer, id())
380 .WillOnce(Return(mc::BufferID{4}))380 .WillOnce(Return(mg::BufferID{4}))
381 .WillOnce(Return(mc::BufferID{5}))381 .WillOnce(Return(mg::BufferID{5}))
382 .WillOnce(Return(mc::BufferID{4}))382 .WillOnce(Return(mg::BufferID{4}))
383 .WillOnce(Return(mc::BufferID{5}));383 .WillOnce(Return(mg::BufferID{5}));
384384
385 mp::Surface surface_response;385 mp::Surface surface_response;
386 mp::SurfaceId buffer_request;386 mp::SurfaceId buffer_request;
387 mp::Buffer buffer_response[3];387 mp::Buffer buffer_response[3];
388388
389 std::shared_ptr<mc::Buffer> tmp_buffer = stubbed_session->mock_buffer;389 std::shared_ptr<mg::Buffer> tmp_buffer = stubbed_session->mock_buffer;
390 EXPECT_CALL(*graphics_platform, fill_ipc_package(_, tmp_buffer))390 EXPECT_CALL(*graphics_platform, fill_ipc_package(_, tmp_buffer))
391 .Times(2);391 .Times(2);
392392
393393
=== modified file 'tests/unit-tests/frontend/test_session_mediator_android.cpp'
--- tests/unit-tests/frontend/test_session_mediator_android.cpp 2013-07-08 21:49:48 +0000
+++ tests/unit-tests/frontend/test_session_mediator_android.cpp 2013-07-17 14:20:33 +0000
@@ -52,9 +52,9 @@
52class StubGraphicBufferAllocator : public mc::GraphicBufferAllocator52class StubGraphicBufferAllocator : public mc::GraphicBufferAllocator
53{53{
54public:54public:
55 std::shared_ptr<mc::Buffer> alloc_buffer(mc::BufferProperties const&)55 std::shared_ptr<mg::Buffer> alloc_buffer(mc::BufferProperties const&)
56 {56 {
57 return std::shared_ptr<mc::Buffer>();57 return std::shared_ptr<mg::Buffer>();
58 }58 }
5959
60 virtual std::vector<geom::PixelFormat> supported_pixel_formats()60 virtual std::vector<geom::PixelFormat> supported_pixel_formats()
6161
=== modified file 'tests/unit-tests/frontend/test_session_mediator_gbm.cpp'
--- tests/unit-tests/frontend/test_session_mediator_gbm.cpp 2013-07-08 21:49:48 +0000
+++ tests/unit-tests/frontend/test_session_mediator_gbm.cpp 2013-07-17 14:20:33 +0000
@@ -51,9 +51,9 @@
51class StubGraphicBufferAllocator : public mc::GraphicBufferAllocator51class StubGraphicBufferAllocator : public mc::GraphicBufferAllocator
52{52{
53public:53public:
54 std::shared_ptr<mc::Buffer> alloc_buffer(mc::BufferProperties const&)54 std::shared_ptr<mg::Buffer> alloc_buffer(mc::BufferProperties const&)
55 {55 {
56 return std::shared_ptr<mc::Buffer>();56 return std::shared_ptr<mg::Buffer>();
57 }57 }
5858
59 virtual std::vector<geom::PixelFormat> supported_pixel_formats()59 virtual std::vector<geom::PixelFormat> supported_pixel_formats()
6060
=== modified file 'tests/unit-tests/graphics/android/test_fb_simple_swapper.cpp'
--- tests/unit-tests/graphics/android/test_fb_simple_swapper.cpp 2013-05-02 00:34:03 +0000
+++ tests/unit-tests/graphics/android/test_fb_simple_swapper.cpp 2013-07-17 14:20:33 +0000
@@ -26,6 +26,7 @@
26#include <gtest/gtest.h>26#include <gtest/gtest.h>
2727
28namespace mc=mir::compositor;28namespace mc=mir::compositor;
29namespace mg=mir::graphics;
29namespace mga=mir::graphics::android;30namespace mga=mir::graphics::android;
30namespace mtd=mir::test::doubles;31namespace mtd=mir::test::doubles;
3132
@@ -39,14 +40,14 @@
39 buffer3 = std::make_shared<mtd::MockBuffer>();40 buffer3 = std::make_shared<mtd::MockBuffer>();
40 }41 }
4142
42 std::shared_ptr<mc::Buffer> buffer1;43 std::shared_ptr<mg::Buffer> buffer1;
43 std::shared_ptr<mc::Buffer> buffer2;44 std::shared_ptr<mg::Buffer> buffer2;
44 std::shared_ptr<mc::Buffer> buffer3;45 std::shared_ptr<mg::Buffer> buffer3;
45};46};
4647
47TEST_F(FBSimpleSwapperTest, simple_swaps_returns_valid)48TEST_F(FBSimpleSwapperTest, simple_swaps_returns_valid)
48{49{
49 std::initializer_list<std::shared_ptr<mc::Buffer>> double_list{buffer1, buffer2};50 std::initializer_list<std::shared_ptr<mg::Buffer>> double_list{buffer1, buffer2};
50 mga::FBSimpleSwapper fb_swapper(double_list);51 mga::FBSimpleSwapper fb_swapper(double_list);
5152
52 auto test_buffer = fb_swapper.compositor_acquire();53 auto test_buffer = fb_swapper.compositor_acquire();
@@ -56,7 +57,7 @@
5657
57TEST_F(FBSimpleSwapperTest, simple_swaps_return_aba_pattern)58TEST_F(FBSimpleSwapperTest, simple_swaps_return_aba_pattern)
58{59{
59 std::initializer_list<std::shared_ptr<mc::Buffer>> double_list{buffer1, buffer2};60 std::initializer_list<std::shared_ptr<mg::Buffer>> double_list{buffer1, buffer2};
60 mga::FBSimpleSwapper fb_swapper(double_list);61 mga::FBSimpleSwapper fb_swapper(double_list);
6162
62 auto test_buffer_1 = fb_swapper.compositor_acquire();63 auto test_buffer_1 = fb_swapper.compositor_acquire();
@@ -74,7 +75,7 @@
7475
75TEST_F(FBSimpleSwapperTest, triple_swaps_return_abcab_pattern)76TEST_F(FBSimpleSwapperTest, triple_swaps_return_abcab_pattern)
76{77{
77 std::initializer_list<std::shared_ptr<mc::Buffer>> triple_list{buffer1, buffer2, buffer3};78 std::initializer_list<std::shared_ptr<mg::Buffer>> triple_list{buffer1, buffer2, buffer3};
78 mga::FBSimpleSwapper fb_swapper(triple_list);79 mga::FBSimpleSwapper fb_swapper(triple_list);
7980
80 auto test_buffer_1 = fb_swapper.compositor_acquire();81 auto test_buffer_1 = fb_swapper.compositor_acquire();
@@ -103,10 +104,10 @@
103104
104TEST_F(FBSimpleSwapperTest, synctest)105TEST_F(FBSimpleSwapperTest, synctest)
105{106{
106 std::vector<std::shared_ptr<mc::Buffer>> test_buffers{buffer1, buffer2};107 std::vector<std::shared_ptr<mg::Buffer>> test_buffers{buffer1, buffer2};
107 mga::FBSimpleSwapper fb_swapper(test_buffers);108 mga::FBSimpleSwapper fb_swapper(test_buffers);
108109
109 std::vector<std::shared_ptr<mc::Buffer>> blist;110 std::vector<std::shared_ptr<mg::Buffer>> blist;
110 std::mutex mut;111 std::mutex mut;
111 for(auto i=0u; i < 150; ++i)112 for(auto i=0u; i < 150; ++i)
112 {113 {
113114
=== modified file 'tests/unit-tests/graphics/android/test_framebuffer_factory.cpp'
--- tests/unit-tests/graphics/android/test_framebuffer_factory.cpp 2013-07-11 16:54:41 +0000
+++ tests/unit-tests/graphics/android/test_framebuffer_factory.cpp 2013-07-17 14:20:33 +0000
@@ -27,6 +27,7 @@
27#include <gmock/gmock.h>27#include <gmock/gmock.h>
28#include <gtest/gtest.h>28#include <gtest/gtest.h>
2929
30namespace mg=mir::graphics;
30namespace mga=mir::graphics::android;31namespace mga=mir::graphics::android;
31namespace mtd=mir::test::doubles;32namespace mtd=mir::test::doubles;
32namespace mt=mir::test;33namespace mt=mir::test;
@@ -39,7 +40,7 @@
39class MockAndroidGraphicBufferAllocator : public mga::GraphicBufferAllocator40class MockAndroidGraphicBufferAllocator : public mga::GraphicBufferAllocator
40{41{
41public:42public:
42 MOCK_METHOD1(alloc_buffer, std::shared_ptr<mc::Buffer>(mc::BufferProperties const&)); 43 MOCK_METHOD1(alloc_buffer, std::shared_ptr<mg::Buffer>(mc::BufferProperties const&));
43 MOCK_METHOD3(alloc_buffer_platform, std::shared_ptr<mga::Buffer>(geom::Size, geom::PixelFormat, mga::BufferUsage));44 MOCK_METHOD3(alloc_buffer_platform, std::shared_ptr<mga::Buffer>(geom::Size, geom::PixelFormat, mga::BufferUsage));
44 MOCK_METHOD0(supported_pixel_formats, std::vector<geom::PixelFormat>());45 MOCK_METHOD0(supported_pixel_formats, std::vector<geom::PixelFormat>());
4546
4647
=== modified file 'tests/unit-tests/graphics/android/test_hwc10_device.cpp'
--- tests/unit-tests/graphics/android/test_hwc10_device.cpp 2013-07-11 16:54:41 +0000
+++ tests/unit-tests/graphics/android/test_hwc10_device.cpp 2013-07-17 14:20:33 +0000
@@ -26,6 +26,7 @@
26#include <stdexcept>26#include <stdexcept>
2727
28namespace mc=mir::compositor;28namespace mc=mir::compositor;
29namespace mg=mir::graphics;
29namespace mga=mir::graphics::android;30namespace mga=mir::graphics::android;
30namespace mtd=mir::test::doubles;31namespace mtd=mir::test::doubles;
31namespace geom=mir::geometry;32namespace geom=mir::geometry;
@@ -90,7 +91,7 @@
9091
91TEST_F(HWC10Device, hwc10_set_next_frontbuffer)92TEST_F(HWC10Device, hwc10_set_next_frontbuffer)
92{93{
93 std::shared_ptr<mc::Buffer> mock_buffer = std::make_shared<mtd::MockBuffer>();94 std::shared_ptr<mg::Buffer> mock_buffer = std::make_shared<mtd::MockBuffer>();
94 EXPECT_CALL(*mock_fbdev, set_next_frontbuffer(mock_buffer))95 EXPECT_CALL(*mock_fbdev, set_next_frontbuffer(mock_buffer))
95 .Times(1);96 .Times(1);
9697
9798
=== modified file 'tests/unit-tests/graphics/android/test_hwc11_device.cpp'
--- tests/unit-tests/graphics/android/test_hwc11_device.cpp 2013-05-22 06:30:39 +0000
+++ tests/unit-tests/graphics/android/test_hwc11_device.cpp 2013-07-17 14:20:33 +0000
@@ -28,6 +28,7 @@
28#include <stdexcept>28#include <stdexcept>
2929
30namespace mc=mir::compositor;30namespace mc=mir::compositor;
31namespace mg=mir::graphics;
31namespace mga=mir::graphics::android;32namespace mga=mir::graphics::android;
32namespace mtd=mir::test::doubles;33namespace mtd=mir::test::doubles;
3334
@@ -258,7 +259,7 @@
258259
259TEST_F(HWC11Device, hwc_device_set_next_frontbuffer_adds_to_layerlist)260TEST_F(HWC11Device, hwc_device_set_next_frontbuffer_adds_to_layerlist)
260{261{
261 std::shared_ptr<mc::Buffer> mock_buffer = std::make_shared<mtd::MockBuffer>();262 std::shared_ptr<mg::Buffer> mock_buffer = std::make_shared<mtd::MockBuffer>();
262 EXPECT_CALL(*this->mock_organizer, set_fb_target(mock_buffer))263 EXPECT_CALL(*this->mock_organizer, set_fb_target(mock_buffer))
263 .Times(1);264 .Times(1);
264 265
@@ -268,7 +269,7 @@
268269
269TEST_F(HWC11Device, hwc_device_set_next_frontbuffer_posts_vsync)270TEST_F(HWC11Device, hwc_device_set_next_frontbuffer_posts_vsync)
270{271{
271 std::shared_ptr<mc::Buffer> mock_buffer = std::make_shared<mtd::MockBuffer>();272 std::shared_ptr<mg::Buffer> mock_buffer = std::make_shared<mtd::MockBuffer>();
272 EXPECT_CALL(*this->mock_display_support_provider, set_next_frontbuffer(mock_buffer))273 EXPECT_CALL(*this->mock_display_support_provider, set_next_frontbuffer(mock_buffer))
273 .Times(1);274 .Times(1);
274275
@@ -278,7 +279,7 @@
278279
279TEST_F(HWC11Device, hwc_device_set_next_frontbuffer_posts_no_sync)280TEST_F(HWC11Device, hwc_device_set_next_frontbuffer_posts_no_sync)
280{281{
281 std::shared_ptr<mc::Buffer> mock_buffer = std::make_shared<mtd::MockBuffer>();282 std::shared_ptr<mg::Buffer> mock_buffer = std::make_shared<mtd::MockBuffer>();
282 EXPECT_CALL(*this->mock_display_support_provider, set_next_frontbuffer(mock_buffer))283 EXPECT_CALL(*this->mock_display_support_provider, set_next_frontbuffer(mock_buffer))
283 .Times(0);284 .Times(0);
284285
285286
=== modified file 'tests/unit-tests/graphics/android/test_internal_client.cpp'
--- tests/unit-tests/graphics/android/test_internal_client.cpp 2013-07-11 16:54:41 +0000
+++ tests/unit-tests/graphics/android/test_internal_client.cpp 2013-07-17 14:20:33 +0000
@@ -22,7 +22,7 @@
22#include <gtest/gtest.h>22#include <gtest/gtest.h>
2323
24namespace geom=mir::geometry;24namespace geom=mir::geometry;
25namespace mc=mir::compositor;25namespace mg=mir::graphics;
26namespace mga=mir::graphics::android;26namespace mga=mir::graphics::android;
2727
28namespace28namespace
@@ -43,9 +43,9 @@
43 {43 {
44 return geom::PixelFormat::xbgr_8888;44 return geom::PixelFormat::xbgr_8888;
45 }45 }
46 std::shared_ptr<mc::Buffer> advance_client_buffer()46 std::shared_ptr<mg::Buffer> advance_client_buffer()
47 {47 {
48 return std::shared_ptr<mc::Buffer>();48 return std::shared_ptr<mg::Buffer>();
49 }49 }
50 bool supports_input() const50 bool supports_input() const
51 {51 {
5252
=== modified file 'tests/unit-tests/graphics/android/test_internal_client_interpreter.cpp'
--- tests/unit-tests/graphics/android/test_internal_client_interpreter.cpp 2013-07-11 16:54:41 +0000
+++ tests/unit-tests/graphics/android/test_internal_client_interpreter.cpp 2013-07-17 14:20:33 +0000
@@ -25,7 +25,7 @@
25#include <gtest/gtest.h>25#include <gtest/gtest.h>
26#include <stdexcept>26#include <stdexcept>
2727
28namespace mc=mir::compositor;28namespace mg=mir::graphics;
29namespace mtd=mir::test::doubles;29namespace mtd=mir::test::doubles;
30namespace mga=mir::graphics::android;30namespace mga=mir::graphics::android;
31namespace geom=mir::geometry;31namespace geom=mir::geometry;
@@ -40,7 +40,7 @@
40 MOCK_CONST_METHOD0(size, geom::Size());40 MOCK_CONST_METHOD0(size, geom::Size());
41 MOCK_CONST_METHOD0(pixel_format, geom::PixelFormat());41 MOCK_CONST_METHOD0(pixel_format, geom::PixelFormat());
4242
43 MOCK_METHOD0(advance_client_buffer, std::shared_ptr<mc::Buffer>());43 MOCK_METHOD0(advance_client_buffer, std::shared_ptr<mg::Buffer>());
4444
45 MOCK_CONST_METHOD0(supports_input, bool());45 MOCK_CONST_METHOD0(supports_input, bool());
46 MOCK_CONST_METHOD0(client_input_fd, int());46 MOCK_CONST_METHOD0(client_input_fd, int());
@@ -83,7 +83,7 @@
83 .Times(1);83 .Times(1);
84 EXPECT_CALL(*mock_buffer, native_buffer_handle())84 EXPECT_CALL(*mock_buffer, native_buffer_handle())
85 .Times(1);85 .Times(1);
86 std::shared_ptr<mc::Buffer> tmp = mock_buffer;86 std::shared_ptr<mg::Buffer> tmp = mock_buffer;
87 EXPECT_CALL(*mock_cache, store_buffer(tmp, stub_anw.get()))87 EXPECT_CALL(*mock_cache, store_buffer(tmp, stub_anw.get()))
88 .Times(1);88 .Times(1);
8989
9090
=== modified file 'tests/unit-tests/graphics/android/test_server_interpreter.cpp'
--- tests/unit-tests/graphics/android/test_server_interpreter.cpp 2013-07-11 16:54:41 +0000
+++ tests/unit-tests/graphics/android/test_server_interpreter.cpp 2013-07-17 14:20:33 +0000
@@ -29,6 +29,7 @@
2929
30namespace mtd=mir::test::doubles;30namespace mtd=mir::test::doubles;
31namespace geom=mir::geometry;31namespace geom=mir::geometry;
32namespace mg=mir::graphics;
32namespace mga=mir::graphics::android;33namespace mga=mir::graphics::android;
33namespace mc=mir::compositor;34namespace mc=mir::compositor;
3435
@@ -44,8 +45,8 @@
44struct MockFBSwapper : public mga::FBSwapper45struct MockFBSwapper : public mga::FBSwapper
45{46{
46 ~MockFBSwapper() noexcept {}47 ~MockFBSwapper() noexcept {}
47 MOCK_METHOD0(compositor_acquire, std::shared_ptr<mc::Buffer>());48 MOCK_METHOD0(compositor_acquire, std::shared_ptr<mg::Buffer>());
48 MOCK_METHOD1(compositor_release, void(std::shared_ptr<mc::Buffer> const& released_buffer));49 MOCK_METHOD1(compositor_release, void(std::shared_ptr<mg::Buffer> const& released_buffer));
49};50};
5051
51struct ServerRenderWindowTest : public ::testing::Test52struct ServerRenderWindowTest : public ::testing::Test
@@ -88,7 +89,7 @@
88 .Times(1)89 .Times(1)
89 .WillOnce(Return(stub_anw));90 .WillOnce(Return(stub_anw));
9091
91 std::shared_ptr<mc::Buffer> tmp = mock_buffer1;92 std::shared_ptr<mg::Buffer> tmp = mock_buffer1;
92 EXPECT_CALL(*mock_cache, store_buffer(tmp, stub_anw.get()))93 EXPECT_CALL(*mock_cache, store_buffer(tmp, stub_anw.get()))
93 .Times(1);94 .Times(1);
9495
@@ -115,7 +116,7 @@
115 render_window.driver_requests_buffer();116 render_window.driver_requests_buffer();
116 testing::Mock::VerifyAndClearExpectations(mock_swapper.get());117 testing::Mock::VerifyAndClearExpectations(mock_swapper.get());
117118
118 std::shared_ptr<mc::Buffer> buf1 = mock_buffer1;119 std::shared_ptr<mg::Buffer> buf1 = mock_buffer1;
119 EXPECT_CALL(*mock_swapper, compositor_release(buf1))120 EXPECT_CALL(*mock_swapper, compositor_release(buf1))
120 .Times(1);121 .Times(1);
121 EXPECT_CALL(*stub_sync, wait())122 EXPECT_CALL(*stub_sync, wait())
@@ -134,13 +135,13 @@
134 .WillOnce(Return(mock_buffer1));135 .WillOnce(Return(mock_buffer1));
135 mga::ServerRenderWindow render_window(mock_swapper, mock_display_poster, mock_cache);136 mga::ServerRenderWindow render_window(mock_swapper, mock_display_poster, mock_cache);
136137
137 mc::BufferID id{442}, returned_id;138 mg::BufferID id{442}, returned_id;
138 EXPECT_CALL(*mock_swapper, compositor_acquire())139 EXPECT_CALL(*mock_swapper, compositor_acquire())
139 .Times(1)140 .Times(1)
140 .WillOnce(Return(mock_buffer1));141 .WillOnce(Return(mock_buffer1));
141 EXPECT_CALL(*mock_swapper, compositor_release(_))142 EXPECT_CALL(*mock_swapper, compositor_release(_))
142 .Times(1);143 .Times(1);
143 std::shared_ptr<mc::Buffer> buf1 = mock_buffer1;144 std::shared_ptr<mg::Buffer> buf1 = mock_buffer1;
144 EXPECT_CALL(*mock_buffer1, native_buffer_handle())145 EXPECT_CALL(*mock_buffer1, native_buffer_handle())
145 .Times(1)146 .Times(1)
146 .WillOnce(Return(stub_anw));147 .WillOnce(Return(stub_anw));
147148
=== modified file 'tests/unit-tests/graphics/gbm/test_internal_client.cpp'
--- tests/unit-tests/graphics/gbm/test_internal_client.cpp 2013-06-20 08:27:10 +0000
+++ tests/unit-tests/graphics/gbm/test_internal_client.cpp 2013-07-17 14:20:33 +0000
@@ -25,7 +25,6 @@
25#include <gtest/gtest.h>25#include <gtest/gtest.h>
2626
27namespace geom=mir::geometry;27namespace geom=mir::geometry;
28namespace mc=mir::compositor;
29namespace mgg=mir::graphics::gbm;28namespace mgg=mir::graphics::gbm;
30namespace mtd=mir::test::doubles;29namespace mtd=mir::test::doubles;
3130
3231
=== modified file 'tests/unit-tests/graphics/gbm/test_internal_native_surface.cpp'
--- tests/unit-tests/graphics/gbm/test_internal_native_surface.cpp 2013-07-11 16:54:41 +0000
+++ tests/unit-tests/graphics/gbm/test_internal_native_surface.cpp 2013-07-17 14:20:33 +0000
@@ -50,7 +50,7 @@
50 MOCK_METHOD0(force_requests_to_complete, void());50 MOCK_METHOD0(force_requests_to_complete, void());
51 MOCK_CONST_METHOD0(size, geom::Size());51 MOCK_CONST_METHOD0(size, geom::Size());
52 MOCK_CONST_METHOD0(pixel_format, geom::PixelFormat());52 MOCK_CONST_METHOD0(pixel_format, geom::PixelFormat());
53 MOCK_METHOD0(advance_client_buffer, std::shared_ptr<mc::Buffer>());53 MOCK_METHOD0(advance_client_buffer, std::shared_ptr<mg::Buffer>());
54 MOCK_CONST_METHOD0(supports_input, bool());54 MOCK_CONST_METHOD0(supports_input, bool());
55 MOCK_CONST_METHOD0(client_input_fd, int());55 MOCK_CONST_METHOD0(client_input_fd, int());
56 MOCK_METHOD2(configure, int(MirSurfaceAttrib, int));56 MOCK_METHOD2(configure, int(MirSurfaceAttrib, int));
5757
=== modified file 'tests/unit-tests/shell/test_application_session.cpp'
--- tests/unit-tests/shell/test_application_session.cpp 2013-07-01 06:36:33 +0000
+++ tests/unit-tests/shell/test_application_session.cpp 2013-07-17 14:20:33 +0000
@@ -17,7 +17,7 @@
17 */17 */
1818
19#include "mir/shell/application_session.h"19#include "mir/shell/application_session.h"
20#include "mir/compositor/buffer.h"20#include "mir/graphics/buffer.h"
21#include "mir/shell/surface_creation_parameters.h"21#include "mir/shell/surface_creation_parameters.h"
22#include "mir_test/fake_shared.h"22#include "mir_test/fake_shared.h"
23#include "mir_test_doubles/mock_surface_factory.h"23#include "mir_test_doubles/mock_surface_factory.h"
2424
=== modified file 'tests/unit-tests/shell/test_surface.cpp'
--- tests/unit-tests/shell/test_surface.cpp 2013-07-12 20:33:47 +0000
+++ tests/unit-tests/shell/test_surface.cpp 2013-07-17 14:20:33 +0000
@@ -40,6 +40,7 @@
40namespace msh = mir::shell;40namespace msh = mir::shell;
41namespace mf = mir::frontend;41namespace mf = mir::frontend;
42namespace mc = mir::compositor;42namespace mc = mir::compositor;
43namespace mg = mir::graphics;
43namespace mi = mir::input;44namespace mi = mir::input;
44namespace geom = mir::geometry;45namespace geom = mir::geometry;
45namespace mt = mir::test;46namespace mt = mir::test;
@@ -484,10 +485,10 @@
484 mt::fake_shared(surface_builder),485 mt::fake_shared(surface_builder),
485 msh::a_surface());486 msh::a_surface());
486487
487 mc::Buffer* buf_ptr{nullptr};488 mg::Buffer* buf_ptr{nullptr};
488489
489 test.with_most_recent_buffer_do(490 test.with_most_recent_buffer_do(
490 [&](mc::Buffer& buffer)491 [&](mg::Buffer& buffer)
491 {492 {
492 buf_ptr = &buffer;493 buf_ptr = &buffer;
493 });494 });
494495
=== modified file 'tests/unit-tests/shell/test_threaded_snapshot_strategy.cpp'
--- tests/unit-tests/shell/test_threaded_snapshot_strategy.cpp 2013-07-11 16:54:41 +0000
+++ tests/unit-tests/shell/test_threaded_snapshot_strategy.cpp 2013-07-17 14:20:33 +0000
@@ -17,9 +17,9 @@
17 */17 */
1818
19#include "mir/shell/threaded_snapshot_strategy.h"19#include "mir/shell/threaded_snapshot_strategy.h"
20#include "mir/shell/pixel_buffer.h"20#include "mir/graphics/pixel_buffer.h"
21#include "mir/shell/surface_buffer_access.h"21#include "mir/shell/surface_buffer_access.h"
22#include "mir/compositor/buffer.h"22#include "mir/graphics/buffer.h"
2323
24#include "mir_test_doubles/stub_buffer.h"24#include "mir_test_doubles/stub_buffer.h"
25#include "mir_test/fake_shared.h"25#include "mir_test/fake_shared.h"
@@ -32,6 +32,7 @@
32#include <atomic>32#include <atomic>
3333
34namespace mc = mir::compositor;34namespace mc = mir::compositor;
35namespace mg = mir::graphics;
35namespace msh = mir::shell;36namespace msh = mir::shell;
36namespace mt = mir::test;37namespace mt = mir::test;
37namespace mtd = mir::test::doubles;38namespace mtd = mir::test::doubles;
@@ -43,7 +44,7 @@
43 ~StubSurfaceBufferAccess() noexcept {}44 ~StubSurfaceBufferAccess() noexcept {}
4445
45 void with_most_recent_buffer_do(46 void with_most_recent_buffer_do(
46 std::function<void(mc::Buffer&)> const& exec)47 std::function<void(mg::Buffer&)> const& exec)
47 {48 {
48 exec(buffer);49 exec(buffer);
49 }50 }
@@ -51,12 +52,12 @@
51 mtd::StubBuffer buffer;52 mtd::StubBuffer buffer;
52};53};
5354
54class MockPixelBuffer : public msh::PixelBuffer55class MockPixelBuffer : public mg::PixelBuffer
55{56{
56public:57public:
57 ~MockPixelBuffer() noexcept {}58 ~MockPixelBuffer() noexcept {}
5859
59 MOCK_METHOD1(fill_from, void(mc::Buffer& buffer));60 MOCK_METHOD1(fill_from, void(mg::Buffer& buffer));
60 MOCK_METHOD0(as_argb_8888, void const*());61 MOCK_METHOD0(as_argb_8888, void const*());
61 MOCK_CONST_METHOD0(size, geom::Size());62 MOCK_CONST_METHOD0(size, geom::Size());
62 MOCK_CONST_METHOD0(stride, geom::Stride());63 MOCK_CONST_METHOD0(stride, geom::Stride());
6364
=== modified file 'tests/unit-tests/surfaces/test_surface_stack.cpp'
--- tests/unit-tests/surfaces/test_surface_stack.cpp 2013-07-12 21:48:58 +0000
+++ tests/unit-tests/surfaces/test_surface_stack.cpp 2013-07-17 14:20:33 +0000
@@ -65,10 +65,10 @@
65class NullBufferBundle : public mc::BufferBundle65class NullBufferBundle : public mc::BufferBundle
66{66{
67public:67public:
68 virtual std::shared_ptr<mc::Buffer> client_acquire() { return std::shared_ptr<mc::Buffer>(); }68 virtual std::shared_ptr<mg::Buffer> client_acquire() { return std::shared_ptr<mg::Buffer>(); }
69 virtual void client_release(std::shared_ptr<mc::Buffer> const&) {}69 virtual void client_release(std::shared_ptr<mg::Buffer> const&) {}
70 virtual std::shared_ptr<mc::Buffer> compositor_acquire(){ return std::shared_ptr<mc::Buffer>(); };70 virtual std::shared_ptr<mg::Buffer> compositor_acquire(){ return std::shared_ptr<mg::Buffer>(); };
71 virtual void compositor_release(std::shared_ptr<mc::Buffer> const&){}71 virtual void compositor_release(std::shared_ptr<mg::Buffer> const&){}
72 virtual void force_client_abort() {}72 virtual void force_client_abort() {}
73 void force_requests_to_complete() {}73 void force_requests_to_complete() {}
74 virtual void allow_framedropping(bool) {}74 virtual void allow_framedropping(bool) {}

Subscribers

People subscribed via source and target branches