profile/ivi/weston.git
11 years agoUpdating changelog 79/1879/1 1.0 1.0_branch accepted/1.0/20121101.212417 submit/1.0/20121101.042911 submit/touch/20120928.233025
Rusty Lynch [Fri, 28 Sep 2012 23:29:56 +0000 (16:29 -0700)]
Updating changelog

11 years agoForce all BTN_TOUCH events to be interpertted as left mouse button events 78/1878/1
Rusty Lynch [Fri, 28 Sep 2012 23:21:48 +0000 (16:21 -0700)]
Force all BTN_TOUCH events to be interpertted as left mouse button events

11 years agoAdd support for flipping touchscreen x values and touchscreen y values 76/1876/1
Rusty Lynch [Fri, 28 Sep 2012 22:39:15 +0000 (15:39 -0700)]
Add support for flipping touchscreen x values and touchscreen y values

11 years agoBoot weston.service after intel-emgd-kmod.service 13/1813/1
Wang Quanxian [Mon, 24 Sep 2012 03:13:57 +0000 (11:13 +0800)]
Boot weston.service after intel-emgd-kmod.service

Signed-Off-By Quanxian Wang <quanxian.wang@intel.com>

11 years agoRelease mechanics for TIVI-107 udev rules 66/1766/1 accepted/trunk/20120918.172254 submit/trunk/20120918.173721
Rob Bradford [Tue, 18 Sep 2012 17:36:38 +0000 (18:36 +0100)]
Release mechanics for TIVI-107 udev rules

11 years agopackaging: Add udev rule to quirk the touchscreen on VTC1000 65/1765/1
Rob Bradford [Tue, 18 Sep 2012 16:51:15 +0000 (17:51 +0100)]
packaging: Add udev rule to quirk the touchscreen on VTC1000

11 years agoRelease to include changes needed for TIVI-107 64/1764/1 accepted/trunk/20120918.171935 submit/trunk/20120918.155052
Rob Bradford [Tue, 18 Sep 2012 15:50:20 +0000 (16:50 +0100)]
Release to include changes needed for TIVI-107

11 years agocompositor-drm: Add quirk loading from udev
Rob Bradford [Mon, 17 Sep 2012 17:07:00 +0000 (18:07 +0100)]
compositor-drm: Add quirk loading from udev

Look at udev properties and then set the quirk flags based on the udev
properties that are set on the device node.

11 years agoevdev: Add support for device quirks and implement axes swapping
Rob Bradford [Mon, 17 Sep 2012 17:02:22 +0000 (18:02 +0100)]
evdev: Add support for device quirks and implement axes swapping

This quirk is designed for hardware that has the X and Y axes swapped for
absolute events.

11 years agoupdate the changelog 62/1762/1 accepted/trunk/20120918.000035 submit/trunk/20120917.235010
Rusty Lynch [Mon, 17 Sep 2012 23:49:30 +0000 (16:49 -0700)]
update the changelog

11 years agoAdd HOME to the list of env varialbes set in the systemd config 61/1761/1
Rusty Lynch [Mon, 17 Sep 2012 23:47:41 +0000 (16:47 -0700)]
Add HOME to the list of env varialbes set in the systemd config

11 years agoIntroduce patch to fix TIVI-191 46/1746/1 accepted/trunk/20120914.215827 submit/trunk/20120914.221040
Rob Bradford [Fri, 14 Sep 2012 22:10:02 +0000 (23:10 +0100)]
Introduce patch to fix TIVI-191

11 years agocompositor-drm: Don't try and scan out a SHM buffer directly 45/1745/1
Rob Bradford [Fri, 14 Sep 2012 22:02:47 +0000 (23:02 +0100)]
compositor-drm: Don't try and scan out a SHM buffer directly

gbm_bo_import will fail to produce a valid bo since the buffer is an SHM
buffer. This cause a crash when the NULL bo returned by gbm_bo_import is
dereferenced later.

Signed-off-by: Rob Bradford <rob@linux.intel.com>
11 years agoAdd manpage to spec file 27/1727/1 accepted/trunk/20120913.200307 submit/trunk/20120913.180132
Rob Bradford [Thu, 13 Sep 2012 17:55:25 +0000 (18:55 +0100)]
Add manpage to spec file

