Merge lp:~brandontschaefer/libsdl/sdl2-upstream-merges into lp:ubuntu/vivid/libsdl2

Proposed by Brandon Schaefer
Status: Merged
Merge reported by: Sebastien Bacher
Merged at revision: not available
Proposed branch: lp:~brandontschaefer/libsdl/sdl2-upstream-merges
Merge into: lp:ubuntu/vivid/libsdl2
Diff against target: 255 lines (+235/-0)
3 files modified
debian/changelog (+11/-0)
debian/patches/mir_upstream_patch.diff (+223/-0)
debian/patches/series (+1/-0)
To merge this branch: bzr merge lp:~brandontschaefer/libsdl/sdl2-upstream-merges
Reviewer Review Type Date Requested Status
Sebastien Bacher Approve
Review via email: mp+247666@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
Sebastien Bacher (seb128) wrote :

thanks

review: Approve

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

Subscribers

People subscribed via source and target branches