Mir

Merge lp:~alan-griffiths/mir/move-SurfaceBufferAccess-to-scene into lp:mir

Proposed by Alan Griffiths
Status: Merged
Merged at revision: 1549
Proposed branch: lp:~alan-griffiths/mir/move-SurfaceBufferAccess-to-scene
Merge into: lp:mir
Diff against target: 186 lines (+18/-21)
8 files modified
include/server/mir/scene/surface.h (+2/-2)
include/server/mir/scene/surface_buffer_access.h (+5/-5)
include/test/mir_test_doubles/null_snapshot_strategy.h (+1/-1)
src/server/scene/snapshot_strategy.h (+2/-5)
src/server/scene/threaded_snapshot_strategy.cpp (+3/-3)
src/server/scene/threaded_snapshot_strategy.h (+1/-1)
tests/unit-tests/scene/test_application_session.cpp (+2/-2)
tests/unit-tests/scene/test_threaded_snapshot_strategy.cpp (+2/-2)
To merge this branch: bzr merge lp:~alan-griffiths/mir/move-SurfaceBufferAccess-to-scene
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Mir development team Pending
Review via email: mp+214573@code.launchpad.net

Commit message

scene, shell: SurfaceBufferAccess belongs in scene, not shell

Description of the change

scene, shell: SurfaceBufferAccess belongs in scene, not shell