11 years agoUpdate snapshot 23/1723/1 submit/trunk/20120913.174637
Rob Bradford [Thu, 13 Sep 2012 17:46:00 +0000 (18:46 +0100)]
Update snapshot

11 years agoUpdate to force rebuild
Rob Bradford [Thu, 16 Aug 2012 17:22:22 +0000 (18:22 +0100)]
Update to force rebuild

11 years agoUpdate snapshot
Rob Bradford [Thu, 16 Aug 2012 08:56:48 +0000 (09:56 +0100)]
Update snapshot

11 years agoAdd new installed file - weston-info
Rob Bradford [Thu, 16 Aug 2012 08:56:33 +0000 (09:56 +0100)]
Add new installed file - weston-info

11 years agoUpdate snapshot
Rob Bradford [Thu, 16 Aug 2012 08:47:38 +0000 (09:47 +0100)]
Update snapshot

11 years agoRemove file from .spec
Rob Bradford [Thu, 16 Aug 2012 08:45:42 +0000 (09:45 +0100)]
Remove file from .spec

11 years agoUpdate snapshot
Rob Bradford [Thu, 16 Aug 2012 08:39:09 +0000 (09:39 +0100)]
Update snapshot

11 years agoDisable xwayland
Rob Bradford [Tue, 14 Aug 2012 17:30:10 +0000 (18:30 +0100)]
Disable xwayland

11 years agoBump .changes and spec for update
Rob Bradford [Tue, 14 Aug 2012 15:51:32 +0000 (16:51 +0100)]
Bump .changes and spec for update

11 years agoFix some lint errors in the spec file
Rob Bradford [Tue, 14 Aug 2012 15:53:51 +0000 (16:53 +0100)]
Fix some lint errors in the spec file

11 years agobuild: Disable the X11 compositor
Rob Bradford [Mon, 13 Aug 2012 13:43:04 +0000 (14:43 +0100)]
build: Disable the X11 compositor

Fixes: https://bugs.tizen.org/jira/browse/TIVI-76

11 years agoUpdate changelog and bump version
Rob Bradford [Fri, 3 Aug 2012 15:23:12 +0000 (16:23 +0100)]
Update changelog and bump version

11 years agodelete weston-mode patch from packaging dir
Wang Quanxian [Tue, 24 Jul 2012 02:19:43 +0000 (10:19 +0800)]
delete weston-mode patch from packaging dir

Signed-Off-By Quanxian Wang <quanxian.wang@intel.com>

11 years agoAdd PATH to weston.service
Rusty Lynch [Wed, 11 Jul 2012 22:23:04 +0000 (15:23 -0700)]
Add PATH to weston.service

11 years agoUse SHM backend for Ecore & Elementary
Rob Bradford [Mon, 9 Jul 2012 17:34:59 +0000 (18:34 +0100)]
Use SHM backend for Ecore & Elementary

11 years agoUpdate changelog & spec version
Rob Bradford [Mon, 9 Jul 2012 10:49:12 +0000 (11:49 +0100)]
Update changelog & spec version

11 years agoTIZEN: Add logging to the weston.service file to facilitate debugging
Rob Bradford [Mon, 9 Jul 2012 10:45:41 +0000 (11:45 +0100)]
TIZEN: Add logging to the weston.service file to facilitate debugging

11 years agoBug fix CrownBay resolution issue
Wang Quanxian [Fri, 6 Jul 2012 11:25:50 +0000 (19:25 +0800)]
Bug fix CrownBay resolution issue

  Use the first mode as preferred mode in weston

Signed-Off-By Quanxian Wang <quanxian.wang@intel.com>

11 years agoAdd default mode for NexCom and Crossiville
Wang Quanxian [Fri, 6 Jul 2012 09:04:27 +0000 (17:04 +0800)]
Add default mode for NexCom and Crossiville

The platform has no EDID information. The mode could not be gotten
from emgd driver interfaces.

