summaryrefslogtreecommitdiff
path: root/src/zoom.c
AgeCommit message (Collapse)AuthorFilesLines
2015-03-27zoom: fix zoomDerek Foreman1-2/+2
Right now zoom only works on the output at 0, 0 because it's adding the output corner co-ordinates to global co-ordinates that already include the output offset. Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Bryce Harrington <b.harrington@samsung.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-03-11zoom: Use pixels instead of GL coordinatesJason Ekstrand1-26/+15
Previously, the zoom functions used GL coordinates natively which doesn't work with the new output matrix calculations. This changes zoom to work in pixel coordinates to match the new output matrix format. This also cleans up the math in the zoom code substantially. This patch changes the meaning of weston_output_zoom::trans_x,trans_y, and doing so probably breaks zoom on the rpi-renderer and all absolute input devices. These problems are fixed by the following patches: rpi-renderer: minimal fix to zoom coordinates compositor: use weston_matrix_transform for weston_output_transform_coordinate [Pekka: added a comment] Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-By: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2015-03-11zoom: remove unused args from weston_zoom_transitionPekka Paalanen1-6/+2
Also remove the now dead code from weston_output_update_zoom(). Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-By: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2015-03-11zoom: remove animation_xy as unusedPekka Paalanen1-46/+3
Remove several fields from struct weston_output_zoom as a consequence of removing animation_xy from it. Animation_xy was always empty, unused. Animation_xy was likely used by text_cursor_position implementation, but that was removed in commit a7af70436b7dccfacd736626d6719b3e751fd985. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Rviewed-By: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2015-01-20zoom: Check the value of level before using it.Carlos Olmedo Escobar1-1/+2
Check the value of level before dividing 1 by it. Signed-off-by: Carlos Olmedo Escobar <carlos.olmedo.e@gmail.com> Reviewed-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2014-05-06Apply the zoom transformation before the output transformationNeil Roberts1-47/+0
The zoom translation is just a scale and a translate. The translation is calculated based on the coordinates of the pointer which are in global space. Previously the calculated translation was transformed by the output transformation so that when the zoom transform is applied after the output transform then it will be correct. However if we just apply the zoom transformation first then we get the same result without the zoom code having to be aware of the output transformation. This also fixes weston_output_transform_coordinate which was applying the output and zoom transforms in the wrong order. https://bugs.freedesktop.org/show_bug.cgi?id=78211
2013-11-15zoom: use the new pointer motion signal to move the zoom frame.Giulio Camuffo1-0/+27
2013-10-22Split the geometry information from weston_surface out into weston_viewJason Ekstrand1-153/+12
The weston_surface structure is split into two structures: * The weston_surface structure storres everything required for a client-side or server-side surface. This includes buffers; callbacks; backend private data; input, damage, and opaque regions; and a few other bookkeeping bits. * The weston_view structure represents an entity in the scenegraph and storres all of the geometry information. This includes clip region, alpha, position, and the transformation list as well as all of the temporary information derived from the geometry state. Because a view, and not a surface, is a scenegraph element, the view is what is placed in layers and planes. There are a few things worth noting about the surface/view split: 1. This is *not* a modification to the protocol. It is, instead, a modification to Weston's internal scenegraph to allow a single surface to exist in multiple places at a time. Clients are completely unaware of how many views to a particular surface exist. 2. A view is considered a direct child of a surface and is destroyed when the surface is destroyed. Because of this, the view.surface pointer is always valid and non-null. 3. The compositor's surface_list is replaced with a view_list. Due to subsurfaces, building the view list is a little more complicated than it used to be and involves building a tree of views on the fly whenever subsurfaces are used. However, this means that backends can remain completely subsurface-agnostic. 4. Surfaces and views both keep track of which outputs they are on. 5. The weston_surface structure now has width and height fields. These are populated when a new buffer is attached before surface.configure is called. This is because there are many surface-based operations that really require the width and height and digging through the views didn't work well. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2013-07-09Convert to wl_global_create/destroy()Kristian Høgsberg1-5/+8
2013-07-03Use wl_resource_create() for creating resourcesJason Ekstrand1-2/+8
This commit sets the version numbers for all added/created objects. The wl_compositor.create_surface implementation was altered to create a surface with the same version as the underlying wl_compositor. Since no other "child interfaces" have version greater than 1, they were all hard-coded to version 1. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2013-06-25compositor: Remove a few legacy uses of wl_objectKristian Høgsberg1-4/+0
2013-06-12Change weston_surface.resource to a wl_resource pointer.Jason Ekstrand1-1/+4
This is the first in what will be a series of weston patches to convert instances of wl_resource to pointers so we can make wl_resource opaque. This patch handles weston_surface and should be the most invasive of the entire series. I am sending this one out ahead of the rest for review. Specifically, my machine is not set up to build XWayland so I have no ability to test it fully. Could someone please test with XWayland and let me know if this causes problems? Because a surface may be created from XWayland, the resource may not always exist. Therefore, a destroy signal was added to weston_surface and everything used to listen to surface->resource.destroy_signal now listens to surface->destroy_signal.
2013-06-05configure.ac: Enable AC_USE_SYSTEM_EXTENSIONSDaniel Stone1-0/+2
AC_USE_SYSTEM_EXTENSIONS enables _XOPEN_SOURCE, _GNU_SOURCE and similar macros to expose the largest extent of functionality supported by the underlying system. This is required since these macros are often limiting rather than merely additive, e.g. _XOPEN_SOURCE will actually on some systems hide declarations which are not part of the X/Open spec. Since this goes into config.h rather than the command line, ensure all source is consistently including config.h before anything else, including system libraries. This doesn't need to be guarded by a HAVE_CONFIG_H ifdef, which was only ever a hangover from the X.Org modular transition. Signed-off-by: Daniel Stone <daniel@fooishbar.org> [pq: rebased and converted more files]
2013-05-07input: Merge wl_seat into weston_seatKristian Høgsberg1-6/+6
2012-11-21zoom: Don't update the zoom translation if zoom level is 0Ander Conselvan de Oliveira1-1/+2
On the first frame with zoom activated, the spring used for animation will have a current value of zero. The translation calculated with that value will be invalid (not a number). Using this value later leads to having an invalid output matrix, so nothing is composited in the first zoomed frame. This problem is most evident when a sprite plane is being used. In that case, enabling the zoom will cause the surface to be moved back to the primary plane, but because of the bug described above, this surface would not actually be rendered causing a quick flicker.
2012-11-16shell/zoom: Increment/decrement disable_planes only when zoom.active changesVille Syrjälä1-1/+1
disable_planes should only be incremented when zoom.active actually toggles. Otherwise the counter will be incremented too many times, and planes will no longer get used. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
2012-08-29Implement output transformations.Scott Moreau1-4/+51
This patch allows rotation and mirroring outputs for x11 and drm backends. A new 'transform' key can be set in the [output] section. From the protocol: "The flipped values correspond to an initial flip around a vertical axis followed by rotation." The transform key can be one of the following 8 strings: normal 90 180 270 flipped flipped-90 flipped-180 flipped-270
2012-08-10zoom: Pick the first seat in seat_list instead of compositor->seatKristian Høgsberg1-12/+19
2012-08-03compositor-drm: Disable planes when zoomed or capturingKristian Høgsberg1-1/+3
When the entire output is transformed or we're capturing the output for screenshot or video, disable all output specific overlays (drm planes, hw cursors etc) and move all surfaces into the primary plane.
2012-06-25Move text-cursor-position.c into zoom.cKristian Høgsberg1-0/+63
2012-06-18Move zoom code to its own file.Scott Moreau1-0/+267