summaryrefslogtreecommitdiff
path: root/clients/nested.c
Commit message (Collapse)AuthorAgeFilesLines
* clients/nested: fix undefined reference to xzallocU. Artie Eoff2016-04-251-0/+1
| | | | | | | | Include shared/xalloc.h in clients/nested.c to fix compilation error: undefined reference to `xzalloc' Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* Moved the MIN() macro to the helper include.Jon Cruz2015-06-151-2/+0
| | | | | | | | | | Removed multiple definitions of the MIN() macro from existing locations and unified with a single definition. Updated sources to use the shared version. 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>
* 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
|
* remove trailing whitespacesMichael Vetter2015-05-151-1/+1
| | | | | Remove trailing whitespaces because they are not needed and jumping to the end of al ine should do just that and not jump to the whitespace.
* Made weston-nested --help workBill Spitzak2014-08-191-2/+5
|
* Use pixman_region32_clear instead of our own empty_regionJason Ekstrand2014-07-051-8/+1
| | | | | | This requires pixman 0.25.2 Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
* 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>
* nested: Disable cairo on the subsurfacesNeil Roberts2014-04-061-0/+2
| | | | | | | | | The subsurface widgets on the nested example aren't using Cairo to render so we should turn it off to prevent the toy toolkit from creating a redundant extra surface for it. This is particularly important since Mesa commit 6c9d6898fdfd7e2 because the surface that the toolkit tries to create is zero-sized and that patch prevents that from working. This was causing weston-nested to crash.
* use xzalloc wrapper insteadU. Artie Eoff2014-01-191-2/+2
| | | | Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
* nested: Add EGL_WL_create_wayland_buffer_from_image compat definesKristian Høgsberg2013-12-171-0/+10
| | | | | Make it possible to compile this example with EGL implementations without this extension.
* nested: Add an option to disable subsurfacesNeil Roberts2013-12-041-0/+12
| | | | | | This adds a -b option to force the nested compositor example to use the old blit renderer even if the appropriate extensions are available.
* nested: Add a renderer using subsurfacesNeil Roberts2013-12-041-5/+209
| | | | | | | | | | | | Adds a second renderer implementation to the nested compositor example that creates a subsurface for each of the client's surfaces. The client buffers are directly attached to the subsurface using the EGL_WL_create_wayland_buffer_from_image extension instead of blitting them in the redraw_handler. The new renderer is always used if the parent compositor supports the wl_subcompositor protocol and the EGL extension is available. Otherwise it will fall back to the blit renderer.
* nested: Add a ‘renderer’ mechanism with a vtableNeil Roberts2013-12-041-71/+147
| | | | | | | | | Eventually the nested compositor example will want to be able to cope with either rendering as it does now with a blit to an intermediate surface or by attaching the client buffers directly to a subsurface without copying. This patch moves the code that is specific to the blitting mechanism into a separate set of functions with a vtable to make it easier to add the second way of rendering in a later patch.
* nested: Move the frame callback list to the surfaceNeil Roberts2013-12-041-11/+27
| | | | | | | | | | Previously the frame callback list was tracked as part of the global compositor state. This patch moves the list to be part of the surface state like it is in Weston. The frame callback now iterates the list of surfaces to flush all of the callbacks. This change will be useful when the example is converted to use subsurfaces so that it can have a separate frame callback for the subsurface and flush the list for an individual client surface rather than flushing globally.
* nested: Add damage tracking to the nested compositor exampleNeil Roberts2013-12-041-0/+21
| | | | | | | | The nested compositor example now responds to damage requests and tracks them in the pending buffer state. This isn't currently used for anything and it is immediately discarded when the surface is commited but it will be used later when the example is converted to use subsurfaces.
* nested: Add double-buffered state semantics to the nested exampleNeil Roberts2013-12-041-27/+103
| | | | | | | | The buffer and frame callback state on the surfaces in the nested compositor example are now double-buffered so that they only take effect when the commit request is received. This doesn't really make much difference for the current state that the example has but it will be useful when more state is added in later patches.
* nested: Add the buffer reference semantics from WestonNeil Roberts2013-12-041-4/+95
| | | | | | | | This copies the buffer reference busy count implementation from Weston to the nested compositor example and adds an internal nested_buffer struct that we could eventually use to attach data. This will be useful to adapt the example to use subsurfaces so that we can attach our compositor-side buffer to the resource.
* nested: Remove the surface from the surface list when destroyedNeil Roberts2013-12-041-0/+2
| | | | | | Otherwise if the surface is destroyed then it will crash when it later tries to render all of the surfaces. You can replicate this by doing killall weston-nested-client while the example is running.
* 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>
* nested: Cast away warnings for differing arguments to eglQueryWaylandBufferWLKristian Høgsberg2013-10-101-3/+5
|
* nested: Free client struct on launch_client error pathsKristian Høgsberg2013-10-101-0/+3
|
* nested: Fix skipping frames due to texture update without a contextAnder Conselvan de Oliveira2013-08-161-3/+9
| | | | | | | | | | | | | | | | | | Calls into cairo-gles may change the current context, so it was only by chance that sometimes we had the proper one as current and updated the correct texture in surface_attach(). In order to fix this, calling display_acquire_window_surface() before binding the texture for setup is necessary. However this call has the side effect of allocating a cairo surface for the window. At flush time, the existence of this surface will cause an eglSwapBuffers(), even if no rendering was done to it, leading to undefined contents on the screen. This happens when the idle redraw task runs while there is a pending frame callback. Workaround this by moving the texture setup from surface_attach() to the redraw handler, so that the cairo surface is only allocated when redering is done.
* nested: The wl_resouce is the buffer, not the wl_resource user dataKristian Høgsberg2013-08-161-5/+5
|
* nested: Use a void * to avoid warnings with EGL_WL_bind_wayland_displayKristian Høgsberg2013-08-121-1/+1
|
* malloc + memset -> zallocPeter Hutterer2013-08-081-4/+2
| | | | | | And for clients using the xmalloc helper, use xzalloc. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* nested: Update to use weston-nested-client binary nameKristian Høgsberg2013-08-071-1/+1
|
* Use #define WL_HIDE_DEPRECATED to avoid deprecated warnings for wl_bufferKristian Høgsberg2013-08-061-0/+1
|
* Convert to wl_global_create/destroy()Kristian Høgsberg2013-07-091-15/+23
|
* nested: Fix direct access to resource->dataKristian Høgsberg2013-06-251-6/+6
|
* nested: Port away from old wl_resource APIKristian Høgsberg2013-06-241-22/+28
|
* clients: Nested compositor exampleKristian Høgsberg2013-06-041-0/+608
A wayland compositor doesn't provide a mechanism for buffer sharing between clients. Under X, one client can render to a Pixmap and another can use it as a source in a subsequent drawing operations. Wayland doesn't have a mechanims to share Pixmaps or textures between clients like that, but it's possible for one client to act as a nested compositor to another client. This less work than it sounds, since the nested compositor won't have to provide input devices or even any kind of shell extension. The nested compositor and its client can be very tightly coupled and have very specific expectations of what the other process should provide. In this example, nested.c is a toytoolkit application that uses cairo-gl for rendering and forks and execs nested-client.c. As it execs the client, it passes it one end of a socketpair that will be the clients connection to the nested compositor. The nested compositor doesn't even create a listening socket. The client is a minimal GLES2 application, which just renders a spinning triangle in its frame callback.