Signed-Off-By Wang Quanxian <quanxian.wang@intel.com>

11 years agoUpdate to latest snapshot
Rob Bradford [Wed, 4 Jul 2012 11:37:39 +0000 (12:37 +0100)]
Update to latest snapshot

11 years agoUpdate .changes
Graydon, Tracy [Mon, 2 Jul 2012 17:59:18 +0000 (10:59 -0700)]
Update .changes

11 years agoupdate service untis to be installed in /usr/lib vs /lib
Chris E Ferron [Mon, 2 Jul 2012 17:55:19 +0000 (10:55 -0700)]
update service untis to be installed in /usr/lib vs /lib

11 years agoRemove the --with-cairo-glesv2 argument since we do not build cairo with gl or gles...
Rusty Lynch [Thu, 21 Jun 2012 17:51:54 +0000 (10:51 -0700)]
Remove the --with-cairo-glesv2 argument since we do not build cairo with gl or gles support

11 years agoAdd packaging files for Tizen
Rusty Lynch [Wed, 13 Jun 2012 00:26:06 +0000 (17:26 -0700)]
Add packaging files for Tizen

11 years agoman: weston --xserver has been replaced
Pekka Paalanen [Thu, 13 Sep 2012 10:46:27 +0000 (13:46 +0300)]
man: weston --xserver has been replaced

The generic module loading must be used now to load xserver.so.
Option --xserver was removed by
a6813d28876423b388cce3ff6d7edab7b9de0f20.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
11 years agocompositor-android: Add output before gles2_renderer_init()
Abhijit Potnis [Thu, 13 Sep 2012 15:22:55 +0000 (11:22 -0400)]
compositor-android: Add output before gles2_renderer_init()

Calling android_compositor_add_output() before gles2_renderer_init(),
or else in gles-renderer_init will have an invalid EGLSurface.

Signed-off-by: Abhijit Potnis <abhijitpotnis@gmail.com>
Reviewed-by: Pekka Paalanen <ppaalanen@gmail.com>
11 years agotext: Add reset requets to protocol
Jan Arne Petersen [Sun, 9 Sep 2012 21:08:46 +0000 (23:08 +0200)]
text: Add reset requets to protocol

Add a reset request to the text_model interface and a reset event to the
input_method_context interface. Use it to reset the pre-edit buffers in
the example keyboard when the cursor is moved in the example editor
client.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
11 years agotext: Add support for control keys to the protocol
Jan Arne Petersen [Sun, 9 Sep 2012 21:08:45 +0000 (23:08 +0200)]
text: Add support for control keys to the protocol

Add key event to the text_model interface and a key request to the
input_method_context interface. Implement it in the example editor
client and the example keyboard.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
11 years agotext: Add delete_surrounding_text to protocol
Jan Arne Petersen [Sun, 9 Sep 2012 21:08:44 +0000 (23:08 +0200)]
text: Add delete_surrounding_text to protocol

Add delete_surrounding_text event in the text_model interface and the
request in the input_method_context interface. Implement it in the
example editor client and in the example keyboard so that the backspace
key works with it.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
11 years agotext: Add support for pre-edit string
Jan Arne Petersen [Sun, 9 Sep 2012 21:08:43 +0000 (23:08 +0200)]
text: Add support for pre-edit string

Add support of preedit-string to the example editor client. Also add a
preedit_string request to the input_method_context interface and use
that in the example weston keyboard to first create a pre-edit string
when entering keys and commit it on space.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
11 years agokeyboard: Use a qwerty virtual keyboard layout
Jan Arne Petersen [Sun, 9 Sep 2012 21:08:42 +0000 (23:08 +0200)]
keyboard: Use a qwerty virtual keyboard layout

Add support for a proper qwerty virtual keyboard layout with lowercase
and uppercase state, space and enter button.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
11 years agotext: Split text and input-method protocols
Jan Arne Petersen [Sun, 9 Sep 2012 21:08:41 +0000 (23:08 +0200)]
text: Split text and input-method protocols

