summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2012-01-31Introduce weston-launchwinitBenjamin Franzke13-20/+975
weston-launch starts weston and provides mechanism for weston to set/drop drm master, open a tty, and read input devices without being root. Execution is allowed for local-active sessions or users in the group weston-launch.
2012-01-27Implement CONFIG_KEY_UNSIGNED_INTEGERScott Moreau3-5/+16
strtol() does not work when trying to assign 32 bits of data into a regular signed int on 32 bit systems. Use corresponding strtoul() instead.
2012-01-27shell: Rotate relative to current rotationKristian Høgsberg1-7/+35
This avoids the surface jumping around when you start rotating it.
2012-01-27compositor: Only set surface geometry through weston_surface_configure()Kristian Høgsberg2-22/+11
There are too many things to keep track of now, so let's require going through this.
2012-01-27compositor: Link to libmKristian Høgsberg1-1/+1
2012-01-27Merge remote-tracking branch 'pq/transform-v1'Kristian Høgsberg18-293/+1511
2012-01-27desktop-shell: print what failed on execPekka Paalanen1-1/+1
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-27window: fix resizing of windows backed by shm buffersAnder Conselvan de Oliveira1-2/+1
When window_attach_surface() calls window_get_resize_dx_dy(), window->resize_edges is cleared. However if there is already a pending surface to be attached, the resize won't be done until the following call to window_attach_surface(). In this next call, since resize_edges is now zero, the top-left corner of the window will be unchanged. If the user is resizing from the top or left border, this causes the resize to happen in the wrong direction. This patch changes window_attach_surface() to call window_get_resize_dx_dy() only if an attach will actually happen. Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
2012-01-27window: Handle data_device.selection events with offer=NULLKristian Høgsberg1-3/+5
This happens when the current selection data_offer is removed.
2012-01-27Collabora copyright updatesPekka Paalanen3-1/+3
which I forgot to add while working on these files. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-27compositor: make overlap computation use the boundingboxPekka Paalanen1-9/+6
This makes the overlap to account for surface transformations. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-27compositor: use bounding box for damage regionsPekka Paalanen1-17/+27
Change weston_surface_damage*() functions to use the full surface bounding box or call surface_compute_bbox() to find the bounding box for an arbitrary rectangle. This should fix all rendering artifacts for non-opaque (i.e. ARGB) transformed surfaces. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-27compositor: weston_surface_assign_output() to use bounding boxPekka Paalanen1-5/+6
Use the bounding box to compute an approximation of which output contains most of the surface. Move the region32 init outside the loop, and fini it, too. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-27compositor: weston_output_set_cursor() to use bounding boxPekka Paalanen1-6/+5
If we ever have transformed cursor surfaces, we would better use the bounding box to check if it is on the given output. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-27compositor: weston_surface_draw() to use bounding boxPekka Paalanen1-6/+8
Use the proper bounding box in clipping the surface repaint area. Fixes excessive clipping for transformed surfaces. Also don't leak the region32 on early return. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-27compositor: move weston_surface::width,height into geometryPekka Paalanen5-54/+74
weston_surface::transform.boundingbox depends on width and height, and therefore geometry.dirty flag, so move width and height into geometry. Fix all users and check that the dirty flag is set. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-27compositor: add weston_surface bounding boxPekka Paalanen2-0/+48
Compute a surface bounding box, especially for transformed surfaces, for which one cannot simply use x,y,width,height. The bounding box depends on width and height, so these are now under the geometry.dirty flag. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-27compositor: fix zoom originPekka Paalanen1-5/+3
Now that we can insert a transformation before the surface position translation, we can drop geometry.x,y from the zoom transformation. That was just undoing and redoing the position translation. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-27compositor-drm: do not scan out transformed surfacesPekka Paalanen1-0/+1
Not sure this check belongs here, but as the position checks are here too, I added this. Just so we don't forget. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-27compositor: move weston_surface::x,y into geometryPekka Paalanen6-73/+101
weston_surface::transform.position depends on x,y, and therefore the dirty flag, so move x and y into geometry. Also add the missing dirty flags. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-27compositor: make position a surface transformationPekka Paalanen2-6/+18
Put the surface translation (absolute position) into the surface transformations list. This allows to set additional transformations before and after the global translation. Having the translation cached, changing the surface x,y now requires to set the geometry.dirty flag. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-27compositor: honour repaint regions with transformed surfacesPekka Paalanen2-70/+50
Previously, if a surface was transformed, it repainted as a whole, regardless of the computed repaint region. As damage regions determine repaint regions and whether a surface is considered for drawing at all, this lead to disappearing surfaces if all surfaces were considered transformed. Also transparent transformed surfaces were redrawn without the surfaces below being properly redrawn, leading to alpha-saturation. Fix that by making texture_region() use the proper global-to-surface coordinate transformation for texture coordinates. This makes it possible to call texture_region() also for transformed surfaces. As texture coordinates may now lie outside the valid texture image, the fragment shader is modified to check the fragment texture coordinates. The special path texture_transformed_surface() is no longer used and is removed. This change fixes many of the rendering artifacts related to transformed surfaces. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-27compositor: disable attrib arrays after usePekka Paalanen1-0/+4
Not strictly necessary right now, but nice to clean up. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-27compositor: remove unused *_uniform membersPekka Paalanen1-1/+0
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-27compositor: rewrite draw and input coordinate transformationsPekka Paalanen3-49/+97
For unifying the coordinate system handling, introduce functions for converting explicitly between the global and the surface local coordinate systems. Use these functions in the input path, replacing weston_surface_transform(). In the draw path, rewrite transform_vertex() to take in surface local coordinates. As shell now uses the new functions, the rotation origin is properly placed in the middle of the surface. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-27compositor: restructure weston_surface::transformPekka Paalanen4-15/+30
Separate mutable data and cached immutable data in struct weston_surface. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-27compositor: handle non-invertible surface transformationsPekka Paalanen1-1/+6
Detect a non-invertible surface total transformation, disable it, and warn about it. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-27shell: add key binding for rotating a surfacePekka Paalanen3-1/+136
Add the key binding Super+Alt+MouseLeftButton to start rotating a surface by dragging. The rotation is removed, when the drag is near the rotation origin. Rotated surface are a stress test for input event coordinate transformations, damage region tracking, draw transformations, and window move and resize orientation. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-27compositor: apply full transformation to input coordinatesPekka Paalanen1-26/+35
When converting input coordinates from global to surface-local system, apply the full inverse surface transformation instead of just translation. Move weston_surface_update_transform() implementation realier in the file, no changes. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-27clickdot: implement the purposePekka Paalanen1-101/+23
Remove all unneeded resizor features, and add the feature why clickdot exists: put a visible marker to exactly where mouse was clicked. This app can be used to check input coordinate transformations in a compositor. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-27clickdot: a copy of resizorPekka Paalanen3-0/+264
Start a new application clickdot as a copy of resizor, with the name changed. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-27compositor: simplify the matrix inversion APIPekka Paalanen6-67/+81
The compositor will likely do an order of magnitude less matrix inversions than point transformations with an inverse, hence we do not really need the optimised path for single-shot invert-and-transform. Expose only the computing of the explicit inverse matrix in the API. However, the matrix inversion tests need access to the internal functions. Designate a unit test build by #defining UNIT_TEST, and export the internal functions in that case. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-27update git ignoresPekka Paalanen2-3/+4
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-27tests: add matrix-testPekka Paalanen6-3/+459
Add a new directory tests/ for unit test applications. This directory will be built only if --enable-tests is given to ./configure. Add matrix-test application. It excercises especially the weston_matrix_invert() and weston_matrix_inverse_transform() functions. It has one test for correctness and precision, and other tests for measuring the speed of various matrix operations. For the record, the correctness test prints: a random matrix: 1.112418e-02 2.628150e+00 8.205844e+02 -1.147526e-04 4.943677e-04 -1.117819e-04 -9.158849e-06 3.678122e-02 7.915063e-03 -3.093254e-04 -4.376583e+02 3.424706e-02 -2.504038e+02 2.481788e+03 -7.545445e+01 1.752909e-03 The matrix multiplied by its inverse, error: 0.000000e+00 -0.000000e+00 -0.000000e+00 -0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 -0.000000e+00 -0.000000e+00 0.000000e+00 -0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 max abs error: 0, original determinant 11595.2 Running a test loop for 10 seconds... test fail, det: -0.00464805, error sup: inf test fail, det: -0.0424053, error sup: 1.30787e-06 test fail, det: 5.15191, error sup: 1.15956e-06 tests: 6791767 ok, 1 not invertible but ok, 3 failed. Total: 6791771 iterations. These results are expected with the current precision thresholds in src/matrix.c and tests/matrix-test.c. The random number generator is seeded with a constant, so the random numbers should be the same on every run. Machine speed and scheduling affect how many iterations are run. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-27compositor: implement inverse matrix transformationPekka Paalanen4-5/+133
Implement 4x4 matrix inversion based on LU-decomposition with partial pivoting. Instead of simply computing the inverse matrix explicitly, introduce the type struct weston_inverse_matrix for storing the LU-decomposition and the permutation from pivoting. Using doubles, this struct has greater precision than struct weston_matrix. If you need only few (less than 5, presumably) multiplications with the inverse matrix, is it cheaper to use weston_inverse_matrix, and not compute the inverse matrix explicitly into a weston_matrix. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-27compositor: drop inverse matrix from weston_transformPekka Paalanen5-11/+18
Remove the inverse matrix member from struct weston_transform. It is easier (and probably faster, too) to create and store only forward transformation matrices in a list, multiply them once, and then invert the final matrix, rather than creating both forward and inverse matrices, and multiplying both. Add a stub for the 4x4 matrix inversion function. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-27compositor: move matrix code to separate filesPekka Paalanen5-93/+151
Move matrix code to separate files to allow writing unit tests for it. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-27util: document matricesPekka Paalanen1-0/+10
Add comments explaining the matrix storage and multiplication, so that no-one else needs to decipher them again. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-27compositor: implement a stack of surface transformationsPekka Paalanen3-10/+55
Having at most one transformation object attached to a surface is not enough anymore. If we have a surface that needs to be scaled to fullscreen, and then we have the zoom animation, we already need two transformations combined. Implement support for multiple transformations by adding a transformation list. The final transformation is the ordered composite of those in the list. To avoid traversing the list every single time, add a dirty flag, and cache the final transformation. The existing transformation users (only zoom) are converted. Note: surface drawing should honour all kinds of transformations, but not damage region code nor input event translating code take transformations into account, AFAICT. Therefore anything but translation will probably behave badly until they are fixed. Cc: Juan Zhao <juan.j.zhao@linux.intel.com> Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-26cairo-util: Don't anger png.h by including setjmp.hKristian Høgsberg1-1/+0
Older libpngs are a bit fussy about this, apparently.
2012-01-26window: Don't crash when window with focus_widget is destroyedKristian Høgsberg1-0/+3
We would try to deliver a leave event to a widget in a destroyed window.
2012-01-26compositor: Keep fade surface around while we're fadingKristian Høgsberg2-18/+24
This removes more special cases from weston_output_repaint() and we avoid creating and destroying the surface for each animation frame. We gain another special case in weston_compositor_top(), but that's less of a problem, and we'll fix that later.
2012-01-26compositor: Use weston_surface_create for creating solid color fade surfaceKristian Høgsberg1-47/+13
2012-01-26compositor: Create surfaces neutral, select shader laterKristian Høgsberg1-7/+27
We only setup the shader and create the texture once we attach a buffer or set a color.
2012-01-26compositor: Drop unused saved_texture surface fieldKristian Høgsberg2-9/+2
2012-01-26compositor: Clear repaint_scheduled when an idle repaint is cancelledKristian Høgsberg1-1/+2
We don't hit this case often, but if we did, the compositor would get stuck thinking a repaint was already scheduled.
2012-01-26compositor: Combine repaint and weston_output_repaintKristian Høgsberg1-19/+11
Fewer repaint functions is better.
2012-01-26compositor: Compute overlapped early and base hw cursor decision on thatKristian Høgsberg3-31/+49
2012-01-26compositor: Move tracking of scanout buffers to compositor-drmKristian Høgsberg3-60/+56
2012-01-25compositor: Remove prepare_scanout_surface calloutKristian Høgsberg5-90/+60
For the drm backend, we just refactor setup_scanout_surface into drm_output_prepare_scanout_surface and call it from drm_output_repaint.