Snapshot and SnapshotCallback too - but moving them will be easier after landing https://code.launchpad.net/~alan-griffiths/mir/scene-grabs-Session-and-SessionListener/+merge/214275

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'include/server/mir/scene/surface.h'
2--- include/server/mir/scene/surface.h 2014-04-03 13:56:16 +0000
3+++ include/server/mir/scene/surface.h 2014-04-07 16:20:27 +0000
4@@ -21,7 +21,7 @@
5
6 #include "mir/graphics/renderable.h"
7 #include "mir/input/surface.h"
8-#include "mir/shell/surface_buffer_access.h"
9+#include "mir/scene/surface_buffer_access.h"
10 #include "mir/frontend/surface.h"
11
12 #include <vector>
13@@ -40,7 +40,7 @@
14 public graphics::Renderable,
15 public input::Surface,
16 public frontend::Surface,
17- public shell::SurfaceBufferAccess
18+ public SurfaceBufferAccess
19 {
20 public:
21 // resolve ambiguous member function names
22
23=== renamed file 'include/server/mir/shell/surface_buffer_access.h' => 'include/server/mir/scene/surface_buffer_access.h'
24--- include/server/mir/shell/surface_buffer_access.h 2013-08-28 03:41:48 +0000
25+++ include/server/mir/scene/surface_buffer_access.h 2014-04-07 16:20:27 +0000
26@@ -1,5 +1,5 @@
27 /*
28- * Copyright © 2013 Canonical Ltd.
29+ * Copyright © 2013-2014 Canonical Ltd.
30 *
31 * This program is free software: you can redistribute it and/or modify it
32 * under the terms of the GNU General Public License version 3,
33@@ -16,8 +16,8 @@
34 * Authored by: Alexandros Frantzis <alexandros.frantzis@canonical.com>
35 */
36
37-#ifndef MIR_SHELL_SURFACE_BUFFER_ACCESS_H_
38-#define MIR_SHELL_SURFACE_BUFFER_ACCESS_H_
39+#ifndef MIR_SCENE_SURFACE_BUFFER_ACCESS_H_
40+#define MIR_SCENE_SURFACE_BUFFER_ACCESS_H_
41
42 #include <functional>
43
44@@ -27,7 +27,7 @@
45 {
46 class Buffer;
47 }
48-namespace shell
49+namespace scene
50 {
51
52 class SurfaceBufferAccess
53@@ -47,4 +47,4 @@
54 }
55 }
56
57-#endif /* MIR_SHELL_SURFACE_BUFFER_ACCESS_H_ */
58+#endif /* MIR_SCENE_SURFACE_BUFFER_ACCESS_H_ */
59
60=== modified file 'include/test/mir_test_doubles/null_snapshot_strategy.h'
61--- include/test/mir_test_doubles/null_snapshot_strategy.h 2014-03-06 06:05:17 +0000
62+++ include/test/mir_test_doubles/null_snapshot_strategy.h 2014-04-07 16:20:27 +0000
63@@ -30,7 +30,7 @@
64
65 struct NullSnapshotStrategy : public scene::SnapshotStrategy
66 {
67- void take_snapshot_of(std::shared_ptr<shell::SurfaceBufferAccess> const&,
68+ void take_snapshot_of(std::shared_ptr<scene::SurfaceBufferAccess> const&,
69 shell::SnapshotCallback const&)
70 {
71 }
72
73=== modified file 'src/server/scene/snapshot_strategy.h'
74--- src/server/scene/snapshot_strategy.h 2014-03-06 06:05:17 +0000
75+++ src/server/scene/snapshot_strategy.h 2014-04-07 16:20:27 +0000
76@@ -25,20 +25,17 @@
77
78 namespace mir
79 {
80-namespace shell
81+namespace scene
82 {
83 class SurfaceBufferAccess;
84-}
85
86-namespace scene
87-{
88 class SnapshotStrategy
89 {
90 public:
91 virtual ~SnapshotStrategy() = default;
92
93 virtual void take_snapshot_of(
94- std::shared_ptr<shell::SurfaceBufferAccess> const& surface_buffer_access,
95+ std::shared_ptr<SurfaceBufferAccess> const& surface_buffer_access,
96 shell::SnapshotCallback const& snapshot_taken) = 0;
97
98 protected:
99
100=== modified file 'src/server/scene/threaded_snapshot_strategy.cpp'
101--- src/server/scene/threaded_snapshot_strategy.cpp 2014-03-06 06:05:17 +0000
102+++ src/server/scene/threaded_snapshot_strategy.cpp 2014-04-07 16:20:27 +0000
103@@ -18,7 +18,7 @@
104
105 #include "threaded_snapshot_strategy.h"
106 #include "pixel_buffer.h"
107-#include "mir/shell/surface_buffer_access.h"
108+#include "mir/scene/surface_buffer_access.h"
109
110 #include <deque>
111 #include <mutex>
112@@ -35,7 +35,7 @@
113
114 struct WorkItem
115 {
116- std::shared_ptr<msh::SurfaceBufferAccess> const surface_buffer_access;
117+ std::shared_ptr<SurfaceBufferAccess> const surface_buffer_access;
118 msh::SnapshotCallback const snapshot_taken;
119 };
120
121@@ -125,7 +125,7 @@
122 }
123
124 void ms::ThreadedSnapshotStrategy::take_snapshot_of(
125- std::shared_ptr<msh::SurfaceBufferAccess> const& surface_buffer_access,
126+ std::shared_ptr<SurfaceBufferAccess> const& surface_buffer_access,
127 msh::SnapshotCallback const& snapshot_taken)
128 {
129 functor->schedule_snapshot(WorkItem{surface_buffer_access, snapshot_taken});
130
131=== modified file 'src/server/scene/threaded_snapshot_strategy.h'
132--- src/server/scene/threaded_snapshot_strategy.h 2014-03-06 06:05:17 +0000
133+++ src/server/scene/threaded_snapshot_strategy.h 2014-04-07 16:20:27 +0000
134@@ -39,7 +39,7 @@
135 ~ThreadedSnapshotStrategy() noexcept;
136
137 void take_snapshot_of(
138- std::shared_ptr<shell::SurfaceBufferAccess> const& surface_buffer_access,
139+ std::shared_ptr<SurfaceBufferAccess> const& surface_buffer_access,
140 shell::SnapshotCallback const& snapshot_taken);
141
142 private:
143
144=== modified file 'tests/unit-tests/scene/test_application_session.cpp'
145--- tests/unit-tests/scene/test_application_session.cpp 2014-04-03 13:17:52 +0000
146+++ tests/unit-tests/scene/test_application_session.cpp 2014-04-07 16:20:27 +0000
147@@ -52,7 +52,7 @@
148 ~MockSnapshotStrategy() noexcept {}
149
150 MOCK_METHOD2(take_snapshot_of,
151- void(std::shared_ptr<msh::SurfaceBufferAccess> const&,
152+ void(std::shared_ptr<ms::SurfaceBufferAccess> const&,
153 msh::SnapshotCallback const&));
154 };
155
156@@ -264,7 +264,7 @@
157 mtd::NullEventSink sender;
158 auto const default_surface = make_mock_surface();
159 auto const default_surface_buffer_access =
160- std::static_pointer_cast<msh::SurfaceBufferAccess>(default_surface);
161+ std::static_pointer_cast<ms::SurfaceBufferAccess>(default_surface);
162 auto const snapshot_strategy = std::make_shared<MockSnapshotStrategy>();
163
164 EXPECT_CALL(surface_coordinator, add_surface(_,_,_))
165
166=== modified file 'tests/unit-tests/scene/test_threaded_snapshot_strategy.cpp'
167--- tests/unit-tests/scene/test_threaded_snapshot_strategy.cpp 2014-03-06 06:05:17 +0000
168+++ tests/unit-tests/scene/test_threaded_snapshot_strategy.cpp 2014-04-07 16:20:27 +0000
169@@ -18,7 +18,7 @@
170
171 #include "src/server/scene/threaded_snapshot_strategy.h"
172 #include "src/server/scene/pixel_buffer.h"
173-#include "mir/shell/surface_buffer_access.h"
174+#include "mir/scene/surface_buffer_access.h"
175 #include "mir/graphics/buffer.h"
176
177 #include "mir_test_doubles/stub_buffer.h"
178@@ -38,7 +38,7 @@
179 namespace mtd = mir::test::doubles;
180 namespace geom = mir::geometry;
181
182-class StubSurfaceBufferAccess : public msh::SurfaceBufferAccess
183+class StubSurfaceBufferAccess : public ms::SurfaceBufferAccess
184 {
185 public:
186 ~StubSurfaceBufferAccess() noexcept {}

Subscribers

People subscribed via source and target branches