It makes sense to split the interfaces in a text and a input-method
protocol for now (only the text protocol needs to be used in toolkits).

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
11 years agotext: Fix set_surrounding_text request
Jan Arne Petersen [Sun, 9 Sep 2012 21:08:40 +0000 (23:08 +0200)]
text: Fix set_surrounding_text request

Add cursor and anchor positions as arguments to the set_surrounding_text
request. The cursor and anchor positions are relative to the surrounded
text, so it does not make sense to have that separate. Remove the
separate set_cursor_index and set_selected_text requests. Also update
the corresponding event in input-method-context and add support for it
in the weston example keyboard.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
11 years agoeditor: Add support for setting a preedit
Jan Arne Petersen [Sun, 9 Sep 2012 21:08:39 +0000 (23:08 +0200)]
editor: Add support for setting a preedit

Add support for setting a preedit text to the editor example.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
11 years agoeditor: Add support for selection
Jan Arne Petersen [Sun, 9 Sep 2012 21:08:38 +0000 (23:08 +0200)]
editor: Add support for selection

Make it possible to select text and render the selection to the editor
example.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
11 years agoeditor: Insert commit-string at cursor
Jan Arne Petersen [Sun, 9 Sep 2012 21:08:37 +0000 (23:08 +0200)]
editor: Insert commit-string at cursor

Instead of appending at the end, insert the commit-string at the cursor
position.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
11 years agoeditor: Add support for cursor
Jan Arne Petersen [Sun, 9 Sep 2012 21:08:36 +0000 (23:08 +0200)]
editor: Add support for cursor

Add support for setting, moving and rendering a cursor.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
11 years agoeditor: Extract text handling into text_layout
Jan Arne Petersen [Sun, 9 Sep 2012 21:08:35 +0000 (23:08 +0200)]
editor: Extract text handling into text_layout

Create a text_layout struct and functions for handling simple text
layouts.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
11 years agoeditor: Make text_entry a widget
Jan Arne Petersen [Sun, 9 Sep 2012 21:08:34 +0000 (23:08 +0200)]
editor: Make text_entry a widget

Simplify the example client by making text_entry a widget.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
11 years agotext: Add some documentation to the text protocol
Jan Arne Petersen [Sun, 9 Sep 2012 21:08:33 +0000 (23:08 +0200)]
text: Add some documentation to the text protocol

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
11 years agotext: Introduce input_method_context interface
Jan Arne Petersen [Sun, 9 Sep 2012 21:08:32 +0000 (23:08 +0200)]
text: Introduce input_method_context interface

Add an input_method_context interface which is the representation of a
text_model on input_method side.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
11 years agotext: Have only one text_model_factory
Philipp Brüschweiler [Sun, 9 Sep 2012 21:08:31 +0000 (23:08 +0200)]
text: Have only one text_model_factory

Have only one text_model_factory instead of one per seat.

This commit also introduces destruction of an input method when the
corresponding seat is removed.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
11 years agotext: Remove surface arg in create_text_model
Jan Arne Petersen [Sun, 9 Sep 2012 21:08:30 +0000 (23:08 +0200)]
text: Remove surface arg in create_text_model

Remove the wl_surface argument from create_text_model request. The
wl_surface is specified as an argument in the activate request instead.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
11 years agocompositor: Accumulate obscured damage into the primary plane damage
Ander Conselvan de Oliveira [Wed, 12 Sep 2012 14:16:31 +0000 (17:16 +0300)]
compositor: Accumulate obscured damage into the primary plane damage

When accumulating damage in the surfaces into the primary plane damage,
regions obscured by the opaque region would be excluded. This causes a
bug when a redraw of a surface is obscured by an opaque surface on
another plane. The drawing to the former surface is clipped but
its damage is never added to the primary plane and is just lost. Moving
the opaque window later reveals the not-up-to-date content below it.

11 years agocompositor: new intersection algorithm
Pekka Paalanen [Tue, 11 Sep 2012 14:02:05 +0000 (17:02 +0300)]
compositor: new intersection algorithm

The existing algorithm had some corner cases (pun!), where it failed to
produce correct vertices in the right order. This appeared only when the
surface was transformed (rotated). It also produced degenerate polygons
(3 or more vertices with zero polygon area) for non-transformed cases
where the clipping and surface rectangles were adjacent but not
overlapping.

