summaryrefslogtreecommitdiff
path: root/clients/subsurfaces.c
Commit message (Collapse)AuthorAgeFilesLines
* clients & tests: Unify multiple definitions of x*alloc and related functionsBryce Harrington2016-03-171-0/+1
| | | | | | | | | | | | | Direct fail_on_null calls now produce output like: [weston-info] clients/weston-info.c:714: out of memory xmalloc, et al produce output on failure like: [weston-info] out of memory (-1) Signed-off-by: Bryce Harrington <bryce@osg.samsung.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* clients: Use zallocBryce Harrington2016-03-091-1/+2
| | | | Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
* Use [x]zalloc instead of [x]malloc + memsetRyo Munakata2015-08-071-4/+2
| | | | | Signed-off-by: Ryo Munakata <ryomnktml@gmail.com> Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
* Moved helper macro to a discrete include file.Jon Cruz2015-06-151-0/+1
| | | | | | | | | | | To help reduce code duplication and also 'kitchen-sink' includes the ARRAY_LENGTH macro was moved to a stand-alone file and referenced from the sources consuming it. Other macros will be added in subsequent passes. Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
* clients: Update boilerplate from MIT X11 license to MIT Expat licensesBryce Harrington2015-06-151-16/+17
|
* platform: rename create_egl_window to create_egl_surfaceJonny Lamb2015-03-261-3/+3
| | | | Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* clients & tests: use eglCreatePlatformWindowSurfaceEXT when supportedJonny Lamb2015-03-201-3/+3
| | | | | Reviewed-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
* clients & tests: use eglGetPlatformDisplayEXT when supportedJonny Lamb2015-03-201-1/+4
| | | | | Reviewed-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
* clients: Remove stray new-lineJonas Ådahl2015-01-261-2/+1
| | | | Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
* Made weston-subsurfaces --help workBill Spitzak2014-08-191-2/+2
|
* Make sure config.h is included before any system headersAndrew Wedgbury2014-04-071-0/+2
| | | | | | | | | | | | | | | There was an issue recently in screen-share.c where config.h was not being included, resulting in the wrong definition for off_t being used on 32 bit systems. I checked and I don't think this problem is happening elsewhere, but to help avoid this sort of problem in the future, I went through and made sure that config.h is included first whenever system headers are included. The config.h header should be included before any system headers, failing to do this can result in the wrong type sizes being defined on certain systems, e.g. off_t from sys/types.h Signed-off-by: Andrew Wedgbury <andrew.wedgbury@realvnc.com>
* westoy: Add an option to explicitly disable cairo on a widgetNeil Roberts2014-01-091-0/+1
| | | | | | | | | | | | | | | | | | | | The subsurfaces example creates a subsurface widget and uses EGL to render to it directly rather than using the cairo context from the widget. In theory this shouldn't cause any problems because the westoy window code lazily creates the cairo surface when an application creates a cairo context. However commit fdca95c7 changed the behaviour to force the lazy creation at the beginning of each surface redraw. This ends up making the triangle surface get two attaches – one from Cairo and one from the direct EGL. It looks like it would be difficult to reinstate the lazy surface creation behaviour whilst still maintaining the error handling for surface creation because none of the redraw handlers in the example clients are designed to cope with that. Instead, this patch adds an explicit option on a widget to disable creating the Cairo surface and the subsurface example now uses that. Closes: https://bugs.freedesktop.org/show_bug.cgi?id=72854
* Rename frame_create and frame_set_child_size with a window_ prefixJason Ekstrand2013-10-131-1/+1
| | | | | | This is to avoid a collision with an actual frame structure. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
* subsurfaces: fix rendering problem with cairo-glesv2Stanislav Vorobiov2013-08-281-0/+3
| | | | | | | | when using cairo-glesv2 subsurface rendering code implicitly calls eglMakeCurrent(dpy, NULL, NULL, ctx) (since EGL_KHR_surfaceless_context is used), thus, triangle_frame_callback:eglSwapBuffers returns EGL_BAD_SURFACE error for all invocations other that the first one
* window: Add API to check for subcompositor, use in subsurface exampleKristian Høgsberg2013-08-151-0/+6
| | | | This way we can fail with a nice error message.
* clients: use xmalloc in more placesBrian Lovin2013-08-071-4/+4
| | | | | | For the clients continue to use xmalloc() to simplify OOM-handling. Signed-off-by: Brian Lovin <brian.j.lovin@intel.com>
* clients: add subsurfaces demoPekka Paalanen2013-05-101-0/+792
Add a demo program with: - a main surface (green) - a Cairo-image sub-surface (red) - a raw GLESv2 widget (triangle) Sub-surface input region is set empty to avoid problems in toytoolkit. If Cairo links to libGL, then we will end up with also libGLESv2 linked to subsurfaces program, and both libs getting really used, which leads to disaster. Do not build subsurfaces demo, if Cairo links to libGL and cairo-egl is usable. The GL rendering loop is not tied to the toytoolkit or the widget, but runs directly from its own frame callback. Therefore it runs independent of the rest of the application. This also relies on one of two things: - eglSwapInterval(0) is implemented, and therefore eglSwapBuffers never blocks indefinitely, or - toytoolkit has a workaround, that guarantees that eglSwapBuffers will return soon, when we force a repaint on resize. Otherwise the demo will deadlock. The code is separated into three sections: 1. The library component, using only EGL, GLESv2, and libwayland-client APIs, and not aware of any toolkit details of the parent application. This runs independently until the parent application tells otherwise. 2. The glue code: a toytoolkit application widget, who has its own rendering machinery. 3. The application written in toytoolkit. This patch also adds new toytoolkit interfaces: - widget_get_wl_surface() - widget_get_last_time() - widget_input_region_add() Toytoolkit applications have not had a possibility to change the input region. The frame widget (decorations) set the input region on its own when used, otherwise the default input region of everything has been used. If a window does not have a frame widget, it can now use widget_input_region_add() to set a custom input region. These are not window methods, because a widget may lie on a different wl_surface (sub-surface) than the window. Changes in v3: - replace set_commit_mode with set_sync and set_desync Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>