Merge lp:~brandontschaefer/libsdl/sdl2-needs-rebuild-mir into lp:ubuntu/vivid/libsdl2

Proposed by Brandon Schaefer
Status: Work in progress
Proposed branch: lp:~brandontschaefer/libsdl/sdl2-needs-rebuild-mir
Merge into: lp:ubuntu/vivid/libsdl2
Diff against target: 250 lines (+44/-29)
7 files modified
debian/changelog (+11/-0)
src/video/mir/SDL_mirevents.c (+10/-16)
src/video/mir/SDL_mirframebuffer.c (+6/-2)
src/video/mir/SDL_mirsym.h (+3/-2)
src/video/mir/SDL_mirvideo.c (+1/-1)
src/video/mir/SDL_mirvideo.h (+2/-0)
src/video/mir/SDL_mirwindow.c (+11/-8)
To merge this branch: bzr merge lp:~brandontschaefer/libsdl/sdl2-needs-rebuild-mir
Reviewer Review Type Date Requested Status
Brandon Schaefer (community) Disapprove
Didier Roche-Tolomelli Needs Fixing
Review via email: mp+247070@code.launchpad.net

Commit message

* New fixes included:
  - symbol fixes
  - software renderering fixes
  - touch events now supported
  - set_type changed to set_state

Description of the change

* New fixes included:
  - symbol fixes
  - software renderering fixes
  - touch events now supported
  - set_type changed to set_state

To post a comment you must log in.
Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