Introduce a new algorithm for finding the boundary vertices of the
intersection of a coordinate axis aligned rectangle and an arbitrary
polygon (here a quadrilateral). The code is based on the
Sutherland-Hodgman algorithm, where a polygon is clipped by infinite
lines one at a time.

This new algorithm should always produce the correct vertices in the
clockwise winding order, and discard duplicate vertices and degenerate
polygons. It retains the fast paths of the existing algorithm for the
no-hit and non-transformed cases.

Benchmarking with earlier versions showed that the new algorithm is
a little slower (56 vs. 68 us/call) than the existing algorithm, for
the transformed case.  The 'cliptest f' command before and after this
commit can be used to compare the speed of the transformed case only.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Acked-by: Rob Clark <rob.clark@linaro.org>
11 years agoclients: add cliptest program
Pekka Paalanen [Tue, 11 Sep 2012 14:02:04 +0000 (17:02 +0300)]
clients: add cliptest program

Cliptest is for controlled testing of the calculate_edges() function in
compositor.c. The function is copied verbatim into cliptest.c.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
11 years agoupdate .gitignores
Pekka Paalanen [Tue, 11 Sep 2012 14:02:03 +0000 (17:02 +0300)]
update .gitignores

Add workspaces-protocol.c, workspaces-server-protocol.h,
workspaces-client-protocol.h.

Remove wscreensaver.

Alphabetaize clients/.gitignore.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
11 years agocompositor: Generalize module loading
Kristian Høgsberg [Wed, 12 Sep 2012 16:21:01 +0000 (12:21 -0400)]
compositor: Generalize module loading

We can now load any number of general modules, and the shell and xwayland
are just two of them.  We continue to use the mechanism for testing but
custom input drivers or logging mechanisms, for example are other use cases.

11 years agocompositor: Always set WAYLAND_DISPLAY
Kristian Høgsberg [Tue, 11 Sep 2012 18:29:47 +0000 (14:29 -0400)]
compositor: Always set WAYLAND_DISPLAY

We used to only set it if we were given an argument on the command line.
It's useful to always set it so nested weston works out of the box.

11 years agocompositor: Don't return the dlsym handle in load_module()
Kristian Høgsberg [Tue, 11 Sep 2012 18:08:26 +0000 (14:08 -0400)]
compositor: Don't return the dlsym handle in load_module()

We don't use it.

11 years agocompositor: Drop unused wl_shm field
Kristian Høgsberg [Tue, 11 Sep 2012 18:07:19 +0000 (14:07 -0400)]
compositor: Drop unused wl_shm field

11 years agocompositor: Make all non-backend modules use module_init() as entry point
Kristian Høgsberg [Tue, 11 Sep 2012 18:06:27 +0000 (14:06 -0400)]
compositor: Make all non-backend modules use module_init() as entry point

11 years agocompositor: Remove unused 'fbo' field from weston_compositor
Kristian Høgsberg [Fri, 7 Sep 2012 02:25:25 +0000 (22:25 -0400)]
compositor: Remove unused 'fbo' field from weston_compositor

11 years agocompositor: Destroy gles2 resource for weston_surface in gles2-renderer.c
Kristian Høgsberg [Fri, 7 Sep 2012 01:59:29 +0000 (21:59 -0400)]
compositor: Destroy gles2 resource for weston_surface in gles2-renderer.c

This moves the last gles2 call out of compositor.c.

11 years agocompositor: Move unbind_display call into gles2-renderer.c
Kristian Høgsberg [Fri, 7 Sep 2012 01:44:24 +0000 (21:44 -0400)]
compositor: Move unbind_display call into gles2-renderer.c

11 years agocompositor: Move EGL context creation to gles2-renderer.c
Kristian Høgsberg [Fri, 7 Sep 2012 01:07:40 +0000 (21:07 -0400)]
compositor: Move EGL context creation to gles2-renderer.c

