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
=== modified file 'debian/changelog'
--- debian/changelog 2015-01-06 23:39:58 +0000
+++ debian/changelog 2015-01-21 18:20:25 +0000
@@ -1,3 +1,14 @@
1libsdl2 (2.0.2+dfsg1-6ubuntu2) vivid; urgency=medium
2
3 * Rebuild against libmirclient.so.8. (Closes: #1402753)
4 * New fixes included:
5 - symbol fixes
6 - software renderering fixes
7 - touch events now supported
8 - set_type changed to set_state
9
10 -- Brandon Schaefer <brandon.schaefer@canonical.com> Tue, 20 Jan 2015 12:55:44 -0800
11
1libsdl2 (2.0.2+dfsg1-6ubuntu1) vivid; urgency=low12libsdl2 (2.0.2+dfsg1-6ubuntu1) vivid; urgency=low
213
3 * Merge from Debian unstable. Remaining changes:14 * Merge from Debian unstable. Remaining changes:
415
=== modified file 'src/video/mir/SDL_mirevents.c'
--- src/video/mir/SDL_mirevents.c 2014-03-15 00:22:48 +0000
+++ src/video/mir/SDL_mirevents.c 2015-01-21 18:20:25 +0000
@@ -117,6 +117,12 @@
117}117}
118118
119static void119static void
120HandleMouseMotion(SDL_Window* sdl_window, int x, int y)
121{
122 SDL_SendMouseMotion(sdl_window, 0, 0, x, y);
123}
124
125static void
120HandleTouchPress(int device_id, int source_id, SDL_bool down, float x, float y, float pressure)126HandleTouchPress(int device_id, int source_id, SDL_bool down, float x, float y, float pressure)
121{127{
122 SDL_SendTouch(device_id, source_id, down, x, y, pressure);128 SDL_SendTouch(device_id, source_id, down, x, y, pressure);
@@ -129,12 +135,6 @@
129}135}
130136
131static void137static void
132HandleMouseMotion(SDL_Window* sdl_window, int x, int y)
133{
134 SDL_SendMouseMotion(sdl_window, 0, 0, x, y);
135}
136
137static void
138HandleMouseScroll(SDL_Window* sdl_window, int hscroll, int vscroll)138HandleMouseScroll(SDL_Window* sdl_window, int hscroll, int vscroll)
139{139{
140 SDL_SendMouseWheel(sdl_window, 0, hscroll, vscroll);140 SDL_SendMouseWheel(sdl_window, 0, hscroll, vscroll);
@@ -205,13 +205,11 @@
205 case mir_motion_action_outside:205 case mir_motion_action_outside:
206 SDL_SetMouseFocus(NULL);206 SDL_SetMouseFocus(NULL);
207 break;207 break;
208#if 0 /* !!! FIXME: needs a newer set of dev headers than Ubuntu 13.10 is shipping atm. */
209 case mir_motion_action_scroll:208 case mir_motion_action_scroll:
210 HandleMouseScroll(sdl_window,209 HandleMouseScroll(sdl_window,
211 motion.pointer_coordinates[cord_index].hscroll,210 motion.pointer_coordinates[cord_index].hscroll,
212 motion.pointer_coordinates[cord_index].vscroll);211 motion.pointer_coordinates[cord_index].vscroll);
213 break;212 break;
214#endif
215 case mir_motion_action_cancel:213 case mir_motion_action_cancel:
216 case mir_motion_action_hover_enter:214 case mir_motion_action_hover_enter:
217 case mir_motion_action_hover_exit:215 case mir_motion_action_hover_exit:
@@ -226,16 +224,12 @@
226{224{
227 int cord_index;225 int cord_index;
228 for (cord_index = 0; cord_index < motion.pointer_count; cord_index++) {226 for (cord_index = 0; cord_index < motion.pointer_count; cord_index++) {
229#if 0 /* !!! FIXME: needs a newer set of dev headers than Ubuntu 13.10 is shipping atm. */227 if (motion.pointer_coordinates[cord_index].tool_type == mir_motion_tool_type_finger) {
230 if (motion.pointer_coordinates[cord_index].tool_type == mir_motion_tool_type_mouse) {228 HandleTouchEvent(motion, cord_index, sdl_window);
229 }
230 else {
231 HandleMouseEvent(motion, cord_index, sdl_window);231 HandleMouseEvent(motion, cord_index, sdl_window);
232 }232 }
233 else if (motion.pointer_coordinates[cord_index].tool_type == mir_motion_tool_type_finger) {
234 HandleTouchEvent(motion, cord_index, sdl_window);
235 }
236#else
237 HandleMouseEvent(motion, cord_index, sdl_window);
238#endif
239 }233 }
240}234}
241235
242236
=== modified file 'src/video/mir/SDL_mirframebuffer.c'
--- src/video/mir/SDL_mirframebuffer.c 2014-03-15 00:22:48 +0000
+++ src/video/mir/SDL_mirframebuffer.c 2015-01-21 18:20:25 +0000
@@ -56,6 +56,8 @@
56 MIR_Window* mir_window;56 MIR_Window* mir_window;
57 MirSurfaceParameters surfaceparm;57 MirSurfaceParameters surfaceparm;
5858
59 mir_data->software = SDL_TRUE;
60
59 if (MIR_CreateWindow(_this, window) < 0)61 if (MIR_CreateWindow(_this, window) < 0)
60 return SDL_SetError("Failed to created a mir window.");62 return SDL_SetError("Failed to created a mir window.");
6163
@@ -91,11 +93,13 @@
91 MirGraphicsRegion region;93 MirGraphicsRegion region;
92 int i, j, x, y, w, h, start;94 int i, j, x, y, w, h, start;
93 int bytes_per_pixel, bytes_per_row, s_stride, d_stride;95 int bytes_per_pixel, bytes_per_row, s_stride, d_stride;
96 char* s_dest;
97 char* pixels;
9498
95 MIR_mir_surface_get_graphics_region(mir_window->surface, &region);99 MIR_mir_surface_get_graphics_region(mir_window->surface, &region);
96100
97 char* s_dest = region.vaddr;101 s_dest = region.vaddr;
98 char* pixels = (char*)window->surface->pixels;102 pixels = (char*)window->surface->pixels;
99103
100 s_stride = window->surface->pitch;104 s_stride = window->surface->pitch;
101 d_stride = region.stride;105 d_stride = region.stride;
102106
=== modified file 'src/video/mir/SDL_mirsym.h'
--- src/video/mir/SDL_mirsym.h 2014-03-15 00:22:48 +0000
+++ src/video/mir/SDL_mirsym.h 2015-01-21 18:20:25 +0000
@@ -26,7 +26,7 @@
26SDL_MIR_SYM(MirSurface *,mir_connection_create_surface_sync,(MirConnection *connection, MirSurfaceParameters const *params))26SDL_MIR_SYM(MirSurface *,mir_connection_create_surface_sync,(MirConnection *connection, MirSurfaceParameters const *params))
27SDL_MIR_SYM(void,mir_connection_get_available_surface_formats,(MirConnection* connection, MirPixelFormat* formats, unsigned const int format_size, unsigned int *num_valid_formats))27SDL_MIR_SYM(void,mir_connection_get_available_surface_formats,(MirConnection* connection, MirPixelFormat* formats, unsigned const int format_size, unsigned int *num_valid_formats))
28SDL_MIR_SYM(MirEGLNativeDisplayType,mir_connection_get_egl_native_display,(MirConnection *connection))28SDL_MIR_SYM(MirEGLNativeDisplayType,mir_connection_get_egl_native_display,(MirConnection *connection))
29SDL_MIR_SYM(int,mir_connection_is_valid,(MirConnection *connection))29SDL_MIR_SYM(MirBool,mir_connection_is_valid,(MirConnection *connection))
30SDL_MIR_SYM(void,mir_connection_release,(MirConnection *connection))30SDL_MIR_SYM(void,mir_connection_release,(MirConnection *connection))
31SDL_MIR_SYM(MirConnection *,mir_connect_sync,(char const *server, char const *app_name))31SDL_MIR_SYM(MirConnection *,mir_connect_sync,(char const *server, char const *app_name))
32SDL_MIR_SYM(void,mir_display_config_destroy,(MirDisplayConfiguration* display_configuration))32SDL_MIR_SYM(void,mir_display_config_destroy,(MirDisplayConfiguration* display_configuration))
@@ -34,10 +34,11 @@
34SDL_MIR_SYM(char const *,mir_surface_get_error_message,(MirSurface *surface))34SDL_MIR_SYM(char const *,mir_surface_get_error_message,(MirSurface *surface))
35SDL_MIR_SYM(void,mir_surface_get_graphics_region,(MirSurface *surface, MirGraphicsRegion *graphics_region))35SDL_MIR_SYM(void,mir_surface_get_graphics_region,(MirSurface *surface, MirGraphicsRegion *graphics_region))
36SDL_MIR_SYM(void,mir_surface_get_parameters,(MirSurface *surface, MirSurfaceParameters *parameters))36SDL_MIR_SYM(void,mir_surface_get_parameters,(MirSurface *surface, MirSurfaceParameters *parameters))
37SDL_MIR_SYM(int,mir_surface_is_valid,(MirSurface *surface))37SDL_MIR_SYM(MirBool,mir_surface_is_valid,(MirSurface *surface))
38SDL_MIR_SYM(void,mir_surface_release_sync,(MirSurface *surface))38SDL_MIR_SYM(void,mir_surface_release_sync,(MirSurface *surface))
39SDL_MIR_SYM(void,mir_surface_set_event_handler,(MirSurface *surface, MirEventDelegate const *event_handler))39SDL_MIR_SYM(void,mir_surface_set_event_handler,(MirSurface *surface, MirEventDelegate const *event_handler))
40SDL_MIR_SYM(MirWaitHandle*,mir_surface_set_type,(MirSurface *surface, MirSurfaceType type))40SDL_MIR_SYM(MirWaitHandle*,mir_surface_set_type,(MirSurface *surface, MirSurfaceType type))
41SDL_MIR_SYM(MirWaitHandle*,mir_surface_set_state,(MirSurface *surface, MirSurfaceState state))
41SDL_MIR_SYM(void,mir_surface_swap_buffers_sync,(MirSurface *surface))42SDL_MIR_SYM(void,mir_surface_swap_buffers_sync,(MirSurface *surface))
4243
43SDL_MIR_MODULE(XKBCOMMON)44SDL_MIR_MODULE(XKBCOMMON)
4445
=== modified file 'src/video/mir/SDL_mirvideo.c'
--- src/video/mir/SDL_mirvideo.c 2014-03-15 00:22:48 +0000
+++ src/video/mir/SDL_mirvideo.c 2015-01-21 18:20:25 +0000
@@ -82,7 +82,6 @@
82 /* !!! FIXME: try to make a MirConnection here. */82 /* !!! FIXME: try to make a MirConnection here. */
83 available = 1;83 available = 1;
84 SDL_MIR_UnloadSymbols();84 SDL_MIR_UnloadSymbols();
85
86 }85 }
8786
88 return available;87 return available;
@@ -274,6 +273,7 @@
274 MIR_Data* mir_data = _this->driverdata;273 MIR_Data* mir_data = _this->driverdata;
275274
276 mir_data->connection = MIR_mir_connect_sync(NULL, __PRETTY_FUNCTION__);275 mir_data->connection = MIR_mir_connect_sync(NULL, __PRETTY_FUNCTION__);
276 mir_data->software = SDL_FALSE;
277277
278 if (!MIR_mir_connection_is_valid(mir_data->connection))278 if (!MIR_mir_connection_is_valid(mir_data->connection))
279 return SDL_SetError("Failed to connect to the Mir Server");279 return SDL_SetError("Failed to connect to the Mir Server");
280280
=== modified file 'src/video/mir/SDL_mirvideo.h'
--- src/video/mir/SDL_mirvideo.h 2014-03-15 00:22:48 +0000
+++ src/video/mir/SDL_mirvideo.h 2015-01-21 18:20:25 +0000
@@ -32,6 +32,8 @@
32typedef struct32typedef struct
33{33{
34 MirConnection* connection;34 MirConnection* connection;
35 SDL_bool software;
36
35} MIR_Data;37} MIR_Data;
3638
37#endif /* _SDL_mirvideo_h_ */39#endif /* _SDL_mirvideo_h_ */
3840
=== modified file 'src/video/mir/SDL_mirwindow.c'
--- src/video/mir/SDL_mirwindow.c 2014-03-15 00:22:48 +0000
+++ src/video/mir/SDL_mirwindow.c 2015-01-21 18:20:25 +0000
@@ -84,7 +84,8 @@
84 .width = window->w,84 .width = window->w,
85 .height = window->h,85 .height = window->h,
86 .pixel_format = mir_pixel_format_invalid,86 .pixel_format = mir_pixel_format_invalid,
87 .buffer_usage = mir_buffer_usage_hardware87 .buffer_usage = mir_buffer_usage_hardware,
88 .output_id = mir_display_output_id_invalid
88 };89 };
8990
90 MirEventDelegate delegate = {91 MirEventDelegate delegate = {
@@ -99,6 +100,9 @@
99 mir_data = _this->driverdata;100 mir_data = _this->driverdata;
100 window->driverdata = mir_window;101 window->driverdata = mir_window;
101102
103 if (mir_data->software)
104 surfaceparm.buffer_usage = mir_buffer_usage_software;
105
102 if (window->x == SDL_WINDOWPOS_UNDEFINED)106 if (window->x == SDL_WINDOWPOS_UNDEFINED)
103 window->x = 0;107 window->x = 0;
104108
@@ -145,14 +149,13 @@
145 MIR_Data* mir_data = _this->driverdata;149 MIR_Data* mir_data = _this->driverdata;
146 MIR_Window* mir_window = window->driverdata;150 MIR_Window* mir_window = window->driverdata;
147151
148 window->driverdata = NULL;
149
150 if (mir_data) {152 if (mir_data) {
151 SDL_EGL_DestroySurface(_this, mir_window->egl_surface);153 SDL_EGL_DestroySurface(_this, mir_window->egl_surface);
152 MIR_mir_surface_release_sync(mir_window->surface);154 MIR_mir_surface_release_sync(mir_window->surface);
153155
154 SDL_free(mir_window);156 SDL_free(mir_window);
155 }157 }
158 window->driverdata = NULL;
156}159}
157160
158SDL_bool161SDL_bool
@@ -183,9 +186,9 @@
183 return;186 return;
184187
185 if (fullscreen) {188 if (fullscreen) {
186 MIR_mir_surface_set_type(mir_window->surface, mir_surface_state_fullscreen);189 MIR_mir_surface_set_state(mir_window->surface, mir_surface_state_fullscreen);
187 } else {190 } else {
188 MIR_mir_surface_set_type(mir_window->surface, mir_surface_state_restored);191 MIR_mir_surface_set_state(mir_window->surface, mir_surface_state_restored);
189 }192 }
190}193}
191194
@@ -197,7 +200,7 @@
197 if (IsSurfaceValid(mir_window) < 0)200 if (IsSurfaceValid(mir_window) < 0)
198 return;201 return;
199202
200 MIR_mir_surface_set_type(mir_window->surface, mir_surface_state_maximized);203 MIR_mir_surface_set_state(mir_window->surface, mir_surface_state_maximized);
201}204}
202205
203void206void
@@ -208,7 +211,7 @@
208 if (IsSurfaceValid(mir_window) < 0)211 if (IsSurfaceValid(mir_window) < 0)
209 return;212 return;
210213
211 MIR_mir_surface_set_type(mir_window->surface, mir_surface_state_minimized);214 MIR_mir_surface_set_state(mir_window->surface, mir_surface_state_minimized);
212}215}
213216
214void217void
@@ -219,7 +222,7 @@
219 if (IsSurfaceValid(mir_window) < 0)222 if (IsSurfaceValid(mir_window) < 0)
220 return;223 return;
221224
222 MIR_mir_surface_set_type(mir_window->surface, mir_surface_state_restored);225 MIR_mir_surface_set_state(mir_window->surface, mir_surface_state_restored);
223}226}
224227
225#endif /* SDL_VIDEO_DRIVER_MIR */228#endif /* SDL_VIDEO_DRIVER_MIR */

Subscribers

People subscribed via source and target branches