I need to make some changes to the code now :(

Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

Hey Brandon,

You are doing inline changes in your current MP, this isn't allowed in debian format 3.0, which is what this package used. Did you try to build the package? It should have prevented you to build it.

Please use quilt as it's what the package is using follow DEP5 format: http://dep.debian.net/deps/dep5/ and then resuscribe the sponsor team.

review: Needs Fixing
Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

Duh... thanks sorry!

Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

And yeah ... dpkg-buildpackage -us -uc -b worked... though it could have ignored some warnings.

Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :
review: Disapprove

Unmerged revisions

19. By Brandon Schaefer

* Fix a few errors that are no in SDL yet

18. By Brandon Schaefer

* New fixes included:
  - symbol fixes
  - software renderering fixes
  - touch events now supported
  - set_type changed to set_state

17. By Brandon Schaefer

* Rebuild against libmirclient.so.8. (Closes: #1402753)

16. By Brandon Schaefer

* Rebuild against libmirclient.so.8

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2015-01-06 23:39:58 +0000
3+++ debian/changelog 2015-01-21 18:20:25 +0000
4@@ -1,3 +1,14 @@
5+libsdl2 (2.0.2+dfsg1-6ubuntu2) vivid; urgency=medium
6+
7+ * Rebuild against libmirclient.so.8. (Closes: #1402753)
8+ * New fixes included:
9+ - symbol fixes
10+ - software renderering fixes
11+ - touch events now supported
12+ - set_type changed to set_state
13+
14+ -- Brandon Schaefer <brandon.schaefer@canonical.com> Tue, 20 Jan 2015 12:55:44 -0800
15+
16 libsdl2 (2.0.2+dfsg1-6ubuntu1) vivid; urgency=low
17
18 * Merge from Debian unstable. Remaining changes:
19
20=== modified file 'src/video/mir/SDL_mirevents.c'
21--- src/video/mir/SDL_mirevents.c 2014-03-15 00:22:48 +0000
22+++ src/video/mir/SDL_mirevents.c 2015-01-21 18:20:25 +0000
23@@ -117,6 +117,12 @@
24 }
25
26 static void
27+HandleMouseMotion(SDL_Window* sdl_window, int x, int y)
28+{
29+ SDL_SendMouseMotion(sdl_window, 0, 0, x, y);
30+}
31+
32+static void
33 HandleTouchPress(int device_id, int source_id, SDL_bool down, float x, float y, float pressure)
34 {
35 SDL_SendTouch(device_id, source_id, down, x, y, pressure);
36@@ -129,12 +135,6 @@
37 }
38
39 static void
40-HandleMouseMotion(SDL_Window* sdl_window, int x, int y)
41-{
42- SDL_SendMouseMotion(sdl_window, 0, 0, x, y);
43-}
44-
45-static void
46 HandleMouseScroll(SDL_Window* sdl_window, int hscroll, int vscroll)
47 {
48 SDL_SendMouseWheel(sdl_window, 0, hscroll, vscroll);
49@@ -205,13 +205,11 @@
50 case mir_motion_action_outside:
51 SDL_SetMouseFocus(NULL);
52 break;
53-#if 0 /* !!! FIXME: needs a newer set of dev headers than Ubuntu 13.10 is shipping atm. */
54 case mir_motion_action_scroll:
55 HandleMouseScroll(sdl_window,
56 motion.pointer_coordinates[cord_index].hscroll,
57 motion.pointer_coordinates[cord_index].vscroll);
58 break;
59-#endif
60 case mir_motion_action_cancel:
61 case mir_motion_action_hover_enter:
62 case mir_motion_action_hover_exit:
63@@ -226,16 +224,12 @@
64 {
65 int cord_index;
66 for (cord_index = 0; cord_index < motion.pointer_count; cord_index++) {
67-#if 0 /* !!! FIXME: needs a newer set of dev headers than Ubuntu 13.10 is shipping atm. */
68- if (motion.pointer_coordinates[cord_index].tool_type == mir_motion_tool_type_mouse) {
69+ if (motion.pointer_coordinates[cord_index].tool_type == mir_motion_tool_type_finger) {
70+ HandleTouchEvent(motion, cord_index, sdl_window);
71+ }
72+ else {
73 HandleMouseEvent(motion, cord_index, sdl_window);
74 }
75- else if (motion.pointer_coordinates[cord_index].tool_type == mir_motion_tool_type_finger) {
76- HandleTouchEvent(motion, cord_index, sdl_window);
77- }
78-#else
79- HandleMouseEvent(motion, cord_index, sdl_window);
80-#endif
81 }
82 }
83
84
85=== modified file 'src/video/mir/SDL_mirframebuffer.c'
86--- src/video/mir/SDL_mirframebuffer.c 2014-03-15 00:22:48 +0000
87+++ src/video/mir/SDL_mirframebuffer.c 2015-01-21 18:20:25 +0000
88@@ -56,6 +56,8 @@
89 MIR_Window* mir_window;
90 MirSurfaceParameters surfaceparm;
91
92+ mir_data->software = SDL_TRUE;
93+
94 if (MIR_CreateWindow(_this, window) < 0)
95 return SDL_SetError("Failed to created a mir window.");
96
97@@ -91,11 +93,13 @@
98 MirGraphicsRegion region;
99 int i, j, x, y, w, h, start;
100 int bytes_per_pixel, bytes_per_row, s_stride, d_stride;
101+ char* s_dest;
102+ char* pixels;
103
104 MIR_mir_surface_get_graphics_region(mir_window->surface, &region);
105
106- char* s_dest = region.vaddr;
107- char* pixels = (char*)window->surface->pixels;
108+ s_dest = region.vaddr;
109+ pixels = (char*)window->surface->pixels;
110
111 s_stride = window->surface->pitch;
112 d_stride = region.stride;
113
114=== modified file 'src/video/mir/SDL_mirsym.h'
115--- src/video/mir/SDL_mirsym.h 2014-03-15 00:22:48 +0000
116+++ src/video/mir/SDL_mirsym.h 2015-01-21 18:20:25 +0000
117@@ -26,7 +26,7 @@
118 SDL_MIR_SYM(MirSurface *,mir_connection_create_surface_sync,(MirConnection *connection, MirSurfaceParameters const *params))
119 SDL_MIR_SYM(void,mir_connection_get_available_surface_formats,(MirConnection* connection, MirPixelFormat* formats, unsigned const int format_size, unsigned int *num_valid_formats))
120 SDL_MIR_SYM(MirEGLNativeDisplayType,mir_connection_get_egl_native_display,(MirConnection *connection))
121-SDL_MIR_SYM(int,mir_connection_is_valid,(MirConnection *connection))
122+SDL_MIR_SYM(MirBool,mir_connection_is_valid,(MirConnection *connection))
123 SDL_MIR_SYM(void,mir_connection_release,(MirConnection *connection))
124 SDL_MIR_SYM(MirConnection *,mir_connect_sync,(char const *server, char const *app_name))
125 SDL_MIR_SYM(void,mir_display_config_destroy,(MirDisplayConfiguration* display_configuration))
126@@ -34,10 +34,11 @@
127 SDL_MIR_SYM(char const *,mir_surface_get_error_message,(MirSurface *surface))
128 SDL_MIR_SYM(void,mir_surface_get_graphics_region,(MirSurface *surface, MirGraphicsRegion *graphics_region))
129 SDL_MIR_SYM(void,mir_surface_get_parameters,(MirSurface *surface, MirSurfaceParameters *parameters))
130-SDL_MIR_SYM(int,mir_surface_is_valid,(MirSurface *surface))
131+SDL_MIR_SYM(MirBool,mir_surface_is_valid,(MirSurface *surface))
132 SDL_MIR_SYM(void,mir_surface_release_sync,(MirSurface *surface))
133 SDL_MIR_SYM(void,mir_surface_set_event_handler,(MirSurface *surface, MirEventDelegate const *event_handler))
134 SDL_MIR_SYM(MirWaitHandle*,mir_surface_set_type,(MirSurface *surface, MirSurfaceType type))
135+SDL_MIR_SYM(MirWaitHandle*,mir_surface_set_state,(MirSurface *surface, MirSurfaceState state))
136 SDL_MIR_SYM(void,mir_surface_swap_buffers_sync,(MirSurface *surface))
137
138 SDL_MIR_MODULE(XKBCOMMON)
139
140=== modified file 'src/video/mir/SDL_mirvideo.c'
141--- src/video/mir/SDL_mirvideo.c 2014-03-15 00:22:48 +0000
142+++ src/video/mir/SDL_mirvideo.c 2015-01-21 18:20:25 +0000
143@@ -82,7 +82,6 @@
144 /* !!! FIXME: try to make a MirConnection here. */
145 available = 1;
146 SDL_MIR_UnloadSymbols();
147-
148 }
149
150 return available;
151@@ -274,6 +273,7 @@
152 MIR_Data* mir_data = _this->driverdata;
153
154 mir_data->connection = MIR_mir_connect_sync(NULL, __PRETTY_FUNCTION__);
155+ mir_data->software = SDL_FALSE;
156
157 if (!MIR_mir_connection_is_valid(mir_data->connection))
158 return SDL_SetError("Failed to connect to the Mir Server");
159
160=== modified file 'src/video/mir/SDL_mirvideo.h'
161--- src/video/mir/SDL_mirvideo.h 2014-03-15 00:22:48 +0000
162+++ src/video/mir/SDL_mirvideo.h 2015-01-21 18:20:25 +0000
163@@ -32,6 +32,8 @@
164 typedef struct
165 {
166 MirConnection* connection;
167+ SDL_bool software;
168+
169 } MIR_Data;
170
171 #endif /* _SDL_mirvideo_h_ */
172
173=== modified file 'src/video/mir/SDL_mirwindow.c'
174--- src/video/mir/SDL_mirwindow.c 2014-03-15 00:22:48 +0000
175+++ src/video/mir/SDL_mirwindow.c 2015-01-21 18:20:25 +0000
176@@ -84,7 +84,8 @@
177 .width = window->w,
178 .height = window->h,
179 .pixel_format = mir_pixel_format_invalid,
180- .buffer_usage = mir_buffer_usage_hardware
181+ .buffer_usage = mir_buffer_usage_hardware,
182+ .output_id = mir_display_output_id_invalid
183 };
184
185 MirEventDelegate delegate = {
186@@ -99,6 +100,9 @@
187 mir_data = _this->driverdata;
188 window->driverdata = mir_window;
189
190+ if (mir_data->software)
191+ surfaceparm.buffer_usage = mir_buffer_usage_software;
192+
193 if (window->x == SDL_WINDOWPOS_UNDEFINED)
194 window->x = 0;
195
196@@ -145,14 +149,13 @@
197 MIR_Data* mir_data = _this->driverdata;
198 MIR_Window* mir_window = window->driverdata;
199
200- window->driverdata = NULL;
201-
202 if (mir_data) {
203 SDL_EGL_DestroySurface(_this, mir_window->egl_surface);
204 MIR_mir_surface_release_sync(mir_window->surface);
205
206 SDL_free(mir_window);
207 }
208+ window->driverdata = NULL;
209 }
210
211 SDL_bool
212@@ -183,9 +186,9 @@
213 return;
214
215 if (fullscreen) {
216- MIR_mir_surface_set_type(mir_window->surface, mir_surface_state_fullscreen);
217+ MIR_mir_surface_set_state(mir_window->surface, mir_surface_state_fullscreen);
218 } else {
219- MIR_mir_surface_set_type(mir_window->surface, mir_surface_state_restored);
220+ MIR_mir_surface_set_state(mir_window->surface, mir_surface_state_restored);
221 }
222 }
223
224@@ -197,7 +200,7 @@
225 if (IsSurfaceValid(mir_window) < 0)
226 return;
227
228- MIR_mir_surface_set_type(mir_window->surface, mir_surface_state_maximized);
229+ MIR_mir_surface_set_state(mir_window->surface, mir_surface_state_maximized);
230 }
231
232 void
233@@ -208,7 +211,7 @@
234 if (IsSurfaceValid(mir_window) < 0)
235 return;
236
237- MIR_mir_surface_set_type(mir_window->surface, mir_surface_state_minimized);
238+ MIR_mir_surface_set_state(mir_window->surface, mir_surface_state_minimized);
239 }
240
241 void
242@@ -219,7 +222,7 @@
243 if (IsSurfaceValid(mir_window) < 0)
244 return;
245
246- MIR_mir_surface_set_type(mir_window->surface, mir_surface_state_restored);
247+ MIR_mir_surface_set_state(mir_window->surface, mir_surface_state_restored);
248 }
249
250 #endif /* SDL_VIDEO_DRIVER_MIR */

Subscribers

People subscribed via source and target branches