11 years agocompositor: Create outputs before initializing GLES2 state
Kristian Høgsberg [Fri, 7 Sep 2012 00:51:00 +0000 (20:51 -0400)]
compositor: Create outputs before initializing GLES2 state

This way we can just use the first weston_output EGLSurface to make a
context current.

11 years agocompositor: Introduce a weston_renderer object
Kristian Høgsberg [Thu, 6 Sep 2012 02:49:55 +0000 (22:49 -0400)]
compositor: Introduce a weston_renderer object

Move the gles2 render functions to vfuncs on the renderer object.

11 years agocompositor: Move EGL/GLES2 parts of weston_surface_attach to gles2-renderer.c
Kristian Høgsberg [Thu, 6 Sep 2012 02:38:18 +0000 (22:38 -0400)]
compositor: Move EGL/GLES2 parts of weston_surface_attach to gles2-renderer.c

11 years agocompositor: Move update_shm_texture() to gles2-renderer.c
Kristian Høgsberg [Thu, 6 Sep 2012 02:13:58 +0000 (22:13 -0400)]
compositor: Move update_shm_texture() to gles2-renderer.c

We rename it flush_damage() as it's the point where we update our rendering
API source (eg, the gles2 texture) according to the accumulated damage,
if necessary.

11 years agocompositor: Move gles2 initialization to gles2-renderer.h
Kristian Høgsberg [Thu, 6 Sep 2012 02:06:26 +0000 (22:06 -0400)]
compositor: Move gles2 initialization to gles2-renderer.h

11 years agocompositor: Move non-GL initialization out of weston_compositor_init_gl()
Kristian Høgsberg [Thu, 6 Sep 2012 02:02:22 +0000 (22:02 -0400)]
compositor: Move non-GL initialization out of weston_compositor_init_gl()

11 years agocompositor: Move surface repaint code to gles2-renderer.c
Kristian Høgsberg [Thu, 6 Sep 2012 01:59:35 +0000 (21:59 -0400)]
compositor: Move surface repaint code to gles2-renderer.c

11 years agocompositor: Consolidate output repaint logic
Kristian Høgsberg [Thu, 6 Sep 2012 01:54:15 +0000 (21:54 -0400)]
compositor: Consolidate output repaint logic

We move the EGL and GLES2 output repaint code into a new gles2-render.c
file.  The eglMakeCurrent, glViewPort, surface loop etc was duplicated
across all backends, but this patch moves it to a new file.

11 years agoscreensaver: fix decoding of transparency in xpm files
Philipp Brüschweiler [Thu, 6 Sep 2012 13:23:28 +0000 (15:23 +0200)]
screensaver: fix decoding of transparency in xpm files

Use 0 as transparent pixel. This is needed when using premultiplied
alpha.

11 years agotest-text-client: fix compile error
U. Artie Eoff [Tue, 4 Sep 2012 17:53:07 +0000 (10:53 -0700)]
test-text-client: fix compile error

Pass surface to text_model_factory_create_text_model.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=54502

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
11 years agocompositor: do not round a zero area to non-zero
Pekka Paalanen [Tue, 4 Sep 2012 10:55:44 +0000 (13:55 +0300)]
compositor: do not round a zero area to non-zero

surface_accumulate_damage() will call surface_compute_bbox() with the
extents of the surface damage region, for transformed surfaces only. If
there is no damage, surface_compute_bbox() will round up the empty
rectangle to a 1x1 rectangle. Triangles are produced for this 1x1
rectangle intersected with the surface.

The problem showed up with the triangle fan debug, where some seemingly
garbage pixels showed up relative to rotated surfaces.

Fix this by explicitly checking, that the area, for which a bounding box
is being computed for, is not zero.

Note, that the bbox will also be empty if only one of width and height
is zero. We do not paint things with zero thickness.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Cc: Rob Clark <rob.clark@linaro.org>
11 years agocompositor: do not duplicate ARRAY_SIZE
Pekka Paalanen [Tue, 4 Sep 2012 10:55:43 +0000 (13:55 +0300)]
compositor: do not duplicate ARRAY_SIZE

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
11 years agocompositor: reduce the number of triangles
Pekka Paalanen [Tue, 4 Sep 2012 10:55:42 +0000 (13:55 +0300)]
compositor: reduce the number of triangles

