Ander Conselvan de Oliveira [Wed, 15 Feb 2012 15:02:54 +0000 (17:02 +0200)]
shell: don't map surfaces with type NONE
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Ander Conselvan de Oliveira [Wed, 15 Feb 2012 15:02:53 +0000 (17:02 +0200)]
compositor: fix two crashs on surface_attach() with null buffer
The condition to return from surface_attach with a null buffer involves
es->output being non-null. However if a surface was just created this
field would be null and an attach of a null buffer would cause the
compositor to crash.
The other crash happened if surface_attach was called twice with a
null buffer after a valid buffer was attached to the surface. Since
es->buffer was not being set to NULL, surface_attach() would call
wl_list_remove(&es->buffer_destroy_listener.link) twice for the same
surface.
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Kristian Høgsberg [Thu, 16 Feb 2012 20:58:14 +0000 (15:58 -0500)]
Follow set_fullscreen protocol change
Kristian Høgsberg [Thu, 16 Feb 2012 20:53:46 +0000 (15:53 -0500)]
window: Toggle maximized with super-f5
Juan Zhao [Tue, 7 Feb 2012 00:45:41 +0000 (08:45 +0800)]
shell: Add the set_maximized implementation
Pekka Paalanen [Mon, 13 Feb 2012 11:03:59 +0000 (13:03 +0200)]
compositor, shell: add and use weston_surface_set_position()
Another shorthand like weston_surface_configure().
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Pekka Paalanen [Fri, 10 Feb 2012 14:40:22 +0000 (16:40 +0200)]
shell: remove two redundant statements from map()
I stared at this function for some time, and these were the only lines
I could sanely remove.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Tiago Vignatti [Fri, 10 Feb 2012 14:26:19 +0000 (16:26 +0200)]
compositor: make functions static
I know it's hard to figure out what the shells or backends will be
using as internal API at this point but we can try to minimize the
amount of WL_EXPORT being used anyway.
[pq: redone due to my earlier changes]
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Tiago Vignatti [Fri, 10 Feb 2012 14:17:23 +0000 (16:17 +0200)]
shell: remove duplicated code
This clean-up seems alright, but someone with better knowledge has to
doublecheck this function. I guess there's a lot of space for clean-up
there.
[pq: looks ok, redone since did not apply after my changes]
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Tiago Vignatti [Thu, 9 Feb 2012 17:06:56 +0000 (19:06 +0200)]
clients: fix spelling
Signed-off-by: Tiago Vignatti <vignatti@freedesktop.org>
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Tiago Vignatti [Thu, 9 Feb 2012 17:06:55 +0000 (19:06 +0200)]
window: simplify a bit widget_set_size and widget_set_allocation
Signed-off-by: Tiago Vignatti <vignatti@freedesktop.org>
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Tiago Vignatti [Thu, 9 Feb 2012 17:06:54 +0000 (19:06 +0200)]
window: explicitly set TYPE_TOPLEVEL for new windows
Signed-off-by: Tiago Vignatti <vignatti@freedesktop.org>
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Pekka Paalanen [Mon, 13 Feb 2012 09:04:30 +0000 (11:04 +0200)]
shell: do not apply damage on window type set
Setting a window type is a non-visual operation, it is not supposed to
affect the rendering immediately. Therefore it does not need to apply
surface damage.
The proper surface damage is applied on an attach request following a
window type change.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Pekka Paalanen [Mon, 13 Feb 2012 09:01:59 +0000 (11:01 +0200)]
compositor: remove redundant cursor damage calls
As weston_surface_update_transform() automatically applies before and
after damage on surface geometry change, we don't need to explicitly add
the same damage in motion_notify() for the cursor surface.
We still need the side-effect, that is scheduling a repaint.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Pekka Paalanen [Mon, 13 Feb 2012 08:34:04 +0000 (10:34 +0200)]
compositor: round off fractions
Round off fractions from non-transformed surface position coordinates.
Transformed surface moved by a client may have non-integer position
coordinates. That is required to prevent drifting on continuous
resizing.
We can round the position to integers when the surface is not (anymore)
transformed.
This change may fix a rounding inconsistency in the opaque region setup,
where the rectangle is initialised from the coordinates without explicit
rounding operation.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Pekka Paalanen [Fri, 10 Feb 2012 13:33:10 +0000 (15:33 +0200)]
shell: replace identity calls to weston_surface_configure()
In the past, weston_surface_configure() was used to change the geometry,
apply damage, and assign an output.
Remove all calls to weston_surface_configure() that do not change the
surface geometry. Add damage calls where needed to keep the wanted
configure side-effects.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Pekka Paalanen [Fri, 10 Feb 2012 11:34:36 +0000 (13:34 +0200)]
compositor: move output assignment to update_transform
Move the call to assign an output from weston_surface_configure() to
weston_surface_update_transform().
As update_transform takes new geometry into use, it should also reassign
the output for the surface, but only if an output was already assigned.
Add explicit assing output calls to where we relied on
weston_surface_configure() unconditionally assigning the output.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Pekka Paalanen [Thu, 9 Feb 2012 14:39:38 +0000 (16:39 +0200)]
compositor: move opaque tracking into transform
Move the surface opaque region setup from weston_surface_configure() to
weston_surface_update_transform(), so we have less reason to call
update_transform from configure. Opaque region depends on geometry,
after all.
Also move the opaque field from weston_surface to
weston_surface::transform to make this obvious.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Pekka Paalanen [Thu, 9 Feb 2012 13:58:44 +0000 (15:58 +0200)]
compositor: clarify update_transform vs. repaint
Remove redundant weston_surface_update_transform() calls from within
output repaint paths, and add a comment that we need to rely on
surface->geometry.dirty == 0 within the repaint sub-functions.
Now that weston_surface_update_transform() does damage as needed, and
weston_output_repaint() explicitly calls update_transform, we can reduce
the updates in rotate_grab_motion() to simply scheduling a repaint. This
will guarantee that the change in rotation ends up on screen ASAP.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Pekka Paalanen [Thu, 9 Feb 2012 13:32:15 +0000 (15:32 +0200)]
compositor: let update_transform deal damage
weston_surface_update_transform() is similar to
weston_surface_configure() in that it changes the surface region on
screen. Unlike configure, update_transform forgets to deal damage at
all, yet it is the only place where we can do damage_below() as needed.
Add a damage_below call to deal damage for the old surface region only
when needed. This uses the cached state from surface->transform to get
the old region.
Add a damage call to deal damage for the new surface region, after
updating the cached state.
Add a repaint call, since we have changed the scene and should render it
out.
This change fixes the rotation not updating the screen properly.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Pekka Paalanen [Thu, 9 Feb 2012 13:27:45 +0000 (15:27 +0200)]
compositor: simplify weston_surface_damage_rectangle()
The non-transformed case looked a little odd, calling
weston_surface_to_global(), since it already tests for transform.enabled
and simply uses width, height for the box.
Streamline it, by open-coding weston_surface_to_global(), and avoiding
another call into weston_surface_update_transform(). This way it does
not look suspicious to me.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Pekka Paalanen [Wed, 8 Feb 2012 13:38:37 +0000 (15:38 +0200)]
compositor: use floats in computing bounding box
In surface_compute_bbox(), call surface_to_global_float() instead of
weston_surface_to_global(). This avoids the recursion:
weston_surface_update_transform()
weston_surface_update_transform_enable()
surface_compute_bbox()
weston_surface_to_global()
weston_surface_update_transform()
which might be non-obvious when reading the code.
Computing the min and max coordinates in floats, we can have a tight
rounding margin by using floor() and ceil().
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Pekka Paalanen [Wed, 8 Feb 2012 13:23:15 +0000 (15:23 +0200)]
compositor: move surface_to_global_float() definition
Move surface_to_global_float() definition earlier in the file. No code
changes.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Pekka Paalanen [Wed, 8 Feb 2012 13:14:17 +0000 (15:14 +0200)]
compositor: split weston_surface_update_transform()
Split two helper functions out of weston_surface_update_transform() to:
- make the code clearer
- update the bounding box properly even if transformation fails
- unify the return point
Also add a comment on what matrix.d[12] is.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Pekka Paalanen [Wed, 8 Feb 2012 12:49:37 +0000 (14:49 +0200)]
compositor: split weston_surface_damage_below()
Extract the core into a function that does not call
weston_surface_update_transform() or schedule repaint.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Pekka Paalanen [Wed, 8 Feb 2012 12:19:18 +0000 (14:19 +0200)]
shell: remove excessive damage from rotating
Rotating a surface should not force a full display repaint, so remove
that.
This change exposes a bug: weston_surface_update_transform() does not
apply damage, but it does change surface geometry. While you rotate a
surface, repaints do not work.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Eric Anholt [Thu, 9 Feb 2012 16:36:03 +0000 (08:36 -0800)]
configure: Fix build on debian by avoiding bashisms in the test command.
Kristian Høgsberg [Thu, 9 Feb 2012 16:18:16 +0000 (11:18 -0500)]
Use dist-xz for tarballs
Kristian Høgsberg [Thu, 9 Feb 2012 14:20:44 +0000 (09:20 -0500)]
Disable setuid install for distcheck
Kristian Høgsberg [Wed, 8 Feb 2012 21:35:12 +0000 (16:35 -0500)]
configure: Change project to weston, set version to 0.89
Kristian Høgsberg [Wed, 8 Feb 2012 21:33:57 +0000 (16:33 -0500)]
compositor: Don't destroy sprite surface, just hide it
Kristian Høgsberg [Wed, 8 Feb 2012 19:47:53 +0000 (14:47 -0500)]
smoke: Use normal window resize mechanism
Kristian Høgsberg [Wed, 8 Feb 2012 19:45:02 +0000 (14:45 -0500)]
window: Don't set the window size in widget_set_size()
We propagate the toplevel widget size to the window size in the
window.c resize code.
Juan Zhao [Fri, 3 Feb 2012 00:02:06 +0000 (16:02 -0800)]
smoke: fix the segment fault error
Add widget_set_size in the initiate time to allow smoke get the
correct surface later. Or it will report segment fault error because
of the null surface.
Also add resize_handler to not allow resizing just like flower.
Signed-off-by: Juan Zhao <juan.j.zhao@linux.intel.com>
Kristian Høgsberg [Wed, 8 Feb 2012 17:46:57 +0000 (12:46 -0500)]
Add support for webp image format
Kristian Høgsberg [Wed, 8 Feb 2012 15:11:42 +0000 (10:11 -0500)]
cairo-util: Only look at first two bytes for jpegs
The next two bytes aren't fixed.
Peter Hutterer [Fri, 3 Feb 2012 10:58:19 +0000 (20:58 +1000)]
terminal: run $SHELL if set
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Jesse Barnes [Tue, 7 Feb 2012 20:42:28 +0000 (12:42 -0800)]
configure.ac: fix cairo-glesv2 help text
Finally figured out why --enable-cairo-gles2 wasn't working like
configure --help said it should.
Kristian Høgsberg [Tue, 7 Feb 2012 16:04:11 +0000 (11:04 -0500)]
Merge remote-tracking branch 'pq/transform-fixes2'
Kristian Høgsberg [Wed, 1 Feb 2012 12:45:51 +0000 (07:45 -0500)]
compositor-wayland: Add window border
Kristian Høgsberg [Tue, 7 Feb 2012 14:57:25 +0000 (09:57 -0500)]
compositor-wayland: Add display sub-option for wayland backend
This lets us launch the compositor on a separate wayland socket that
what we're listening on.
Kristian Høgsberg [Tue, 7 Feb 2012 14:56:51 +0000 (09:56 -0500)]
compositor-wayland: Hide cursor for compositor surfaces
Kristian Høgsberg [Tue, 7 Feb 2012 14:56:15 +0000 (09:56 -0500)]
compositor-wayland: Destroy wl_callback in callback function
Kristian Høgsberg [Wed, 1 Feb 2012 03:17:25 +0000 (22:17 -0500)]
compositor: Drop setuid when launching clients
Pekka Paalanen [Tue, 7 Feb 2012 12:19:01 +0000 (14:19 +0200)]
compositor: simple menu transform
Transform a menu popup the same as its parent surface.
The parent's transformation is snapshotted at the popup map() time, and
does not follow further parent motion.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Pekka Paalanen [Tue, 7 Feb 2012 11:18:00 +0000 (13:18 +0200)]
compositor: add weston_surface transformation doc
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Pekka Paalanen [Mon, 6 Feb 2012 14:26:57 +0000 (16:26 +0200)]
compositor: fix transformed opaque surface repainting
Computing the real maximal opaque screen aligned rectangle of a
transformed surface is hard. Let's drop the opaque optimisation
instead.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Pekka Paalanen [Mon, 6 Feb 2012 12:54:20 +0000 (14:54 +0200)]
compositor: q&d solution for surface drift
When a transformed (rotated) surface is continuously resized from its
top-left corner, its location will drift. This is due to accumulating
rounding errors in transforming an offset from surface-local to global
coordinates in surface_attach().
Diminish the drift down to unobservable level by changing the
weston_surface global position from integer to float.
The offset transformation is now done without rounding. To preserve the
precision, wl_shell::configure() interface must use floats, and so does
weston_surface_configure(), too.
The con of this patch is that it adds inconsistency to the surface
position coordinates: sometimes they are floats, sometimes integers.
Pekka Paalanen [Mon, 6 Feb 2012 10:16:07 +0000 (12:16 +0200)]
compositor: clear surface damage on draw
Commit
a0d6dc4f26c95ae08ffff7d5f1ee7c1f53bdf545 lost one line of code in
the refactoring, and so did not reset the surface damage on repaint
anymore. This causes damage to only accumulate, leading to a full
display redraw every cycle and hiding damage tracking issues.
Put the damage clear back.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Pekka Paalanen [Thu, 2 Feb 2012 14:49:05 +0000 (16:49 +0200)]
compositor: fix and simplify shader uniform handling
The uniform location variables should be signed, according to the OpenGL
ES 2 specification. Moreover, GL_NONE, i.e. 0, is not an invalid nor
special location; it is actually used as a valid uniform location.
Change struct weston_shader uniform members to signed.
Stop using 0 for identifying a non-existing uniform, use -1 instead.
Furthermore, as the spec says a) glGetUniformLocation() will return -1
for non-active/existing uniforms, and b) glUniform*() function will
simply ignore all calls with location -1, we can simplify the code. We
don't have to avoid locating uniforms that don't exist, and we don't
need to test for them in weston_surface_draw() either.
Remove the micro-optimisation that avoids setting 'alpha' uniform if it
has not changed, in the name of simplification.
Unify shader creation by dropping init_solid_shader(), and calling
weston_shader_init() instead. The downside is that we compile the vertex
shader twice at startup now.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Pekka Paalanen [Wed, 1 Feb 2012 09:31:31 +0000 (11:31 +0200)]
configure: add libpng to client libs
http://lists.freedesktop.org/archives/wayland-devel/2012-January/001975.html
reports a linking problem:
/usr/bin/ld: libtoytoolkit.a(cairo-util.o): undefined reference to
symbol 'png_set_filler@@PNG12_0'
/usr/bin/ld: note: 'png_set_filler@@PNG12_0' is defined in DSO
/usr/lib/i386-linux-gnu/libpng12.so.0 so try adding it to the linker command line
/usr/lib/i386-linux-gnu/libpng12.so.0: could not read symbols: Invalid
operation
collect2: ld returned 1 exit status
make[3]: [weston-terminal] Error 1 (ignored)
A similar problem is diagnosed here:
http://lists.fedoraproject.org/pipermail/devel/2010-March/133601.html
As some distros are shipping linkers, that do not resolve symbols from
implicitly linked libraries, check and link libpng explicitly.
Cc: nerdopolis <bluescreen_avenger@verizon.net>
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Kristian Høgsberg [Tue, 31 Jan 2012 20:38:36 +0000 (15:38 -0500)]
compositor: Don't just update uniforms when we change shaders
The uniforms change from surface to surface or output to output, so always
set them.
Kristian Høgsberg [Tue, 31 Jan 2012 20:34:15 +0000 (15:34 -0500)]
window: Fold window_resize into idle_resize
Kristian Høgsberg [Tue, 31 Jan 2012 20:30:47 +0000 (15:30 -0500)]
window: Don't overwrite window->allocation until we've done the resize
This way we can actually detect whether or not a window resizes.
Kristian Høgsberg [Tue, 31 Jan 2012 20:24:48 +0000 (15:24 -0500)]
window: Dont take width and height in window constructor
Always set this by scheduling an initial resize.
Kristian Høgsberg [Tue, 31 Jan 2012 16:53:20 +0000 (11:53 -0500)]
flower: Dont allow resizing
Kristian Høgsberg [Tue, 31 Jan 2012 14:54:04 +0000 (09:54 -0500)]
flower: Redraw flower on middle click, pop up window menu on right click
Kristian Høgsberg [Tue, 31 Jan 2012 14:53:44 +0000 (09:53 -0500)]
window: Make window frame menu available to client
Pekka Paalanen [Tue, 31 Jan 2012 14:35:19 +0000 (16:35 +0200)]
configure: use --disable-tests, since default is enabled
Add a nice help text, too.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Pekka Paalanen [Tue, 31 Jan 2012 14:35:18 +0000 (16:35 +0200)]
configure: toytoolkit GL apps depend on cairo-egl
Do not build toytoolkit applications that use GL, if Cairo-egl is not
available. These applications (which happen to be also the full GL
clients) do not work at all without Cairo-egl, and fail at runtime with
"unable to acquire window surface".
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Pekka Paalanen [Tue, 31 Jan 2012 10:04:54 +0000 (12:04 +0200)]
compositor: handle attach request in surface-local coordinates
The x, y offsets in attach request are in surface-local coordinates, as
that is the only coordinate system the clients know about. The offset
must be transformed to global coordinate system to be applied properly.
This approximately fixes the top-left resizing of transformed surfaces.
However, it suffers from drift due to accumulating rounding errors in
continuous resizing.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Pekka Paalanen [Mon, 30 Jan 2012 14:19:47 +0000 (16:19 +0200)]
shell: fix resize for transformed surfaces
This fixes the resize pointer motion vs. surface size mismatch for
right/bottom direction resizes. Top/left resizes need further fixes in
surface motion.
Additionally there is some clean-up in weston_surface_resize() to
eliminate a failure path, and fixing the Weston resize binding's resize
direction heuristic to follow transformations.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Pekka Paalanen [Mon, 30 Jan 2012 12:16:34 +0000 (14:16 +0200)]
shell: fix move of transformed surfaces
In the stack of transformations, change the rotation to be applied
to the surface before the absolute positioning. Doing so avoids having
to undo and redo the absolute positioning, and we can simply use the
surface center in local coordinates as the origin.
This fixes the surface move. Before, the surface moved along the surface
local axis, but the user expects it to move along the global axis with
the pointer.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Kristian Høgsberg [Tue, 31 Jan 2012 00:15:04 +0000 (19:15 -0500)]
test: Fix out-of-tree builds
Ander Conselvan de Oliveira [Mon, 30 Jan 2012 13:02:06 +0000 (15:02 +0200)]
build: fix build of matrix test
This test uses files from src/ so use COMPOSITOR_CFLAGS to find headers
in non-standard locations.
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Scott Moreau [Mon, 30 Jan 2012 14:05:14 +0000 (07:05 -0700)]
Update config files to reflect new terminal name, weston-terminal
krh: Updated to use /usr/bin/weston-terminal.
Kristian Høgsberg [Mon, 30 Jan 2012 14:10:14 +0000 (09:10 -0500)]
compositor: Allow attaching null buffer
Attaching a null buffer is allowed and takes the surface back to the
unattached state it starts in.
Scott Moreau [Fri, 27 Jan 2012 20:25:49 +0000 (13:25 -0700)]
Implement CONFIG_KEY_UNSIGNED_INTEGER
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.
Kristian Høgsberg [Fri, 27 Jan 2012 18:36:13 +0000 (13:36 -0500)]
shell: Rotate relative to current rotation
This avoids the surface jumping around when you start rotating it.
Kristian Høgsberg [Fri, 27 Jan 2012 16:58:31 +0000 (11:58 -0500)]
compositor: Only set surface geometry through weston_surface_configure()
There are too many things to keep track of now, so let's require going
through this.
Kristian Høgsberg [Fri, 27 Jan 2012 16:57:28 +0000 (11:57 -0500)]
compositor: Link to libm
Kristian Høgsberg [Fri, 27 Jan 2012 16:42:18 +0000 (11:42 -0500)]
Merge remote-tracking branch 'pq/transform-v1'
Pekka Paalanen [Fri, 27 Jan 2012 07:50:02 +0000 (09:50 +0200)]
desktop-shell: print what failed on exec
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Ander Conselvan de Oliveira [Fri, 27 Jan 2012 15:17:39 +0000 (17:17 +0200)]
window: fix resizing of windows backed by shm buffers
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>
Kristian Høgsberg [Fri, 27 Jan 2012 16:04:18 +0000 (11:04 -0500)]
window: Handle data_device.selection events with offer=NULL
This happens when the current selection data_offer is removed.
Pekka Paalanen [Fri, 27 Jan 2012 14:25:16 +0000 (16:25 +0200)]
Collabora copyright updates
which I forgot to add while working on these files.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Pekka Paalanen [Fri, 27 Jan 2012 12:38:33 +0000 (14:38 +0200)]
compositor: make overlap computation use the boundingbox
This makes the overlap to account for surface transformations.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Pekka Paalanen [Thu, 26 Jan 2012 11:12:45 +0000 (13:12 +0200)]
compositor: use bounding box for damage regions
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>
Pekka Paalanen [Thu, 26 Jan 2012 09:34:16 +0000 (11:34 +0200)]
compositor: weston_surface_assign_output() to use bounding box
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>
Pekka Paalanen [Thu, 26 Jan 2012 09:31:01 +0000 (11:31 +0200)]
compositor: weston_output_set_cursor() to use bounding box
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>
Pekka Paalanen [Thu, 26 Jan 2012 09:28:08 +0000 (11:28 +0200)]
compositor: weston_surface_draw() to use bounding box
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>
Pekka Paalanen [Wed, 25 Jan 2012 13:55:43 +0000 (15:55 +0200)]
compositor: move weston_surface::width,height into geometry
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>
Pekka Paalanen [Wed, 25 Jan 2012 13:17:40 +0000 (15:17 +0200)]
compositor: add weston_surface bounding box
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>
Pekka Paalanen [Wed, 25 Jan 2012 12:45:18 +0000 (14:45 +0200)]
compositor: fix zoom origin
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>
Pekka Paalanen [Wed, 25 Jan 2012 12:33:33 +0000 (14:33 +0200)]
compositor-drm: do not scan out transformed surfaces
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>
Pekka Paalanen [Wed, 25 Jan 2012 14:22:05 +0000 (16:22 +0200)]
compositor: move weston_surface::x,y into geometry
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>
Pekka Paalanen [Wed, 25 Jan 2012 11:37:39 +0000 (13:37 +0200)]
compositor: make position a surface transformation
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>
Pekka Paalanen [Tue, 24 Jan 2012 12:47:37 +0000 (14:47 +0200)]
compositor: honour repaint regions with transformed surfaces
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>
Pekka Paalanen [Tue, 24 Jan 2012 13:53:35 +0000 (15:53 +0200)]
compositor: disable attrib arrays after use
Not strictly necessary right now, but nice to clean up.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Pekka Paalanen [Tue, 24 Jan 2012 12:50:14 +0000 (14:50 +0200)]
compositor: remove unused *_uniform members
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Pekka Paalanen [Tue, 24 Jan 2012 07:59:29 +0000 (09:59 +0200)]
compositor: rewrite draw and input coordinate transformations
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>
Pekka Paalanen [Tue, 24 Jan 2012 07:53:37 +0000 (09:53 +0200)]
compositor: restructure weston_surface::transform
Separate mutable data and cached immutable data in struct
weston_surface.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Pekka Paalanen [Mon, 23 Jan 2012 08:02:47 +0000 (10:02 +0200)]
compositor: handle non-invertible surface transformations
Detect a non-invertible surface total transformation, disable it, and
warn about it.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Pekka Paalanen [Fri, 20 Jan 2012 14:48:25 +0000 (16:48 +0200)]
shell: add key binding for rotating a surface
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>
Pekka Paalanen [Fri, 20 Jan 2012 12:24:25 +0000 (14:24 +0200)]
compositor: apply full transformation to input coordinates
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>
Pekka Paalanen [Fri, 20 Jan 2012 11:04:56 +0000 (13:04 +0200)]
clickdot: implement the purpose
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>
Pekka Paalanen [Fri, 20 Jan 2012 09:09:13 +0000 (11:09 +0200)]
clickdot: a copy of resizor
Start a new application clickdot as a copy of resizor, with the name
changed.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Pekka Paalanen [Fri, 20 Jan 2012 08:47:57 +0000 (10:47 +0200)]
compositor: simplify the matrix inversion API
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>
Pekka Paalanen [Mon, 16 Jan 2012 13:38:17 +0000 (15:38 +0200)]
update git ignores
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Pekka Paalanen [Mon, 16 Jan 2012 13:04:28 +0000 (15:04 +0200)]
tests: add matrix-test
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>