The intersection of two rectangles is guaranteed to be convex. Therefore
we do not need a center vertex for the triangle fan, we can simply use
the whatever first vertex the intersection polygon has. This reduces the
number of triangles, while still painting the exact same area.

While at it, emit_vertex() nested function is factored into the
for-loop, since that is the only calling site left.

Comments are updated to reflect the changes, and some unrelated comment
fixes are in repaint_region().

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Cc: Rob Clark <rob.clark@linaro.org>
11 years agocompositor: fix fan_debug mode
Pekka Paalanen [Mon, 3 Sep 2012 13:48:43 +0000 (16:48 +0300)]
compositor: fix fan_debug mode

- make it respect output transforms by making sure the uniforms are
  up-to-date

- properly restore the current shader program, in case it was
  overridden

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
11 years agocompositor: paint opaque regions with RGBX shader
Pekka Paalanen [Mon, 3 Sep 2012 13:48:42 +0000 (16:48 +0300)]
compositor: paint opaque regions with RGBX shader

weston_surface_draw() is restructured so that it will always use the
RGBX shader for opaque regions, if the surface is assigned the RGBA
shader.

Previously for opaque regions, we simply assumed, that the texture alpha
would be 1.0. If it was not (which really is an application bug), the
region would be misrendered. The RGBX shader forces the texture alpha to
1.0.

Xwayland surfaces may have bad alpha data in the opaque client area. If
blending was enabled, the bad alpha would be used with the RGBA shader.
This patch fixes rendering opaque xwayland windows with full-surface
alpha applied.

Test case: xterm, with full-surface alpha one step below 1.0. Before,
black text was fully transparent, now it is correctly only slightly
transparent.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
11 years agoxwayland: replace opaque_rect, fix an alpha problem
Pekka Paalanen [Mon, 3 Sep 2012 13:48:41 +0000 (16:48 +0300)]
xwayland: replace opaque_rect, fix an alpha problem

Remove weston_surface::opaque_rect completely.

Instead, set the opaque region in xwayland.

Before this patch, black text in xterm was transparent. Now it is not.

However, this patch fixes only a part of the alpha problem. If you apply
full-surface alpha with super+alt+wheel, the problem reappears. This
problem is still due to bad alpha channel contents on xwayland windows.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
11 years agotoytoolkit: supply correct widget in motion_handler callback
Philipp Brüschweiler [Sat, 1 Sep 2012 14:21:40 +0000 (16:21 +0200)]
toytoolkit: supply correct widget in motion_handler callback

11 years agoworkspaces: don't segfault on invalid move_surface_to_workspace request
Philipp Brüschweiler [Sat, 1 Sep 2012 14:03:05 +0000 (16:03 +0200)]
workspaces: don't segfault on invalid move_surface_to_workspace request

Also fixes the off-by-one in toytoolkit that exposed the issue.

11 years agoshell: Improve focus handling when moving surfaces between workspaces
Jonas Ådahl [Wed, 29 Aug 2012 20:13:03 +0000 (22:13 +0200)]
shell: Improve focus handling when moving surfaces between workspaces

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
11 years agotoytoolkit: Implement support for the workspace manager interface
Jonas Ådahl [Wed, 29 Aug 2012 20:13:02 +0000 (22:13 +0200)]
toytoolkit: Implement support for the workspace manager interface

Two buttons are added to the right-click menu of the window frame for
moving a surface either up or down.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
11 years agoshell: Introduce workspace manager interface
Jonas Ådahl [Wed, 29 Aug 2012 20:13:01 +0000 (22:13 +0200)]
shell: Introduce workspace manager interface

The workspace manager interface purpose is to provide clients with
control and knowledge about the current workspace state. Initially only
one function and one event exists; moving a surface and state updated
event. A workspace is represented as an index in a 1 dimensional array.

A client keeps track of the state by being broadcasted events when the
state changes, currently limited to current workspace or number of
workspaces available.

A client can send an asynchronous request to the manager asking to move
a surface to workspace identified by an index. It is up to the shell to
actually move it.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
11 years agoshell: Add possibility to move surfaces to other workspaces
Jonas Ådahl [Wed, 29 Aug 2012 20:13:00 +0000 (22:13 +0200)]
shell: Add possibility to move surfaces to other workspaces

By default, Control + Shift + Up/Down will move the currently active
surface, if any, while changing to another workspace.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
11 years agoshell: Always set focus when restoring focus state
Jonas Ådahl [Wed, 29 Aug 2012 20:12:59 +0000 (22:12 +0200)]
shell: Always set focus when restoring focus state

To avoid having a surface on a hidden workspace in focus always set the
focus (even to NULL) when restoring.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
11 years agoAdd sample configuration for workspaces to weston.ini
Jonas Ådahl [Wed, 29 Aug 2012 20:12:58 +0000 (22:12 +0200)]
Add sample configuration for workspaces to weston.ini

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
11 years agosimple-egl: Avoid race condition.
Scott Moreau [Fri, 31 Aug 2012 09:18:15 +0000 (03:18 -0600)]
simple-egl: Avoid race condition.

After explaining the problem on irc, Pekka dictated this solution which works.
The problem is that simple-egl can hang when toggling fullscreen because of a
race where (quoting Pekka) "if it dispatches the frame callback simple-egl
itself requested before the Mesa's own frame callback came, simple-egl will go
to its redraw routing and call eglSwapBuffers so you end up effectively calling
eglSwapBuffers from within eglSwapBuffers, and deadlock". This patch avoids
redrawing (which calls eglSwapBuffers) when there is a pending frame callback.

11 years agosimple-egl: Only set alpha_size=0 when -o is passed.
Scott Moreau [Thu, 30 Aug 2012 20:44:16 +0000 (14:44 -0600)]
simple-egl: Only set alpha_size=0 when -o is passed.

When starting simple-egl with -f for fullscreen and toggling to 'windowed' mode with F11,
the surface is opaque instead of semi-trnasparent as it is when starting without -f. We
only want to create the surface with alpha_size=0 when the user explicitly passes -o
because otherwise it will never have the ability to use alpha.

11 years agosimple-egl: Remove unused variable.
Scott Moreau [Thu, 30 Aug 2012 20:44:15 +0000 (14:44 -0600)]
simple-egl: Remove unused variable.

11 years agocompositor: triangle fan debug
Pekka Paalanen [Thu, 30 Aug 2012 21:47:21 +0000 (16:47 -0500)]
compositor: triangle fan debug

Draw the borders of all the triangles.

v1: original
v2: add keybinding to enable/disable fan debug (super-alt-space),
    cycle colors to make it easier to see individual draws, and
    redraw undamaged region to clean up previous frames debug
    lines

Signed-off-by: Rob Clark <rob@ti.com>
11 years agocompositor: fix blending for full-surface alpha
Pekka Paalanen [Thu, 30 Aug 2012 21:47:20 +0000 (16:47 -0500)]
compositor: fix blending for full-surface alpha

We can use and render the opaque region only, if we are not applying a
full-surface alpha.

Test case: weston-terminal; use super+alt+mousewheel to adjust the
window transparency. Before it went black, now it blends correctly.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
11 years agocompositor: specialised fragment shader for RGBX
Pekka Paalanen [Thu, 30 Aug 2012 21:47:19 +0000 (16:47 -0500)]
compositor: specialised fragment shader for RGBX

Remove the weston_surface::blend attribute, which really meant that the
texture produced valid alpha values. This was used to override the opaque
region for RGBX surfaces, which produce undefined values for alpha.

Instead, compile a new shader especially for RGBX surfaces, that
hardcodes the sampled alpha as 1.0.

Before "compositor: optimize/simplify shaders" there was a 'vec4 opaque'
in the shaders, that would cause part of the texture to be forced to
alpha=1.0. Now that is gone, and we need this replacement.

To test: launch simple-shm, and use the super+alt+mousewheel combination
to make it transparent. It should not show a light cross over the window.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>