Compare commits

..

148 Commits

Author SHA1 Message Date
Carlos Garnacho
162d6d45a0 cogl/egl: Use EGL_IMG_context_priority
As long as the context_priority extension is available request a high
priority context, to help the compositor look fluid despite heavy GPU usage
from other applications at a regular priority.

This becomes sort of pointless if/when unredirection applies, should still
help with overview/workspace switch animations, or if the application is
not fullscreen.

Based on a similar patch by Daniel Stone to Weston.
2019-01-21 16:33:44 +01:00
Jonas Ådahl
ff507273d2 startup-notification: Silence warning
Warning in question:

../src/core/startup-notification.c:646:16: error: unused variable ‘display’ [-Werror=unused-variable]
2019-01-18 18:18:57 +01:00
Carlos Garnacho
f033d0e846 core: Add MetaLaunchContext
This is a GAppLaunchContext subclass meant to replace usage of
GdkAppLaunchContext in gnome-shell.

Launch contexts get created from the MetaStartupNotification as
they are closely related. The messaging underneath depends on
the availability of a X11 display, if there is one we go through
it (and libsn). If there is none, we still create startup sequences
manually for wayland clients.
2019-01-18 17:03:57 +00:00
Carlos Garnacho
ca67d52cac x11: Add method to launch applications, using SnLauncher
The method spawns a launch request that will get caught by the
SnMonitor we have in place to handle X11 startup notification
messages.
2019-01-18 17:03:57 +00:00
Carlos Garnacho
60d22b7cd0 wayland: Accept NULL primary data source
A NULL argument is expected here in order to unset the selection,
meta_wayland_data_device_set_primary() accepts a NULL source, but
gtk_primary_selection_device.set_selection was not handling a
NULL wl_resource.

Closes: https://gitlab.gnome.org/GNOME/mutter/issues/335
2019-01-18 13:52:05 +00:00
Jonas Ådahl
e9778eba18 build: Pass --quiet to glib-genmarshal
We don't need to know it read the input file really.
2019-01-17 20:42:10 +00:00
Jonas Ådahl
56d260cfb3 screen-cast-monitor-stream-src: Only send cursor bitmap when it changes
To avoid unnecessary pixel copying, only send the cursor bitmap when it
changes. This also allows the receiver to know when the cursor bitmap
actually changed.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/357
2019-01-16 17:09:51 +00:00
Jonas Ådahl
c45d5f53ff cursor-tracker: Emit cursor-changed after renderer was updated
Otherwise the cursor retrieved via meta_cursor_renderer_get_cursor() is
out of date.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/357
2019-01-16 17:09:51 +00:00
Jonas Ådahl
4e402b3972 screen-cast: Add 'cursor-mode' to allow decoupled cursor updates
The 'cursor-mode', which currently is limited to RecordMonitor(), allows
the user to either do screen casts where the cursor is hidden, embedded
in the framebuffer, or sent as PipeWire stream metadata.

The latter allows the user to get cursor updates sent, including the
cursor sprite, without requiring a stage paint each frame. Currently
this is done by using the cursor sprite texture, and either reading
directly from, or drawing to an offscreen framebuffer which is read from
instead, in case the texture is scaled.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/357
2019-01-16 17:09:51 +00:00
Jonas Ådahl
79d99cbe3f cursor-renderer: Add API to allow inhibiting HW cursor
There may be reasons to temporarly inhibit the HW cursor under certain
circumstances. Allow adding such inhibitations by adding API to the
cursor renderer to allow API users to add generic inhibitors with
whatever logic is deemed necessary.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/357
2019-01-16 17:09:51 +00:00
Jonas Ådahl
328eff7352 screen-cast/monitor-stream-src: Copy content before cursor is drawn
To get a consistent behaviour no matter whether HW cursors are in use or
not, make sure to copy the framebuffer content before the stage overlays
(cursor sprite textures) are painted.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/357
2019-01-16 17:09:51 +00:00
Jonas Ådahl
ed5c1f433b backends/stage: Emit signal between painting actors and overlays
Will be used by screen casting for embedding the cursor separately, or
not including at all.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/357
2019-01-16 17:09:51 +00:00
Jonas Ådahl
7ac2083134 backends/stage: Fix minor style issue
https://gitlab.gnome.org/GNOME/mutter/merge_requests/357
2019-01-16 17:09:51 +00:00
Jonas Ådahl
bd97b11414 renderer: Add API to get view from logical monitor
Will be used to get the view scale for a logical monitor, which is
necessary for passing cursor sprites via PipeWire.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/357
2019-01-16 17:09:51 +00:00
Jonas Ådahl
0da0207eed screen-cast: Add getters to fetch object owners
MetaBackend owns MetaScreenCast which owns MetaScreenCastSession which
owns MetaScreenCastStream. Make it possible to fetch objects in the
oppositev direction too.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/357
2019-01-16 17:09:51 +00:00
Jonas Ådahl
08229a6f5d screen-cast-monitor-stream: Don't pass monitor manager when creating
It can be fetched indirectly from the monitor already.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/357
2019-01-16 17:09:51 +00:00
Jonas Ådahl
50071303af clutter/stage: Add clutter_stage_is_redraw_queued() API
This will be used by the screen casting code to check whether it should
wait for a frame before reading cursor state, or send only the cursor
update, if no redraw is queued.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/357
2019-01-16 17:09:51 +00:00
Jonas Ådahl
2b2d77dc3e cursor-tracker: Add 'cursor-moved' signal
https://gitlab.gnome.org/GNOME/mutter/merge_requests/357
2019-01-16 17:09:51 +00:00
Florian Müllner
a0909c3440 constraints: Fix titlebars going off the bottom
The "current" rect includes the frame, so in order to keep the
titlebar on screen, window movement must be restricted to at
most (height - titlebar_height) past the work area bottom.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/391
2019-01-16 01:19:32 +01:00
Pekka Paalanen
22f865122c renderer/native: Prefer hardware rendering for primary GPU
Mutter prefers platform devices over anything else as the primary GPU.
This will not work too well, when a platform device does not actually
have a rendering GPU but is a display-only device. An example of this
are DisplayLink devices with the proprietary driver stack, which exposes
a DRM KMS platform device but without any rendering driver.

Mutter cannot rely on EGL init failing on such devices either, because
nowadays Mesa supports software renderers on GBM, so the initialization
may well succeed.

The hardware rendering capability is recognized by matching the GL
renderer string to the known Mesa software renderers. At this time,
there is no better alternative to detecting this.

The secondary GPU data is abused for the GL renderer, as the Cogl
context may not have been created yet.  Also, the Cogl context would
only be created on the primary GPU, but at this point the primary GPU
has not been chosen yet. Hence, GPU copy path GL context is used as a
proxy and predictor of what the Cogl context might be if it was created.
Mind, that even the GL flavour are not the same between Cogl and
secondary contexts, so this is stretch but it should be just enough.

The logic to choose the primary GPU is changed to always prefer hardware
rendering devices while also maintaining the old order of preferring
platform over boot_vga devices.

Co-authored by: Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>

https://gitlab.gnome.org/GNOME/mutter/merge_requests/271
2019-01-13 10:30:44 +00:00
Emilio Pozuelo Monfort
60ac2838b5 renderer/native: Move primary GPU choosing later
Moves the primary GPU choosing to after all secondary gpu data has been
created.

This makes it possible for a future patch to start looking at secondary
gpu data in choose_primary_gpu () to determine if it is using a hardware
driver or a software renderer.

Co-authored by: Pekka Paalanen <pekka.paalanen@collabora.com>

https://gitlab.gnome.org/GNOME/mutter/merge_requests/271
2019-01-13 10:30:44 +00:00
Emilio Pozuelo Monfort
dfde2f59da renderer/native: Secondary gpu data for all
Initialize the secondary GPU data for all GPUs, even the primary one. By
not looking at the primary_gpu_kms member, a future patch is allowed to
postpone choosing the primary GPU.

A future patch will use the secondary GPU data to decide which GPU will
become the primary GPU.

Co-authored by: Pekka Paalanen <pekka.paalanen@collabora.com>

https://gitlab.gnome.org/GNOME/mutter/merge_requests/271
2019-01-13 10:30:44 +00:00
Pekka Paalanen
3d2ca9a67f renderer/native: Count devices on EGLDevice check
create_renderer_gpu_data_egl_device () relied on the primary GPU being
already chosen for the "EGLDevice currently only works with single GPU
systems" error message. A future patch will choose the primary GPU after
this, not before, so this check needs to be rewritten before the
initialization order is changed.

The new check is implemented exactly as the error message says: there
must be exactly one GPU, otherwise fail.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/271
2019-01-13 10:30:44 +00:00
Pekka Paalanen
9182c8b801 backends/native: Move primary_gpu into MetaRendererNative
Make the choosing and identity of the primary GPU an internal detail to
the native renderer. MonitorManagerKms did not need it for anything.

The primary GPU logic remains unchanged.

This allows follow-up patches to change how the renderer chooses the
primary GPU. It will be easier for the renderer to use private
information for choosing.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/271
2019-01-13 10:30:44 +00:00
Emilio Pozuelo Monfort
1def099047 backends/native: Re-order primary GPU choosing logic
This is a step towards moving the primary GPU logic into the native
renderer exclusively. In the future the renderer will have one more
criterion on choosing the primary GPU than MetaMonitorManagerKms should
know about: does a GPU offer hardware rendering.

The choosing of primary GPU is separated from the discovery of GPUs.
When GPUs are discovered and added to the list, the MetaGpuKmsFlag is
now populated correctly and used in choosing.

Choosing the primary GPU is done after all GPUs have been found and is
slightly different from before:

- Skipping devices that do not belong to our seat now works instead of
becoming the primary GPU.

- Fall back to any non-platform, non-boot_vga device if neither kind is
found.

The old preference of platform over boot_vga device is kept.

The hotplug path will continue creating a gpu_kms without flags, because
at that point the primary GPU has already been chosen and the flags are
irrelevant.

Co-authored by: Pekka Paalanen <pekka.paalanen@collabora.com>

https://gitlab.gnome.org/GNOME/mutter/merge_requests/271
2019-01-13 10:30:44 +00:00
Pekka Paalanen
ddb0ef1e8d backends/native: Add flags to MetaGpuKms
Add a flags field to MetaGpuKms. In following commits, the flags defined
here will be set and used for choosing the primary GPU.

Co-authored by: Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>

https://gitlab.gnome.org/GNOME/mutter/merge_requests/271
2019-01-13 10:30:44 +00:00
Piotr Drąg
a56a59feee Remove po/ChangeLog
Ain’t nobody need ChangeLogs for a while now.
2019-01-12 14:53:13 +01:00
Piotr Drąg
174df4eaeb Remove po/Makevars
Follow-up to 763ae36cee
2019-01-12 14:51:46 +01:00
Andrea Azzarone
e3e933c47a clutter/x11: Implement keycode remap to keysyms on virtual key devices
Keycode lookup can fail for serveral reasons, e.g. if there is no combination of
modifiers and keycodes that can produce the target keysym with the current
keyboard layout.

In case the keycode lookup fails, remap temporarily the keysym to an unused
keycodes.

Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/issues/109
2019-01-11 17:29:27 +01:00
Florian Müllner
fda2e798bb Bump version to 3.31.4
Update NEWS.
2019-01-10 20:07:55 +01:00
Georges Basile Stavracas Neto
fb38738fe9 Remove obsolete .cvsignore files
We moved to git 11 years ago, it's about time.
2019-01-10 11:50:54 -02:00
Georges Basile Stavracas Neto
5eb749d690 project: Update gitignore 2019-01-10 11:50:54 -02:00
Georges Basile Stavracas Neto
763ae36cee Drop Autotools
I saw Meson fade from the sky
On the wind I heard a sigh
As snowflakes cover fallen Makefiles
I will say this last goodbye

Meson is now coming
So ends Autotools days
Future is now coming
And we must away
Over Python and without Bashisms
Through lands where never Meson touched
By silver streams that run down to the Sea

Under parsers, beneath old legacy
Over snow one winter’s morn
I turned at last to paths that lead home
And though where the road then takes me
I cannot tell
We came all this way
But now comes the day
To bid you farewell

Many places I have been
Many sorrows I have seen
But I don’t regret
Nor will I forget
All Makefiles that took that road with me

I bid you all a very fond farewell.
2019-01-10 11:50:54 -02:00
Olivier Fourdan
582b67a2f1 window: Handle maximize when headless
When for some reason a window is maximized while the compositor is
headless, `window->monitor` will be NULL, so check for a NULL monitor
to avoid a NULL-pointer dereference.

Closes: https://gitlab.gnome.org/GNOME/mutter/issues/58

https://gitlab.gnome.org/GNOME/mutter/merge_requests/383
2019-01-09 15:19:20 +01:00
Robert Mader
f740e8ed79 core: Fix compiler warning in MetaSoundPlayer 2019-01-09 03:42:43 +00:00
Florian Müllner
d360b25b81 build: Install .pc files in correct location
If a library is provided in the positional arguments, then meson
defaults to installing the .pc file in a 'pkgconfig' subdirectory
in the library's install location. We want the files in the regular
$libdir/pkgconfig rather than $libdir/mutter-$api/pkgconfig, so
specify the location explicitly in the parameters.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/382
2019-01-08 22:36:20 +01:00
Carlos Garnacho
3693f6f630 build: Use plain libcanberra instead of libcanberra-gtk3
We no longer use the gtk-aware ca_context, the dependency can be lowered
now.
2019-01-08 16:14:17 +01:00
Carlos Garnacho
ebfc6184b2 workspace: Port to MetaSoundPlayer
Use MetaSoundPlayer to play workspace switch sounds, instead of using
libcanberra directly.
2019-01-08 16:14:17 +01:00
Carlos Garnacho
8715f7481b core: Make MetaBell use MetaSoundPlayer to play the bell sound
Instead of using libcanberra/gtk+.
2019-01-08 16:14:17 +01:00
Carlos Garnacho
12f8325cbc core: Add MetaSoundPlayer abstraction
This is a simple libcanberra abstraction object, so we are able
to play file/theme sounds without poking into GTK+/X11. Play
requests are delegated to a separate thread, so we don't block
UI on cards that are slow to wake up from power saving.
2019-01-08 16:14:17 +01:00
Carlos Garnacho
956ab4bd58 build: Make libcanberra no longer optional
This is not the case anymore with MetaSoundPlayer in place, and also
important to get keyboard bell right.
2019-01-08 15:58:11 +01:00
Niels De Graef
58b5dee869 clutter: remove deprecated ClutterMedia.
It isn't used by GNOME Shell, so it should be safe to remove.
2019-01-08 14:18:07 +00:00
Jonas Ådahl
b448ced8e4 backends: Silence a couple of gtk-doc warnings
A lot of fancy gtk-doc documentation was added, but they had a couple of
issues: invalid return value annotations and wrong documented function
name.
2019-01-08 09:06:11 +01:00
Jonas Ådahl
73ddd7cd48 build: Pass library as first argument to pkg.generate()
Dependencies are added automatically, and we no longer get warnings
like:

clutter/clutter/meson.build:628: DEPRECATION: Library mutter-clutter-4
was passed to the "libraries" keyword argument of a previous call to
generate() method instead of first positional argument. Adding
mutter-clutter-4 to "Requires" field, but this is a deprecated behaviour
that will change in a future version of Meson. Please report the issue
if this warning cannot be avoided in your case.
2019-01-08 09:05:08 +01:00
Robert Mader
e7fb45364a compositor: Fix maybe-uninitialized warning
Introduced in 54febd1419

https://gitlab.gnome.org/GNOME/mutter/merge_requests/374
2019-01-07 16:13:32 +00:00
Niels De Graef
0478c225b7 Add some gtk-doc comments. 2019-01-06 21:57:16 +01:00
Daniel van Vugt
93c29318b2 clutter-stage: Don't emit "after-paint" when picking 2019-01-06 12:36:56 +00:00
Robert Mader
51e4fe7fef shaped-texture: Indentation fix in update_area()
https://gitlab.gnome.org/GNOME/mutter/merge_requests/366
2019-01-05 14:18:31 +01:00
Robert Mader
d52081bed4 shaped-texture: Invert transform of damage in update_area()
Transformed textures need to transform back the damage area, which
is given in buffer coordinates, with the inverted transform.

Fixes https://gitlab.gnome.org/GNOME/mutter/issues/419

https://gitlab.gnome.org/GNOME/mutter/merge_requests/366
2019-01-05 14:18:28 +01:00
Robert Mader
686b7f8baa boxes: Add API to transform a MetaRectangle
To be used if not a whole region needs to get transformed.
It also has an argument for reverse-transforms.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/366
2019-01-05 14:18:25 +01:00
Robert Mader
b7a9c7e7d3 monitor-transform: Add helper function transform_invert()
It returns the inverted transform, which is always the same as the
input, besides for TRANSFORM_90 and TRANSFORM_270.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/366
2019-01-05 14:18:02 +01:00
Robert Mader
676a8da005 monitor-transform: Move helper functions into their own file
The existing ones are statically inlined, so there is no .c file
right now.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/366
2019-01-05 14:15:23 +01:00
Jonas Ådahl
490f27efcb shaped-texture: Use actual texture if tower returned NULL
The texture tower can return no texture e.g. if the calculated level is
negative. This was handled before, but regressed with
e1370ee209. This fixes a potential crash
observed occasionally when starting Firefox nightly using the Wayland
backend in overview mode.
2019-01-05 09:36:46 +00:00
Jonas Ådahl
173867c12b renderer/native: Use shadow fb on software GL if preferred
If a KMS device has the DRM_CAP_DUMB_PREFER_SHADOW and a software based
GL driver is used, always use a shadow fb. This will speed up read backs
in the llvmpipe OpenGL implementation, making blend operations faster.

Fixes: https://gitlab.gnome.org/GNOME/mutter/issues/106
2019-01-04 20:59:00 +00:00
Georges Basile Stavracas Neto
df1384a856 window-actor: Turn into an abstract class
Now that everything is settled, from the initialization
process to the subclasses to moving code to the compositor,
MetaWindowActor can be a proper abstract class that cannot
be instantiated.

Thus, make MetaWindowActor an abstract class.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/368
2019-01-04 11:58:03 -02:00
Georges Basile Stavracas Neto
5fbeecaac6 window-actor: Remove post_init() vfunc
This vfunc was added as a was to work around the convoluted
initialization process. Now that we figured it out and moved
the MetaWindowActor-specific initialization to constructed(),
we can override that.

Remove post_init() and use GObject.constructed() entirely.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/368
2019-01-04 11:58:02 -02:00
Georges Basile Stavracas Neto
54febd1419 window-actor: Move window actor creation to MetaCompositor
MetaWindowActor breaks layering isolation by accessing
and injecting itself into compositor->windows. This is
a bad practice, and effecticely makes returning the
new actor useless, since we doesn't even use the return
value.

Move window actor creation to under MetaCompositor and
stop violating (too badly) the resposabilities of each
component. This moves meta_window_actor_new() into
meta_compositor_add_window().

Also, move the remaining initialization code to the
GObject.constructed vfunc.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/368
2019-01-04 11:58:02 -02:00
Georges Basile Stavracas Neto
7952808469 Document window and surface actors
Document the roles of MetaSurfaceActor and MetaWindowActor,
and when their subclasses are used.

(And this is actually the first real documentation under
src/compositor/README!)

https://gitlab.gnome.org/GNOME/mutter/merge_requests/368
2019-01-04 09:32:58 -02:00
Georges Basile Stavracas Neto
0442fc8ddc window-actor: Cleanup includes
https://gitlab.gnome.org/GNOME/mutter/merge_requests/368
2019-01-04 09:32:58 -02:00
Georges Basile Stavracas Neto
80e3c1de57 window-actor: Move X11-specific code to MetaWindowActorX11
MetaWindowActor handles sending _NET_WM_FRAME_* X atoms to
clients - even pure Wayland clients.

Now that we have Wayland- and X11-specific implementations of
MetaWindowActor, we can delegate this to MetaWindowActorX11,
and allow pure Wayland apps to not even connect to
MetaSurfaceActor:repaint-scheduled.

Do that by moving all the X11-specific code to the X11-specific
MetaWindowActorX11 class. Add vfuncs to MetaWindowActorClass
that are necessary for the move, namely:

 * pre_paint() and post_paint()
 * post_init()
 * frame_complete()
 * set_surface_actor()
 * queue_frame_drawn()

https://gitlab.gnome.org/GNOME/mutter/merge_requests/368
2019-01-04 09:32:58 -02:00
Georges Basile Stavracas Neto
ac2f8cad0c window-actor: Select X11 or Wayland actor based on client type
X11 clients now have a MetaWindowActorX11 on the surface. Next
commits will move the X11-specific code to MetaWindowActorX11.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/368
2019-01-04 09:32:51 -02:00
Georges Basile Stavracas Neto
7e8fc13504 Add MetaWindowActorX11 and MetaWindowActorWayland
Those are stub specialized classes for MetaWindowActor. This will
help ensuring that we do not execute X11-specific code paths on
pure Wayland clients.

The relationship between the window actor and the surface is the
following:

 * Wayland: MetaWindowActorWayland + MetaSurfaceActorWayland
 * X11: MetaWindowActorX11 + MetaSurfaceActorX11
 * Xwayland: MetaWindowActorX11 + MetaSurfaceActorWayland

It is not possible to have MetaWindowActorWayland backed by a
MetaSurfaceActorX11 surface.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/368
2019-01-04 09:32:51 -02:00
Georges Basile Stavracas Neto
60f7ff3a69 window-actor: Turn into a derivable class
We will introduce specialized MetaWindowActors for X11
and Wayland in the future, so it needs to be derivable.

Make it a derivable class, and introduce a private field.
The MetaWindowActorClass definition is in the private
header in order to prevent external consumers of Mutter
to create MetaWindowActor implementations of their own.
That is, MetaWindowActor is only internally derivable.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/368
2019-01-04 09:32:51 -02:00
Jonas Ådahl
2fe05d7c35 x11-display: Add back _GTK_EDGE_CONSTRAINTS as supported hints
It was dropped by accident in 1530f27513,
so lets add it back.

Fixes: https://gitlab.gnome.org/GNOME/mutter/issues/423
2019-01-03 17:57:06 +01:00
Jonas Ådahl
012691bebf shaped-texture: Draw external textures via offscreen
EGLStream textures are imported as GL_TEXTURE_EXTERNAL_OES and reading
pixels directly from them is not supported. To make it possible to get
pixels, create an offscreen framebuffer and paint the actor to it, then
read pixels from the framebuffer instead of the texture directly.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/362
2019-01-03 10:26:13 +00:00
Jonas Ådahl
c84d7ebc6d shaped-texture: Get transformed textures pixels via offscreen
When a texture is transformed in any way (e.g. Wayland buffer
transforms), we cannot just fetch the pixels from the texture directly
and be done with it, as that will result in getting the untransformed
pixels.

To properly get the pixels in their right form, first draw to an
offscreen framebuffer, using the same method as when painting on the
stage, then read from the framebuffer into a cairo image surface.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/362

Fixes: https://gitlab.gnome.org/GNOME/mutter/issues/408
2019-01-03 10:26:13 +00:00
Jonas Ådahl
f9118fb99b shaped-texture: Don't change the callers clip rect
We intersected the callers clip rect. That is probably not a good idea,
and easily avoided, so lets avoid it.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/362
2019-01-03 10:26:13 +00:00
Jonas Ådahl
d3301d6b53 shaped-texture: Stop using gdk rect helper
We have our own version, just use that.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/362
2019-01-03 10:26:13 +00:00
Jonas Ådahl
1755a8b8de shaped-texture: Fix include order
https://gitlab.gnome.org/GNOME/mutter/merge_requests/362
2019-01-03 10:26:13 +00:00
Jonas Ådahl
36b46af92f boxes: Add helper to scale rectangles by a double
And change the similar region scaling helper to use this one.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/362
2019-01-03 10:26:13 +00:00
Jonas Ådahl
e1370ee209 shaped-texture: Put actual texture painting in helper
This is so that it can be reused later by meta_shaped_texture_get_image() for
drawing via an offscreen framebuffer.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/362
2019-01-03 10:26:13 +00:00
Jonas Ådahl
37e36e8208 compositor: Make meta_actor_painting_untransformed take a framebuffer
Stop using the cogl draw framebuffer implicitly.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/362
2019-01-03 10:26:13 +00:00
Jonas Ådahl
eac18647c3 cogl/texture: Add API to check whether _get_data() will work
Currently, GL_TEXTURE_EXTERNAL_OES textures doesn't support getting pixel data.
Make it possible for texture users to know this.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/362
2019-01-03 10:26:13 +00:00
Jonas Ådahl
c681ccef3c cogl/texture-2d-gl: Bind correct target when getting data
While for normal textures, GL_TEXTURE_2D should be used, when it's an external
texture, binding it using GL_TEXTURE_2D results in an error.

Reading the specification for GL_TEXTURE_EXTERNAL_OES it is unclear whether
getting pixel data from a texture is possible, and tests show it doesn't result
in any data, but in case it would eventually start working, at least bind the
correct target for now.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/362
2019-01-03 10:26:13 +00:00
Jonas Ådahl
b329256113 cogl/texture-2d-gl: Try to determine format for external textures
Don't just set the internal format to the dummy format "any", as that causes
code intended to be unreachable code to be reached. It's not possible to
actually know the internal format of an external texture, however, so it might
not actually correspond to the real format.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/362
2019-01-03 10:26:13 +00:00
Daniel Stone
177d0c2d63 gpu/kms: Use correct DRM event context version
DRM_EVENT_CONTEXT_VERSION is the latest context version supported by
whatever version of libdrm is present. Mutter was blindly asserting it
supported whatever version that may be, even if it actually didn't.

With libdrm 2.4.78, setting a higher context version than 2 will attempt
to call the page_flip_handler2 vfunc if it was non-NULL, which being a
random chunk of stack memory, it might well have been.

Set the version as 2, which should be bumped only with the appropriate
version checks.

https://bugzilla.gnome.org/show_bug.cgi?id=781034
2019-01-02 15:44:52 +01:00
Jonas Ådahl
f7d4a727a8 build: Always pass --quiet to g-ir-scanner
This makes the build less verbose, as all .gir generation except for
clutters didn't pass --quiet to g-ir-scanner, making it output long
linking commands. Do this by adding a common introspection_args
variable.

While at it, put -U_GNU_SOURCE in there too, as it was always passed
everywhere as without it the scanner would log warnings.
2018-12-22 11:31:10 +01:00
Niels De Graef
d539fe28d5 Use G_DECLARE_DERIVABLE/FINAL_TYPE on some types
This is only for types in the `Meta` namespace.

* Clears up a lot of boilerplate
* We get `g_autoptr` support for free
2018-12-21 19:48:50 +00:00
Daniel van Vugt
7759adf8e9 meson.build: Print correct value of EGLStream support
Fixes a minor mistake in 7a75692e.
2018-12-21 13:48:54 +08:00
Georges Basile Stavracas Neto
7a75692e11 meson: Print some configure flags
Just an additional touch after adding installed tests,
outputting those flags helped not losing track of them.
2018-12-20 13:52:35 -02:00
Georges Basile Stavracas Neto
9bd427a74c meta/tests: Remove commented lines
Leftovers from the initial landing of Meson files.
2018-12-20 13:52:35 -02:00
Georges Basile Stavracas Neto
ebb6c56f67 Add Meson support for installed tests
This is the last remaining feature necessary to achieve
parity with the Autotools build.

A few changes were made to the install locations of the
tests, in order to better acomodate them in Meson:

 * Tests are now installed under a versioned folder (e.g.
   /usr/share/installed-tests/mutter-4)

 * The mutter-cogl.test file is now generated from an .in
   file, instead of a series of $(echo)s from within Makefile.

Notice that those tests need very controlled environments
to run correctly. Mutter installed tests, for example, will
failed when running under a regular session due to D-Bus
failing to acquire the ScreenCast and/or RemoteScreen names.
2018-12-20 13:52:35 -02:00
Georges Basile Stavracas Neto
dcb525397c build: Move libmutter_name to toplevel Meson file
The libmutter name will be reused by other Meson files,
so it makes sense to share it instead of rebuilding this
string every time.
2018-12-20 12:44:15 -02:00
Georges Basile Stavracas Neto
05ab8eebe8 cogl/tests: Use tmp file to dump test results
When running installed tests, the working directory for Cogl
tests is /usr/libexec/installed-tests/mutter-cogl-4/conform,
which isn't writable by normal users.

To avoid the adding stray hidden files to the current directory,
adapt the runner script to fallback to $(mktemp) - which is
available on all platform we care about - and avoid adding
hidden files everywhere.
2018-12-20 11:30:40 -02:00
Pekka Paalanen
981b045459 cogl: Pick glReadPixels format by target, not source
Presumably glReadPixels itself can be more performant with pixel format
conversions than doing a fix-up conversion on the CPU afterwards. Hence,
pick required_format based on the destination rather than the source, so
that it has a better chance to avoid the fix-up conversion.

With CoglOnscreen objects, CoglFramebuffer::internal_format (the source
format) is also wrong. It is left to a default value and never set to
reflect the reality. In other words, read-pixels had an arbitrary
intermediate pixel format that was used in glReadPixels and then fix-up
conversion made it work for the destination.

The render buffers (GBM surface) are allocated as DRM_FORMAT_XRGB8888.
If the destination buffer is allocated as the same format, the Cogl
read-pixels first converts with glReadPixels XRGB -> ABGR because of the
above default format, and then the fix-up conversion does ABGR -> XRGB.
This case was observed with DisplayLink outputs, where the native
renderer must use the CPU copy path to fill the "secondary GPU"
framebuffers.

This patch stops using internal_format and uses the desired destination
format instead.

_cogl_framebuffer_gl_read_pixels_into_bitmap() will still use
internal_format to determine alpha premultiplication state and multiply
or un-multiply as needed. Luckily all the formats involved in the
DisplayLink use case are always _PRE and so is the default
internal_format too, so things work in practise.

Furthermore, the GL texture_swizzle extension can never apply to
glReadPixels. Not even with FBOs, as found in this discussion:
https://gitlab.gnome.org/GNOME/mutter/issues/72
Therefore the target_format argument is hardcoded to something that can
never match anything, which will prevent the swizzle from being assumed.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/313
2018-12-19 19:21:51 +00:00
Pekka Paalanen
6502735f01 cogl: Remove mesa_46631_slow_read_pixels_workaround
This function gets hit even today on relatively modern Intel systems (I
have a Haswell Desktop with Mesa 18.2.4) if the pixel format is right.
Presumably it makes things slower for no longer a reason.

According to cb146dc515, this
functionality was refactored into a workaround path in 2012. The commit
message mentions the problem existing before Mesa 8.0.2. The number
refers to https://bugs.freedesktop.org/show_bug.cgi?id=46631 .

The use case where I hit this is when improving support for DisplayLink
video outputs. These are used through a "secondary GPU", and since
DisplayLink does not have a GPU, Mutter uses the CPU copy path with Cogl
read-pixels[1]. If the DisplayLink framebuffer was allocated as
DRM_FORMAT_XRGB8888 (the only format it currently handles correctly),
mesa_46631_slow_read_pixels_workaround would get hit. The render buffer is
the same format as the framebuffer, yet doing the copy XRGB -> XRGB ends
up being slower than XRGB -> XBGR which makes no sense.

This patch is not sufficient to fix the XRGB -> XRGB copy performance,
but it is required.

This patch reverts CoglGpuInfoDriverBug into what it was before
cb146dc515.

[1] This is not actually true until
    https://gitlab.gnome.org/GNOME/mutter/merge_requests/278 is
    merged.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/313
2018-12-19 19:21:51 +00:00
Carlos Garnacho
1d73533f78 tests: Don't check pixels outside actor allocation
The actor-shader-effect test actors are 50px wide, but we check the 51st
pixel. This went along undetected until "clutter: Avoid rounding
compensation when invalidating 2D actors" because the paint volumes were
made slightly bigger and the shaders paint all over them (I guess nobody
noticed those actors being actually ~52px wide).

Update the test to check the middle of the opposite edge, so we keep neatly
rounded numbers.
2018-12-18 13:54:09 +01:00
Carlos Garnacho
697aeae2ad clutter/tests: Update expectations in actor-anchors test
The test does a clutter_actor_set_scale_full() call that only updates
the scale center (i.e. no changes to scale-x/y), but expects to receive
notifications of actor scale changes.

Since "Revert "Revert "ClutterActor: Optimize away idempotent
scale/position updates"" these are optimized away, so just drop the
assumption.
2018-12-18 13:51:44 +01:00
Carlos Garnacho
2e79d05e04 Revert "Revert "ClutterActor: Optimize away idempotent scale/position updates""
This reverts commit 4d2647cdbc.

A proper fix is now in GTK+, let's reintroduce this optimization.

Related: gtk#844, gtk!294
2018-12-18 12:51:28 +01:00
Carlos Garnacho
4139907a7e cogl: Ensure to only clear the depth buffer if depth testing is enabled
The depth buffer is marked as invalid when 1) the framebuffer is just created,
and 2) whenever GL_DEPTH_TEST is enabled on it. This will ensure the
framebuffers attached depth buffer (if any) is properly cleared before it's
actually used, while saving needless clears while depth testing is disabled
(the default).

https://bugzilla.gnome.org/show_bug.cgi?id=782344
2018-12-18 12:51:28 +01:00
Carlos Garnacho
3c6a518d40 compositor: Avoid changing pipeline/source if shadow is not being painted
Avoids some context invalidations in cogl.

https://bugzilla.gnome.org/show_bug.cgi?id=782344
2018-12-18 12:51:28 +01:00
Carlos Garnacho
a7df459416 clutter: Avoid rounding compensation when invalidating 2D actors
This allows the redraw clip to be more constrained, so MetaCullable doesn't
end up rendering portions of window shadows, frame and background when a
window invalidates (part of) its contents.

https://bugzilla.gnome.org/show_bug.cgi?id=782344
2018-12-18 12:51:28 +01:00
Peter Hutterer
9f3d321bf2 input-settings: treat a serial of 1 as serial of 0
The Wacom Xorg driver assigns a serial number of 1 for any pad that doesn't
have a serial. libinput assigns 0. Just treat 1 as 0 here, there are no pens
with a real serial 1 anyway.

Fixes https://gitlab.gnome.org/GNOME/mutter/issues/414
2018-12-17 16:12:50 +10:00
Andre Klapper
49c2be40bb Replace Bugzilla by Gitlab URL in DOAP file 2018-12-15 23:50:01 +01:00
Jonas Ådahl
781ec74fd2 window: Fix introspection warnings
(transfer none) was added for fundamental types, which can't be
transfered.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/356
2018-12-14 15:57:36 +01:00
Olivier Fourdan
7a5e0c7824 window: Expose the client type in the API
We already have the enum exposed, but no accessor function.

Add `meta_window_get_client_type()` which returns the
`MetaWindowClientType` of a window.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/306
2018-12-14 13:26:16 +01:00
Olivier Fourdan
c786b6c13c screen-cast-session: Add window-id support
Use the "window-id" property to select the window to cast using
RecordWindow.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/306
2018-12-14 13:26:16 +01:00
Olivier Fourdan
bbcb66ddf4 window: Add window id
Generate a unique 64bit window-id which is unrelated to any windowing
backend.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/306
2018-12-14 13:26:16 +01:00
Olivier Fourdan
ec25f3a6b7 screen-cast-session: Add support for RecordWindow
Add support for the RecordWindow screencast method, casting the
currently focused window.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/306
2018-12-14 13:26:16 +01:00
Olivier Fourdan
dbe7279c7f screen-cast-session: Add screen-cast window mode
Window mode will cast the content of a single window using the
`MetaScreenCastWindow` interface.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/306
2018-12-14 13:26:16 +01:00
Olivier Fourdan
931934511c window-actor: Implement MetaScreenCastWindow interface
Implements the `MetaScreenCastWindow` interface for screen-cast
`RecordWindow` mode.

`meta_window_actor_capture_into()` implementation is still pretty crude
and doesn't take into account subsurfaces and O-R windows so menus,
popups and other tooltips won't show in the capture.

This is left as a future improvement for now.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/306
2018-12-14 13:26:16 +01:00
Olivier Fourdan
20c9ca25c0 screen-cast: Add screen-cast-window interface
Typically, to stream the content of a window, we need a way to copy the
content of its window-actor into a buffer, transform relative input
coordinates to relative position within the window-actor and a mean to
get the window bounds within the buffer.

For this purpose, add a new GType interface `MetaScreenCastWindow` with
the methods needed for screen-cast window mode:

 * meta_screen_cast_window_get_buffer_bounds()
 * meta_screen_cast_window_get_frame_bounds()
 * meta_screen_cast_window_transform_relative_position()
 * meta_screen_cast_window_capture_into()

This interface is meant to be implemented by `MetaWindowActor` which has
access to all the necessary bits to implement them.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/306
2018-12-14 13:26:16 +01:00
Olivier Fourdan
f64eba57ce screen-cast-src: Add VideoCrop support
To be able to cast windows, which by definition can change in size
dynamically, we need a way to specify the video crop meta to adjust to
the window size whenever it changes.

Add VideoCrop support with a new optional hook `get_videocrop()` in the
`ScreenCastStreamSrcClass` which, if defined, can let the child specify
a rectangle for the video cropping area.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/306
2018-12-14 13:26:16 +01:00
Jonas Ådahl
149e4d6934 monitor-manager: Don't use switch-config when ensuring configuration
Switch-configs are only to be used in certain circumstances (see
meta_monitor_manager_can_switch_config()) so when ensuring
configuration and attempting to create a linear configuration, use the
linear configuration constructor function directly without going via the
switch config method, otherwise we might incorrectly fall back to the
fallback configuration (only enable primary monitor).

This is a regression introduced by 6267732bec.

Fixes: https://gitlab.gnome.org/GNOME/mutter/issues/342
2018-12-13 12:40:27 +00:00
Daniel van Vugt
8d514095cb cursor-renderer-native: Floor the cursor position instead of rounding
Which eliminates the 1px jitter that was visible when dragging windows,
and eliminates the flickering that was visible when pushing the cursor
against the right/bottom edges of the screen.
2018-12-13 17:12:28 +08:00
Nikita Churaev
bdf8d0f1c3 compositor: improve vignette on background actor
The shader used for computing a vignette currently has two
problems:

 * The math is wrong such that the vignette isn't stretched
   across the whole actor and so ends abruptly
 * There is noticeable banding in its gradient

This commit corrects both problems by fixing the computing
and introducing noise dithering.
2018-12-12 09:31:24 -02:00
Daniel van Vugt
8e9184b62e background: Mipmap wallpaper when shrinking
So as to minimize jaggies for wallpaper that is >= double the resolution
of the screen.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/issues/254
2018-12-12 12:30:10 +08:00
Ting-Wei Lan
b34bb773a4 tests: Don't show 'core dumped' messages 2018-12-11 12:53:31 -02:00
Jonas Ådahl
efd9f86efe Dockerfile: Install gsettings-desktop-schemas rpm built from git
We depend on a newer version than packaged, so install a custom one from
https://copr.fedorainfracloud.org/coprs/jadahl/mutter-ci/build/836095/
2018-12-11 11:05:29 +01:00
Carlos Garnacho
7a9805554c build: Depend on gsettings-desktop-schemas >= 3.31.0
This is necessary for MetaInputMapper. This version is unreleased
yet but version was bumped in git.
2018-12-06 18:30:13 +01:00
Carlos Garnacho
ffca9b999d backends: Update to new "output" setting for tablets/touchscreens 2018-12-06 14:44:46 +00:00
Carlos Garnacho
d30301c00a backends: Turn builtin touchscreen on/off together with DPMS
This takes over gsd-power code, that would disable touchscreens
on DPMS off.

https://bugzilla.gnome.org/show_bug.cgi?id=742598
https://gitlab.gnome.org/GNOME/gnome-settings-daemon/issues/29
2018-12-06 14:44:46 +00:00
Carlos Garnacho
faf89ff35f backends: Add MetaInputMapper method to lookup devices from outputs
So we may know the device of a certain ClutterInputDeviceType that is
mapped to the given output.
2018-12-06 14:44:46 +00:00
Carlos Garnacho
87858a4e01 backends: Delegate on MetaInputMapper for unmapped display devices
If a display device (touchscreen, tablet with libwacom integration flags)
does not receive a monitor through settings. Delegate on the
MetaInputMapper so it receives a mapping through heuristics.
2018-12-06 14:44:46 +00:00
Carlos Garnacho
08a5e660d3 backends: Add MetaInputMapper
This object takes care of mapping absolute devices to monitors,
to do so it uses 3 heuristics, in this order of preference:
- If a device is known to be builtin, it's assigned to the
  builtin monitor.
- If input device and monitor match sizes (with an error margin
  of 5%)
- If input device name and monitor vendor/product in EDID match
  somehow (from "full", through "partial", to just "vendor")

The most favorable outputs are then assigned to each device, making
sure not to assign two devices of the same kind to the same output.

This object replaces (and is mostly 1:1 with) GsdDeviceMapper in
g-s-d. That object would perform these same heuristics, and let
mutter indirectly know through settings changes. This object allows
doing the same in-process.
2018-12-06 14:44:46 +00:00
Carlos Garnacho
df48b94889 clutter: Add API to retrieve the physical size of absolute devices
This will be used in upper layers to match abs input devices (touchscreens,
tablets) to the corresponding output.
2018-12-06 14:44:46 +00:00
Georges Basile Stavracas Neto
2b938ce795 clutter: minor documentation update
Just better wording for swap throttled.
2018-12-06 14:29:34 +00:00
Georges Basile Stavracas Neto
df284f9c9d clutter: Rename SYNC_TO_VBLANK to SWAP_THROTTLE
This is to reflect what this flag is actually about.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/191
2018-12-06 14:29:34 +00:00
Georges Basile Stavracas Neto
7d20101198 cogl-framebuffer: Remove swap_throttled config
Since now we don't set the swap throttled value based
on sync-to-vblank, we can effectively remove it from
Cogl. Throttling swap buffers in Cogl is as much a
historical artifact as sync-to-vblank. Furthermore,
it doesn't make sense to disable it on a compositor,
which is the case with the embedded Cogl.

In addition to that, the winsys vfunc for updating
whenever swap throttling changes could also be removed,
since swap throttling is always enabled now.

Removing it means less code, less branches when running,
and one less config option to deal with.

This also removes the micro-perf test, since it doesn't
make sense for the case where Cogl is embedded into the
compositor.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/191
2018-12-06 14:29:34 +00:00
Georges Basile Stavracas Neto
ae4d3bc27d clutter: Remove ability to externally set sync-to-vblank
Externally setting the sync-to-vblank setting was a feature
added as a workaround to old Intel and ATI graphic cards, and
is not needed anymore. Furthermore, it doesn't make sense to
change it on a compositor whatsoever.

This commit removes all the ways to externally change this
setting, as well as the now unused API.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/191
2018-12-06 14:29:34 +00:00
Abderrahim Kitouni
fe0a394e69 build: check for cvt only when building the native backend
Also error out properly when cvt is not found on Autotools.
2018-12-06 10:16:51 -02:00
Peter Hutterer
1f3e9176fc clutter/x11: detect tablet type from the Wacom property
The xf86-input-wacom driver exports a property with the tool type as known by
the driver. This is a more reliable choice than guessing based on the device
name.

In the touchscreen case, we simply use is_touch_device() to guess which one of
the two options it is. Note that this code should never be hit anyway as we
would've succeeded earlier with a previous is_touch_device() call.
2018-12-06 11:46:44 +00:00
Carlos Garnacho
ffaec917e5 clutter: Only redraw affected portions on parent widget on show/hide
If we are lucky enough and the parent actor has the CLUTTER_ACTOR_NO_LAYOUT
flag, we would skip the relayout, but still redraw the parent actor in its
entirety.

In these cases, we can at least just redraw the area affected by the actor
being shown/hidden.
2018-12-06 02:45:11 +00:00
Carlos Garnacho
bf4ccd21c1 clutter: Avoid relayouts when raising/lowering children
These calls don't actually affect the layout, but the paint order.
It seems safe to skip the full relayout/repaint of the parent actor,
and redraw only the area occupied by the affected child.
2018-12-06 02:45:11 +00:00
Carlos Garnacho
9a843857b3 clutter: Make paint volume argument const on queue_redraw*()
The given paint volume is actually unmodified, there is no need to
require non-const arguments when some getters actually give const
paint volumes.
2018-12-06 02:45:11 +00:00
Niels De Graef
9004253c4e cogl: remove CoglFuncPtr, use GCallback instead
They literally mean the same thing, so we shouldn't reinvent the wheel.
2018-12-05 13:20:43 +00:00
Marco Trevisan (Treviño)
c5471e5b8b renderer-x11-nested: Use rounded width/heights for fb size
https://bugzilla.gnome.org/show_bug.cgi?id=765011
2018-12-05 10:34:22 +00:00
Jonas Ådahl
eacf2f2187 backends/x11/nested: Draw the stage view CRTCs with the correct size
The nested stage tries to emulate how CRTCs are drawn, but fails to do
this when a stage view is scaled as it didn't adapt the viewport size
according to the stage view scale.

https://bugzilla.gnome.org/show_bug.cgi?id=786663
2018-12-05 10:34:22 +00:00
Marco Trevisan (Treviño)
7821256f5c monitor-manager-dummy: Allow to pass extra monitor specs via env
Add MUTTER_DEBUG_DUMMY_MONITORS_SPECS env variable support so that you can define
a ':' separated list of monitor specs in the form of WWWxHHH@RR that will be
available for configuring the nested mutter.
2018-12-05 10:34:22 +00:00
Jonas Ådahl
4baefe46b3 clutter/stage: Round viewport coordinates before setting
cogl_(fromebuffer)_set_viewport will implicitly cast away the fraction
of a floating point number, meaning if a coordinate calculation
resulted in just below the integer (which for example ~1.75 scaling on
a 1920x1080 did), we'd set a one pixel too narrow viewport. Fix this by
always rounding the floating point to the closest int before passing,
avoiding the precision loss.

https://bugzilla.gnome.org/show_bug.cgi?id=765011
2018-12-05 10:34:22 +00:00
Jonas Ådahl
c388a8fc9d display: Ceil pointer cursor theme scale when fractional
The fraction of the scale was accidentally casted away, lets ceil it
instead.

https://bugzilla.gnome.org/show_bug.cgi?id=765011
2018-12-05 10:34:22 +00:00
Marco Trevisan (Treviño)
e4a2d15171 display: Code cleanups
Compare integers with integer literals, and update docs

https://bugzilla.gnome.org/show_bug.cgi?id=765011
2018-12-05 10:34:22 +00:00
Jonas Ådahl
4786cc85bd monitor-config-manager: Round layout size after scaling
When calculating the logical monitor layout size given a scale, don't
risk precision loss by float to int casting, which could result in a too
small layout.

https://bugzilla.gnome.org/show_bug.cgi?id=765011
2018-12-05 10:34:22 +00:00
Jonas Ådahl
666bef7af9 stack: Don't place Wayland popups in o-r layer
Placing persistant Wayland popups (e.g. not menus etc) in the o-r layer
breaks stacking order with other window trees (e.g. other client
windows), as the menu would get stuck in the o-r layer, i.e. on top,
even if the parent of the popup got lowered.

Fix this by placing the popups in the normal layer, relying on
transient-ness to keep stacking correct.
2018-12-04 14:33:01 +00:00
Jonas Ådahl
19e3c21667 wayland/surface: Don't make destoryed actor reactive
When destructing a xdg_toplevel, we'll disassociate the actor from the
MetaWaylandSurface, to allow it to animate out. After having done this,
avoid trying to set it as unreactive when unsetting the window.

This fixes the runtime warning:

clutter_actor_set_reactive: assertion 'CLUTTER_IS_ACTOR (actor)' failed
2018-12-04 14:20:45 +00:00
Jonas Ådahl
da5a2d3cb8 wayland/surface: Intersect buffer damage with buffer rect
Before processing the buffer damage region, intersect it with the buffer
rectangle to avoid trying to damage content outside the surface.

This fixes the runtime warning "GL error (1281): Invalid value"
happening when a client posts too large buffer damage larger.
2018-12-04 14:20:45 +00:00
Jonas Ådahl
7226c5c7bf backend/native: Remove leftover stage view checks
We haven't supported disabling stage views in the native backend since

commit 70edc7dda4
Author: Jonas Ådahl <jadahl@gmail.com>
Date:   Mon Jul 24 12:31:32 2017 +0800

    backends/native: Stop supporting stage views being disabled

There were still some left over checks; lets remove them.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/343
2018-12-04 15:04:50 +01:00
Georges Basile Stavracas Neto
acacd3dd64 clutter/stage-cogl: Disable buffer age when painting red damage
This is to ensure we're rendering a red damage area that actually
represents what is being damaged.

Fixes an always-fullscreen red damage on bare metal Wayland and
GNOME Shell.
2018-12-04 12:50:51 +00:00
Georges Basile Stavracas Neto
20b271fa49 clutter/stage-cogl: Add option to visualize damaged regions
This is useful to visualize which parts of the screen are being
damaged.

Add a new 'damage-region' value for CLUTTER_PAINT and paint the
damaged regions accordingly.
2018-12-04 12:50:51 +00:00
Robert Mader
e4de9ed580 wayland/surface: Add support for buffer transforms
This adds the required bits to wayland surfaces and ties them up
to the compositor parts.

The central part here is to recalculate the surface size accordingly
and to translate surface damage into buffer damage.

The choosen approach additionally lays groundwork for wp_viewporter
support, which is closely related in its nature.

A further explanation of buffer transforms from the specification:
> The purpose of this request is to allow clients to render content
> according to the output transform, thus permitting the compositor
> to use certain optimizations even if the display is rotated.
> Using hardware overlays and scanning out a client buffer for
> fullscreen surfaces are examples of such optimizations.
2018-12-03 19:13:51 +01:00
Robert Mader
452ef4d5bb region-utils: Add API to transform an integer region
The added API requires additional width and height arguments
to calculate transformed coordinates.
2018-12-03 18:58:17 +01:00
Robert Mader
1467b6b02a shaped-texture: Add support for texture transform
This adds the necessary bits to support Wayland buffer transforms.
The main part here is to properly setup the Cogl pipeline
and to recalculate the size of the painted area accordingly,
so culling etc. still works.

The choosen approach additionally lays groundwork for Wayland
wp_viewporter support.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/322
2018-12-03 18:57:59 +01:00
Javier Jardón
9ca6c74267 autogen.sh: Don't run intltoolize
Mutter hasn't depended on intltool for a long time.

This completes 3248c685

Related: https://gitlab.gnome.org/GNOME/gnome-build-meta/issues/104
2018-12-03 11:36:45 +00:00
Ting-Wei Lan
319500e4f3 tests: Fix warnings reported by shellcheck
This commit includes following fixes for a few shell scripts:

1. Follow the best practice of quoting variables everywhere unless they
   are used in places where word-splitting and globbing can never happen.

2. Replace `command` with $(command) because the latter is easier to use
   and read.

3. Don't use "$@" in places expecting a string because it is an array
   of strings instead of a single string.
2018-12-01 13:07:29 +00:00
Ting-Wei Lan
b2e75b5da0 build: Don't hardcode the path of bash
Bash is not always installed in /bin and we should not hardcode the path
of it in source code which is expected to be built on many operating
systems and distributions.

Since most scripts using #!/bin/bash here doesn't have any bashism,
they can be converted to #!/bin/sh instead of using /usr/bin/env trick.
2018-12-01 12:56:12 +00:00
Ting-Wei Lan
365ea2fd56 build: Don't check for Xwayland when Wayland is disabled 2018-12-01 12:56:12 +00:00
Carlos Garnacho
88f8228425 wayland: Fix DnD actor set up
Commit 70036429bd mixed drag_origin and drag_surface, leading to warnings
and invisible drag icon. Fix this up so we correctly set up the feedback
actor. This will correctly display the DnD icon alongside the pointer.
2018-12-01 09:42:48 +00:00
Carlos Garnacho
f8cd1e55a4 wayland: Make DnD role inherit from MetaWaylandActorSurface
It is meant to hold surfaces that require a ClutterActor, just like wl/xdg
shell surfaces and subsurfaces. Make it inherit from MetaWaylandActorSurface
so it gets that for free.

The type declaration is also made completely private, in order to avoid
cyclic dependency between meta-wayland-surface.h and
meta-wayland-actor-surface.h. We just require the GType fro assign_role()
anyway.
2018-12-01 09:42:48 +00:00
271 changed files with 7870 additions and 16103 deletions

29
.gitignore vendored
View File

@@ -1,25 +1,9 @@
Makefile
Makefile.in
Makefile.in.in
aclocal.m4
autom4te.cache
build-aux
compile
config.guess
config.h
config.h.in
config.log
config.status
config.sub
configure
depcomp
install-sh
intltool-extract.in
intltool-merge.in
libtool
ltmain.sh
missing
.deps
50-mutter-navigation.xml
50-mutter-system.xml
50-mutter-windows.xml
@@ -33,15 +17,11 @@ mutter-wayland.desktop
*.swp
*.gir
*.typelib
stamp-h1
*.gmo
*.make
*.log
*.trs
*~
stamp-it
.intltool-merge-cache
ABOUT-NLS
POTFILES
Makevars.template
po/*.header
@@ -64,9 +44,7 @@ org.gnome.mutter.wayland.gschema.xml
testasyncgetprop
testboxes
testgradient
m4/*
INSTALL
mkinstalldirs
meta-enum-types.[ch]
src/stamp-meta-enum-types.h
src/meta-dbus-display-config.[ch]
@@ -122,13 +100,6 @@ doc/reference/meta-undocumented.txt
doc/reference/meta-unused.txt
doc/reference/meta-docs.sgml
doc/reference/meta.types
gtk-doc.m4
intltool.m4
libtool.m4
ltoptions.m4
ltsugar.m4
ltversion.m4
lt~obsolete.m4
.dirstamp
**/tags.*
build/

View File

@@ -10,5 +10,11 @@ RUN dnf -y update && dnf -y upgrade && \
# For running unit tests
dnf install -y xorg-x11-server-Xvfb mesa-dri-drivers dbus dbus-x11 && \
# Unpackaged versions
dnf install -y https://copr-be.cloud.fedoraproject.org/results/jadahl/mutter-ci/fedora-29-x86_64/00836095-gsettings-desktop-schemas/gsettings-desktop-schemas-3.30.1-1.20181206git918efdd69be53.fc29.x86_64.rpm https://copr-be.cloud.fedoraproject.org/results/jadahl/mutter-ci/fedora-29-x86_64/00836095-gsettings-desktop-schemas/gsettings-desktop-schemas-devel-3.30.1-1.20181206git918efdd69be53.fc29.x86_64.rpm && \
# Packages not yet in stable
dnf install -y https://kojipkgs.fedoraproject.org//packages/pipewire/0.2.5/1.fc29/x86_64/pipewire-0.2.5-1.fc29.x86_64.rpm https://kojipkgs.fedoraproject.org//packages/pipewire/0.2.5/1.fc29/x86_64/pipewire-devel-0.2.5-1.fc29.x86_64.rpm https://kojipkgs.fedoraproject.org//packages/pipewire/0.2.5/1.fc29/x86_64/pipewire-libs-0.2.5-1.fc29.x86_64.rpm && \
dnf install -y intltool redhat-rpm-config make && \
dnf clean all

View File

@@ -1,13 +0,0 @@
pkgdatadir = $(datadir)/mutter-$(LIBMUTTER_API_VERSION)
pkglibdir = $(libdir)/mutter-$(LIBMUTTER_API_VERSION)
SUBDIRS = cogl clutter data src po doc
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
DISTCLEANFILES = \
intltool-extract \
intltool-merge \
intltool-update \
po/stamp-it \
po/.intltool-merge-cache

29
NEWS
View File

@@ -1,3 +1,32 @@
3.31.4
======
* keybindings: Limit corner move to current monitor [Jānis; #320]
* xdg-output: Report rotated physical dimensions [Olivier; #369]
* Add continuous integration pipeline [Jonas; #193]
* Improve performance on secondary GPUs [Pekka; #323, !313]
* Use the actual hardware refresh rate [Daniel; #781296]
* Remove hide-titlebar-when-maximized support [Florian; !221]
* wayland: Implement buffer transforms [Robert; !322]
* Remove ability to externally set sync-to-vblank [Georges; !191]
* Turn off touchscreens together with DPMS [Carlos; gnome-settings-daemon#29]
* Mipmap the wallpaper when shrinking [Daniel; gnome-shell#254]
* Implement RecordWindow method for screen-casts [Olivier; !306]
* Fix EGLStream texture downloading [Jonas; !362]
* Split out display-server-specific code from MetaWindowActor [Georges; !368]
* Improve render performance on some KMS devices with software GL [Jonas; #106]
* Fix damage area of transformed surfaces [Robert; !366]
* Remove autotools support [George]
* Misc. bug fixes and cleanups [Jonas, Alan, Olivier, Carlos, Javier, Peter,
Daniel, Robert, Florian; !309, #790207, #272, #393, #276, #404, #104, !343,
#765011, #786663, #342, !356, #414, #782344, #781034, #423, !374, !382, !383]
Contributors:
Jonas Ådahl, Nikita Churaev, Alan Coopersmith, Jānis Džeriņš, Olivier Fourdan,
Carlos Garnacho, Niels De Graef, Peter Hutterer, Javier Jardón,
Abderrahim Kitouni, Andre Klapper, Ting-Wei Lan, Robert Mader,
Emilio Pozuelo Monfort, Florian Müllner, Georges Basile Stavracas Neto,
Pekka Paalanen, Daniel Stone, Marco Trevisan (Treviño), Daniel van Vugt
3.31.2
======
* Fix handling of non-UTF8 encodings [Florian; !227]

View File

@@ -1,28 +0,0 @@
#!/bin/sh
# Run this to generate all the initial makefiles, etc.
srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.
REQUIRED_AUTOMAKE_VERSION=1.11
olddir="$(pwd)"
cd "${srcdir}"
(test -f configure.ac \
&& test -d src) || {
echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
echo " top-level mutter directory"
exit 1
}
aclocal --install || exit 1
intltoolize --force --copy --automake || exit 1
autoreconf --verbose --force --install || exit 1
cd "${olddir}"
if [ "$NOCONFIGURE" = "" ]; then
"${srcdir}/configure" "$@" || exit 1
fi

View File

@@ -1,49 +0,0 @@
NULL =
SUBDIRS = build clutter tests
DIST_SUBDIRS = clutter tests build
# XXX - this is a massive hack to make autoreconf honour the ACLOCAL_FLAGS
# that jhbuild sets while still retaining build/autotools as the authoritative
# source for m4 macros
ACLOCAL_AMFLAGS = -I build/autotools ${ACLOCAL_FLAGS}
CLEANFILES = $(pcfiles)
DISTCLEANFILES =
DISTCHECK_CONFIGURE_FLAGS = --enable-maintainer-flags
# proxy rules for tests
test-report full-report:
$(MAKE) -C tests/conform $(@)
perf-report:
$(MAKE) -C tests/performance $(@)
if ENABLE_GCOV
# use recursive makes in order to ignore errors during check/perf
lcov:
-$(MAKE) $(AM_MAKEFLAGS) -C clutter check
-$(MAKE) $(AM_MAKEFLAGS) -C tests/conform test
$(MAKE) $(AM_MAKEFLAGS) genlcov
# we have to massage the lcov.info file slightly to hide the effect of libtool
# placing the objects files in the .libs/ directory separate from the *.c
genlcov:
$(LTP) --directory $(top_builddir) --capture --output-file clutter-lcov.info --test-name CLUTTER_TEST --no-checksum
$(SED) -e 's#.libs/##' < clutter-lcov.info > clutter-lcov.info.tmp
LANG=C $(LTP_GENHTML) --prefix $(top_builddir) --output-directory clutter-lcov --title "Clutter Code Coverage" --show-details clutter-lcov.info.tmp
rm -f clutter-lcov.info.tmp
lcov-clean:
-$(LTP) --directory $(top_builddir) -z
-$(RM) -rf clutter-lcov.info clutter-lcov
else
lcov genlcov lcov-clean:
@echo You need to configure Clutter with support for gcov enabled.
@echo e.g., ./configure --enable-gcov
endif
.PHONY: test-report full-report perf-report lcov genlcov lcov-clean

View File

@@ -1 +0,0 @@
SUBDIRS = autotools

View File

@@ -1,8 +0,0 @@
gtk-doc.m4
libtool.m4
ltoptions.m4
ltsugar.m4
ltversion.m4
lt~obsolete.m4
shave
shave-libtool

View File

@@ -1,10 +0,0 @@
NULL =
EXTRA_DIST = \
introspection.m4 \
as-compiler-flag.m4 \
glibtests.m4 \
glib-tap.mk \
tap-driver.sh \
tap-test \
$(NULL)

View File

@@ -1,62 +0,0 @@
dnl as-compiler-flag.m4 0.1.0
dnl autostars m4 macro for detection of compiler flags
dnl David Schleef <ds@schleef.org>
dnl $Id: as-compiler-flag.m4,v 1.1 2005/12/15 23:35:19 ds Exp $
dnl AS_COMPILER_FLAG(CFLAGS, ACTION-IF-ACCEPTED, [ACTION-IF-NOT-ACCEPTED])
dnl Tries to compile with the given CFLAGS.
dnl Runs ACTION-IF-ACCEPTED if the compiler can compile with the flags,
dnl and ACTION-IF-NOT-ACCEPTED otherwise.
AC_DEFUN([AS_COMPILER_FLAG],
[
AC_MSG_CHECKING([to see if compiler understands $1])
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $1"
AC_TRY_COMPILE([ ], [], [flag_ok=yes], [flag_ok=no])
CFLAGS="$save_CFLAGS"
if test "X$flag_ok" = Xyes ; then
m4_ifvaln([$2],[$2])
true
else
m4_ifvaln([$3],[$3])
true
fi
AC_MSG_RESULT([$flag_ok])
])
dnl AS_COMPILER_FLAGS(VAR, FLAGS)
dnl Tries to compile with the given CFLAGS.
AC_DEFUN([AS_COMPILER_FLAGS],
[
list=$2
flags_supported=""
flags_unsupported=""
AC_MSG_CHECKING([for supported compiler flags])
for each in $list
do
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $each"
AC_TRY_COMPILE([ ], [], [flag_ok=yes], [flag_ok=no])
CFLAGS="$save_CFLAGS"
if test "X$flag_ok" = Xyes ; then
flags_supported="$flags_supported $each"
else
flags_unsupported="$flags_unsupported $each"
fi
done
AC_MSG_RESULT([$flags_supported])
if test "X$flags_unsupported" != X ; then
AC_MSG_WARN([unsupported compiler flags: $flags_unsupported])
fi
$1="$$1 $flags_supported"
])

View File

@@ -1,134 +0,0 @@
# GLIB - Library of useful C routines
TESTS_ENVIRONMENT= \
G_TEST_SRCDIR="$(abs_srcdir)" \
G_TEST_BUILDDIR="$(abs_builddir)" \
G_DEBUG=gc-friendly \
MALLOC_CHECK_=2 \
MALLOC_PERTURB_=$$(($${RANDOM:-256} % 256))
LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) $(top_srcdir)/build/autotools/tap-driver.sh
LOG_COMPILER = $(top_srcdir)/build/autotools/tap-test
NULL =
# initialize variables for unconditional += appending
BUILT_SOURCES =
BUILT_EXTRA_DIST =
CLEANFILES = *.log *.trs
DISTCLEANFILES =
MAINTAINERCLEANFILES =
EXTRA_DIST =
TESTS =
installed_test_LTLIBRARIES =
installed_test_PROGRAMS =
installed_test_SCRIPTS =
nobase_installed_test_DATA =
noinst_LTLIBRARIES =
noinst_PROGRAMS =
noinst_SCRIPTS =
noinst_DATA =
check_LTLIBRARIES =
check_PROGRAMS =
check_SCRIPTS =
check_DATA =
# We support a fairly large range of possible variables. It is expected that all types of files in a test suite
# will belong in exactly one of the following variables.
#
# First, we support the usual automake suffixes, but in lowercase, with the customary meaning:
#
# test_programs, test_scripts, test_data, test_ltlibraries
#
# The above are used to list files that are involved in both uninstalled and installed testing. The
# test_programs and test_scripts are taken to be actual testcases and will be run as part of the test suite.
# Note that _data is always used with the nobase_ automake variable name to ensure that installed test data is
# installed in the same way as it appears in the package layout.
#
# In order to mark a particular file as being only for one type of testing, use 'installed' or 'uninstalled',
# like so:
#
# installed_test_programs, uninstalled_test_programs
# installed_test_scripts, uninstalled_test_scripts
# installed_test_data, uninstalled_test_data
# installed_test_ltlibraries, uninstalled_test_ltlibraries
#
# Additionally, we support 'extra' infixes for programs and scripts. This is used for support programs/scripts
# that should not themselves be run as testcases (but exist to be used from other testcases):
#
# test_extra_programs, installed_test_extra_programs, uninstalled_test_extra_programs
# test_extra_scripts, installed_test_extra_scripts, uninstalled_test_extra_scripts
#
# Additionally, for _scripts and _data, we support the customary dist_ prefix so that the named script or data
# file automatically end up in the tarball.
#
# dist_test_scripts, dist_test_data, dist_test_extra_scripts
# dist_installed_test_scripts, dist_installed_test_data, dist_installed_test_extra_scripts
# dist_uninstalled_test_scripts, dist_uninstalled_test_data, dist_uninstalled_test_extra_scripts
#
# Note that no file is automatically disted unless it appears in one of the dist_ variables. This follows the
# standard automake convention of not disting programs scripts or data by default.
#
# test_programs, test_scripts, uninstalled_test_programs and uninstalled_test_scripts (as well as their disted
# variants) will be run as part of the in-tree 'make check'. These are all assumed to be runnable under
# gtester. That's a bit strange for scripts, but it's possible.
TESTS += $(test_programs) $(test_scripts) $(uninstalled_test_programs) $(uninstalled_test_scripts) \
$(dist_test_scripts) $(dist_uninstalled_test_scripts)
# Note: build even the installed-only targets during 'make check' to ensure that they still work.
# We need to do a bit of trickery here and manage disting via EXTRA_DIST instead of using dist_ prefixes to
# prevent automake from mistreating gmake functions like $(wildcard ...) and $(addprefix ...) as if they were
# filenames, including removing duplicate instances of the opening part before the space, eg. '$(addprefix'.
all_test_programs = $(test_programs) $(uninstalled_test_programs) $(installed_test_programs) \
$(test_extra_programs) $(uninstalled_test_extra_programs) $(installed_test_extra_programs)
all_test_scripts = $(test_scripts) $(uninstalled_test_scripts) $(installed_test_scripts) \
$(test_extra_scripts) $(uninstalled_test_extra_scripts) $(installed_test_extra_scripts)
all_dist_test_scripts = $(dist_test_scripts) $(dist_uninstalled_test_scripts) $(dist_installed_test_scripts) \
$(dist_test_extra_scripts) $(dist_uninstalled_test_extra_scripts) $(dist_installed_test_extra_scripts)
all_test_scripts += $(all_dist_test_scripts)
EXTRA_DIST += $(all_dist_test_scripts)
all_test_data = $(test_data) $(uninstalled_test_data) $(installed_test_data)
all_dist_test_data = $(dist_test_data) $(dist_uninstalled_test_data) $(dist_installed_test_data)
all_test_data += $(all_dist_test_data)
EXTRA_DIST += $(all_dist_test_data)
all_test_ltlibs = $(test_ltlibraries) $(uninstalled_test_ltlibraries) $(installed_test_ltlibraries)
if ENABLE_ALWAYS_BUILD_TESTS
noinst_LTLIBRARIES += $(all_test_ltlibs)
noinst_PROGRAMS += $(all_test_programs)
noinst_SCRIPTS += $(all_test_scripts)
noinst_DATA += $(all_test_data)
else
check_LTLIBRARIES += $(all_test_ltlibs)
check_PROGRAMS += $(all_test_programs)
check_SCRIPTS += $(all_test_scripts)
check_DATA += $(all_test_data)
endif
if ENABLE_INSTALLED_TESTS
installed_test_PROGRAMS += $(test_programs) $(installed_test_programs) \
$(test_extra_programs) $(installed_test_extra_programs)
installed_test_SCRIPTS += $(test_scripts) $(installed_test_scripts) \
$(test_extra_scripts) $(test_installed_extra_scripts)
installed_test_SCRIPTS += $(dist_test_scripts) $(dist_test_extra_scripts) \
$(dist_installed_test_scripts) $(dist_installed_test_extra_scripts)
nobase_installed_test_DATA += $(test_data) $(installed_test_data)
nobase_installed_test_DATA += $(dist_test_data) $(dist_installed_test_data)
installed_test_LTLIBRARIES += $(test_ltlibraries) $(installed_test_ltlibraries)
installed_testcases = $(test_programs) $(installed_test_programs) \
$(test_scripts) $(installed_test_scripts) \
$(dist_test_scripts) $(dist_installed_test_scripts)
installed_test_meta_DATA = $(installed_testcases:=.test)
%.test: %$(EXEEXT) Makefile
$(AM_V_GEN) (echo '[Test]' > $@.tmp; \
echo 'Type=session' >> $@.tmp; \
echo 'Exec=env G_ENABLE_DIAGNOSTIC=0 CLUTTER_ENABLE_DIAGNOSTIC=0 $(installed_testdir)/$<' >> $@.tmp; \
mv $@.tmp $@)
CLEANFILES += $(installed_test_meta_DATA)
endif

View File

@@ -1,28 +0,0 @@
dnl GLIB_TESTS
dnl
AC_DEFUN([GLIB_TESTS],
[
AC_ARG_ENABLE(installed-tests,
AS_HELP_STRING([--enable-installed-tests],
[Enable installation of some test cases]),
[case ${enableval} in
yes) ENABLE_INSTALLED_TESTS="1" ;;
no) ENABLE_INSTALLED_TESTS="" ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-installed-tests]) ;;
esac])
AM_CONDITIONAL([ENABLE_INSTALLED_TESTS], test "$ENABLE_INSTALLED_TESTS" = "1")
AC_ARG_ENABLE(always-build-tests,
AS_HELP_STRING([--enable-always-build-tests],
[Enable always building tests during 'make all']),
[case ${enableval} in
yes) ENABLE_ALWAYS_BUILD_TESTS="1" ;;
no) ENABLE_ALWAYS_BUILD_TESTS="" ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-always-build-tests]) ;;
esac])
AM_CONDITIONAL([ENABLE_ALWAYS_BUILD_TESTS], test "$ENABLE_ALWAYS_BUILD_TESTS" = "1")
if test "$ENABLE_INSTALLED_TESTS" = "1"; then
AC_SUBST(installed_test_metadir, [${datadir}/installed-tests/]AC_PACKAGE_NAME)
AC_SUBST(installed_testdir, [${libexecdir}/installed-tests/]AC_PACKAGE_NAME)
fi
])

View File

@@ -1,96 +0,0 @@
dnl -*- mode: autoconf -*-
dnl Copyright 2009 Johan Dahlin
dnl
dnl This file is free software; the author(s) gives unlimited
dnl permission to copy and/or distribute it, with or without
dnl modifications, as long as this notice is preserved.
dnl
# serial 1
m4_define([_GOBJECT_INTROSPECTION_CHECK_INTERNAL],
[
AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first
AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first
AC_BEFORE([LT_INIT],[$0])dnl setup libtool first
dnl enable/disable introspection
m4_if([$2], [require],
[dnl
enable_introspection=yes
],[dnl
AC_ARG_ENABLE(introspection,
AS_HELP_STRING([--enable-introspection[=@<:@no/auto/yes@:>@]],
[Enable introspection for this build]),,
[enable_introspection=auto])
])dnl
AC_MSG_CHECKING([for gobject-introspection])
dnl presence/version checking
AS_CASE([$enable_introspection],
[no], [dnl
found_introspection="no (disabled, use --enable-introspection to enable)"
],dnl
[yes],[dnl
PKG_CHECK_EXISTS([gobject-introspection-1.0],,
AC_MSG_ERROR([gobject-introspection-1.0 is not installed]))
PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1],
found_introspection=yes,
AC_MSG_ERROR([You need to have gobject-introspection >= $1 installed to build AC_PACKAGE_NAME]))
],dnl
[auto],[dnl
PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1], found_introspection=yes, found_introspection=no)
dnl Canonicalize enable_introspection
enable_introspection=$found_introspection
],dnl
[dnl
AC_MSG_ERROR([invalid argument passed to --enable-introspection, should be one of @<:@no/auto/yes@:>@])
])dnl
AC_MSG_RESULT([$found_introspection])
INTROSPECTION_SCANNER=
INTROSPECTION_COMPILER=
INTROSPECTION_GENERATE=
INTROSPECTION_GIRDIR=
INTROSPECTION_TYPELIBDIR=
if test "x$found_introspection" = "xyes"; then
INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0`
INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0`
INTROSPECTION_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0`
INTROSPECTION_GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0`
INTROSPECTION_TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)"
INTROSPECTION_CFLAGS=`$PKG_CONFIG --cflags gobject-introspection-1.0`
INTROSPECTION_LIBS=`$PKG_CONFIG --libs gobject-introspection-1.0`
INTROSPECTION_MAKEFILE=`$PKG_CONFIG --variable=datadir gobject-introspection-1.0`/gobject-introspection-1.0/Makefile.introspection
fi
AC_SUBST(INTROSPECTION_SCANNER)
AC_SUBST(INTROSPECTION_COMPILER)
AC_SUBST(INTROSPECTION_GENERATE)
AC_SUBST(INTROSPECTION_GIRDIR)
AC_SUBST(INTROSPECTION_TYPELIBDIR)
AC_SUBST(INTROSPECTION_CFLAGS)
AC_SUBST(INTROSPECTION_LIBS)
AC_SUBST(INTROSPECTION_MAKEFILE)
AM_CONDITIONAL(HAVE_INTROSPECTION, test "x$found_introspection" = "xyes")
])
dnl Usage:
dnl GOBJECT_INTROSPECTION_CHECK([minimum-g-i-version])
AC_DEFUN([GOBJECT_INTROSPECTION_CHECK],
[
_GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1])
])
dnl Usage:
dnl GOBJECT_INTROSPECTION_REQUIRE([minimum-g-i-version])
AC_DEFUN([GOBJECT_INTROSPECTION_REQUIRE],
[
_GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1], [require])
])

View File

@@ -1,652 +0,0 @@
#! /bin/sh
# Copyright (C) 2011-2013 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# This file is maintained in Automake, please report
# bugs to <bug-automake@gnu.org> or send patches to
# <automake-patches@gnu.org>.
scriptversion=2011-12-27.17; # UTC
# Make unconditional expansion of undefined variables an error. This
# helps a lot in preventing typo-related bugs.
set -u
me=tap-driver.sh
fatal ()
{
echo "$me: fatal: $*" >&2
exit 1
}
usage_error ()
{
echo "$me: $*" >&2
print_usage >&2
exit 2
}
print_usage ()
{
cat <<END
Usage:
tap-driver.sh --test-name=NAME --log-file=PATH --trs-file=PATH
[--expect-failure={yes|no}] [--color-tests={yes|no}]
[--enable-hard-errors={yes|no}] [--ignore-exit]
[--diagnostic-string=STRING] [--merge|--no-merge]
[--comments|--no-comments] [--] TEST-COMMAND
The \`--test-name', \`--log-file' and \`--trs-file' options are mandatory.
END
}
# TODO: better error handling in option parsing (in particular, ensure
# TODO: $log_file, $trs_file and $test_name are defined).
test_name= # Used for reporting.
log_file= # Where to save the result and output of the test script.
trs_file= # Where to save the metadata of the test run.
expect_failure=0
color_tests=0
merge=0
ignore_exit=0
comments=0
diag_string='#'
while test $# -gt 0; do
case $1 in
--help) print_usage; exit $?;;
--version) echo "$me $scriptversion"; exit $?;;
--test-name) test_name=$2; shift;;
--log-file) log_file=$2; shift;;
--trs-file) trs_file=$2; shift;;
--color-tests) color_tests=$2; shift;;
--expect-failure) expect_failure=$2; shift;;
--enable-hard-errors) shift;; # No-op.
--merge) merge=1;;
--no-merge) merge=0;;
--ignore-exit) ignore_exit=1;;
--comments) comments=1;;
--no-comments) comments=0;;
--diagnostic-string) diag_string=$2; shift;;
--) shift; break;;
-*) usage_error "invalid option: '$1'";;
esac
shift
done
test $# -gt 0 || usage_error "missing test command"
case $expect_failure in
yes) expect_failure=1;;
*) expect_failure=0;;
esac
if test $color_tests = yes; then
init_colors='
color_map["red"]="" # Red.
color_map["grn"]="" # Green.
color_map["lgn"]="" # Light green.
color_map["blu"]="" # Blue.
color_map["mgn"]="" # Magenta.
color_map["std"]="" # No color.
color_for_result["ERROR"] = "mgn"
color_for_result["PASS"] = "grn"
color_for_result["XPASS"] = "red"
color_for_result["FAIL"] = "red"
color_for_result["XFAIL"] = "lgn"
color_for_result["SKIP"] = "blu"'
else
init_colors=''
fi
# :; is there to work around a bug in bash 3.2 (and earlier) which
# does not always set '$?' properly on redirection failure.
# See the Autoconf manual for more details.
:;{
(
# Ignore common signals (in this subshell only!), to avoid potential
# problems with Korn shells. Some Korn shells are known to propagate
# to themselves signals that have killed a child process they were
# waiting for; this is done at least for SIGINT (and usually only for
# it, in truth). Without the `trap' below, such a behaviour could
# cause a premature exit in the current subshell, e.g., in case the
# test command it runs gets terminated by a SIGINT. Thus, the awk
# script we are piping into would never seen the exit status it
# expects on its last input line (which is displayed below by the
# last `echo $?' statement), and would thus die reporting an internal
# error.
# For more information, see the Autoconf manual and the threads:
# <http://lists.gnu.org/archive/html/bug-autoconf/2011-09/msg00004.html>
# <http://mail.opensolaris.org/pipermail/ksh93-integration-discuss/2009-February/004121.html>
trap : 1 3 2 13 15
if test $merge -gt 0; then
exec 2>&1
else
exec 2>&3
fi
"$@"
echo $?
) | LC_ALL=C ${AM_TAP_AWK-awk} \
-v me="$me" \
-v test_script_name="$test_name" \
-v log_file="$log_file" \
-v trs_file="$trs_file" \
-v expect_failure="$expect_failure" \
-v merge="$merge" \
-v ignore_exit="$ignore_exit" \
-v comments="$comments" \
-v diag_string="$diag_string" \
'
# FIXME: the usages of "cat >&3" below could be optimized when using
# FIXME: GNU awk, and/on on systems that supports /dev/fd/.
# Implementation note: in what follows, `result_obj` will be an
# associative array that (partly) simulates a TAP result object
# from the `TAP::Parser` perl module.
## ----------- ##
## FUNCTIONS ##
## ----------- ##
function fatal(msg)
{
print me ": " msg | "cat >&2"
exit 1
}
function abort(where)
{
fatal("internal error " where)
}
# Convert a boolean to a "yes"/"no" string.
function yn(bool)
{
return bool ? "yes" : "no";
}
function add_test_result(result)
{
if (!test_results_index)
test_results_index = 0
test_results_list[test_results_index] = result
test_results_index += 1
test_results_seen[result] = 1;
}
# Whether the test script should be re-run by "make recheck".
function must_recheck()
{
for (k in test_results_seen)
if (k != "XFAIL" && k != "PASS" && k != "SKIP")
return 1
return 0
}
# Whether the content of the log file associated to this test should
# be copied into the "global" test-suite.log.
function copy_in_global_log()
{
for (k in test_results_seen)
if (k != "PASS")
return 1
return 0
}
# FIXME: this can certainly be improved ...
function get_global_test_result()
{
if ("ERROR" in test_results_seen)
return "ERROR"
if ("FAIL" in test_results_seen || "XPASS" in test_results_seen)
return "FAIL"
all_skipped = 1
for (k in test_results_seen)
if (k != "SKIP")
all_skipped = 0
if (all_skipped)
return "SKIP"
return "PASS";
}
function stringify_result_obj(result_obj)
{
if (result_obj["is_unplanned"] || result_obj["number"] != testno)
return "ERROR"
if (plan_seen == LATE_PLAN)
return "ERROR"
if (result_obj["directive"] == "TODO")
return result_obj["is_ok"] ? "XPASS" : "XFAIL"
if (result_obj["directive"] == "SKIP")
return result_obj["is_ok"] ? "SKIP" : COOKED_FAIL;
if (length(result_obj["directive"]))
abort("in function stringify_result_obj()")
return result_obj["is_ok"] ? COOKED_PASS : COOKED_FAIL
}
function decorate_result(result)
{
color_name = color_for_result[result]
if (color_name)
return color_map[color_name] "" result "" color_map["std"]
# If we are not using colorized output, or if we do not know how
# to colorize the given result, we should return it unchanged.
return result
}
function report(result, details)
{
if (result ~ /^(X?(PASS|FAIL)|SKIP|ERROR)/)
{
msg = ": " test_script_name
add_test_result(result)
}
else if (result == "#")
{
msg = " " test_script_name ":"
}
else
{
abort("in function report()")
}
if (length(details))
msg = msg " " details
# Output on console might be colorized.
print decorate_result(result) msg
# Log the result in the log file too, to help debugging (this is
# especially true when said result is a TAP error or "Bail out!").
print result msg | "cat >&3";
}
function testsuite_error(error_message)
{
report("ERROR", "- " error_message)
}
function handle_tap_result()
{
details = result_obj["number"];
if (length(result_obj["description"]))
details = details " " result_obj["description"]
if (plan_seen == LATE_PLAN)
{
details = details " # AFTER LATE PLAN";
}
else if (result_obj["is_unplanned"])
{
details = details " # UNPLANNED";
}
else if (result_obj["number"] != testno)
{
details = sprintf("%s # OUT-OF-ORDER (expecting %d)",
details, testno);
}
else if (result_obj["directive"])
{
details = details " # " result_obj["directive"];
if (length(result_obj["explanation"]))
details = details " " result_obj["explanation"]
}
report(stringify_result_obj(result_obj), details)
}
# `skip_reason` should be empty whenever planned > 0.
function handle_tap_plan(planned, skip_reason)
{
planned += 0 # Avoid getting confused if, say, `planned` is "00"
if (length(skip_reason) && planned > 0)
abort("in function handle_tap_plan()")
if (plan_seen)
{
# Error, only one plan per stream is acceptable.
testsuite_error("multiple test plans")
return;
}
planned_tests = planned
# The TAP plan can come before or after *all* the TAP results; we speak
# respectively of an "early" or a "late" plan. If we see the plan line
# after at least one TAP result has been seen, assume we have a late
# plan; in this case, any further test result seen after the plan will
# be flagged as an error.
plan_seen = (testno >= 1 ? LATE_PLAN : EARLY_PLAN)
# If testno > 0, we have an error ("too many tests run") that will be
# automatically dealt with later, so do not worry about it here. If
# $plan_seen is true, we have an error due to a repeated plan, and that
# has already been dealt with above. Otherwise, we have a valid "plan
# with SKIP" specification, and should report it as a particular kind
# of SKIP result.
if (planned == 0 && testno == 0)
{
if (length(skip_reason))
skip_reason = "- " skip_reason;
report("SKIP", skip_reason);
}
}
function extract_tap_comment(line)
{
if (index(line, diag_string) == 1)
{
# Strip leading `diag_string` from `line`.
line = substr(line, length(diag_string) + 1)
# And strip any leading and trailing whitespace left.
sub("^[ \t]*", "", line)
sub("[ \t]*$", "", line)
# Return what is left (if any).
return line;
}
return "";
}
# When this function is called, we know that line is a TAP result line,
# so that it matches the (perl) RE "^(not )?ok\b".
function setup_result_obj(line)
{
# Get the result, and remove it from the line.
result_obj["is_ok"] = (substr(line, 1, 2) == "ok" ? 1 : 0)
sub("^(not )?ok[ \t]*", "", line)
# If the result has an explicit number, get it and strip it; otherwise,
# automatically assing the next progresive number to it.
if (line ~ /^[0-9]+$/ || line ~ /^[0-9]+[^a-zA-Z0-9_]/)
{
match(line, "^[0-9]+")
# The final `+ 0` is to normalize numbers with leading zeros.
result_obj["number"] = substr(line, 1, RLENGTH) + 0
line = substr(line, RLENGTH + 1)
}
else
{
result_obj["number"] = testno
}
if (plan_seen == LATE_PLAN)
# No further test results are acceptable after a "late" TAP plan
# has been seen.
result_obj["is_unplanned"] = 1
else if (plan_seen && testno > planned_tests)
result_obj["is_unplanned"] = 1
else
result_obj["is_unplanned"] = 0
# Strip trailing and leading whitespace.
sub("^[ \t]*", "", line)
sub("[ \t]*$", "", line)
# This will have to be corrected if we have a "TODO"/"SKIP" directive.
result_obj["description"] = line
result_obj["directive"] = ""
result_obj["explanation"] = ""
if (index(line, "#") == 0)
return # No possible directive, nothing more to do.
# Directives are case-insensitive.
rx = "[ \t]*#[ \t]*([tT][oO][dD][oO]|[sS][kK][iI][pP])[ \t]*"
# See whether we have the directive, and if yes, where.
pos = match(line, rx "$")
if (!pos)
pos = match(line, rx "[^a-zA-Z0-9_]")
# If there was no TAP directive, we have nothing more to do.
if (!pos)
return
# Let`s now see if the TAP directive has been escaped. For example:
# escaped: ok \# SKIP
# not escaped: ok \\# SKIP
# escaped: ok \\\\\# SKIP
# not escaped: ok \ # SKIP
if (substr(line, pos, 1) == "#")
{
bslash_count = 0
for (i = pos; i > 1 && substr(line, i - 1, 1) == "\\"; i--)
bslash_count += 1
if (bslash_count % 2)
return # Directive was escaped.
}
# Strip the directive and its explanation (if any) from the test
# description.
result_obj["description"] = substr(line, 1, pos - 1)
# Now remove the test description from the line, that has been dealt
# with already.
line = substr(line, pos)
# Strip the directive, and save its value (normalized to upper case).
sub("^[ \t]*#[ \t]*", "", line)
result_obj["directive"] = toupper(substr(line, 1, 4))
line = substr(line, 5)
# Now get the explanation for the directive (if any), with leading
# and trailing whitespace removed.
sub("^[ \t]*", "", line)
sub("[ \t]*$", "", line)
result_obj["explanation"] = line
}
function get_test_exit_message(status)
{
if (status == 0)
return ""
if (status !~ /^[1-9][0-9]*$/)
abort("getting exit status")
if (status < 127)
exit_details = ""
else if (status == 127)
exit_details = " (command not found?)"
else if (status >= 128 && status <= 255)
exit_details = sprintf(" (terminated by signal %d?)", status - 128)
else if (status > 256 && status <= 384)
# We used to report an "abnormal termination" here, but some Korn
# shells, when a child process die due to signal number n, can leave
# in $? an exit status of 256+n instead of the more standard 128+n.
# Apparently, both behaviours are allowed by POSIX (2008), so be
# prepared to handle them both. See also Austing Group report ID
# 0000051 <http://www.austingroupbugs.net/view.php?id=51>
exit_details = sprintf(" (terminated by signal %d?)", status - 256)
else
# Never seen in practice.
exit_details = " (abnormal termination)"
return sprintf("exited with status %d%s", status, exit_details)
}
function write_test_results()
{
print ":global-test-result: " get_global_test_result() > trs_file
print ":recheck: " yn(must_recheck()) > trs_file
print ":copy-in-global-log: " yn(copy_in_global_log()) > trs_file
for (i = 0; i < test_results_index; i += 1)
print ":test-result: " test_results_list[i] > trs_file
close(trs_file);
}
BEGIN {
## ------- ##
## SETUP ##
## ------- ##
'"$init_colors"'
# Properly initialized once the TAP plan is seen.
planned_tests = 0
COOKED_PASS = expect_failure ? "XPASS": "PASS";
COOKED_FAIL = expect_failure ? "XFAIL": "FAIL";
# Enumeration-like constants to remember which kind of plan (if any)
# has been seen. It is important that NO_PLAN evaluates "false" as
# a boolean.
NO_PLAN = 0
EARLY_PLAN = 1
LATE_PLAN = 2
testno = 0 # Number of test results seen so far.
bailed_out = 0 # Whether a "Bail out!" directive has been seen.
# Whether the TAP plan has been seen or not, and if yes, which kind
# it is ("early" is seen before any test result, "late" otherwise).
plan_seen = NO_PLAN
## --------- ##
## PARSING ##
## --------- ##
is_first_read = 1
while (1)
{
# Involutions required so that we are able to read the exit status
# from the last input line.
st = getline
if (st < 0) # I/O error.
fatal("I/O error while reading from input stream")
else if (st == 0) # End-of-input
{
if (is_first_read)
abort("in input loop: only one input line")
break
}
if (is_first_read)
{
is_first_read = 0
nextline = $0
continue
}
else
{
curline = nextline
nextline = $0
$0 = curline
}
# Copy any input line verbatim into the log file.
print | "cat >&3"
# Parsing of TAP input should stop after a "Bail out!" directive.
if (bailed_out)
continue
# TAP test result.
if ($0 ~ /^(not )?ok$/ || $0 ~ /^(not )?ok[^a-zA-Z0-9_]/)
{
testno += 1
setup_result_obj($0)
handle_tap_result()
}
# TAP plan (normal or "SKIP" without explanation).
else if ($0 ~ /^1\.\.[0-9]+[ \t]*$/)
{
# The next two lines will put the number of planned tests in $0.
sub("^1\\.\\.", "")
sub("[^0-9]*$", "")
handle_tap_plan($0, "")
continue
}
# TAP "SKIP" plan, with an explanation.
else if ($0 ~ /^1\.\.0+[ \t]*#/)
{
# The next lines will put the skip explanation in $0, stripping
# any leading and trailing whitespace. This is a little more
# tricky in truth, since we want to also strip a potential leading
# "SKIP" string from the message.
sub("^[^#]*#[ \t]*(SKIP[: \t][ \t]*)?", "")
sub("[ \t]*$", "");
handle_tap_plan(0, $0)
}
# "Bail out!" magic.
# Older versions of prove and TAP::Harness (e.g., 3.17) did not
# recognize a "Bail out!" directive when preceded by leading
# whitespace, but more modern versions (e.g., 3.23) do. So we
# emulate the latter, "more modern" behaviour.
else if ($0 ~ /^[ \t]*Bail out!/)
{
bailed_out = 1
# Get the bailout message (if any), with leading and trailing
# whitespace stripped. The message remains stored in `$0`.
sub("^[ \t]*Bail out![ \t]*", "");
sub("[ \t]*$", "");
# Format the error message for the
bailout_message = "Bail out!"
if (length($0))
bailout_message = bailout_message " " $0
testsuite_error(bailout_message)
}
# Maybe we have too look for dianogtic comments too.
else if (comments != 0)
{
comment = extract_tap_comment($0);
if (length(comment))
report("#", comment);
}
}
## -------- ##
## FINISH ##
## -------- ##
# A "Bail out!" directive should cause us to ignore any following TAP
# error, as well as a non-zero exit status from the TAP producer.
if (!bailed_out)
{
if (!plan_seen)
{
testsuite_error("missing test plan")
}
else if (planned_tests != testno)
{
bad_amount = testno > planned_tests ? "many" : "few"
testsuite_error(sprintf("too %s tests run (expected %d, got %d)",
bad_amount, planned_tests, testno))
}
if (!ignore_exit)
{
# Fetch exit status from the last line.
exit_message = get_test_exit_message(nextline)
if (exit_message)
testsuite_error(exit_message)
}
}
write_test_results()
exit 0
} # End of "BEGIN" block.
'
# TODO: document that we consume the file descriptor 3 :-(
} 3>"$log_file"
test $? -eq 0 || fatal "I/O or internal error"
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:

View File

@@ -1,5 +0,0 @@
#! /bin/sh
# run a GTest in tap mode. The test binary is passed as $1
$1 -k --tap

View File

@@ -1,710 +0,0 @@
AUTOMAKE_OPTIONS = subdir-objects
# preamble
NULL =
# common definitions
CLEANFILES =
DISTCLEANFILES =
EXTRA_DIST =
BUILT_SOURCES =
AM_CPPFLAGS = \
-DCLUTTER_SYSCONFDIR=\""$(sysconfdir)"\" \
-DCLUTTER_COMPILATION=1 \
-DCOGL_DISABLE_DEPRECATION_WARNINGS \
-DG_LOG_DOMAIN=\"Clutter\" \
-fvisibility=hidden \
-I$(top_srcdir) \
-I$(top_srcdir)/clutter \
-I$(top_builddir) \
-I$(top_builddir)/clutter \
-I$(top_srcdir)/../cogl \
-I$(top_builddir)/../cogl \
-I$(top_builddir)/../cogl/cogl \
$(CLUTTER_DEPRECATED_CFLAGS) \
$(CLUTTER_DEBUG_CFLAGS) \
$(NULL)
AM_CFLAGS = $(CLUTTER_CFLAGS) $(MAINTAINER_CFLAGS)
# these are the gir files we generate using g-ir-scanner
INTROSPECTION_GIRS =
# the base include path for headers
clutter_base_includedir = $(includedir)/mutter-$(LIBMUTTER_API_VERSION)/clutter
clutter_includedir = $(clutter_base_includedir)/clutter
clutter_deprecateddir = $(clutter_base_includedir)/clutter/deprecated
# pkg-config files
pc_files =
# common sources - please, keep these sorted alphabetically
source_h = \
clutter-action.h \
clutter-actor-meta.h \
clutter-actor.h \
clutter-align-constraint.h \
clutter-animatable.h \
clutter-backend.h \
clutter-bind-constraint.h \
clutter-binding-pool.h \
clutter-bin-layout.h \
clutter-blur-effect.h \
clutter-box-layout.h \
clutter-brightness-contrast-effect.h \
clutter-cairo.h \
clutter-canvas.h \
clutter-child-meta.h \
clutter-click-action.h \
clutter-clone.h \
clutter-color-static.h \
clutter-color.h \
clutter-colorize-effect.h \
clutter-constraint.h \
clutter-container.h \
clutter-content.h \
clutter-deform-effect.h \
clutter-deprecated.h \
clutter-desaturate-effect.h \
clutter-device-manager.h \
clutter-drag-action.h \
clutter-drop-action.h \
clutter-effect.h \
clutter-enums.h \
clutter-event.h \
clutter-feature.h \
clutter-fixed-layout.h \
clutter-flow-layout.h \
clutter-gesture-action.h \
clutter-grid-layout.h \
clutter-group.h \
clutter-image.h \
clutter-input-device.h \
clutter-input-device-tool.h \
clutter-input-focus.h \
clutter-input-method.h \
clutter-interval.h \
clutter-keyframe-transition.h \
clutter-keysyms.h \
clutter-layout-manager.h \
clutter-layout-meta.h \
clutter-macros.h \
clutter-main.h \
clutter-offscreen-effect.h \
clutter-page-turn-effect.h \
clutter-paint-nodes.h \
clutter-paint-node.h \
clutter-pan-action.h \
clutter-path-constraint.h \
clutter-path.h \
clutter-property-transition.h \
clutter-rotate-action.h \
clutter-script.h \
clutter-scriptable.h \
clutter-scroll-actor.h \
clutter-settings.h \
clutter-shader-effect.h \
clutter-shader-types.h \
clutter-swipe-action.h \
clutter-snap-constraint.h \
clutter-stage.h \
clutter-stage-manager.h \
clutter-tap-action.h \
clutter-test-utils.h \
clutter-texture.h \
clutter-text.h \
clutter-text-buffer.h \
clutter-timeline.h \
clutter-transition-group.h \
clutter-transition.h \
clutter-types.h \
clutter-units.h \
clutter-virtual-input-device.h \
clutter-zoom-action.h \
$(NULL)
source_c = \
clutter-action.c \
clutter-actor-box.c \
clutter-actor-meta.c \
clutter-actor.c \
clutter-align-constraint.c \
clutter-animatable.c \
clutter-backend.c \
clutter-base-types.c \
clutter-bezier.c \
clutter-bind-constraint.c \
clutter-binding-pool.c \
clutter-bin-layout.c \
clutter-blur-effect.c \
clutter-box-layout.c \
clutter-brightness-contrast-effect.c \
clutter-cairo.c \
clutter-canvas.c \
clutter-child-meta.c \
clutter-click-action.c \
clutter-clone.c \
clutter-color.c \
clutter-colorize-effect.c \
clutter-constraint.c \
clutter-container.c \
clutter-content.c \
clutter-deform-effect.c \
clutter-desaturate-effect.c \
clutter-device-manager.c \
clutter-drag-action.c \
clutter-drop-action.c \
clutter-effect.c \
clutter-event.c \
clutter-feature.c \
clutter-fixed-layout.c \
clutter-flatten-effect.c \
clutter-flow-layout.c \
clutter-gesture-action.c \
clutter-grid-layout.c \
clutter-image.c \
clutter-input-device.c \
clutter-input-device-tool.c \
clutter-input-focus.c \
clutter-input-method.c \
clutter-virtual-input-device.c \
clutter-interval.c \
clutter-keyframe-transition.c \
clutter-keysyms-table.c \
clutter-layout-manager.c \
clutter-layout-meta.c \
clutter-main.c \
clutter-master-clock.c \
clutter-master-clock-default.c \
clutter-offscreen-effect.c \
clutter-page-turn-effect.c \
clutter-paint-nodes.c \
clutter-paint-node.c \
clutter-pan-action.c \
clutter-path-constraint.c \
clutter-path.c \
clutter-property-transition.c \
clutter-rotate-action.c \
clutter-script.c \
clutter-script-parser.c \
clutter-scriptable.c \
clutter-scroll-actor.c \
clutter-settings.c \
clutter-shader-effect.c \
clutter-shader-types.c \
clutter-swipe-action.c \
clutter-snap-constraint.c \
clutter-stage.c \
clutter-stage-manager.c \
clutter-stage-window.c \
clutter-tap-action.c \
clutter-test-utils.c \
clutter-text.c \
clutter-text-buffer.c \
clutter-transition-group.c \
clutter-transition.c \
clutter-timeline.c \
clutter-units.c \
clutter-util.c \
clutter-paint-volume.c \
clutter-zoom-action.c \
$(NULL)
# private headers; these should not be distributed or introspected
source_h_priv = \
clutter-actor-meta-private.h \
clutter-actor-private.h \
clutter-backend-private.h \
clutter-bezier.h \
clutter-constraint-private.h \
clutter-content-private.h \
clutter-debug.h \
clutter-device-manager-private.h \
clutter-easing.h \
clutter-effect-private.h \
clutter-event-translator.h \
clutter-event-private.h \
clutter-flatten-effect.h \
clutter-gesture-action-private.h \
clutter-id-pool.h \
clutter-input-focus-private.h \
clutter-input-method-private.h \
clutter-master-clock.h \
clutter-master-clock-default.h \
clutter-offscreen-effect-private.h \
clutter-paint-node-private.h \
clutter-paint-volume-private.h \
clutter-private.h \
clutter-script-private.h \
clutter-settings-private.h \
clutter-stage-manager-private.h \
clutter-stage-private.h \
clutter-stage-view.h \
clutter-stage-window.h \
$(NULL)
# private source code; these should not be introspected
source_c_priv = \
clutter-easing.c \
clutter-event-translator.c \
clutter-id-pool.c \
clutter-stage-view.c \
$(NULL)
# deprecated installed headers
deprecated_h = \
deprecated/clutter-actor.h \
deprecated/clutter-alpha.h \
deprecated/clutter-animatable.h \
deprecated/clutter-animation.h \
deprecated/clutter-animator.h \
deprecated/clutter-backend.h \
deprecated/clutter-behaviour.h \
deprecated/clutter-behaviour-depth.h \
deprecated/clutter-behaviour-ellipse.h \
deprecated/clutter-behaviour-opacity.h \
deprecated/clutter-behaviour-path.h \
deprecated/clutter-behaviour-rotate.h \
deprecated/clutter-behaviour-scale.h \
deprecated/clutter-bin-layout.h \
deprecated/clutter-box.h \
deprecated/clutter-cairo-texture.h \
deprecated/clutter-container.h \
deprecated/clutter-frame-source.h \
deprecated/clutter-group.h \
deprecated/clutter-input-device.h \
deprecated/clutter-keysyms.h \
deprecated/clutter-list-model.h \
deprecated/clutter-main.h \
deprecated/clutter-media.h \
deprecated/clutter-model.h \
deprecated/clutter-rectangle.h \
deprecated/clutter-score.h \
deprecated/clutter-shader.h \
deprecated/clutter-stage-manager.h \
deprecated/clutter-stage.h \
deprecated/clutter-state.h \
deprecated/clutter-table-layout.h \
deprecated/clutter-texture.h \
deprecated/clutter-timeline.h \
deprecated/clutter-timeout-pool.h \
deprecated/clutter-util.h \
$(NULL)
# deprecated source code
deprecated_c = \
deprecated/clutter-actor-deprecated.c \
deprecated/clutter-alpha.c \
deprecated/clutter-animation.c \
deprecated/clutter-animator.c \
deprecated/clutter-behaviour.c \
deprecated/clutter-behaviour-depth.c \
deprecated/clutter-behaviour-ellipse.c \
deprecated/clutter-behaviour-opacity.c \
deprecated/clutter-behaviour-path.c \
deprecated/clutter-behaviour-rotate.c \
deprecated/clutter-behaviour-scale.c \
deprecated/clutter-box.c \
deprecated/clutter-cairo-texture.c \
deprecated/clutter-frame-source.c \
deprecated/clutter-group.c \
deprecated/clutter-input-device-deprecated.c \
deprecated/clutter-layout-manager-deprecated.c \
deprecated/clutter-list-model.c \
deprecated/clutter-media.c \
deprecated/clutter-model.c \
deprecated/clutter-rectangle.c \
deprecated/clutter-score.c \
deprecated/clutter-shader.c \
deprecated/clutter-state.c \
deprecated/clutter-table-layout.c \
deprecated/clutter-texture.c \
deprecated/clutter-timeout-pool.c \
$(NULL)
# deprecated private headers; these should not be installed
deprecated_h_priv = \
deprecated/clutter-model-private.h \
deprecated/clutter-timeout-interval.h \
$(NULL)
# deprecated private source code; these should not be introspected
deprecated_c_priv = \
deprecated/clutter-timeout-interval.c \
$(NULL)
# built sources
built_source_c = \
clutter-enum-types.c \
clutter-marshal.c \
$(NULL)
# built headers
built_source_h = \
clutter-enum-types.h \
clutter-marshal.h \
$(NULL)
# config header
DISTCLEANFILES += clutter-config.h
EXTRA_DIST += clutter-config.h.in
# key symbol update script
EXTRA_DIST += clutter-keysyms-update.pl
pc_files += mutter-clutter-$(LIBMUTTER_API_VERSION).pc
# in order to be compatible with Clutter < 1.10, when we shipped a single
# shared library whose name was determined by the single backend it
# supported, we need to install symbolic links so that existing applications
# using Clutter won't break in the Brave New World of multi-backend support
# in the same shared object.
compat_libs =
# backends source listings
#
# backend_source_c := source code
# backend_source_h := installed public headers
# backend_source_c_priv := source that should not be scanned by g-i
# backend_source_h_priv := private headers
# backend_source_built := built sources
#
backend_source_c =
backend_source_h =
backend_source_c_priv =
backend_source_h_priv =
backend_source_built =
# X11 backend rules
x11_source_c = \
x11/clutter-backend-x11.c \
x11/clutter-device-manager-core-x11.c \
x11/clutter-event-x11.c \
x11/clutter-input-device-core-x11.c \
x11/clutter-keymap-x11.c \
x11/clutter-stage-x11.c \
x11/clutter-x11-texture-pixmap.c \
x11/clutter-xkb-a11y-x11.c \
$(NULL)
x11_source_h = \
x11/clutter-x11.h \
x11/clutter-x11-texture-pixmap.h \
$(NULL)
x11_source_h_priv = \
x11/clutter-backend-x11.h \
x11/clutter-device-manager-core-x11.h \
x11/clutter-input-device-core-x11.h \
x11/clutter-keymap-x11.h \
x11/clutter-settings-x11.h \
x11/clutter-stage-x11.h \
x11/clutter-xkb-a11y-x11.h \
$(NULL)
x11_source_c_priv = \
x11/xsettings/xsettings-client.c \
x11/xsettings/xsettings-client.h \
x11/xsettings/xsettings-common.c \
x11/xsettings/xsettings-common.h \
$(NULL)
x11_source_c += \
x11/clutter-device-manager-xi2.c \
x11/clutter-input-device-xi2.c \
x11/clutter-input-device-tool-xi2.c \
$(NULL)
x11_source_h_priv += \
x11/clutter-device-manager-xi2.h \
x11/clutter-input-device-xi2.h \
x11/clutter-input-device-tool-xi2.h \
$(NULL)
x11_source_c += \
x11/clutter-virtual-input-device-x11.c \
$(NULL)
x11_source_h_priv += \
x11/clutter-virtual-input-device-x11.h \
$(NULL)
backend_source_h += $(x11_source_h)
backend_source_c += $(x11_source_c)
backend_source_h_priv += $(x11_source_h_priv)
backend_source_c_priv += $(x11_source_c_priv)
# the list of files we want to introspect on X11
x11_introspection = $(x11_source_c) $(x11_source_h)
clutterx11_includedir = $(clutter_includedir)/x11
clutterx11_include_HEADERS = $(x11_source_h)
mutter-clutter-x11-@LIBMUTTER_API_VERSION@.pc: mutter-clutter-$(LIBMUTTER_API_VERSION).pc
$(QUIET_GEN)cp -f $< $(@F)
pc_files += mutter-clutter-x11-$(LIBMUTTER_API_VERSION).pc
# Shared cogl backend files
cogl_source_h =
cogl_source_c = \
cogl/clutter-stage-cogl.c \
$(NULL)
cogl_source_h_priv = \
cogl/clutter-stage-cogl.h \
$(NULL)
cogl_source_c_priv =
backend_source_h += $(cogl_source_h)
backend_source_c += $(cogl_source_c)
backend_source_h_priv += $(cogl_source_h_priv)
backend_source_c_priv += $(cogl_source_c_priv)
backend_source_h += $(glx_source_h)
backend_source_c += $(glx_source_c)
evdev_c_priv = \
evdev/clutter-device-manager-evdev.c \
evdev/clutter-input-device-evdev.c \
evdev/clutter-seat-evdev.c \
evdev/clutter-virtual-input-device-evdev.c \
evdev/clutter-event-evdev.c \
evdev/clutter-input-device-tool-evdev.c \
$(NULL)
evdev_h_priv = \
evdev/clutter-device-manager-evdev.h \
evdev/clutter-input-device-evdev.h \
evdev/clutter-seat-evdev.h \
evdev/clutter-input-device-tool-evdev.h \
evdev/clutter-virtual-input-device-evdev.h \
$(NULL)
evdev_h = evdev/clutter-evdev.h
if SUPPORT_WAYLAND
backend_source_c_priv += $(evdev_c_priv)
backend_source_h_priv += $(evdev_h_priv)
backend_source_h += $(evdev_h)
backend_source_c += evdev/clutter-xkb-utils.c
backend_source_h_priv += evdev/clutter-xkb-utils.h
# EGL backend rules
egl_source_h = \
egl/clutter-egl-headers.h \
egl/clutter-egl.h \
$(NULL)
egl_source_h_priv = egl/clutter-backend-eglnative.h
egl_source_c = egl/clutter-backend-eglnative.c
wayland_compositor_source_h = \
wayland/clutter-wayland-compositor.h \
wayland/clutter-wayland-surface.h
backend_source_h += $(wayland_compositor_source_h)
backend_source_c += \
wayland/clutter-wayland-surface.c
backend_source_h += $(egl_source_h)
backend_source_c += $(egl_source_c)
backend_source_h_priv += $(egl_source_h_priv)
endif # SUPPORT_WAYLAND
# cally
cally_sources_h = \
cally/cally-actor.h \
cally/cally-clone.h \
cally/cally-factory.h \
cally/cally-group.h \
cally/cally.h \
cally/cally-main.h \
cally/cally-rectangle.h \
cally/cally-root.h \
cally/cally-stage.h \
cally/cally-text.h \
cally/cally-texture.h \
cally/cally-util.h \
$(NULL)
cally_sources_c = \
cally/cally-actor.c \
cally/cally.c \
cally/cally-clone.c \
cally/cally-group.c \
cally/cally-rectangle.c \
cally/cally-root.c \
cally/cally-stage.c \
cally/cally-text.c \
cally/cally-texture.c \
cally/cally-util.c \
$(NULL)
cally_sources_private = \
cally/cally-actor-private.h \
$(NULL)
cally_includedir = $(clutter_base_includedir)/cally
cally_include_HEADERS = $(cally_sources_h)
# general build rules:
# you should not need to modify anything below this point
# glib-genmarshal rules
glib_marshal_list = clutter-marshal.list
glib_marshal_prefix = _clutter_marshal
include $(srcdir)/Makefile.am.marshal
# glib-mkenums rules
glib_enum_h = clutter-enum-types.h
glib_enum_c = clutter-enum-types.c
glib_enum_headers = $(source_h) $(deprecated_h)
include $(srcdir)/Makefile.am.enums
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = $(pc_files)
DISTCLEANFILES += $(pc_files)
clutter_include_HEADERS = $(source_h) clutter.h clutter-autocleanups.h clutter-mutter.h
nodist_clutter_include_HEADERS = clutter-config.h $(built_source_h)
clutter_deprecated_HEADERS = $(deprecated_h)
mutterlibdir = $(libdir)/mutter-@LIBMUTTER_API_VERSION@
mutterlib_LTLIBRARIES = libmutter-clutter-@LIBMUTTER_API_VERSION@.la
libmutter_clutter_@LIBMUTTER_API_VERSION@_la_LIBADD = \
$(LIBM) \
$(CLUTTER_LIBS) \
$(top_builddir)/../cogl/cogl/libmutter-cogl-$(LIBMUTTER_API_VERSION).la \
$(top_builddir)/../cogl/cogl-pango/libmutter-cogl-pango-$(LIBMUTTER_API_VERSION).la \
$(top_builddir)/../cogl/cogl-path/libmutter-cogl-path-$(LIBMUTTER_API_VERSION).la \
$(NULL)
libmutter_clutter_@LIBMUTTER_API_VERSION@_la_SOURCES = \
$(backend_source_c) \
$(backend_source_h) \
$(backend_source_c_priv) \
$(backend_source_h_priv) \
$(source_c) \
$(source_h) \
$(source_c_priv) \
$(source_h_priv) \
$(deprecated_c) \
$(deprecated_h) \
$(deprecated_c_priv) \
$(deprecated_h_priv) \
$(cally_sources_c) \
$(cally_sources_h) \
$(cally_sources_private) \
$(NULL)
nodist_libmutter_clutter_@LIBMUTTER_API_VERSION@_la_SOURCES = \
$(backend_source_built) \
$(built_source_c) \
$(built_source_h)
libmutter_clutter_@LIBMUTTER_API_VERSION@_la_LDFLAGS = \
$(CLUTTER_LINK_FLAGS) \
$(CLUTTER_LT_LDFLAGS) \
-export-dynamic \
-rpath $(mutterlibdir) \
$(NULL)
install-exec-local:
test -z "$(mutterlibdir)" || $(MKDIR_P) "$(DESTDIR)$(mutterlibdir)"
for lib in `echo $(compat_libs)`; do \
(cd $(DESTDIR)$(mutterlibdir) && \
rm -f $$lib.0.$(CLUTTER_LT_CURRENT).$(CLUTTER_LT_REVISION); \
) ; \
(cd $(DESTDIR)$(mutterlibdir) && \
{ ln -s -f libmutter-clutter-$(LIBMUTTER_API_VERSION).so.0.$(CLUTTER_LT_CURRENT).$(CLUTTER_LT_REVISION) $$lib.0 || \
{ rm -f $$lib.0 && ln -s libmutter-clutter-$(LIBMUTTER_API_VERSION).so.0.$(CLUTTER_LT_CURRENT).$(CLUTTER_LT_REVISION) $$lib.0; }; \
} \
) ; \
(cd $(DESTDIR)$(mutterlibdir) && \
{ ln -s -f libmutter-clutter-$(LIBMUTTER_API_VERSION).so.0.$(CLUTTER_LT_CURRENT).$(CLUTTER_LT_REVISION) $$lib || \
{ rm -f $$lib && ln -s libmutter-clutter-$(LIBMUTTER_API_VERSION).so.0.$(CLUTTER_LT_CURRENT).$(CLUTTER_LT_REVISION) $$lib; }; \
} \
) ; \
done
# gobject-introspection rules
-include $(INTROSPECTION_MAKEFILE)
INTROSPECTION_SCANNER_ARGS = \
--add-include-path=$(top_builddir)/../cogl/cogl \
--add-include-path=$(top_builddir)/../cogl/cogl-pango
INTROSPECTION_COMPILER_ARGS = \
--includedir=$(top_builddir)/../cogl/cogl \
--includedir=$(top_builddir)/../cogl/cogl-pango
INTROSPECTION_SCANNER_ENV = \
PKG_CONFIG_PATH=$(top_builddir)/../cogl/cogl/:$(top_builddir)/../cogl/cogl-pango/:$${PKG_CONFIG_PATH}
Clutter-@LIBMUTTER_API_VERSION@.gir: libmutter-clutter-@LIBMUTTER_API_VERSION@.la Makefile
Clutter_@LIBMUTTER_API_VERSION@_gir_NAMESPACE = Clutter
Clutter_@LIBMUTTER_API_VERSION@_gir_VERSION = @LIBMUTTER_API_VERSION@
Clutter_@LIBMUTTER_API_VERSION@_gir_LIBS = libmutter-clutter-@LIBMUTTER_API_VERSION@.la
Clutter_@LIBMUTTER_API_VERSION@_gir_FILES = \
$(clutter_include_HEADERS) \
$(clutter_deprecated_HEADERS) \
$(nodist_clutter_include_HEADERS) \
$(source_c) \
$(deprecated_c) \
$(built_source_c)
Clutter_@LIBMUTTER_API_VERSION@_gir_CFLAGS = $(AM_CPPFLAGS) $(CLUTTER_CFLAGS)
Clutter_@LIBMUTTER_API_VERSION@_gir_INCLUDES = GL-1.0 GObject-2.0 cairo-1.0 Cogl-@LIBMUTTER_API_VERSION@ CoglPango-@LIBMUTTER_API_VERSION@ Atk-1.0 Json-1.0
Clutter_@LIBMUTTER_API_VERSION@_gir_SCANNERFLAGS = \
--warn-all \
--c-include='clutter/clutter.h' \
--pkg-export=mutter-clutter-@LIBMUTTER_API_VERSION@
INTROSPECTION_GIRS += Clutter-@LIBMUTTER_API_VERSION@.gir
Cally-@LIBMUTTER_API_VERSION@.gir: Makefile Clutter-@LIBMUTTER_API_VERSION@.gir
Cally_@LIBMUTTER_API_VERSION@_gir_NAMESPACE = Cally
Cally_@LIBMUTTER_API_VERSION@_gir_VERSION = @LIBMUTTER_API_VERSION@
Cally_@LIBMUTTER_API_VERSION@_gir_LIBS = libmutter-clutter-@LIBMUTTER_API_VERSION@.la
Cally_@LIBMUTTER_API_VERSION@_gir_FILES = $(cally_sources_h) $(cally_sources_c)
Cally_@LIBMUTTER_API_VERSION@_gir_CFLAGS = $(AM_CPPFLAGS) $(CLUTTER_CFLAGS)
Cally_@LIBMUTTER_API_VERSION@_gir_SCANNERFLAGS = \
--warn-all \
--c-include='cally/cally.h' \
--pkg-export=mutter-clutter-@LIBMUTTER_API_VERSION@ \
--include-uninstalled=$(top_builddir)/clutter/Clutter-@LIBMUTTER_API_VERSION@.gir
INTROSPECTION_GIRS += Cally-@LIBMUTTER_API_VERSION@.gir
ClutterX11-@LIBMUTTER_API_VERSION@.gir: Makefile Clutter-@LIBMUTTER_API_VERSION@.gir
ClutterX11_@LIBMUTTER_API_VERSION@_gir_NAMESPACE = ClutterX11
ClutterX11_@LIBMUTTER_API_VERSION@_gir_INCLUDES = xlib-2.0
ClutterX11_@LIBMUTTER_API_VERSION@_gir_LIBS = libmutter-clutter-@LIBMUTTER_API_VERSION@.la
ClutterX11_@LIBMUTTER_API_VERSION@_gir_FILES = $(x11_introspection)
ClutterX11_@LIBMUTTER_API_VERSION@_gir_CFLAGS = $(AM_CPPFLAGS) $(CLUTTER_CFLAGS)
ClutterX11_@LIBMUTTER_API_VERSION@_gir_SCANNERFLAGS = \
--warn-all \
--c-include='clutter/x11/clutter-x11.h' \
--pkg-export=mutter-clutter-x11-@LIBMUTTER_API_VERSION@ \
--include-uninstalled=$(top_builddir)/clutter/Clutter-@LIBMUTTER_API_VERSION@.gir
INTROSPECTION_GIRS += ClutterX11-@LIBMUTTER_API_VERSION@.gir
# INTROSPECTION_GIRDIR/INTROSPECTION_TYPELIBDIR aren't the right place to
# install anything - we need to install inside our prefix.
girdir = $(mutterlibdir)
gir_DATA = $(INTROSPECTION_GIRS)
typelibdir = $(mutterlibdir)
typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
EXTRA_DIST += \
Makefile.am.marshal \
Makefile.am.enums
CLEANFILES += $(gir_DATA) $(typelib_DATA)

View File

@@ -1,52 +0,0 @@
# Rules for generating enumeration types using glib-mkenums
#
# Define:
# glib_enum_h = header template file
# glib_enum_c = source template file
# glib_enum_headers = list of headers to parse
#
# before including Makefile.am.enums. You will also need to have
# the following targets already defined:
#
# CLEANFILES
# DISTCLEANFILES
# BUILT_SOURCES
# EXTRA_DIST
#
# Author: Emmanuele Bassi <ebassi@linux.intel.com>
# Basic sanity checks
$(if $(GLIB_MKENUMS),,$(error Need to define GLIB_MKENUMS))
$(if $(or $(glib_enum_h), \
$(glib_enum_c)),, \
$(error Need to define glib_enum_h and glib_enum_c))
$(if $(glib_enum_headers),,$(error Need to define glib_enum_headers))
enum_tmpl_h=$(addprefix $(srcdir)/, $(glib_enum_h:.h=.h.in))
enum_tmpl_c=$(addprefix $(srcdir)/, $(glib_enum_c:.c=.c.in))
enum_headers=$(addprefix $(srcdir)/, $(glib_enum_headers))
CLEANFILES += stamp-enum-types
DISTCLEANFILES += $(glib_enum_h) $(glib_enum_c)
BUILT_SOURCES += $(glib_enum_h) $(glib_enum_c)
EXTRA_DIST += $(enum_tmpl_h) $(enum_tmpl_c)
stamp-enum-types: $(enum_headers) $(enum_tmpl_h)
$(AM_V_GEN)$(GLIB_MKENUMS) \
--template $(enum_tmpl_h) \
$(enum_headers) > xgen-eh \
&& (cmp -s xgen-eh $(glib_enum_h) || cp -f xgen-eh $(glib_enum_h)) \
&& rm -f xgen-eh \
&& echo timestamp > $(@F)
$(glib_enum_h): stamp-enum-types
@true
$(glib_enum_c): $(enum_headers) $(enum_tmpl_h) $(enum_tmpl_c)
$(AM_V_GEN)$(GLIB_MKENUMS) \
--template $(enum_tmpl_c) \
$(enum_headers) > xgen-ec \
&& cp -f xgen-ec $(glib_enum_c) \
&& rm -f xgen-ec

View File

@@ -1,54 +0,0 @@
# Rules for generating marshal files using glib-genmarshal
#
# Define:
# glib_marshal_list = marshal list file
# glib_marshal_prefix = prefix for marshal functions
#
# before including Makefile.am.marshal. You will also need to have
# the following targets already defined:
#
# CLEANFILES
# DISTCLEANFILES
# BUILT_SOURCES
# EXTRA_DIST
#
# Author: Emmanuele Bassi <ebassi@linux.intel.com>
# Basic sanity checks
$(if $(GLIB_GENMARSHAL),,$(error Need to define GLIB_GENMARSHAL))
$(if $(or $(glib_marshal_list), \
$(glib_marshal_prefix)),, \
$(error Need to define glib_marshal_list and glib_marshal_prefix))
marshal_h = $(glib_marshal_list:.list=.h)
marshal_c = $(glib_marshal_list:.list=.c)
marshal_list = $(addprefix $(srcdir)/, $(glib_marshal_list))
CLEANFILES += stamp-marshal
DISTCLEANFILES += $(marshal_h) $(marshal_c)
BUILT_SOURCES += $(marshal_h) $(marshal_c)
EXTRA_DIST += $(marshal_list)
stamp-marshal: $(marshal_list)
$(AM_V_GEN)$(GLIB_GENMARSHAL) \
--prefix=$(glib_marshal_prefix) \
--header \
--valist-marshallers \
$(marshal_list) > xgen-mh \
&& (cmp -s xgen-mh $(marshal_h) || cp -f xgen-mh $(marshal_h)) \
&& rm -f xgen-mh \
&& echo timestamp > $(@F)
$(marshal_h): stamp-marshal
@true
$(marshal_c): $(marshal_h)
$(AM_V_GEN)$(GLIB_GENMARSHAL) \
--prefix=$(glib_marshal_prefix) \
--body \
--valist-marshallers \
--prototypes \
$(marshal_list) > xgen-mc \
&& (cmp -s xgen-mc $(marshal_c) || cp -f xgen-mc $(marshal_c)) \
&& rm -f xgen-mc

View File

@@ -275,13 +275,13 @@ void _clutter_actor_set_enable_paint_unmapped
void _clutter_actor_set_has_pointer (ClutterActor *self,
gboolean has_pointer);
void _clutter_actor_queue_redraw_with_clip (ClutterActor *self,
ClutterRedrawFlags flags,
ClutterPaintVolume *clip_volume);
void _clutter_actor_queue_redraw_full (ClutterActor *self,
ClutterRedrawFlags flags,
ClutterPaintVolume *volume,
ClutterEffect *effect);
void _clutter_actor_queue_redraw_with_clip (ClutterActor *self,
ClutterRedrawFlags flags,
const ClutterPaintVolume *clip_volume);
void _clutter_actor_queue_redraw_full (ClutterActor *self,
ClutterRedrawFlags flags,
const ClutterPaintVolume *volume,
ClutterEffect *effect);
ClutterPaintVolume * _clutter_actor_get_queue_redraw_clip (ClutterActor *self);
void _clutter_actor_set_queue_redraw_clip (ClutterActor *self,

View File

@@ -1722,6 +1722,22 @@ set_show_on_set_parent (ClutterActor *self,
}
}
static void
clutter_actor_queue_redraw_on_parent (ClutterActor *self)
{
const ClutterPaintVolume *pv;
if (!self->priv->parent)
return;
/* A relayout/redraw is underway */
if (self->priv->needs_allocation)
return;
pv = clutter_actor_get_transformed_paint_volume (self, self->priv->parent);
_clutter_actor_queue_redraw_with_clip (self->priv->parent, 0, pv);
}
/**
* clutter_actor_show:
* @self: A #ClutterActor
@@ -1777,7 +1793,7 @@ clutter_actor_show (ClutterActor *self)
g_object_notify_by_pspec (G_OBJECT (self), obj_props[PROP_VISIBLE]);
if (priv->parent != NULL)
clutter_actor_queue_redraw (priv->parent);
clutter_actor_queue_redraw (self);
g_object_thaw_notify (G_OBJECT (self));
}
@@ -1902,8 +1918,10 @@ clutter_actor_hide (ClutterActor *self)
g_signal_emit (self, actor_signals[HIDE], 0);
g_object_notify_by_pspec (G_OBJECT (self), obj_props[PROP_VISIBLE]);
if (priv->parent != NULL)
if (priv->parent != NULL && priv->needs_allocation)
clutter_actor_queue_redraw (priv->parent);
else
clutter_actor_queue_redraw_on_parent (self);
g_object_thaw_notify (G_OBJECT (self));
}
@@ -4862,7 +4880,8 @@ clutter_actor_set_scale_factor (ClutterActor *self,
g_assert (pspec != NULL);
g_assert (scale_p != NULL);
_clutter_actor_create_transition (self, pspec, *scale_p, factor);
if (*scale_p != factor)
_clutter_actor_create_transition (self, pspec, *scale_p, factor);
}
static inline void
@@ -8744,15 +8763,14 @@ _clutter_actor_get_allocation_clip (ClutterActor *self,
}
void
_clutter_actor_queue_redraw_full (ClutterActor *self,
ClutterRedrawFlags flags,
ClutterPaintVolume *volume,
ClutterEffect *effect)
_clutter_actor_queue_redraw_full (ClutterActor *self,
ClutterRedrawFlags flags,
const ClutterPaintVolume *volume,
ClutterEffect *effect)
{
ClutterActorPrivate *priv = self->priv;
ClutterPaintVolume allocation_pv;
ClutterPaintVolume *pv;
gboolean should_free_pv;
ClutterPaintVolume *pv = NULL;
ClutterActor *stage;
/* Here's an outline of the actor queue redraw mechanism:
@@ -8894,21 +8912,15 @@ _clutter_actor_queue_redraw_full (ClutterActor *self,
clutter_paint_volume_set_height (pv,
allocation_clip.y2 -
allocation_clip.y1);
should_free_pv = TRUE;
}
else
{
pv = volume;
should_free_pv = FALSE;
}
self->priv->queue_redraw_entry =
_clutter_stage_queue_actor_redraw (CLUTTER_STAGE (stage),
priv->queue_redraw_entry,
self,
pv);
pv ? pv : volume);
if (should_free_pv)
if (pv)
clutter_paint_volume_free (pv);
/* If this is the first redraw queued then we can directly use the
@@ -9022,9 +9034,9 @@ clutter_actor_queue_redraw (ClutterActor *self)
* picking of your actor.
*/
void
_clutter_actor_queue_redraw_with_clip (ClutterActor *self,
ClutterRedrawFlags flags,
ClutterPaintVolume *volume)
_clutter_actor_queue_redraw_with_clip (ClutterActor *self,
ClutterRedrawFlags flags,
const ClutterPaintVolume *volume)
{
_clutter_actor_queue_redraw_full (self,
flags, /* flags */
@@ -10301,9 +10313,10 @@ clutter_actor_set_position (ClutterActor *self,
cur_position.x = clutter_actor_get_x (self);
cur_position.y = clutter_actor_get_y (self);
_clutter_actor_create_transition (self, obj_props[PROP_POSITION],
&cur_position,
&new_position);
if (!clutter_point_equals (&cur_position, &new_position))
_clutter_actor_create_transition (self, obj_props[PROP_POSITION],
&cur_position,
&new_position);
}
/**
@@ -13662,7 +13675,7 @@ clutter_actor_set_child_above_sibling (ClutterActor *self,
sibling);
g_object_unref(child);
clutter_actor_queue_relayout (self);
clutter_actor_queue_redraw_on_parent (child);
}
/**
@@ -13709,7 +13722,7 @@ clutter_actor_set_child_below_sibling (ClutterActor *self,
sibling);
g_object_unref(child);
clutter_actor_queue_relayout (self);
clutter_actor_queue_redraw_on_parent (child);
}
/**

View File

@@ -430,7 +430,7 @@ clutter_backend_real_get_features (ClutterBackend *backend)
if (cogl_clutter_winsys_has_feature (COGL_WINSYS_FEATURE_SWAP_THROTTLE))
{
CLUTTER_NOTE (BACKEND, "Cogl supports swap buffers throttling");
flags |= CLUTTER_FEATURE_SYNC_TO_VBLANK;
flags |= CLUTTER_FEATURE_SWAP_THROTTLE;
}
else
CLUTTER_NOTE (BACKEND, "Cogl doesn't support swap buffers throttling");

View File

@@ -39,7 +39,8 @@ typedef enum {
CLUTTER_DEBUG_DISABLE_CULLING = 1 << 4,
CLUTTER_DEBUG_DISABLE_OFFSCREEN_REDIRECT = 1 << 5,
CLUTTER_DEBUG_CONTINUOUS_REDRAW = 1 << 6,
CLUTTER_DEBUG_PAINT_DEFORM_TILES = 1 << 7
CLUTTER_DEBUG_PAINT_DEFORM_TILES = 1 << 7,
CLUTTER_DEBUG_PAINT_DAMAGE_REGION = 1 << 8,
} ClutterDrawDebugFlag;
#ifdef CLUTTER_ENABLE_DEBUG

View File

@@ -26,7 +26,6 @@
#include "deprecated/clutter-keysyms.h"
#include "deprecated/clutter-list-model.h"
#include "deprecated/clutter-main.h"
#include "deprecated/clutter-media.h"
#include "deprecated/clutter-model.h"
#include "deprecated/clutter-rectangle.h"
#include "deprecated/clutter-score.h"

View File

@@ -167,6 +167,10 @@ struct _ClutterInputDeviceClass
gboolean (* is_grouped) (ClutterInputDevice *device,
ClutterInputDevice *other_device);
gboolean (* get_physical_size) (ClutterInputDevice *device,
gdouble *width,
gdouble *height);
/* Keyboard accessbility */
void (* process_kbd_a11y_event) (ClutterEvent *event,
ClutterInputDevice *device,

View File

@@ -884,7 +884,7 @@ typedef enum {
/**
* ClutterFeatureFlags:
* @CLUTTER_FEATURE_TEXTURE_NPOT: Set if NPOTS textures supported.
* @CLUTTER_FEATURE_SYNC_TO_VBLANK: Set if vblank syncing supported.
* @CLUTTER_FEATURE_SWAP_THROTTLE: Set if backend throttles buffer swaps.
* @CLUTTER_FEATURE_TEXTURE_YUV: Set if YUV based textures supported.
* @CLUTTER_FEATURE_TEXTURE_READ_PIXELS: Set if texture pixels can be read.
* @CLUTTER_FEATURE_STAGE_STATIC: Set if stage size if fixed (i.e framebuffer)
@@ -903,7 +903,7 @@ typedef enum {
typedef enum
{
CLUTTER_FEATURE_TEXTURE_NPOT = (1 << 2),
CLUTTER_FEATURE_SYNC_TO_VBLANK = (1 << 3),
CLUTTER_FEATURE_SWAP_THROTTLE = (1 << 3),
CLUTTER_FEATURE_TEXTURE_YUV = (1 << 4),
CLUTTER_FEATURE_TEXTURE_READ_PIXELS = (1 << 5),
CLUTTER_FEATURE_STAGE_STATIC = (1 << 6),

View File

@@ -2284,3 +2284,15 @@ clutter_input_device_is_grouped (ClutterInputDevice *device,
return CLUTTER_INPUT_DEVICE_GET_CLASS (device)->is_grouped (device, other_device);
}
gboolean
clutter_input_device_get_physical_size (ClutterInputDevice *device,
gdouble *width,
gdouble *height)
{
g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (device), FALSE);
return CLUTTER_INPUT_DEVICE_GET_CLASS (device)->get_physical_size (device,
width,
height);
}

View File

@@ -171,6 +171,10 @@ void clutter_input_device_set_mapping_mode (ClutterInputDev
CLUTTER_EXPORT
gboolean clutter_input_device_is_grouped (ClutterInputDevice *device,
ClutterInputDevice *other_device);
CLUTTER_EXPORT
gboolean clutter_input_device_get_physical_size (ClutterInputDevice *device,
gdouble *width,
gdouble *height);
G_END_DECLS

View File

@@ -142,6 +142,7 @@ static const GDebugKey clutter_paint_debug_keys[] = {
{ "disable-offscreen-redirect", CLUTTER_DEBUG_DISABLE_OFFSCREEN_REDIRECT },
{ "continuous-redraw", CLUTTER_DEBUG_CONTINUOUS_REDRAW },
{ "paint-deform-tiles", CLUTTER_DEBUG_PAINT_DEFORM_TILES },
{ "damage-region", CLUTTER_DEBUG_PAINT_DAMAGE_REGION },
};
static void
@@ -254,16 +255,6 @@ clutter_config_read_from_key_file (GKeyFile *keyfile)
else
clutter_enable_accessibility = bool_value;
bool_value =
g_key_file_get_boolean (keyfile, ENVIRONMENT_GROUP,
"SyncToVblank",
&key_error);
if (key_error != NULL)
g_clear_error (&key_error);
else
clutter_sync_to_vblank = bool_value;
int_value =
g_key_file_get_integer (keyfile, ENVIRONMENT_GROUP,
"DefaultFps",
@@ -1365,6 +1356,9 @@ clutter_init_real (GError **error)
CLUTTER_DEBUG_DISABLE_CLIPPED_REDRAWS | CLUTTER_DEBUG_DISABLE_CULLING;
}
if (clutter_paint_debug_flags & CLUTTER_DEBUG_PAINT_DAMAGE_REGION)
g_message ("Enabling damaged region");
/* this will take care of initializing Cogl's state and
* query the GL machinery for features
*/
@@ -1487,10 +1481,6 @@ pre_parse_hook (GOptionContext *context,
if (env_string)
clutter_use_fuzzy_picking = TRUE;
env_string = g_getenv ("CLUTTER_VBLANK");
if (g_strcmp0 (env_string, "none") == 0)
clutter_sync_to_vblank = FALSE;
return _clutter_backend_pre_parse (backend, error);
}
@@ -3631,12 +3621,6 @@ _clutter_set_sync_to_vblank (gboolean sync_to_vblank)
clutter_sync_to_vblank = !!sync_to_vblank;
}
gboolean
_clutter_get_sync_to_vblank (void)
{
return clutter_sync_to_vblank;
}
void
_clutter_debug_messagev (const char *format,
va_list var_args)

View File

@@ -298,10 +298,10 @@ master_clock_next_frame_delay (ClutterMasterClockDefault *master_clock)
* (NB: if there aren't even any timelines running then the master clock will
* be completely stopped in master_clock_is_running())
*/
if (clutter_feature_available (CLUTTER_FEATURE_SYNC_TO_VBLANK) &&
if (clutter_feature_available (CLUTTER_FEATURE_SWAP_THROTTLE) &&
!master_clock->idle)
{
CLUTTER_NOTE (SCHEDULER, "vblank available and updated stages");
CLUTTER_NOTE (SCHEDULER, "swap throttling available and updated stages");
return 0;
}

View File

@@ -34,9 +34,6 @@
CLUTTER_EXPORT
void clutter_set_custom_backend_func (ClutterBackend *(* func) (void));
CLUTTER_EXPORT
gboolean _clutter_get_sync_to_vblank (void);
CLUTTER_EXPORT
int64_t clutter_stage_get_frame_counter (ClutterStage *stage);

View File

@@ -1164,6 +1164,21 @@ _clutter_paint_volume_get_stage_paint_box (ClutterPaintVolume *pv,
_clutter_paint_volume_get_bounding_box (&projected_pv, box);
if (pv->is_2d && pv->actor &&
clutter_actor_get_z_position (pv->actor) == 0)
{
/* If the volume/actor are perfectly 2D, take the bounding box as
* good. We won't need to add any extra room for sub-pixel positioning
* in this case.
*/
clutter_paint_volume_free (&projected_pv);
box->x1 = CLUTTER_NEARBYINT (box->x1);
box->y1 = CLUTTER_NEARBYINT (box->y1);
box->x2 = CLUTTER_NEARBYINT (box->x2);
box->y2 = CLUTTER_NEARBYINT (box->y2);
return;
}
/* The aim here is that for a given rectangle defined with floating point
* coordinates we want to determine a stable quantized size in pixels
* that doesn't vary due to the original box's sub-pixel position.

View File

@@ -87,7 +87,7 @@ const ClutterPlane *_clutter_stage_get_clip (ClutterStage *stage);
ClutterStageQueueRedrawEntry *_clutter_stage_queue_actor_redraw (ClutterStage *stage,
ClutterStageQueueRedrawEntry *entry,
ClutterActor *actor,
ClutterPaintVolume *clip);
const ClutterPaintVolume *clip);
void _clutter_stage_queue_redraw_entry_invalidate (ClutterStageQueueRedrawEntry *entry);
CoglFramebuffer *_clutter_stage_get_active_framebuffer (ClutterStage *stage);

View File

@@ -6,6 +6,14 @@
#include "clutter-stage-window.h"
#include "clutter-private.h"
/**
* SECTION:clutter-stage-window
* @short_description: Handles the implementation for ClutterStage
*
* #ClutterStageWindow is an interface that provides the implementation for the
* #ClutterStage actor, abstracting away the specifics of the windowing system.
*/
#define clutter_stage_window_get_type _clutter_stage_window_get_type
typedef ClutterStageWindowIface ClutterStageWindowInterface;
@@ -36,6 +44,12 @@ clutter_stage_window_default_init (ClutterStageWindowInterface *iface)
g_object_interface_install_property (iface, pspec);
}
/**
* _clutter_stage_window_get_wrapper:
* @window: a #ClutterStageWindow object
*
* Returns the pointer to the #ClutterStage it's part of.
*/
ClutterActor *
_clutter_stage_window_get_wrapper (ClutterStageWindow *window)
{
@@ -138,6 +152,14 @@ _clutter_stage_window_schedule_update (ClutterStageWindow *window,
iface->schedule_update (window, sync_delay);
}
/**
* _clutter_stage_window_get_update_time:
* @window: a #ClutterStageWindow object
*
* See _clutter_stage_get_update_time() for more info.
*
* Returns: The timestamp of the update time
*/
gint64
_clutter_stage_window_get_update_time (ClutterStageWindow *window)
{
@@ -155,6 +177,12 @@ _clutter_stage_window_get_update_time (ClutterStageWindow *window)
return iface->get_update_time (window);
}
/**
* _clutter_stage_window_clear_update_time:
* @window: a #ClutterStageWindow object
*
* Clears the update time. See _clutter_stage_clear_update_time() for more info.
*/
void
_clutter_stage_window_clear_update_time (ClutterStageWindow *window)
{

View File

@@ -36,10 +36,10 @@
* using clutter_actor_destroy(), which will take care of destroying all the
* actors contained inside them.
*
* #ClutterStage is a proxy actor, wrapping the backend-specific
* implementation of the windowing system. It is possible to subclass
* #ClutterStage, as long as every overridden virtual function chains up to
* the parent class corresponding function.
* #ClutterStage is a proxy actor, wrapping the backend-specific implementation
* (a #StageWindow) of the windowing system. It is possible to subclass
* #ClutterStage, as long as every overridden virtual function chains up to the
* parent class corresponding function.
*/
#include "clutter-build-config.h"
@@ -1511,7 +1511,8 @@ _clutter_stage_do_pick_on_view (ClutterStage *stage,
* are drawn offscreen (as we never swap buffers)
*/
context->pick_mode = mode;
_clutter_stage_paint_view (stage, view, NULL);
clutter_stage_do_paint_view (stage, view, NULL);
context->pick_mode = CLUTTER_PICK_NONE;
/* Read the color of the screen co-ords pixel. RGBA_8888_PRE is used
@@ -2248,6 +2249,8 @@ clutter_stage_class_init (ClutterStageClass *klass)
* @stage: the stage that received the event
* @frame_event: a #CoglFrameEvent
* @frame_info: a #ClutterFrameInfo
*
* Signals that the #ClutterStage was presented on the screen to the user.
*/
stage_signals[PRESENTED] =
g_signal_new (I_("presented"),
@@ -3627,6 +3630,10 @@ _clutter_stage_maybe_setup_viewport (ClutterStage *stage,
float fb_scale;
float viewport_offset_x;
float viewport_offset_y;
float viewport_x;
float viewport_y;
float viewport_width;
float viewport_height;
float z_2d;
CLUTTER_NOTE (PAINT,
@@ -3639,11 +3646,13 @@ _clutter_stage_maybe_setup_viewport (ClutterStage *stage,
viewport_offset_x = view_layout.x * fb_scale;
viewport_offset_y = view_layout.y * fb_scale;
viewport_x = roundf (priv->viewport[0] * fb_scale - viewport_offset_x);
viewport_y = roundf (priv->viewport[1] * fb_scale - viewport_offset_y);
viewport_width = roundf (priv->viewport[2] * fb_scale);
viewport_height = roundf (priv->viewport[3] * fb_scale);
cogl_framebuffer_set_viewport (fb,
priv->viewport[0] * fb_scale - viewport_offset_x,
priv->viewport[1] * fb_scale - viewport_offset_y,
priv->viewport[2] * fb_scale,
priv->viewport[3] * fb_scale);
viewport_x, viewport_y,
viewport_width, viewport_height);
perspective = priv->perspective;
@@ -3722,6 +3731,17 @@ clutter_stage_ensure_redraw (ClutterStage *stage)
_clutter_master_clock_start_running (master_clock);
}
/**
* clutter_stage_is_redraw_queued: (skip)
*/
gboolean
clutter_stage_is_redraw_queued (ClutterStage *stage)
{
ClutterStagePrivate *priv = stage->priv;
return priv->redraw_pending;
}
/**
* clutter_stage_queue_redraw:
* @stage: the #ClutterStage
@@ -3982,6 +4002,12 @@ clutter_stage_get_minimum_size (ClutterStage *stage,
*height_p = (guint) height;
}
/**
* _clutter_stage_schedule_update:
* @window: a #ClutterStage actor
*
* Schedules a redraw of the #ClutterStage at the next optimal timestamp.
*/
void
_clutter_stage_schedule_update (ClutterStage *stage)
{
@@ -3998,7 +4024,18 @@ _clutter_stage_schedule_update (ClutterStage *stage)
stage->priv->sync_delay);
}
/* Returns the earliest time the stage is ready to update */
/**
* _clutter_stage_get_update_time:
* @stage: a #ClutterStage actor
*
* Returns the earliest time in which the stage is ready to update. The update
* time is set when _clutter_stage_schedule_update() is called. This can then
* be used by e.g. the #ClutterMasterClock to know when the stage needs to be
* redrawn.
*
* Returns: -1 if no redraw is needed; 0 if the backend doesn't know, or the
* timestamp (in microseconds) otherwise.
*/
gint64
_clutter_stage_get_update_time (ClutterStage *stage)
{
@@ -4014,6 +4051,13 @@ _clutter_stage_get_update_time (ClutterStage *stage)
return _clutter_stage_window_get_update_time (stage_window);
}
/**
* _clutter_stage_clear_update_time:
* @stage: a #ClutterStage actor
*
* Resets the update time. Call this after a redraw, so that the update time
* can again be updated.
*/
void
_clutter_stage_clear_update_time (ClutterStage *stage)
{
@@ -4139,10 +4183,10 @@ _clutter_stage_get_clip (ClutterStage *stage)
* didn't explicitly do so.
*/
ClutterStageQueueRedrawEntry *
_clutter_stage_queue_actor_redraw (ClutterStage *stage,
_clutter_stage_queue_actor_redraw (ClutterStage *stage,
ClutterStageQueueRedrawEntry *entry,
ClutterActor *actor,
ClutterPaintVolume *clip)
ClutterActor *actor,
const ClutterPaintVolume *clip)
{
ClutterStagePrivate *priv = stage->priv;

View File

@@ -250,6 +250,9 @@ void clutter_stage_ensure_viewport (ClutterStage
CLUTTER_EXPORT
void clutter_stage_ensure_redraw (ClutterStage *stage);
CLUTTER_EXPORT
gboolean clutter_stage_is_redraw_queued (ClutterStage *stage);
#ifdef CLUTTER_ENABLE_EXPERIMENTAL_API
CLUTTER_EXPORT
void clutter_stage_set_sync_delay (ClutterStage *stage,

View File

@@ -351,6 +351,58 @@ valid_buffer_age (ClutterStageViewCogl *view_cogl,
return age < MIN (view_priv->damage_index, DAMAGE_HISTORY_MAX);
}
static void
paint_damage_region (ClutterStageWindow *stage_window,
ClutterStageView *view,
cairo_rectangle_int_t *swap_region)
{
CoglFramebuffer *framebuffer = clutter_stage_view_get_onscreen (view);
CoglContext *ctx = cogl_framebuffer_get_context (framebuffer);
static CoglPipeline *overlay_blue = NULL;
ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_window);
ClutterActor *actor = CLUTTER_ACTOR (stage_cogl->wrapper);
float x_1 = swap_region->x;
float x_2 = swap_region->x + swap_region->width;
float y_1 = swap_region->y;
float y_2 = swap_region->y + swap_region->height;
CoglMatrix modelview;
if (G_UNLIKELY (overlay_blue == NULL))
{
overlay_blue = cogl_pipeline_new (ctx);
cogl_pipeline_set_color4ub (overlay_blue, 0x00, 0x00, 0x33, 0x33);
}
cogl_framebuffer_push_matrix (framebuffer);
cogl_matrix_init_identity (&modelview);
_clutter_actor_apply_modelview_transform (actor, &modelview);
cogl_framebuffer_set_modelview_matrix (framebuffer, &modelview);
/* Blue for the swap region */
cogl_framebuffer_draw_rectangle (framebuffer, overlay_blue, x_1, y_1, x_2, y_2);
/* Red for the clip */
if (stage_cogl->initialized_redraw_clip)
{
static CoglPipeline *overlay_red = NULL;
if (G_UNLIKELY (overlay_red == NULL))
{
overlay_red = cogl_pipeline_new (ctx);
cogl_pipeline_set_color4ub (overlay_red, 0x33, 0x00, 0x00, 0x33);
}
x_1 = stage_cogl->bounding_redraw_clip.x;
x_2 = stage_cogl->bounding_redraw_clip.x + stage_cogl->bounding_redraw_clip.width;
y_1 = stage_cogl->bounding_redraw_clip.y;
y_2 = stage_cogl->bounding_redraw_clip.y + stage_cogl->bounding_redraw_clip.height;
cogl_framebuffer_draw_rectangle (framebuffer, overlay_red, x_1, y_1, x_2, y_2);
}
cogl_framebuffer_pop_matrix (framebuffer);
}
static gboolean
swap_framebuffer (ClutterStageWindow *stage_window,
ClutterStageView *view,
@@ -370,6 +422,9 @@ swap_framebuffer (ClutterStageWindow *stage_window,
else
ndamage = 0;
if (G_UNLIKELY ((clutter_paint_debug_flags & CLUTTER_DEBUG_PAINT_DAMAGE_REGION)))
paint_damage_region (stage_window, view, swap_region);
if (cogl_is_onscreen (framebuffer))
{
CoglOnscreen *onscreen = COGL_ONSCREEN (framebuffer);
@@ -521,6 +576,15 @@ calculate_scissor_region (cairo_rectangle_int_t *fb_clip_region,
};
}
static inline gboolean
is_buffer_age_enabled (void)
{
/* Buffer age is disabled when running with CLUTTER_PAINT=damage-region,
* to ensure the red damage represents the currently damaged area */
return !(clutter_paint_debug_flags & CLUTTER_DEBUG_PAINT_DAMAGE_REGION) &&
cogl_clutter_winsys_has_feature (COGL_WINSYS_FEATURE_BUFFER_AGE);
}
static gboolean
clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
ClutterStageView *view)
@@ -558,9 +622,7 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
cogl_is_onscreen (fb) &&
cogl_clutter_winsys_has_feature (COGL_WINSYS_FEATURE_SWAP_REGION);
has_buffer_age =
cogl_is_onscreen (fb) &&
cogl_clutter_winsys_has_feature (COGL_WINSYS_FEATURE_BUFFER_AGE);
has_buffer_age = cogl_is_onscreen (fb) && is_buffer_age_enabled ();
/* NB: a zero width redraw clip == full stage redraw */
if (stage_cogl->bounding_redraw_clip.width == 0)
@@ -891,7 +953,7 @@ clutter_stage_cogl_get_dirty_pixel (ClutterStageWindow *stage_window,
CoglFramebuffer *framebuffer = clutter_stage_view_get_framebuffer (view);
gboolean has_buffer_age =
cogl_is_onscreen (framebuffer) &&
cogl_clutter_winsys_has_feature (COGL_WINSYS_FEATURE_BUFFER_AGE);
is_buffer_age_enabled ();
float fb_scale;
gboolean scale_is_fractional;

View File

@@ -1,664 +0,0 @@
/*
* Clutter.
*
* An OpenGL based 'interactive canvas' library.
*
* Authored By: Matthew Allum <mallum@openedhand.com>
* Emmanuele Bassi <ebassi@linux.intel.com>
*
* Copyright (C) 2006 OpenedHand
* Copyright (C) 2009 Intel Corp.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* SECTION:clutter-media
* @short_description: An interface for controlling playback of media data
*
* #ClutterMedia is an interface for controlling playback of media sources.
*
* Clutter core does not provide an implementation of this interface, but
* other integration libraries like Clutter-GStreamer implement it to offer
* a uniform API for applications.
*
* #ClutterMedia is available since Clutter 0.2
*
* #ClutterMedia is deprecated since Clutter 1.12. Use the Clutter-GStreamer
* API directly instead.
*/
#include "clutter-build-config.h"
#define CLUTTER_DISABLE_DEPRECATION_WARNINGS
#include "clutter-debug.h"
#include "clutter-enum-types.h"
#include "clutter-marshal.h"
#include "clutter-media.h"
#include "clutter-main.h"
#include "clutter-private.h" /* for DBG */
enum
{
EOS_SIGNAL,
ERROR_SIGNAL, /* can't be called 'ERROR' otherwise it clashes with wingdi.h */
LAST_SIGNAL
};
static guint media_signals[LAST_SIGNAL] = { 0, };
typedef ClutterMediaIface ClutterMediaInterface;
G_DEFINE_INTERFACE (ClutterMedia, clutter_media, G_TYPE_OBJECT);
static void
clutter_media_default_init (ClutterMediaInterface *iface)
{
GParamSpec *pspec = NULL;
/**
* ClutterMedia:uri:
*
* The location of a media file, expressed as a valid URI.
*
* Since: 0.2
*
* Deprecated: 1.12
*/
pspec = g_param_spec_string ("uri",
P_("URI"),
P_("URI of a media file"),
NULL,
CLUTTER_PARAM_READWRITE |
G_PARAM_DEPRECATED);
g_object_interface_install_property (iface, pspec);
/**
* ClutterMedia:playing:
*
* Whether the #ClutterMedia actor is playing.
*
* Since: 0.2
*
* Deprecated: 1.12
*/
pspec = g_param_spec_boolean ("playing",
P_("Playing"),
P_("Whether the actor is playing"),
FALSE,
CLUTTER_PARAM_READWRITE |
G_PARAM_DEPRECATED);
g_object_interface_install_property (iface, pspec);
/**
* ClutterMedia:progress:
*
* The current progress of the playback, as a normalized
* value between 0.0 and 1.0.
*
* Since: 1.0
*
* Deprecated: 1.12
*/
pspec = g_param_spec_double ("progress",
P_("Progress"),
P_("Current progress of the playback"),
0.0, 1.0, 0.0,
CLUTTER_PARAM_READWRITE |
G_PARAM_DEPRECATED);
g_object_interface_install_property (iface, pspec);
/**
* ClutterMedia:subtitle-uri:
*
* The location of a subtitle file, expressed as a valid URI.
*
* Since: 1.2
*
* Deprecated: 1.12
*/
pspec = g_param_spec_string ("subtitle-uri",
P_("Subtitle URI"),
P_("URI of a subtitle file"),
NULL,
CLUTTER_PARAM_READWRITE |
G_PARAM_DEPRECATED);
g_object_interface_install_property (iface, pspec);
/**
* ClutterMedia:subtitle-font-name:
*
* The font used to display subtitles. The font description has to
* follow the same grammar as the one recognized by
* pango_font_description_from_string().
*
* Since: 1.2
*
* Deprecated: 1.12
*/
pspec = g_param_spec_string ("subtitle-font-name",
P_("Subtitle Font Name"),
P_("The font used to display subtitles"),
NULL,
CLUTTER_PARAM_READWRITE |
G_PARAM_DEPRECATED);
g_object_interface_install_property (iface, pspec);
/**
* ClutterMedia:audio-volume:
*
* The volume of the audio, as a normalized value between
* 0.0 and 1.0.
*
* Since: 1.0
*
* Deprecated: 1.12
*/
pspec = g_param_spec_double ("audio-volume",
P_("Audio Volume"),
P_("The volume of the audio"),
0.0, 1.0, 0.5,
CLUTTER_PARAM_READWRITE |
G_PARAM_DEPRECATED);
g_object_interface_install_property (iface, pspec);
/**
* ClutterMedia:can-seek:
*
* Whether the current stream is seekable.
*
* Since: 0.2
*
* Deprecated: 1.12
*/
pspec = g_param_spec_boolean ("can-seek",
P_("Can Seek"),
P_("Whether the current stream is seekable"),
FALSE,
CLUTTER_PARAM_READABLE |
G_PARAM_DEPRECATED);
g_object_interface_install_property (iface, pspec);
/**
* ClutterMedia:buffer-fill:
*
* The fill level of the buffer for the current stream,
* as a value between 0.0 and 1.0.
*
* Since: 1.0
*
* Deprecated: 1.12
*/
pspec = g_param_spec_double ("buffer-fill",
P_("Buffer Fill"),
P_("The fill level of the buffer"),
0.0, 1.0, 0.0,
CLUTTER_PARAM_READABLE |
G_PARAM_DEPRECATED);
g_object_interface_install_property (iface, pspec);
/**
* ClutterMedia:duration:
*
* The duration of the current stream, in seconds
*
* Since: 0.2
*
* Deprecated: 1.12
*/
pspec = g_param_spec_double ("duration",
P_("Duration"),
P_("The duration of the stream, in seconds"),
0, G_MAXDOUBLE, 0,
CLUTTER_PARAM_READABLE);
g_object_interface_install_property (iface, pspec);
/**
* ClutterMedia::eos:
* @media: the #ClutterMedia instance that received the signal
*
* The ::eos signal is emitted each time the media stream ends.
*
* Since: 0.2
*
* Deprecated: 1.12
*/
media_signals[EOS_SIGNAL] =
g_signal_new (I_("eos"),
CLUTTER_TYPE_MEDIA,
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (ClutterMediaIface, eos),
NULL, NULL,
_clutter_marshal_VOID__VOID,
G_TYPE_NONE, 0);
/**
* ClutterMedia::error:
* @media: the #ClutterMedia instance that received the signal
* @error: the #GError
*
* The ::error signal is emitted each time an error occurred.
*
* Since: 0.2
*
* Deprecated: 1.12
*/
media_signals[ERROR_SIGNAL] =
g_signal_new (I_("error"),
CLUTTER_TYPE_MEDIA,
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (ClutterMediaIface, error),
NULL, NULL,
_clutter_marshal_VOID__BOXED,
G_TYPE_NONE, 1,
G_TYPE_ERROR);
}
/**
* clutter_media_set_uri:
* @media: a #ClutterMedia
* @uri: the URI of the media stream
*
* Sets the URI of @media to @uri.
*
* Since: 0.2
*
* Deprecated: 1.12
*/
void
clutter_media_set_uri (ClutterMedia *media,
const gchar *uri)
{
g_return_if_fail (CLUTTER_IS_MEDIA(media));
g_object_set (G_OBJECT (media), "uri", uri, NULL);
}
/**
* clutter_media_get_uri:
* @media: a #ClutterMedia
*
* Retrieves the URI from @media.
*
* Return value: the URI of the media stream. Use g_free()
* to free the returned string
*
* Since: 0.2
*
* Deprecated: 1.12
*/
gchar *
clutter_media_get_uri (ClutterMedia *media)
{
gchar *retval = NULL;
g_return_val_if_fail (CLUTTER_IS_MEDIA(media), NULL);
g_object_get (G_OBJECT (media), "uri", &retval, NULL);
return retval;
}
/**
* clutter_media_set_playing:
* @media: a #ClutterMedia
* @playing: %TRUE to start playing
*
* Starts or stops playing of @media.
* The implementation might be asynchronous, so the way to know whether
* the actual playing state of the @media is to use the #GObject::notify
* signal on the #ClutterMedia:playing property and then retrieve the
* current state with clutter_media_get_playing(). ClutterGstVideoTexture
* in clutter-gst is an example of such an asynchronous implementation.
*
* Since: 0.2
*
* Deprecated: 1.12
*/
void
clutter_media_set_playing (ClutterMedia *media,
gboolean playing)
{
g_return_if_fail (CLUTTER_IS_MEDIA(media));
g_object_set (G_OBJECT (media), "playing", playing, NULL);
}
/**
* clutter_media_get_playing:
* @media: A #ClutterMedia object
*
* Retrieves the playing status of @media.
*
* Return value: %TRUE if playing, %FALSE if stopped.
*
* Since: 0.2
*
* Deprecated: 1.12
*/
gboolean
clutter_media_get_playing (ClutterMedia *media)
{
gboolean is_playing = FALSE;
g_return_val_if_fail (CLUTTER_IS_MEDIA (media), FALSE);
g_object_get (G_OBJECT (media), "playing", &is_playing, NULL);
return is_playing;
}
/**
* clutter_media_set_progress:
* @media: a #ClutterMedia
* @progress: the progress of the playback, between 0.0 and 1.0
*
* Sets the playback progress of @media. The @progress is
* a normalized value between 0.0 (begin) and 1.0 (end).
*
* Since: 1.0
*
* Deprecated: 1.12
*/
void
clutter_media_set_progress (ClutterMedia *media,
gdouble progress)
{
g_return_if_fail (CLUTTER_IS_MEDIA (media));
g_object_set (G_OBJECT (media), "progress", progress, NULL);
}
/**
* clutter_media_get_progress:
* @media: a #ClutterMedia
*
* Retrieves the playback progress of @media.
*
* Return value: the playback progress, between 0.0 and 1.0
*
* Since: 1.0
*
* Deprecated: 1.12
*/
gdouble
clutter_media_get_progress (ClutterMedia *media)
{
gdouble retval = 0.0;
g_return_val_if_fail (CLUTTER_IS_MEDIA (media), 0);
g_object_get (G_OBJECT (media), "progress", &retval, NULL);
return retval;
}
/**
* clutter_media_set_subtitle_uri:
* @media: a #ClutterMedia
* @uri: the URI of a subtitle file
*
* Sets the location of a subtitle file to display while playing @media.
*
* Since: 1.2
*
* Deprecated: 1.12
*/
void
clutter_media_set_subtitle_uri (ClutterMedia *media,
const char *uri)
{
g_return_if_fail (CLUTTER_IS_MEDIA (media));
g_object_set (G_OBJECT (media), "subtitle-uri", uri, NULL);
}
/**
* clutter_media_get_subtitle_uri:
* @media: a #ClutterMedia
*
* Retrieves the URI of the subtitle file in use.
*
* Return value: the URI of the subtitle file. Use g_free()
* to free the returned string
*
* Since: 1.2
*
* Deprecated: 1.12
*/
gchar *
clutter_media_get_subtitle_uri (ClutterMedia *media)
{
gchar *retval = NULL;
g_return_val_if_fail (CLUTTER_IS_MEDIA(media), NULL);
g_object_get (G_OBJECT (media), "subtitle-uri", &retval, NULL);
return retval;
}
/**
* clutter_media_set_subtitle_font_name:
* @media: a #ClutterMedia
* @font_name: a font name, or %NULL to set the default font name
*
* Sets the font used by the subtitle renderer. The @font_name string must be
* either %NULL, which means that the default font name of the underlying
* implementation will be used; or must follow the grammar recognized by
* pango_font_description_from_string() like:
*
* |[
* clutter_media_set_subtitle_font_name (media, "Sans 24pt");
* ]|
*
* Since: 1.2
*
* Deprecated: 1.12
*/
void
clutter_media_set_subtitle_font_name (ClutterMedia *media,
const char *font_name)
{
g_return_if_fail (CLUTTER_IS_MEDIA (media));
g_object_set (G_OBJECT (media), "subtitle-font-name", font_name, NULL);
}
/**
* clutter_media_get_subtitle_font_name:
* @media: a #ClutterMedia
*
* Retrieves the font name currently used.
*
* Return value: a string containing the font name. Use g_free()
* to free the returned string
*
* Since: 1.2
*
* Deprecated: 1.12
*/
gchar *
clutter_media_get_subtitle_font_name (ClutterMedia *media)
{
gchar *retval = NULL;
g_return_val_if_fail (CLUTTER_IS_MEDIA(media), NULL);
g_object_get (G_OBJECT (media), "subtitle-font-name", &retval, NULL);
return retval;
}
/**
* clutter_media_set_audio_volume:
* @media: a #ClutterMedia
* @volume: the volume as a double between 0.0 and 1.0
*
* Sets the playback volume of @media to @volume.
*
* Since: 1.0
*
* Deprecated: 1.12
*/
void
clutter_media_set_audio_volume (ClutterMedia *media,
gdouble volume)
{
g_return_if_fail (CLUTTER_IS_MEDIA(media));
g_object_set (G_OBJECT (media), "audio-volume", volume, NULL);
}
/**
* clutter_media_get_audio_volume:
* @media: a #ClutterMedia
*
* Retrieves the playback volume of @media.
*
* Return value: The playback volume between 0.0 and 1.0
*
* Since: 1.0
*
* Deprecated: 1.12
*/
gdouble
clutter_media_get_audio_volume (ClutterMedia *media)
{
gdouble retval = 0.0;
g_return_val_if_fail (CLUTTER_IS_MEDIA (media), 0.0);
g_object_get (G_OBJECT (media), "audio-volume", &retval, NULL);
return retval;
}
/**
* clutter_media_get_can_seek:
* @media: a #ClutterMedia
*
* Retrieves whether @media is seekable or not.
*
* Return value: %TRUE if @media can seek, %FALSE otherwise.
*
* Since: 0.2
*
* Deprecated: 1.12
*/
gboolean
clutter_media_get_can_seek (ClutterMedia *media)
{
gboolean retval = FALSE;
g_return_val_if_fail (CLUTTER_IS_MEDIA (media), FALSE);
g_object_get (G_OBJECT (media), "can-seek", &retval, NULL);
return retval;
}
/**
* clutter_media_get_buffer_fill:
* @media: a #ClutterMedia
*
* Retrieves the amount of the stream that is buffered.
*
* Return value: the fill level, between 0.0 and 1.0
*
* Since: 1.0
*
* Deprecated: 1.12
*/
gdouble
clutter_media_get_buffer_fill (ClutterMedia *media)
{
gdouble retval = 0.0;
g_return_val_if_fail (CLUTTER_IS_MEDIA (media), 0);
g_object_get (G_OBJECT (media), "buffer-fill", &retval, NULL);
return retval;
}
/**
* clutter_media_get_duration:
* @media: a #ClutterMedia
*
* Retrieves the duration of the media stream that @media represents.
*
* Return value: the duration of the media stream, in seconds
*
* Since: 0.2
*
* Deprecated: 1.12
*/
gdouble
clutter_media_get_duration (ClutterMedia *media)
{
gdouble retval = 0;
g_return_val_if_fail (CLUTTER_IS_MEDIA(media), 0);
g_object_get (G_OBJECT (media), "duration", &retval, NULL);
return retval;
}
/* helper funcs */
/**
* clutter_media_set_filename:
* @media: a #ClutterMedia
* @filename: A filename
*
* Sets the source of @media using a file path.
*
* Since: 0.2
*
* Deprecated: 1.12
*/
void
clutter_media_set_filename (ClutterMedia *media,
const gchar *filename)
{
gchar *uri;
GError *uri_error = NULL;
if (!g_path_is_absolute (filename))
{
gchar *abs_path;
abs_path = g_build_filename (g_get_current_dir (), filename, NULL);
uri = g_filename_to_uri (abs_path, NULL, &uri_error);
g_free (abs_path);
}
else
uri = g_filename_to_uri (filename, NULL, &uri_error);
if (uri_error)
{
g_signal_emit (media, media_signals[ERROR_SIGNAL], 0, uri_error);
g_error_free (uri_error);
return;
}
clutter_media_set_uri (media, uri);
g_free (uri);
}

View File

@@ -1,121 +0,0 @@
/*
* Clutter.
*
* An OpenGL based 'interactive canvas' library.
*
* Authored By: Matthew Allum <mallum@openedhand.com>
* Emmanuele Bassi <ebassi@linux.intel.com>
*
* Copyright (C) 2006 OpenedHand
* Copyright (C) 2009 Intel Corp.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
#error "Only <clutter/clutter.h> can be included directly."
#endif
#ifndef __CLUTTER_MEDIA_H__
#define __CLUTTER_MEDIA_H__
#include <glib-object.h>
G_BEGIN_DECLS
#define CLUTTER_TYPE_MEDIA (clutter_media_get_type ())
#define CLUTTER_MEDIA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_MEDIA, ClutterMedia))
#define CLUTTER_IS_MEDIA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_MEDIA))
#define CLUTTER_MEDIA_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), CLUTTER_TYPE_MEDIA, ClutterMediaIface))
typedef struct _ClutterMedia ClutterMedia; /* dummy typedef */
typedef struct _ClutterMediaIface ClutterMediaIface;
/**
* ClutterMedia:
*
* #ClutterMedia is an opaque structure whose members cannot be directly
* accessed
*
* Since: 0.2
*/
/**
* ClutterMediaIface:
* @eos: handler for the #ClutterMedia::eos signal
* @error: handler for the #ClutterMedia::error signal
*
* Interface vtable for #ClutterMedia implementations
*
* Since: 0.2
*/
struct _ClutterMediaIface
{
/*< private >*/
GTypeInterface base_iface;
/*< public >*/
/* signals */
void (* eos) (ClutterMedia *media);
void (* error) (ClutterMedia *media,
const GError *error);
};
CLUTTER_DEPRECATED
GType clutter_media_get_type (void) G_GNUC_CONST;
CLUTTER_DEPRECATED
void clutter_media_set_uri (ClutterMedia *media,
const gchar *uri);
CLUTTER_DEPRECATED
gchar * clutter_media_get_uri (ClutterMedia *media);
CLUTTER_DEPRECATED
void clutter_media_set_filename (ClutterMedia *media,
const gchar *filename);
CLUTTER_DEPRECATED
void clutter_media_set_playing (ClutterMedia *media,
gboolean playing);
CLUTTER_DEPRECATED
gboolean clutter_media_get_playing (ClutterMedia *media);
CLUTTER_DEPRECATED
void clutter_media_set_progress (ClutterMedia *media,
gdouble progress);
CLUTTER_DEPRECATED
gdouble clutter_media_get_progress (ClutterMedia *media);
CLUTTER_DEPRECATED
void clutter_media_set_subtitle_uri (ClutterMedia *media,
const gchar *uri);
CLUTTER_DEPRECATED
gchar * clutter_media_get_subtitle_uri (ClutterMedia *media);
CLUTTER_DEPRECATED
void clutter_media_set_subtitle_font_name (ClutterMedia *media,
const char *font_name);
CLUTTER_DEPRECATED
gchar * clutter_media_get_subtitle_font_name (ClutterMedia *media);
CLUTTER_DEPRECATED
void clutter_media_set_audio_volume (ClutterMedia *media,
gdouble volume);
CLUTTER_DEPRECATED
gdouble clutter_media_get_audio_volume (ClutterMedia *media);
CLUTTER_DEPRECATED
gboolean clutter_media_get_can_seek (ClutterMedia *media);
CLUTTER_DEPRECATED
gdouble clutter_media_get_buffer_fill (ClutterMedia *media);
CLUTTER_DEPRECATED
gdouble clutter_media_get_duration (ClutterMedia *media);
G_END_DECLS
#endif /* __CLUTTER_MEDIA_H__ */

View File

@@ -1265,6 +1265,18 @@ clutter_input_device_evdev_release_touch_state (ClutterInputDeviceEvdev *device,
GINT_TO_POINTER (touch_state->device_slot));
}
static gboolean
clutter_input_device_evdev_get_physical_size (ClutterInputDevice *device,
gdouble *width,
gdouble *height)
{
struct libinput_device *libinput_device;
libinput_device = clutter_evdev_input_device_get_libinput_device (device);
return libinput_device_get_size (libinput_device, width, height) == 0;
}
static void
clutter_input_device_evdev_class_init (ClutterInputDeviceEvdevClass *klass)
{
@@ -1280,6 +1292,7 @@ clutter_input_device_evdev_class_init (ClutterInputDeviceEvdevClass *klass)
klass->get_group_n_modes = clutter_input_device_evdev_get_group_n_modes;
klass->is_grouped = clutter_input_device_evdev_is_grouped;
klass->process_kbd_a11y_event = clutter_input_device_evdev_process_kbd_a11y_event;
klass->get_physical_size = clutter_input_device_evdev_get_physical_size;
obj_props[PROP_DEVICE_MATRIX] =
g_param_spec_boxed ("device-matrix",

View File

@@ -237,7 +237,6 @@ clutter_deprecated_headers = [
'deprecated/clutter-keysyms.h',
'deprecated/clutter-list-model.h',
'deprecated/clutter-main.h',
'deprecated/clutter-media.h',
'deprecated/clutter-model.h',
'deprecated/clutter-rectangle.h',
'deprecated/clutter-score.h',
@@ -271,7 +270,6 @@ clutter_deprecated_sources = [
'deprecated/clutter-input-device-deprecated.c',
'deprecated/clutter-layout-manager-deprecated.c',
'deprecated/clutter-list-model.c',
'deprecated/clutter-media.c',
'deprecated/clutter-model.c',
'deprecated/clutter-rectangle.c',
'deprecated/clutter-score.c',
@@ -493,7 +491,7 @@ clutter_marshal = gnome.genmarshal('clutter-marshal',
prefix: '_clutter_marshal',
sources: 'clutter-marshal.list',
valist_marshallers: true,
extra_args: ['--prototypes'],
extra_args: ['--prototypes', '--quiet'],
install_dir: clutter_clutter_includedir,
install_header: true,
)
@@ -540,10 +538,7 @@ libmutter_clutter_dep = declare_dependency(
)
if have_introspection
clutter_introspection_args = clutter_c_args + [
'-U_GNU_SOURCE', # _GNU_SOURCE triggers warnings in g-ir-scanner
'--quiet',
]
clutter_introspection_args = introspection_args + clutter_c_args
libmutter_clutter_gir = gnome.generate_gir(libmutter_clutter,
sources: [
@@ -628,28 +623,30 @@ install_headers(clutter_deprecated_headers,
install_headers(clutter_x11_headers,
subdir: join_paths(clutter_clutter_includedir, 'x11'))
pkg.generate(
pkg.generate(libmutter_clutter,
name: 'Mutters Clutter',
filebase: libmutter_clutter_name,
description: 'Mutters Clutter Private Library',
libraries: [libmutter_clutter, m_dep],
libraries: [m_dep],
subdirs: join_paths(pkgname, 'clutter'),
requires: [clutter_pkg_deps, libmutter_cogl_name],
version: meson.project_version(),
variables: [
'apiversion=' + libmutter_api_version,
],
install_dir: pcdir,
)
pkg.generate(
pkg.generate(libmutter_clutter,
name: 'Mutters ClutterX11',
filebase: 'mutter-clutter-x11-' + libmutter_api_version,
description: 'Mutters ClutterX11 Private Library',
libraries: [libmutter_clutter, m_dep],
libraries: [m_dep],
subdirs: join_paths(pkgname, 'clutter'),
requires: [clutter_pkg_deps, libmutter_cogl_name],
version: meson.project_version(),
variables: [
'apiversion=' + libmutter_api_version,
],
install_dir: pcdir,
)

View File

@@ -67,6 +67,23 @@ static const char *clutter_input_axis_atom_names[] = {
#define N_AXIS_ATOMS G_N_ELEMENTS (clutter_input_axis_atom_names)
static const char *wacom_type_atoms[] = {
"STYLUS",
"CURSOR",
"ERASER",
"PAD",
"TOUCH"
};
#define N_WACOM_TYPE_ATOMS G_N_ELEMENTS (wacom_type_atoms)
enum {
WACOM_TYPE_STYLUS,
WACOM_TYPE_CURSOR,
WACOM_TYPE_ERASER,
WACOM_TYPE_PAD,
WACOM_TYPE_TOUCH,
};
enum {
PAD_AXIS_FIRST = 3, /* First axes are always x/y/pressure, ignored in pads */
PAD_AXIS_STRIP1 = PAD_AXIS_FIRST,
@@ -394,6 +411,86 @@ get_pad_features (XIDeviceInfo *info,
*n_strips = strips;
}
/* The Wacom driver exports the tool type as property. Use that over
guessing based on the device name */
static gboolean
guess_source_from_wacom_type (ClutterBackendX11 *backend_x11,
XIDeviceInfo *info,
ClutterInputDeviceType *source_out)
{
gulong nitems, bytes_after;
guint32 *data = NULL;
int rc, format;
Atom type;
Atom prop;
Atom device_type;
Atom types[N_WACOM_TYPE_ATOMS];
prop = XInternAtom (backend_x11->xdpy, "Wacom Tool Type", True);
if (prop == None)
return FALSE;
clutter_x11_trap_x_errors ();
rc = XIGetProperty (backend_x11->xdpy,
info->deviceid,
prop,
0, 1, False, XA_ATOM, &type, &format, &nitems, &bytes_after,
(guchar **) &data);
clutter_x11_untrap_x_errors ();
if (rc != Success || type != XA_ATOM || format != 32 || nitems != 1)
{
XFree (data);
return FALSE;
}
device_type = *data;
XFree (data);
if (device_type == 0)
return FALSE;
rc = XInternAtoms (backend_x11->xdpy,
(char **)wacom_type_atoms,
N_WACOM_TYPE_ATOMS,
False,
types);
if (rc == 0)
return FALSE;
if (device_type == types[WACOM_TYPE_STYLUS])
{
*source_out = CLUTTER_PEN_DEVICE;
}
else if (device_type == types[WACOM_TYPE_CURSOR])
{
*source_out = CLUTTER_CURSOR_DEVICE;
}
else if (device_type == types[WACOM_TYPE_ERASER])
{
*source_out = CLUTTER_ERASER_DEVICE;
}
else if (device_type == types[WACOM_TYPE_PAD])
{
*source_out = CLUTTER_PAD_DEVICE;
}
else if (device_type == types[WACOM_TYPE_TOUCH])
{
guint num_touches = 0;
if (!is_touch_device (info->classes, info->num_classes,
source_out, &num_touches))
*source_out = CLUTTER_TOUCHSCREEN_DEVICE;
}
else
{
return FALSE;
}
return TRUE;
}
static ClutterInputDevice *
create_device (ClutterDeviceManagerXI2 *manager_xi2,
ClutterBackendX11 *backend_x11,
@@ -421,7 +518,7 @@ create_device (ClutterDeviceManagerXI2 *manager_xi2,
{
source = touch_source;
}
else
else if (!guess_source_from_wacom_type (backend_x11, info, &source))
{
gchar *name;

View File

@@ -180,6 +180,56 @@ clutter_input_device_xi2_is_mode_switch_button (ClutterInputDevice *device,
return button_group == (int) group;
}
static gboolean
clutter_input_device_xi2_get_physical_size (ClutterInputDevice *device,
gdouble *width,
gdouble *height)
{
Display *xdisplay;
XIDeviceInfo *dev_info;
gdouble w = 0, h = 0;
int i, n_info, device_id;
xdisplay = clutter_x11_get_default_display ();
device_id = clutter_input_device_get_device_id (device);
clutter_x11_trap_x_errors ();
dev_info = XIQueryDevice (xdisplay, device_id, &n_info);
if (clutter_x11_untrap_x_errors ())
return FALSE;
if (!dev_info)
return FALSE;
for (i = 0; i < dev_info->num_classes; i++)
{
XIValuatorClassInfo *valuator;
gdouble *value;
if (dev_info->classes[i]->type != XIValuatorClass)
continue;
valuator = (XIValuatorClassInfo *) dev_info->classes[i];
if (valuator->label == XInternAtom (xdisplay, "Abs X", True) ||
valuator->label == XInternAtom (xdisplay, "Abs MT Position X", True))
value = &w;
else if (valuator->label == XInternAtom (xdisplay, "Abs Y", True) ||
valuator->label == XInternAtom (xdisplay, "Abs MT Position Y", True))
value = &h;
else
continue;
*value = (valuator->max - valuator->min) * 1000 / valuator->resolution;
}
XIFreeDeviceInfo (dev_info);
*width = w;
*height = h;
return (w > 0 && h > 0);
}
static void
clutter_input_device_xi2_class_init (ClutterInputDeviceXI2Class *klass)
{
@@ -193,6 +243,7 @@ clutter_input_device_xi2_class_init (ClutterInputDeviceXI2Class *klass)
device_class->is_grouped = clutter_input_device_xi2_is_grouped;
device_class->get_group_n_modes = clutter_input_device_xi2_get_group_n_modes;
device_class->is_mode_switch_button = clutter_input_device_xi2_is_mode_switch_button;
device_class->get_physical_size = clutter_input_device_xi2_get_physical_size;
}
static void

View File

@@ -76,6 +76,9 @@ struct _ClutterKeymapX11
DirectionCacheEntry group_direction_cache[4];
int current_group;
GHashTable *reserved_keycodes;
GQueue *available_keycodes;
guint caps_lock_state : 1;
guint num_lock_state : 1;
guint has_direction : 1;
@@ -422,15 +425,97 @@ clutter_keymap_x11_set_property (GObject *gobject,
}
}
static void
clutter_keymap_x11_refresh_reserved_keycodes (ClutterKeymapX11 *keymap_x11)
{
Display *dpy = clutter_x11_get_default_display ();
GHashTableIter iter;
gpointer key, value;
g_hash_table_iter_init (&iter, keymap_x11->reserved_keycodes);
while (g_hash_table_iter_next (&iter, &key, &value))
{
guint reserved_keycode = GPOINTER_TO_UINT (key);
guint reserved_keysym = GPOINTER_TO_UINT (value);
guint actual_keysym = XkbKeycodeToKeysym (dpy, reserved_keycode, 0, 0);
/* If an available keycode is no longer mapped to the stored keysym, then
* the keycode should not be considered available anymore and should be
* removed both from the list of available and reserved keycodes.
*/
if (reserved_keysym != actual_keysym)
{
g_hash_table_iter_remove (&iter);
g_queue_remove (keymap_x11->available_keycodes, key);
}
}
}
static gboolean
clutter_keymap_x11_replace_keycode (ClutterKeymapX11 *keymap_x11,
KeyCode keycode,
KeySym keysym)
{
if (CLUTTER_BACKEND_X11 (keymap_x11->backend)->use_xkb)
{
Display *dpy = clutter_x11_get_default_display ();
XkbDescPtr xkb = get_xkb (keymap_x11);
XkbMapChangesRec changes;
XFlush (dpy);
xkb->device_spec = XkbUseCoreKbd;
memset (&changes, 0, sizeof(changes));
if (keysym != NoSymbol)
{
int types[XkbNumKbdGroups] = { XkbOneLevelIndex };
XkbChangeTypesOfKey (xkb, keycode, 1, XkbGroup1Mask, types, &changes);
XkbKeySymEntry (xkb, keycode, 0, 0) = keysym;
}
else
{
/* Reset to NoSymbol */
XkbChangeTypesOfKey (xkb, keycode, 0, XkbGroup1Mask, NULL, &changes);
}
changes.changed = XkbKeySymsMask | XkbKeyTypesMask;
changes.first_key_sym = keycode;
changes.num_key_syms = 1;
changes.first_type = 0;
changes.num_types = xkb->map->num_types;
XkbChangeMap (dpy, xkb, &changes);
XFlush (dpy);
return TRUE;
}
return FALSE;
}
static void
clutter_keymap_x11_finalize (GObject *gobject)
{
ClutterKeymapX11 *keymap;
ClutterEventTranslator *translator;
GHashTableIter iter;
gpointer key, value;
keymap = CLUTTER_KEYMAP_X11 (gobject);
translator = CLUTTER_EVENT_TRANSLATOR (keymap);
clutter_keymap_x11_refresh_reserved_keycodes (keymap);
g_hash_table_iter_init (&iter, keymap->reserved_keycodes);
while (g_hash_table_iter_next (&iter, &key, &value))
{
guint keycode = GPOINTER_TO_UINT (key);
clutter_keymap_x11_replace_keycode (keymap, keycode, NoSymbol);
}
g_hash_table_destroy (keymap->reserved_keycodes);
g_queue_free (keymap->available_keycodes);
_clutter_backend_remove_event_translator (keymap->backend, translator);
if (keymap->xkb_desc != NULL)
@@ -462,6 +547,8 @@ clutter_keymap_x11_init (ClutterKeymapX11 *keymap)
{
keymap->current_direction = PANGO_DIRECTION_NEUTRAL;
keymap->current_group = -1;
keymap->reserved_keycodes = g_hash_table_new (NULL, NULL);
keymap->available_keycodes = g_queue_new ();
}
static ClutterTranslateReturn
@@ -731,6 +818,72 @@ clutter_keymap_x11_get_entries_for_keyval (ClutterKeymapX11 *keymap_x11,
}
}
static guint
clutter_keymap_x11_get_available_keycode (ClutterKeymapX11 *keymap_x11)
{
if (CLUTTER_BACKEND_X11 (keymap_x11->backend)->use_xkb)
{
clutter_keymap_x11_refresh_reserved_keycodes (keymap_x11);
if (g_hash_table_size (keymap_x11->reserved_keycodes) < 5)
{
Display *dpy = clutter_x11_get_default_display ();
XkbDescPtr xkb = get_xkb (keymap_x11);
guint i;
for (i = xkb->max_key_code; i >= xkb->min_key_code; --i)
{
if (XkbKeycodeToKeysym (dpy, i, 0, 0) == NoSymbol)
return i;
}
}
return GPOINTER_TO_UINT (g_queue_pop_head (keymap_x11->available_keycodes));
}
return 0;
}
gboolean clutter_keymap_x11_reserve_keycode (ClutterKeymapX11 *keymap_x11,
guint keyval,
guint *keycode_out)
{
g_return_val_if_fail (CLUTTER_IS_KEYMAP_X11 (keymap_x11), FALSE);
g_return_val_if_fail (keyval != 0, FALSE);
g_return_val_if_fail (keycode_out != NULL, FALSE);
*keycode_out = clutter_keymap_x11_get_available_keycode (keymap_x11);
if (*keycode_out == NoSymbol)
{
g_warning ("Cannot reserve a keycode for keyval %d: no available keycode", keyval);
return FALSE;
}
if (!clutter_keymap_x11_replace_keycode (keymap_x11, *keycode_out, keyval))
{
g_warning ("Failed to remap keycode %d to keyval %d", *keycode_out, keyval);
return FALSE;
}
g_hash_table_insert (keymap_x11->reserved_keycodes, GUINT_TO_POINTER (*keycode_out), GUINT_TO_POINTER (keyval));
g_queue_remove (keymap_x11->available_keycodes, GUINT_TO_POINTER (*keycode_out));
return TRUE;
}
void clutter_keymap_x11_release_keycode_if_needed (ClutterKeymapX11 *keymap_x11,
guint keycode)
{
g_return_if_fail (CLUTTER_IS_KEYMAP_X11 (keymap_x11));
if (!g_hash_table_contains (keymap_x11->reserved_keycodes, GUINT_TO_POINTER (keycode)) ||
g_queue_index (keymap_x11->available_keycodes, GUINT_TO_POINTER (keycode)) != -1)
return;
g_queue_push_tail (keymap_x11->available_keycodes, GUINT_TO_POINTER (keycode));
}
void
clutter_keymap_x11_latch_modifiers (ClutterKeymapX11 *keymap_x11,
uint32_t level,

View File

@@ -58,7 +58,11 @@ gboolean clutter_keymap_x11_keycode_for_keyval (ClutterKeymapX11 *keymap_x11,
void clutter_keymap_x11_latch_modifiers (ClutterKeymapX11 *keymap_x11,
uint32_t level,
gboolean enable);
gboolean clutter_keymap_x11_reserve_keycode (ClutterKeymapX11 *keymap_x11,
guint keyval,
guint *keycode_out);
void clutter_keymap_x11_release_keycode_if_needed (ClutterKeymapX11 *keymap_x11,
guint keycode);
G_END_DECLS
#endif /* __CLUTTER_KEYMAP_X11_H__ */

View File

@@ -631,8 +631,6 @@ clutter_stage_x11_realize (ClutterStageWindow *stage_window)
stage_x11->onscreen = cogl_onscreen_new (backend->cogl_context, width, height);
cogl_onscreen_set_swap_throttled (stage_x11->onscreen,
_clutter_get_sync_to_vblank ());
stage_x11->frame_closure =
cogl_onscreen_add_frame_callback (stage_x11->onscreen,
frame_cb,

View File

@@ -141,8 +141,13 @@ clutter_virtual_input_device_x11_notify_keyval (ClutterVirtualInputDevice *virtu
if (!clutter_keymap_x11_keycode_for_keyval (keymap, keyval, &keycode, &level))
{
g_warning ("No keycode found for keyval %x in current group", keyval);
return;
level = 0;
if (!clutter_keymap_x11_reserve_keycode (keymap, keyval, &keycode))
{
g_warning ("No keycode found for keyval %x in current group", keyval);
return;
}
}
if (!_clutter_keymap_x11_get_is_modifier (keymap, keycode) &&
@@ -153,9 +158,13 @@ clutter_virtual_input_device_x11_notify_keyval (ClutterVirtualInputDevice *virtu
(KeyCode) keycode,
key_state == CLUTTER_KEY_STATE_PRESSED, 0);
if (!_clutter_keymap_x11_get_is_modifier (keymap, keycode) &&
key_state == CLUTTER_KEY_STATE_RELEASED)
clutter_keymap_x11_latch_modifiers (keymap, level, FALSE);
if (key_state == CLUTTER_KEY_STATE_RELEASED)
{
if (!_clutter_keymap_x11_get_is_modifier (keymap, keycode))
clutter_keymap_x11_latch_modifiers (keymap, level, FALSE);
clutter_keymap_x11_release_keycode_if_needed (keymap, keycode);
}
}
static void

View File

@@ -1,705 +0,0 @@
AC_PREREQ([2.63])
AC_INIT([clutter],
[0.1],
[http://bugzilla.gnome.org/enter_bug.cgi?product=clutter],
[clutter],
[http://www.clutter-project.org])
AC_CONFIG_SRCDIR([clutter/clutter.h])
AC_CONFIG_HEADERS([clutter/clutter-build-config.h])
AC_CONFIG_AUX_DIR([build])
AC_CONFIG_MACRO_DIR([build/autotools])
AM_INIT_AUTOMAKE([1.11 foreign -Wno-portability no-define no-dist-gzip dist-xz tar-ustar])
AM_SILENT_RULES([yes])
dnl = Check that we are configured by mutter ==============================
AC_ARG_VAR([MUTTER_VERSION])
AC_ARG_VAR([LIBMUTTER_API_VERSION])
AS_IF([test "x$MUTTER_VERSION" = "x"],
[AC_MSG_ERROR([Clutter can only be configured by mutter])],)
AC_DEFINE_UNQUOTED(MUTTER_VERSION, "$MUTTER_VERSION", [Mutter version])
AC_PROG_SED
dnl = Preliminary platform checks =============================================
AC_CANONICAL_HOST
AC_CACHE_SAVE
dnl = Dependencies =========================================================
# Checks for programs.
AM_PROG_CC_C_O
# require libtool >= 2.2
LT_PREREQ([2.2.6])
LT_INIT([disable-static])
LT_LIB_M
# Checks for header files.
AC_HEADER_STDC
# required versions for dependencies
m4_define([glib_req_version], [2.53.2])
m4_define([cogl_req_version], [1.21.2])
m4_define([json_glib_req_version], [0.12.0])
m4_define([atk_req_version], [2.5.3])
m4_define([cairo_req_version], [1.14.0])
m4_define([pango_req_version], [1.30])
m4_define([gi_req_version], [1.39.0])
m4_define([xcomposite_req_version], [0.4])
m4_define([libinput_req_version], [1.4.0])
m4_define([libudev_req_version], [136])
m4_define([libwacom_req_version], [0.13])
AC_SUBST([GLIB_REQ_VERSION], [glib_req_version])
AC_SUBST([COGL_REQ_VERSION], [cogl_req_version])
AC_SUBST([JSON_GLIB_REQ_VERSION], [json_glib_req_version])
AC_SUBST([ATK_REQ_VERSION], [atk_req_version])
AC_SUBST([CAIRO_REQ_VERSION], [cairo_req_version])
AC_SUBST([PANGO_REQ_VERSION], [pango_req_version])
AC_SUBST([GI_REQ_VERSION], [gi_req_version])
AC_SUBST([XCOMPOSITE_REQ_VERSION], [xcomposite_req_version])
AC_SUBST([LIBINPUT_REQ_VERSION], [libinput_req_version])
AC_SUBST([LIBUDEV_REQ_VERSION], [libudev_req_version])
AC_SUBST([LIBWACOM_REQ_VERSION], [libwacom_req_version])
# Checks for typedefs, structures, and compiler characteristics.
AM_PATH_GLIB_2_0([glib_req_version],
[],
[AC_MSG_ERROR([glib-2.0 is required])],
[gobject gio gthread gmodule-no-export])
# Check for -Bsymbolic-functions to avoid intra-library PLT jumps
AC_ARG_ENABLE([Bsymbolic],
[AS_HELP_STRING([--disable-Bsymbolic],
[Avoid linking with -Bsymbolic])],
[],
[
saved_LDFLAGS="${LDFLAGS}"
AC_MSG_CHECKING([for -Bsymbolic-functions linker flag])
LDFLAGS=-Wl,-Bsymbolic-functions
AC_TRY_LINK([], [return 0],
[
AC_MSG_RESULT([yes])
enable_Bsymbolic=yes
],
[
AC_MSG_RESULT([no])
enable_Bsymbolic=no
])
LDFLAGS="${saved_LDFLAGS}"
])
AS_IF([test "x$enable_Bsymbolic" = "xyes"], [CLUTTER_LINK_FLAGS=-Wl[,]-Bsymbolic-functions])
AC_SUBST(CLUTTER_LINK_FLAGS)
AC_CACHE_SAVE
dnl ========================================================================
FLAVOUR_LIBS=""
FLAVOUR_CFLAGS=""
CLUTTER_BACKENDS=""
CLUTTER_INPUT_BACKENDS=""
CLUTTER_CONFIG_DEFINES=
# base dependencies for core
CLUTTER_BASE_PC_FILES="cairo-gobject >= $CAIRO_REQ_VERSION gio-2.0 >= glib_req_version atk >= $ATK_REQ_VERSION pangocairo >= $PANGO_REQ_VERSION json-glib-1.0 >= $JSON_GLIB_REQ_VERSION"
# private base dependencies
CLUTTER_BASE_PC_FILES_PRIVATE=""
# backend specific pkg-config files
BACKEND_PC_FILES=""
# private backend specific dependencies
BACKEND_PC_FILES_PRIVATE=""
dnl === Clutter windowing system backend ======================================
CLUTTER_BACKENDS="$CLUTTER_BACKENDS x11"
CLUTTER_INPUT_BACKENDS="$CLUTTER_INPUT_BACKENDS x11"
SUPPORT_X11=1
SUPPORT_GLX=1
SUPPORT_COGL=1
# we use fontconfig API and pango-ft2 when the fontconfig
# configuration changes; we don't expose any API for this
# so we add pango-ft2 to the private Requires.
PKG_CHECK_EXISTS([pangoft2],
[
AC_DEFINE([HAVE_PANGO_FT2], [1], [Supports PangoFt2])
BACKEND_PC_FILES_PRIVATE="$BACKEND_PC_FILES_PRIVATE pangoft2"
],
[])
AC_ARG_ENABLE(
[wayland-egl-server],
[AC_HELP_STRING([--enable-wayland-egl-server=@<:@no/yes@:>@], [Enable server side wayland support @<:@default=no@:>@])],
[],
enable_wayland_egl_server=yes
)
AS_IF([test "x$enable_wayland_egl_server" = "xyes"],
[
CLUTTER_BACKENDS="$CLUTTER_BACKENDS egl"
SUPPORT_EGL=1
BACKEND_PC_FILES="$BACKEND_PC_FILES wayland-egl wayland-server"
SUPPORT_WAYLAND_COMPOSITOR=1
CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
#define CLUTTER_HAS_WAYLAND_COMPOSITOR_SUPPORT 1"
CLUTTER_INPUT_BACKENDS="$CLUTTER_INPUT_BACKENDS evdev"
SUPPORT_EVDEV=1
BACKEND_PC_FILES_PRIVATE="$BACKEND_PC_FILES_PRIVATE libudev >= $LIBUDEV_REQ_VERSION libinput >= $LIBINPUT_REQ_VERSION xkbcommon"
AC_DEFINE([HAVE_EVDEV], [1], [Have evdev support for input handling])
])
AM_CONDITIONAL(SUPPORT_WAYLAND, [test "x$enable_wayland_egl_server" = "xyes"])
AC_DEFINE_UNQUOTED([CLUTTER_DRIVERS], ["*"], [List of Cogl drivers])
dnl strip leading spaces
CLUTTER_BACKENDS=${CLUTTER_BACKENDS#* }
AC_SUBST(CLUTTER_BACKENDS)
CLUTTER_INPUT_BACKENDS=${CLUTTER_INPUT_BACKENDS#* }
AC_SUBST(CLUTTER_INPUT_BACKENDS)
AC_CACHE_SAVE
dnl === Clutter configuration =================================================
# windowing systems
AS_IF([test "x$SUPPORT_X11" = "x1"],
[CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
#define CLUTTER_WINDOWING_X11 \"x11\"
#define CLUTTER_INPUT_X11 \"x11\""])
AS_IF([test "x$SUPPORT_GLX" = "x1"],
[CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
#define CLUTTER_WINDOWING_GLX \"glx\""])
AS_IF([test "x$SUPPORT_EGL" = "x1"],
[CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
#define CLUTTER_WINDOWING_EGL \"eglnative\""])
AS_IF([test "x$SUPPORT_EVDEV" = "x1"],
[CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
#define CLUTTER_INPUT_EVDEV \"evdev\""])
# the 'null' input backend is special
CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
#define CLUTTER_INPUT_NULL \"null\""
AC_SUBST([CLUTTER_CONFIG_DEFINES])
dnl === Clutter substitutions kept for backwards compatibility ================
AC_SUBST([CLUTTER_WINSYS], [deprecated])
AC_SUBST([CLUTTER_WINSYS_BASE], [deprecated])
AC_SUBST([CLUTTER_STAGE_TYPE], [deprecated])
AC_SUBST([CLUTTER_SONAME_INFIX], [deprecated])
AC_SUBST([CLUTTER_FLAVOUR], [deprecated])
AC_SUBST([CLUTTER_COGL], [deprecated])
AC_SUBST([COGL_DRIVER], [deprecated])
dnl === X11 checks, only for X11-based backends ===============================
X11_PC_FILES=""
X11_EXTS=""
x11_tests=no
AS_IF([test "x$SUPPORT_X11" = "x1"],
[
# base X11 includes and libraries
AC_MSG_CHECKING([for X11])
# start with pkg-config
PKG_CHECK_EXISTS([x11], [have_x11=yes], [have_x11=no])
AS_IF([test "x$have_x11" = "xyes"],
[
X11_PC_FILES="x11"
# we actually need to ask for CFLAGS and LIBS
X11_CFLAGS=`$PKG_CONFIG --cflags $X11_PC_FILES`
X11_LIBS=`$PKG_CONFIG --libs $X11_PC_FILES`
AC_MSG_RESULT([found])
],
[
# no pkg-config, let's go old school
AC_PATH_X
AS_IF([test "x$no_x" = "xyes"],
[AC_MSG_ERROR([No X11 Libraries found])],
[
AS_IF([test "x$x_includes" != "xNONE" && test -n "$x_includes"],
[X11_CFLAGS=-I`echo $x_includes | sed -e "s/:/ -I/g"`])
AS_IF([test "x$x_libraries" != "xNONE" && test -n "$x_libraries"],
[X11_LIBS=-L`echo $x_libraries | sed -e "s/:/ -L/g"`])
AC_MSG_RESULT([found])
]
)
]
)
# XEXT (required)
AC_MSG_CHECKING([for XEXT extension])
PKG_CHECK_EXISTS([xext], [have_xext=yes], [have_xext=no])
AS_IF([test "x$have_xext" = "xyes"],
[
AC_DEFINE(HAVE_XEXT, [1], [Define to 1 if we have the XEXT X extension])
X11_LIBS="$X11_LIBS -lXext"
X11_PC_FILES="$X11_PC_FILES xext"
X11_EXTS="$X11_EXTS xext"
AC_MSG_RESULT([found])
],
[AC_MSG_ERROR([Not found])]
)
# XDAMAGE (required)
AC_MSG_CHECKING([for XDAMAGE extension])
PKG_CHECK_EXISTS([xdamage], [have_xdamage=yes], [have_xdamage=no])
AS_IF([test "x$have_xdamage" = "xyes"],
[
AC_DEFINE(HAVE_XDAMAGE, [1], [Define to 1 if we have the XDAMAGE X extension])
X11_LIBS="$X11_LIBS -lXdamage"
X11_PC_FILES="$X11_PC_FILES xdamage"
X11_EXTS="$X11_EXTS xdamage"
AC_MSG_RESULT([found])
],
[AC_MSG_ERROR([not found])]
)
# XCOMPOSITE (required)
AC_MSG_CHECKING([for XCOMPOSITE extension >= $XCOMPOSITE_REQ_VERSION])
PKG_CHECK_EXISTS([xcomposite >= $XCOMPOSITE_REQ_VERSION], [have_xcomposite=yes], [have_xcomposite=no])
AS_IF([test "x$have_xcomposite" = "xyes"],
[
X11_LIBS="$X11_LIBS -lXcomposite"
X11_PC_FILES="$X11_PC_FILES xcomposite >= $XCOMPOSITE_REQ_VERSION"
X11_EXTS="$X11_EXTS xcomposite"
AC_MSG_RESULT([found])
],
[AC_MSG_ERROR([not found])]
)
# XTEST (required)
AC_MSG_CHECKING([for XTest extension])
PKG_CHECK_EXISTS([xtst], [have_xtest=yes], [have_xtest=no])
AS_IF([test "x$have_xtest" = "xyes"],
[
AC_DEFINE(HAVE_XTEST, [1], [Define to 1 if we have the XTest X extension])
X11_LIBS="$X11_LIBS -lXtst"
X11_PC_FILES="$X11_PC_FILES xtst"
X11_EXTS="$X11_EXTS xtst"
AC_MSG_RESULT([found])
],
[AC_MSG_ERROR([Not found])]
)
# X Generic Extensions (optional)
clutter_save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $X11_CFLAGS"
clutter_save_LIBS="$LIBS"
LIBS="$LIBS $X11_LIBS"
CPPFLAGS="$clutter_save_CPPFLAGS"
LIBS="$clutter_save_LIBS"
PKG_CHECK_EXISTS([xi], [have_xinput=yes], AC_MSG_ERROR([XI support not found]))
AC_CHECK_HEADERS([X11/extensions/XInput2.h],
[],
AC_MSG_ERROR([XI2 not found]))
AC_CHECK_FUNC([XIAllowTouchEvents],
[
AC_CHECK_MEMBER([XIScrollClassInfo.number],
[],
AC_MSG_ERROR([XIScrollClasSInfo.number member missing in XI2]),
[[#include <X11/extensions/XInput2.h>]])
])
LIBS="$clutter_save_LIBS"
X11_LIBS="$X11_LIBS $XINPUT_LIBS"
X11_PC_FILES="$X11_PC_FILES xi"
AS_IF([test "x$have_xinput_2_2" = "xyes"],
[X11_EXTS="$X11_EXTS xi2.2"],
[X11_EXTS="$X11_EXTS xi2.0"])
# XKB
clutter_save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $X11_CFLAGS"
clutter_save_LIBS="$LIBS"
LIBS="$LIBS $X11_LIBS"
AC_CHECK_FUNC([XkbQueryExtension],
[],
[AC_MSG_ERROR([XKB support not found])])
CPPFLAGS="$clutter_save_CPPFLAGS"
LIBS="$clutter_save_LIBS"
x11_tests=yes
BACKEND_PC_FILES="$BACKEND_PC_FILES $X11_PC_FILES"
FLAVOUR_LIBS="$FLAVOUR_LIBS $X11_LIBS"
FLAVOUR_CFLAGS="$FLAVOUR_CFLAGS $X11_CFLAGS"
]
)
AM_CONDITIONAL([BUILD_XI2], [test "x$have_xinput2" = "xyes"])
AM_CONDITIONAL([X11_TESTS], [test "x$x11_tests" = "xyes"])
X11_EXTS=${X11_EXTS#* }
AC_CACHE_SAVE
dnl === Libwacom support for X11 ===============================================
AC_ARG_WITH(libwacom,
AC_HELP_STRING([--without-libwacom],
[disable the use of libwacom for advanced tablet management]),,
with_libwacom=auto)
have_libwacom=no
AC_MSG_CHECKING([libwacom])
if test x$with_libwacom = xno ; then
AC_MSG_RESULT([disabled])
else
if $PKG_CONFIG --exists libwacom '>=' $LIBWACOM_REQ_VERSION; then
have_libwacom=yes
AC_MSG_RESULT(yes)
PKG_CHECK_MODULES([LIBWACOM], [libwacom])
AC_SUBST(LIBWACOM_CFLAGS)
AC_SUBST(LIBWACOM_LIBS)
AC_DEFINE([HAVE_LIBWACOM], 1, [Building with libwacom for advanced tablet management])
else
AC_MSG_RESULT(no)
if test x$with_libwacom = xyes ; then
AC_MSG_ERROR([libwacom forced but not found])
fi
fi
fi
dnl === Check for GDK-Pixbuf in tests =========================================
PKG_CHECK_MODULES([GDK_PIXBUF], [gdk-pixbuf-2.0])
AC_SUBST(GDK_PIXBUF_CFLAGS)
AC_SUBST(GDK_PIXBUF_LIBS)
dnl === Enable debug level ====================================================
m4_define([debug_default], [minimum])
AC_ARG_ENABLE([debug],
[AS_HELP_STRING([--enable-debug=@<:@no/minimum/yes@:>@],
[Control Clutter debugging level @<:@default=]debug_default[@:>@])],
[],
[enable_debug=debug_default])
AS_CASE([$enable_debug],
[yes],
[
test "$cflags_set" = set || CFLAGS="$CFLAGS -g"
CLUTTER_DEBUG_CFLAGS="-DCLUTTER_ENABLE_DEBUG"
],
[minimum],
[CLUTTER_DEBUG_CFLAGS="-DG_DISABLE_CAST_CHECKS"],
[no],
[CLUTTER_DEBUG_CFLAGS="-DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS"],
[AC_MSG_ERROR([Unknown argument for --enable-debug])]
)
AC_SUBST(CLUTTER_DEBUG_CFLAGS)
dnl === Enable deprecation guards ==================================================
m4_define([deprecated_default],
[yes])
AC_ARG_ENABLE([deprecated],
[AS_HELP_STRING([--enable-deprecated=@<:@no/yes@:>@],
[Whether deprecated symbols should be disabled when compiling Clutter @<:@default=]deprecated_default[@:>@])],
[],
[enable_deprecated=deprecated_default])
AS_CASE([$enable_deprecated],
[no],
[
CLUTTER_DEPRECATED_CFLAGS="-DG_DISABLE_SINGLE_INCLUDES -DCOGL_DISABLE_DEPRECATED"
],
[yes],
[
CLUTTER_DEPRECATED_CFLAGS="-DGLIB_DISABLE_DEPRECATION_WARNINGS"
],
[AC_MSG_ERROR([Unknown argument for --enable-deprecated])]
)
AC_SUBST([CLUTTER_DEPRECATED_CFLAGS])
dnl === Enable strict compiler flags ==========================================
# use strict compiler flags only when building from git; the rules for
# distcheck will take care of turning this on when making a release
m4_define([maintainer_flags_default], [no])
AC_ARG_ENABLE([maintainer-flags],
[AS_HELP_STRING([--enable-maintainer-flags=@<:@no/yes/error@:>@],
[Use strict compiler flags @<:@default=]maintainer_flags_default[@:>@])],
[],
[enable_maintainer_flags=maintainer_flags_default])
MAINTAINER_COMPILER_FLAGS="$MAINTAINER_COMPILER_FLAGS
-Wall
-Wcast-align
-Wuninitialized
-Wno-strict-aliasing
-Wshadow"
AC_ARG_ENABLE([Werror],
[AS_HELP_STRING([--disable-Werror], [Removes -Werror from compiler flags])],
[],
[enable_Werror=yes])
AS_IF([test "x$enable_Werror" = xyes], [
MAINTAINER_COMPILER_FLAGS="$MAINTAINER_COMPILER_FLAGS
-Werror=logical-op
-Werror=pointer-arith
-Werror=missing-declarations
-Werror=redundant-decls
-Werror=empty-body
-Werror=format
-Werror=format-security
-Werror=format-nonliteral
-Werror=init-self
-Werror=declaration-after-statement
-Werror=vla"
])
AS_CASE([$enable_maintainer_flags],
[yes],
[
AS_COMPILER_FLAGS([MAINTAINER_CFLAGS], [$MAINTAINER_COMPILER_FLAGS])
],
[no],
[
],
[error],
[
MAINTAINER_COMPILER_FLAGS="$MAINTAINER_COMPILER_FLAGS -Werror"
AS_COMPILER_FLAGS([MAINTAINER_CFLAGS], [$MAINTAINER_COMPILER_FLAGS])
],
[*],
[AC_MSG_ERROR([Invalid option for --enable-maintainer-flags])]
)
# strip leading spaces
MAINTAINER_CFLAGS=${MAINTAINER_CFLAGS#* }
AC_SUBST(MAINTAINER_CFLAGS)
dnl === Dependencies, compiler flags and linker libraries =====================
# strip leading space
BACKEND_PC_FILES=${BACKEND_PC_FILES#* }
# public dependencies, will fill the Requires: field of clutter.pc
CLUTTER_REQUIRES="$CLUTTER_BASE_PC_FILES $BACKEND_PC_FILES"
PKG_CHECK_MODULES(CLUTTER_DEPS, [$CLUTTER_REQUIRES])
# private dependencies, will fill the Requires.private: field of clutter.pc
AS_IF([test "x$CLUTTER_BASE_PC_FILES_PRIVATE" = "x" && test "x$BACKEND_PC_FILES_PRIVATE" = "x"],
[
CLUTTER_REQUIRES_PRIVATE=""
CLUTTER_DEPS_PRIVATE_CFLAGS=""
CLUTTER_DEPS_PRIVATE_LIBS=""
],
[
CLUTTER_REQUIRES_PRIVATE="$CLUTTER_BASE_PC_FILES_PRIVATE $BACKEND_PC_FILES_PRIVATE"
PKG_CHECK_MODULES(CLUTTER_DEPS_PRIVATE, [$CLUTTER_REQUIRES_PRIVATE])
])
AC_SUBST(CLUTTER_REQUIRES)
AC_SUBST(CLUTTER_REQUIRES_PRIVATE)
CLUTTER_CFLAGS="$FLAVOUR_CFLAGS $CLUTTER_DEPS_CFLAGS $CLUTTER_DEPS_PRIVATE_CFLAGS $GLIB_CFLAGS $LIBWACOM_CFLAGS"
CLUTTER_LIBS="$FLAVOUR_LIBS $CLUTTER_DEPS_LIBS $CLUTTER_DEPS_PRIVATE_LIBS $GLIB_LIBS $LIBWACOM_LIBS"
AC_SUBST(CLUTTER_CFLAGS)
AC_SUBST(CLUTTER_LIBS)
dnl === Test coverage =========================================================
AC_ARG_ENABLE([gcov],
[AS_HELP_STRING([--enable-gcov], [Enable gcov])],
[use_gcov=$enableval],
[use_gcov=no])
AS_IF([test "x$use_gcov" = "xyes"],
[
dnl we need gcc:
AS_IF([test "$GCC" != "yes"], [AC_MSG_ERROR([GCC is required for --enable-gcov])])
dnl Check if ccache is being used
AC_CHECK_PROG(SHTOOL, shtool, shtool)
AS_CASE([`$SHTOOL path $CC`],
[*ccache*], [gcc_ccache=yes],
[gcc_ccache=no])
if test "$gcc_ccache" = "yes" && (test -z "$CCACHE_DISABLE" || test "$CCACHE_DISABLE" != "1"); then
AC_MSG_ERROR([ccache must be disabled when --enable-gcov option is used. You can disable ccache by setting environment variable CCACHE_DISABLE=1.])
fi
ltp_version_list="1.6 1.7 1.8 1.9 1.10"
AC_CHECK_PROG(LTP, lcov, lcov)
AC_CHECK_PROG(LTP_GENHTML, genhtml, genhtml)
if test "$LTP"; then
AC_CACHE_CHECK([for ltp version], clutter_cv_ltp_version,
[
clutter_cv_ltp_version=invalid
ltp_version=`$LTP -v 2>/dev/null | $SED -e 's/^.* //'`
for ltp_check_version in $ltp_version_list; do
if test "$ltp_version" = "$ltp_check_version"; then
clutter_cv_ltp_version="$ltp_check_version (ok)"
fi
done
])
else
ltp_msg="To enable code coverage reporting you must have one of the following LTP versions installed: $ltp_version_list"
AC_MSG_ERROR([$ltp_msg])
fi
case $clutter_cv_ltp_version in
""|invalid[)]
ltp_msg="You must have one of the following versions of LTP: $ltp_version_list (found: $ltp_version)."
AC_MSG_ERROR([$ltp_msg])
LTP="exit 0;"
;;
esac
if test -z "$LTP_GENHTML"; then
AC_MSG_ERROR([Could not find genhtml from the LTP package])
fi
dnl Remove all optimization flags from CFLAGS
changequote({,})
CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O[0-9]*//g'`
CLUTTER_CFLAGS=`echo "$CLUTTER_CFLAGS" | $SED -e 's/-O[0-9]*//g'`
changequote([,])
dnl Define the special gcc flags
CLUTTER_GCOV_CFLAGS="-O0 -fprofile-arcs -ftest-coverage"
CLUTTER_GCOV_LDADD="-lgcov"
AC_SUBST(CLUTTER_GCOV_CFLAGS)
AC_SUBST(CLUTTER_GCOV_LDADD)
CLUTTER_CFLAGS="$CLUTTER_CFLAGS $CLUTTER_GCOV_CFLAGS"
CLUTTER_LIBS="$CLUTTER_LIBS $CLUTTER_GCOV_LDADD"
])
AM_CONDITIONAL(ENABLE_GCOV, test "x$use_gcov" = "xyes")
dnl === GObject-Introspection check ===========================================
GOBJECT_INTROSPECTION_CHECK([gi_req_version])
dnl === Conformance test suite ================================================
GLIB_TESTS
dnl ===========================================================================
AC_CONFIG_FILES([
Makefile
build/Makefile
build/autotools/Makefile
clutter/Makefile
clutter/clutter-config.h
clutter/mutter-clutter-$LIBMUTTER_API_VERSION.pc:clutter/mutter-clutter.pc.in
tests/Makefile
tests/accessibility/Makefile
tests/conform/Makefile
tests/interactive/Makefile
tests/interactive/wrapper.sh
tests/micro-bench/Makefile
tests/performance/Makefile
])
AC_OUTPUT
dnl === Summary ===============================================================
echo ""
echo "Clutter - $VERSION (${CLUTTER_RELEASE_STATUS})"
# Global flags
echo ""
echo " • Global:"
echo " Prefix: ${prefix}"
echo " Libdir: ${libdir}"
echo " Sysconfdir: ${sysconfdir}"
# Compiler/Debug related flags
echo ""
echo " • Compiler options:"
echo " Clutter debug level: ${enable_debug}"
echo " Compiler flags: ${CFLAGS} ${MAINTAINER_CFLAGS}"
echo " Enable coverage tests: ${use_gcov}"
echo " Enable deprecated symbols: ${enable_deprecated}"
# Miscellaneous
echo ""
echo " • Extra:"
echo " Build introspection data: ${enable_introspection}"
if test "x$x11_tests" = "xyes"; then
echo " Build X11-specific tests: ${x11_tests}"
fi
if test "x$pixbuf_tests" = "xyes"; then
echo " Build tests using GDK-Pixbuf: ${pixbuf_tests}"
fi
echo " Install test suites: ${enable_installed_tests}"
# Clutter backend related flags
echo ""
echo " • Clutter Backends:"
echo " Windowing systems: ${CLUTTER_BACKENDS}"
echo " Input backends: ${CLUTTER_INPUT_BACKENDS}"
if test "x$SUPPORT_X11" = "x1"; then
echo ""
echo " - X11 backend options:"
echo " Enabled extensions: ${X11_EXTS}"
fi
if test "x$SUPPORT_WAYLAND_COMPOSITOR" = "x1"; then
echo ""
echo " - Wayland compositor support enabled"
fi
echo ""

View File

@@ -1,3 +0,0 @@
SUBDIRS = accessibility conform interactive micro-bench performance
EXTRA_DIST = README clutter-1.0.suppressions

View File

@@ -1,37 +0,0 @@
common_ldadd = \
$(top_builddir)/clutter/libmutter-clutter-@LIBMUTTER_API_VERSION@.la
common_sources = \
cally-examples-util.c \
cally-examples-util.h
AM_CPPFLAGS = \
-DPREFIXDIR=\"$(libdir)\" \
-DCLUTTER_DISABLE_DEPRECATION_WARNINGS \
-DGLIB_DISABLE_DEPRECATION_WARNINGS \
-I$(top_srcdir)/../cogl \
-I$(top_builddir)/../cogl \
-I$(top_builddir)/../cogl/cogl \
-I$(top_srcdir) \
-I$(top_builddir) \
-I$(top_srcdir)/clutter \
-I$(top_builddir)/clutter \
-I$(top_srcdir)/tests/accessibility
AM_CFLAGS = $(CLUTTER_CFLAGS) $(MAINTAINER_CFLAGS)
LDADD = $(common_ldadd) $(CLUTTER_LIBS)
check_PROGRAMS = \
cally-atkcomponent-example \
cally-atkeditabletext-example \
cally-atkevents-example \
cally-atktext-example \
cally-clone-example
cally_atkcomponent_example_SOURCES = $(common_sources) cally-atkcomponent-example.c
cally_atktext_example_SOURCES = $(common_sources) cally-atktext-example.c
cally_atkevents_example_SOURCES = $(common_sources) cally-atkevents-example.c
cally_atkeditabletext_example_SOURCES = $(common_sources) cally-atkeditabletext-example.c
cally_clone_example_SOURCES = $(common_sources) cally-clone-example.c
DISTCLEANFILES =

View File

@@ -1,97 +0,0 @@
installed_test_metadir = $(datadir)/installed-tests/mutter-clutter
installed_testdir = $(libexecdir)/installed-tests/mutter-clutter
include $(top_srcdir)/build/autotools/glib-tap.mk
AM_CFLAGS = -g $(CLUTTER_CFLAGS) $(MAINTAINER_CFLAGS)
LDADD = $(top_builddir)/../cogl/cogl/libmutter-cogl-@LIBMUTTER_API_VERSION@.la $(top_builddir)/clutter/libmutter-clutter-@LIBMUTTER_API_VERSION@.la $(CLUTTER_LIBS) $(LIBM)
AM_LDFLAGS = -export-dynamic
AM_CPPFLAGS = \
-DG_LOG_DOMAIN=\"Clutter-Conform\" \
-I$(top_srcdir)/../cogl \
-I$(top_builddir)/../cogl \
-I$(top_builddir)/../cogl/cogl \
-I$(top_srcdir) \
-I$(top_builddir) \
-DCOGL_DISABLE_DEPRECATION_WARNINGS \
$(CLUTTER_DEPRECATED_CFLAGS) \
$(CLUTTER_DEBUG_CFLAGS)
# Basic actor API
actor_tests = \
actor-anchors \
actor-destroy \
actor-graph \
actor-invariants \
actor-iter \
actor-layout \
actor-meta \
actor-offscreen-limit-max-size \
actor-offscreen-redirect \
actor-paint-opacity \
actor-pick \
actor-shader-effect \
actor-size \
$(NULL)
# Actor classes
classes_tests = \
text \
$(NULL)
# General API
general_tests = \
binding-pool \
color \
interval \
model \
script-parser \
units \
$(NULL)
# Test for deprecated functionality
deprecated_tests = \
animator \
behaviours \
group \
rectangle \
texture \
$(NULL)
test_programs = $(actor_tests) $(general_tests) $(classes_tests) $(deprecated_tests)
dist_test_data = $(script_ui_files)
script_ui_files = $(addprefix scripts/,$(script_tests))
script_tests = \
test-animator-1.json \
test-animator-2.json \
test-animator-3.json \
test-script-animation.json \
test-script-child.json \
test-script-implicit-alpha.json \
test-script-interval.json \
test-script-layout-property.json \
test-script-margin.json \
test-script-model.json \
test-script-named-object.json \
test-script-object-property.json \
test-script-single.json \
test-script-timeline-markers.json \
test-state-1.json
TESTS_ENVIRONMENT += G_ENABLE_DIAGNOSTIC=0 CLUTTER_ENABLE_DIAGNOSTIC=0 CLUTTER_SCALE=1
# simple rules for generating a Git ignore file for the conformance test suite
$(srcdir)/.gitignore: Makefile
$(AM_V_GEN)( echo "/*.trs" ; \
echo "/*.log" ; \
echo "/*.test" ; \
echo "/.gitignore" ; \
for p in $(test_programs); do \
echo "/$$p" ; \
done ) > $(@F)
gitignore: $(srcdir)/.gitignore
all-am: gitignore
DISTCLEANFILES += .gitignore

View File

@@ -407,8 +407,7 @@ test_scale_center (TestState *state)
g_assert (scale_x == 4.0);
g_assert (scale_y == 2.0);
g_assert (gravity == CLUTTER_GRAVITY_NONE);
assert_notifications (NOTIFY_SCALE_X | NOTIFY_SCALE_Y
| NOTIFY_SCALE_CENTER_X | NOTIFY_SCALE_CENTER_Y
assert_notifications (NOTIFY_SCALE_CENTER_X | NOTIFY_SCALE_CENTER_Y
| NOTIFY_SCALE_GRAVITY);
assert_coords (state, 100 + 10 - 10 * 4, 200 + 20 - 20 * 2,
100 + 10 + (RECT_WIDTH - 10) * 4,

View File

@@ -230,13 +230,13 @@ paint_cb (ClutterStage *stage,
gboolean *was_painted = data;
/* old shader effect */
g_assert_cmpint (get_pixel (50, 50), ==, 0xff0000);
g_assert_cmpint (get_pixel (0, 25), ==, 0xff0000);
/* new shader effect */
g_assert_cmpint (get_pixel (150, 50), ==, 0x00ffff);
g_assert_cmpint (get_pixel (100, 25), ==, 0x00ffff);
/* another new shader effect */
g_assert_cmpint (get_pixel (250, 50), ==, 0xff00ff);
g_assert_cmpint (get_pixel (200, 25), ==, 0xff00ff);
/* new shader effect */
g_assert_cmpint (get_pixel (350, 50), ==, 0x00ffff);
g_assert_cmpint (get_pixel (300, 25), ==, 0x00ffff);
*was_painted = TRUE;
}

View File

@@ -1,143 +0,0 @@
UNIT_TESTS = \
test-texture-slicing.c \
test-texture-async.c \
test-texture-material.c \
test-events.c \
test-scale.c \
test-actors.c \
test-shader-effects.c \
test-script.c \
test-grab.c \
test-cogl-shader-glsl.c \
test-animator.c \
test-state.c \
test-state-animator.c \
test-fbo.c \
test-multistage.c \
test-cogl-tex-tile.c \
test-cogl-tex-convert.c \
test-cogl-tex-foreign.c \
test-cogl-offscreen.c \
test-cogl-tex-polygon.c \
test-cogl-multitexture.c \
test-stage-read-pixels.c \
test-paint-wrapper.c \
test-texture-quality.c \
test-layout.c \
test-animation.c \
test-easing.c \
test-binding-pool.c \
test-text.c \
test-text-field.c \
test-cairo-clock.c \
test-cairo-flowers.c \
test-cogl-vertex-buffer.c \
test-stage-sizing.c \
test-scrolling.c \
test-swipe-action.c \
test-cogl-point-sprites.c \
test-table-layout.c \
test-path-constraint.c \
test-state-script.c \
test-devices.c \
test-content.c \
test-keyframe-transition.c \
test-bind-constraint.c \
test-touch-events.c \
test-rotate-zoom.c \
test-image.c
if X11_TESTS
UNIT_TESTS += test-pixmap.c
endif
SHEXT = $(EXEEXT)
# For convenience, this provides a way to easily run individual unit tests:
wrappers: stamp-test-interactive
@true
GIT_IGNORE_EXTRA = \
stamp-test-interactive \
stamp-test-unit-names \
test-unit-names.h \
$(UNIT_TESTS:.c=$(SHEXT))
stamp-test-interactive: Makefile
@wrapper=$(abs_builddir)/wrapper.sh ; \
chmod +x $$wrapper && \
for i in $(UNIT_TESTS); \
do \
test_bin=$${i%*.c} ; \
echo " GEN $$test_bin" ; \
( echo "#!/bin/sh" ; \
echo "$$wrapper $$test_bin \$$@" \
) > $$test_bin$(SHEXT) ; \
chmod +x $$test_bin$(SHEXT) ; \
done \
&& echo timestamp > $(@F)
test-unit-names.h: stamp-test-unit-names
@true
stamp-test-unit-names: Makefile
@( echo "/* ** This file is autogenerated. Do not edit. ** */" ; \
echo "" ; \
echo "const char *test_unit_names[] = {" ) > test-unit-names.h ; \
for i in $(UNIT_TESTS); \
do \
test_bin=$${i%*.c} ; \
echo " \"$$test_bin\"," >> test-unit-names.h ; \
done \
&& echo "};" >> test-unit-names.h \
&& echo timestamp > $(@F)
clean-wrappers:
@for i in $(UNIT_TESTS); \
do \
test_bin=$${i%*.c} ; \
echo " RM $$test_bin"; \
rm -f $$test_bin$(SHEXT); \
done \
&& rm -f stamp-test-unit-names \
&& rm -f stamp-test-interactive
.PHONY: wrappers clean-wrappers
common_ldadd = \
$(top_builddir)/clutter/libmutter-clutter-@LIBMUTTER_API_VERSION@.la \
$(top_builddir)/../cogl/cogl/libmutter-cogl-@LIBMUTTER_API_VERSION@.la
check_PROGRAMS = test-interactive
check_SCRIPTS = wrappers
test_interactive_SOURCES = test-main.c $(UNIT_TESTS)
nodist_test_interactive_SOURCES = test-unit-names.h
test_interactive_CFLAGS = $(CLUTTER_CFLAGS) $(GDK_PIXBUF_CFLAGS)
test_interactive_CPPFLAGS = \
-DTESTS_DATADIR=\""$(abs_srcdir)"\" \
-DG_DISABLE_SINGLE_INCLUDES \
-DGLIB_DISABLE_DEPRECATION_WARNINGS \
-DCOGL_DISABLE_DEPRECATION_WARNINGS \
-DCLUTTER_DISABLE_DEPRECATION_WARNINGS \
-I$(top_srcdir)/../cogl \
-I$(top_builddir)/../cogl \
-I$(top_builddir)/../cogl/cogl \
-I$(top_srcdir) \
-I$(top_builddir) \
-I$(top_srcdir)/clutter \
-I$(top_builddir)/clutter
test_interactive_LDFLAGS = -export-dynamic
test_interactive_LDADD = $(CLUTTER_LIBS) $(GDK_PIXBUF_LIBS) $(common_ldadd) $(LIBM)
EXTRA_DIST = \
wrapper.sh.in \
test-script.json \
test-script-signals.json \
redhand.png
DISTCLEANFILES = wrapper.sh .gitignore test-unit-names.h
BUILT_SOURCES = test-unit-names.h
clean-local: clean-wrappers

View File

@@ -1,15 +1,14 @@
#!/bin/bash
#!/bin/sh
outputfile=$1
shift
test_source_files="$@"
echo '/* ** This file is autogenerated. Do not edit. ** */' > $outputfile
echo '' >> $outputfile
echo 'const char *test_unit_names[] = {' >> $outputfile
echo '/* ** This file is autogenerated. Do not edit. ** */' > "$outputfile"
echo '' >> "$outputfile"
echo 'const char *test_unit_names[] = {' >> "$outputfile"
for test_source_file in $test_source_files; do
echo " \"$(echo $test_source_file | sed 's/.*\(test-[a-z0-9\-]\+\)\.c/\1/')\"," >> $outputfile
for test_source_file in "$@"; do
echo " \"$(echo "$test_source_file" | sed 's/.*\(test-[a-z0-9\-]\+\)\.c/\1/')\"," >> "$outputfile"
done
echo '};' >> $outputfile
echo '};' >> "$outputfile"

View File

@@ -1,34 +0,0 @@
common_ldadd = \
$(top_builddir)/clutter/libmutter-clutter-@LIBMUTTER_API_VERSION@.la \
$(top_builddir)/../cogl/cogl/libmutter-cogl-@LIBMUTTER_API_VERSION@.la
check_PROGRAMS = \
test-text \
test-picking \
test-text-perf \
test-random-text \
test-cogl-perf
AM_CFLAGS = $(CLUTTER_CFLAGS) $(MAINTAINER_CFLAGS)
AM_CPPFLAGS = \
-DG_DISABLE_SINGLE_INCLUDES \
-DGLIB_DISABLE_DEPRECATION_WARNINGS \
-DCOGL_DISABLE_DEPRECATION_WARNINGS \
-DCLUTTER_DISABLE_DEPRECATION_WARNINGS \
-I$(top_srcdir)/../cogl \
-I$(top_builddir)/../cogl \
-I$(top_builddir)/../cogl/cogl \
-I$(top_srcdir) \
-I$(top_builddir) \
-I$(top_srcdir)/clutter \
-I$(top_builddir)/clutter
LDADD = $(common_ldadd) $(CLUTTER_LIBS) $(LIBM)
test_text_SOURCES = test-text.c
test_picking_SOURCES = test-picking.c
test_text_perf_SOURCES = test-text-perf.c
test_random_text_SOURCES = test-random-text.c
test_cogl_perf_SOURCES = test-cogl-perf.c

View File

@@ -1,66 +0,0 @@
# A makefile based framework for testing performance commits in retrospect,
# based on work done by pippin@gimp.org done for GEGL, original code placed in the public domain.
SELF = Makefile-retrospect
MAKE_FLAGS = -j3 -k
CC = "ccache gcc" # if you do not have ccache replace with just gcc
PROJECT_PATH = ../../
# mute makes echoing of commands
.SILENT:
# replace sequential with random to build a random subset
all: reset sequential
#all: reset random
retry:
rm -rf reports/`cat jobs | tail -n1`*
make -f $(SELF)
prepare:
# uncomment these to make sure cpu is in high performance mode
#sudo sh -c 'echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor || true'
#sudo sh -c 'echo performance > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor || true'
reset:
rm -rf jobs jobs
# remove checkout dir to have a full reset on each invokation
rm -rf checkout
# create clone
git clone -s $(PROJECT_PATH) checkout
mkdir reports > /dev/null 2>&1 || true
make -f $(SELF) jobs
make -f $(SELF) prepare
jobs: joblist
./makejobs.rb joblist > jobs
sequential:
for a in `cat jobs`;do make -f $(SELF) reports/$$a;done
random:
for a in `cat jobs|sort`;do make -f $(SELF) reports/$$a;done
reports/%:
# check out revision
(cd checkout; git checkout `echo $@|sed s:reports/::`)
# write header for report
git log -1 `echo $@|sed s:reports/::` > $@ || true
# clean previous build
rm -rf install; mkdir install
# build revision
(cd checkout; if [ ! -f Makefile ]; then CC=$(CC) ./autogen.sh --disable-introspection --prefix=`pwd`/../install; fi ; \
make $(MAKE_FLAGS) ; make -k install ) > $@.log 2>&1 || true
# testing
make -f Makefile-tests clean;\
make -f Makefile-tests; sync;\
make -f Makefile-tests check >> $@ || true
# update report.pdf / report.png
./create-report.rb
echo
clean:
rm -rf reports jobs report.pdf report.png checkout install
make -f Makefile-tests clean

View File

@@ -1,15 +0,0 @@
CFILES = $(wildcard *.c)
bins = $(subst ,,$(CFILES:.c=))
all: $(bins)
%: %.c
PKG_CONFIG_PATH=install/lib/pkgconfig:$(PKG_CONFIG_PATH) $(CC) -DTESTS_DATA_DIR=\"../data/\" `pkg-config clutter-1.0 --cflags --libs` -Wall -O2 -o $@ $<
check: $(bins)
for a in $(bins); do \
LD_LIBRARY_PATH=install/lib:$(LD_LIBRARY_PATH) ./$$a;\
done
clean:
rm -f $(bins)

View File

@@ -1,43 +0,0 @@
check_PROGRAMS = \
test-picking \
test-text-perf \
test-state \
test-state-interactive \
test-state-hidden \
test-state-mini \
test-state-pick
common_ldadd = $(top_builddir)/clutter/libmutter-clutter-@LIBMUTTER_API_VERSION@.la
LDADD = $(common_ldadd) $(CLUTTER_LIBS) $(LIBM)
AM_CFLAGS = $(CLUTTER_CFLAGS)
AM_CPPFLAGS = \
-DG_DISABLE_SINGLE_INCLUDES \
-DGLIB_DISABLE_DEPRECATION_WARNINGS \
-DCOGL_DISABLE_DEPRECATION_WARNINGS \
-DCLUTTER_DISABLE_DEPRECATION_WARNINGS \
-DTESTS_DATA_DIR=\""$(top_srcdir)/tests/data/"\" \
-I$(top_srcdir)/../cogl \
-I$(top_builddir)/../cogl \
-I$(top_builddir)/../cogl/cogl \
-I$(top_srcdir) \
-I$(top_builddir) \
-I$(top_srcdir)/clutter \
-I$(top_builddir)/clutter
perf-report: check
check:
for a in $(noinst_PROGRAMS);do ./$$a;done;true
test_picking_SOURCES = test-picking.c
test_text_perf_SOURCES = test-text-perf.c
test_state_SOURCES = test-state.c
test_state_hidden_SOURCES = test-state-hidden.c
test_state_pick_SOURCES = test-state-pick.c
test_state_interactive_SOURCES = test-state-interactive.c
test_state_mini_SOURCES = test-state-mini.c
EXTRA_DIST = Makefile-retrospect Makefile-tests create-report.rb test-common.h

1
cogl/.gitignore vendored
View File

@@ -66,7 +66,6 @@ TAGS
/tests/conform/config.env
/tests/conform/.log
/tests/unit/.log
/tests/micro-perf/test-journal
/tests/config.env
/po/POTFILES
/po/*.gmo

View File

@@ -1,33 +0,0 @@
SUBDIRS = test-fixtures
SUBDIRS += cogl
SUBDIRS += cogl-path
SUBDIRS += cogl-pango
if BUILD_COGL_GLES2
SUBDIRS += cogl-gles2
endif
SUBDIRS += tests
ACLOCAL_AMFLAGS = -I build/autotools ${ACLOCAL_FLAGS}
EXTRA_DIST = \
config-custom.h
# .changelog expects these to be initializes
CLEANFILES=
DISTCLEANFILES=
DISTCHECK_CONFIGURE_FLAGS = \
--enable-maintainer-flags \
--enable-profile \
--enable-gles2 \
--enable-gl \
--enable-xlib-egl-platform \
--enable-wayland-egl-platform \
--enable-glx \
--enable-wayland-egl-server \
--enable-cogl-gst

View File

@@ -1,52 +0,0 @@
# Rules for generating enumeration types using glib-mkenums
#
# Define:
# glib_enum_h = header template file
# glib_enum_c = source template file
# glib_enum_headers = list of headers to parse
#
# before including Makefile.am.enums. You will also need to have
# the following targets already defined:
#
# CLEANFILES
# DISTCLEANFILES
# BUILT_SOURCES
# EXTRA_DIST
#
# Author: Emmanuele Bassi <ebassi@linux.intel.com>
# Basic sanity checks
$(if $(GLIB_MKENUMS),,$(error Need to define GLIB_MKENUMS))
$(if $(or $(glib_enum_h), \
$(glib_enum_c)),, \
$(error Need to define glib_enum_h and glib_enum_c))
$(if $(glib_enum_headers),,$(error Need to define glib_enum_headers))
enum_tmpl_h=$(addprefix $(srcdir)/, $(glib_enum_h:.h=.h.in))
enum_tmpl_c=$(addprefix $(srcdir)/, $(glib_enum_c:.c=.c.in))
enum_headers=$(addprefix $(srcdir)/, $(glib_enum_headers))
CLEANFILES += stamp-enum-types
DISTCLEANFILES += $(glib_enum_h) $(glib_enum_c)
BUILT_SOURCES += $(glib_enum_h) $(glib_enum_c)
EXTRA_DIST += $(enum_tmpl_h) $(enum_tmpl_c)
stamp-enum-types: $(enum_headers) $(enum_tmpl_h)
$(AM_V_GEN)$(GLIB_MKENUMS) \
--template $(enum_tmpl_h) \
$(enum_headers) > xgen-eh \
&& (cmp -s xgen-eh $(glib_enum_h) || cp -f xgen-eh $(glib_enum_h)) \
&& rm -f xgen-eh \
&& echo timestamp > $(@F)
$(glib_enum_h): stamp-enum-types
@true
$(glib_enum_c): $(enum_headers) $(enum_tmpl_h) $(enum_tmpl_c)
$(AM_V_GEN)$(GLIB_MKENUMS) \
--template $(enum_tmpl_c) \
$(enum_headers) > xgen-ec \
&& cp -f xgen-ec $(glib_enum_c) \
&& rm -f xgen-ec

View File

@@ -1,62 +0,0 @@
dnl as-compiler-flag.m4 0.1.0
dnl autostars m4 macro for detection of compiler flags
dnl David Schleef <ds@schleef.org>
dnl $Id: as-compiler-flag.m4,v 1.1 2005/12/15 23:35:19 ds Exp $
dnl AS_COMPILER_FLAG(CFLAGS, ACTION-IF-ACCEPTED, [ACTION-IF-NOT-ACCEPTED])
dnl Tries to compile with the given CFLAGS.
dnl Runs ACTION-IF-ACCEPTED if the compiler can compile with the flags,
dnl and ACTION-IF-NOT-ACCEPTED otherwise.
AC_DEFUN([AS_COMPILER_FLAG],
[
AC_MSG_CHECKING([to see if compiler understands $1])
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $1"
AC_TRY_COMPILE([ ], [], [flag_ok=yes], [flag_ok=no])
CFLAGS="$save_CFLAGS"
if test "X$flag_ok" = Xyes ; then
m4_ifvaln([$2],[$2])
true
else
m4_ifvaln([$3],[$3])
true
fi
AC_MSG_RESULT([$flag_ok])
])
dnl AS_COMPILER_FLAGS(VAR, FLAGS)
dnl Tries to compile with the given CFLAGS.
AC_DEFUN([AS_COMPILER_FLAGS],
[
list=$2
flags_supported=""
flags_unsupported=""
AC_MSG_CHECKING([for supported compiler flags])
for each in $list
do
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $each"
AC_TRY_COMPILE([ ], [], [flag_ok=yes], [flag_ok=no])
CFLAGS="$save_CFLAGS"
if test "X$flag_ok" = Xyes ; then
flags_supported="$flags_supported $each"
else
flags_unsupported="$flags_unsupported $each"
fi
done
AC_MSG_RESULT([$flags_supported])
if test "X$flags_unsupported" != X ; then
AC_MSG_WARN([unsupported compiler flags: $flags_unsupported])
fi
$1="$$1 $flags_supported"
])

View File

@@ -1,94 +0,0 @@
dnl -*- mode: autoconf -*-
dnl Copyright 2009 Johan Dahlin
dnl
dnl This file is free software; the author(s) gives unlimited
dnl permission to copy and/or distribute it, with or without
dnl modifications, as long as this notice is preserved.
dnl
# serial 1
m4_define([_GOBJECT_INTROSPECTION_CHECK_INTERNAL],
[
AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first
AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first
AC_BEFORE([LT_INIT],[$0])dnl setup libtool first
dnl enable/disable introspection
m4_if([$2], [require],
[dnl
enable_introspection=yes
],[dnl
AC_ARG_ENABLE(introspection,
AS_HELP_STRING([--enable-introspection[=@<:@no/auto/yes@:>@]],
[Enable introspection for this build]),,
[enable_introspection=auto])
])dnl
AC_MSG_CHECKING([for gobject-introspection])
dnl presence/version checking
AS_CASE([$enable_introspection],
[no], [dnl
found_introspection="no (disabled, use --enable-introspection to enable)"
],dnl
[yes],[dnl
PKG_CHECK_EXISTS([gobject-introspection-1.0],,
AC_MSG_ERROR([gobject-introspection-1.0 is not installed]))
PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1],
found_introspection=yes,
AC_MSG_ERROR([You need to have gobject-introspection >= $1 installed to build AC_PACKAGE_NAME]))
],dnl
[auto],[dnl
PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1], found_introspection=yes, found_introspection=no)
],dnl
[dnl
AC_MSG_ERROR([invalid argument passed to --enable-introspection, should be one of @<:@no/auto/yes@:>@])
])dnl
AC_MSG_RESULT([$found_introspection])
INTROSPECTION_SCANNER=
INTROSPECTION_COMPILER=
INTROSPECTION_GENERATE=
INTROSPECTION_GIRDIR=
INTROSPECTION_TYPELIBDIR=
if test "x$found_introspection" = "xyes"; then
INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0`
INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0`
INTROSPECTION_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0`
INTROSPECTION_GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0`
INTROSPECTION_TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)"
INTROSPECTION_CFLAGS=`$PKG_CONFIG --cflags gobject-introspection-1.0`
INTROSPECTION_LIBS=`$PKG_CONFIG --libs gobject-introspection-1.0`
INTROSPECTION_MAKEFILE=`$PKG_CONFIG --variable=datadir gobject-introspection-1.0`/gobject-introspection-1.0/Makefile.introspection
fi
AC_SUBST(INTROSPECTION_SCANNER)
AC_SUBST(INTROSPECTION_COMPILER)
AC_SUBST(INTROSPECTION_GENERATE)
AC_SUBST(INTROSPECTION_GIRDIR)
AC_SUBST(INTROSPECTION_TYPELIBDIR)
AC_SUBST(INTROSPECTION_CFLAGS)
AC_SUBST(INTROSPECTION_LIBS)
AC_SUBST(INTROSPECTION_MAKEFILE)
AM_CONDITIONAL(HAVE_INTROSPECTION, test "x$found_introspection" = "xyes")
])
dnl Usage:
dnl GOBJECT_INTROSPECTION_CHECK([minimum-g-i-version])
AC_DEFUN([GOBJECT_INTROSPECTION_CHECK],
[
_GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1])
])
dnl Usage:
dnl GOBJECT_INTROSPECTION_REQUIRE([minimum-g-i-version])
AC_DEFUN([GOBJECT_INTROSPECTION_REQUIRE],
[
_GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1], [require])
])

View File

@@ -1,37 +0,0 @@
# preamble
NULL =
DISTCLEANFILES =
mutterlibdir = $(libdir)/mutter-@LIBMUTTER_API_VERSION@
mutterlib_LTLIBRARIES = libmutter-cogl-gles2-@LIBMUTTER_API_VERSION@.la
AM_CPPFLAGS = \
-I$(top_srcdir) \
-I$(top_builddir) \
-I$(top_builddir)/cogl \
$(NULL)
AM_CFLAGS = $(COGL_DEP_CFLAGS) $(COGL_EXTRA_CFLAGS) $(MAINTAINER_CFLAGS)
libmutter_cogl_gles2_@LIBMUTTER_API_VERSION@_la_SOURCES = cogl-gles2-api.c
libmutter_cogl_gles2_@LIBMUTTER_API_VERSION@_la_LDFLAGS = \
-no-undefined \
-rpath $(mutterlibdir) \
-avoid-version \
-export-dynamic \
-export-symbols-regex "^gl*"
coglgles2includedir = $(includedir)/mutter-@LIBMUTTER_API_VERSION@/cogl/cogl-gles2/GLES2
coglgles2include_HEADERS = \
GLES2/gl2.h \
GLES2/gl2ext.h \
GLES2/gl2platform.h
pc_files = mutter-cogl-gles2-$(LIBMUTTER_API_VERSION).pc
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = $(pc_files)
DISTCLEANFILES += $(pc_files)

View File

@@ -27,15 +27,15 @@ cogl_gles2_includedir = join_paths(cogl_includedir, 'cogl-gles2/GLES2')
install_headers(cogl_gles2_public_headers,
subdir: cogl_gles2_includedir)
pkg.generate(
pkg.generate(libmutter_cogl_gles2,
name: 'CoglGles2',
filebase: 'mutter-cogl-gles2-' + libmutter_api_version,
description: 'A cogl GLES2 helper library for mutter',
libraries: [libmutter_cogl_gles2],
subdirs: join_paths(pkgname, 'cogl'),
requires: [cogl_pkg_deps, libmutter_cogl_name],
version: meson.project_version(),
variables: [
'apiversion=' + libmutter_api_version,
],
install_dir: pcdir,
)

View File

@@ -1,93 +0,0 @@
NULL =
CLEANFILES =
DISTCLEANFILES =
EXTRA_DIST =
source_c = \
cogl-pango-display-list.c \
cogl-pango-fontmap.c \
cogl-pango-render.c \
cogl-pango-glyph-cache.c \
cogl-pango-pipeline-cache.c \
$(NULL)
source_h = cogl-pango.h
source_h_priv = \
cogl-pango-display-list.h \
cogl-pango-private.h \
cogl-pango-glyph-cache.h \
cogl-pango-pipeline-cache.h \
$(NULL)
mutterlibdir = $(libdir)/mutter-@LIBMUTTER_API_VERSION@
mutterlib_LTLIBRARIES = libmutter-cogl-pango-@LIBMUTTER_API_VERSION@.la
libmutter_cogl_pango_@LIBMUTTER_API_VERSION@_la_SOURCES = $(source_c) $(source_h) $(source_h_priv)
libmutter_cogl_pango_@LIBMUTTER_API_VERSION@_la_CFLAGS = $(COGL_DEP_CFLAGS) $(COGL_PANGO_DEP_CFLAGS) $(COGL_EXTRA_CFLAGS) $(MAINTAINER_CFLAGS)
libmutter_cogl_pango_@LIBMUTTER_API_VERSION@_la_LIBADD = $(top_builddir)/cogl/libmutter-cogl-$(LIBMUTTER_API_VERSION).la
libmutter_cogl_pango_@LIBMUTTER_API_VERSION@_la_LIBADD += $(COGL_DEP_LIBS) $(COGL_PANGO_DEP_LIBS) $(COGL_EXTRA_LDFLAGS)
libmutter_cogl_pango_@LIBMUTTER_API_VERSION@_la_LDFLAGS = \
-export-dynamic \
-rpath $(mutterlibdir) \
-export-symbols-regex "^cogl_pango_.*" \
-no-undefined \
-avoid-version
AM_CPPFLAGS = \
-DCOGL_COMPILATION \
-DG_LOG_DOMAIN=\"CoglPango\" \
-I$(top_srcdir)/cogl \
-I$(top_builddir)/cogl \
-I$(top_srcdir)/cogl/winsys \
-I$(top_srcdir) \
-I$(top_builddir)
cogl_base_includedir = $(includedir)/mutter-@LIBMUTTER_API_VERSION@
cogl_pangoheadersdir = $(cogl_base_includedir)/cogl/cogl-pango
cogl_pangoheaders_HEADERS = $(source_h)
pc_files = mutter-cogl-pango-$(LIBMUTTER_API_VERSION).pc
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = $(pc_files)
DISTCLEANFILES += $(pc_files)
EXTRA_DIST += cogl-pango.symbols
-include $(INTROSPECTION_MAKEFILE)
INTROSPECTION_GIRS =
if HAVE_INTROSPECTION
INTROSPECTION_COMPILER_ARGS=--includedir=$(top_builddir)/cogl
CoglPango-@LIBMUTTER_API_VERSION@.gir: libmutter-cogl-pango-$(LIBMUTTER_API_VERSION).la Makefile
CoglPango_@LIBMUTTER_API_VERSION@_gir_NAMESPACE = CoglPango
CoglPango_@LIBMUTTER_API_VERSION@_gir_VERSION = @LIBMUTTER_API_VERSION@
CoglPango_@LIBMUTTER_API_VERSION@_gir_LIBS = $(top_builddir)/cogl/libmutter-cogl-$(LIBMUTTER_API_VERSION).la libmutter-cogl-pango-$(LIBMUTTER_API_VERSION).la
CoglPango_@LIBMUTTER_API_VERSION@_gir_FILES = $(source_h) $(source_c)
CoglPango_@LIBMUTTER_API_VERSION@_gir_CFLAGS = $(AM_CPPFLAGS) $(COGL_DEP_CFLAGS) $(COGL_PANGO_DEP_CFLAGS)
CoglPango_@LIBMUTTER_API_VERSION@_gir_INCLUDES = Pango-1.0 PangoCairo-1.0
CoglPango_@LIBMUTTER_API_VERSION@_gir_EXPORT_PACKAGES = mutter-cogl-pango-@LIBMUTTER_API_VERSION@
CoglPango_@LIBMUTTER_API_VERSION@_gir_SCANNERFLAGS = \
--warn-all \
--identifier-prefix=CoglPango \
--symbol-prefix=cogl_pango \
--c-include='cogl-pango/cogl-pango.h' \
--include-uninstalled=$(top_builddir)/cogl/Cogl-@LIBMUTTER_API_VERSION@.gir
INTROSPECTION_GIRS += CoglPango-@LIBMUTTER_API_VERSION@.gir
girdir = $(mutterlibdir)
gir_DATA = $(INTROSPECTION_GIRS)
typelibdir = $(mutterlibdir)
typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
CLEANFILES += $(gir_DATA) $(typelib_DATA)
endif

View File

@@ -54,10 +54,9 @@ if have_introspection
pango_dep,
libmutter_cogl_pango_dep,
],
extra_args: [
extra_args: introspection_args + [
'-UCOGL_COMPILATION',
'-DG_LOG_DOMAIN=\"CoglPango\"',
'-U_GNU_SOURCE',
],
install_dir_gir: pkglibdir,
install_dir_typelib: pkglibdir,
@@ -68,15 +67,15 @@ endif
cogl_pango_includedir = join_paths(cogl_includedir, 'cogl-pango')
install_headers(cogl_pango_public_headers, subdir: cogl_pango_includedir)
pkg.generate(
pkg.generate(libmutter_cogl_pango,
name: 'CoglPango',
filebase: 'mutter-cogl-pango-' + libmutter_api_version,
description: 'A text rendering for Cogl in mutter',
libraries: [libmutter_cogl_pango],
subdirs: join_paths(pkgname, 'cogl'),
requires: [cogl_pkg_deps, libmutter_cogl_name],
version: meson.project_version(),
variables: [
'apiversion=' + libmutter_api_version,
],
install_dir: pcdir,
)

View File

@@ -1,102 +0,0 @@
NULL =
BUILT_SOURCES =
CLEANFILES =
DISTCLEANFILES =
EXTRA_DIST =
# tesselator sources
cogl_tesselator_sources = \
tesselator/dict-list.h \
tesselator/dict.c \
tesselator/dict.h \
tesselator/geom.c \
tesselator/geom.h \
tesselator/gluos.h \
tesselator/memalloc.h \
tesselator/mesh.c \
tesselator/mesh.h \
tesselator/normal.c \
tesselator/normal.h \
tesselator/priorityq-heap.h \
tesselator/priorityq-sort.h \
tesselator/priorityq.c \
tesselator/priorityq.h \
tesselator/render.c \
tesselator/render.h \
tesselator/sweep.c \
tesselator/sweep.h \
tesselator/tess.c \
tesselator/tess.h \
tesselator/tesselator.h \
tesselator/tessmono.c \
tesselator/tessmono.h \
tesselator/GL/glu.h \
$(NULL)
source_c = \
$(cogl_tesselator_sources) \
cogl-path-private.h \
cogl-path.c \
$(NULL)
EXTRA_DIST += \
tesselator/README \
tesselator/priorityq-heap.c \
cogl-path.symbols \
$(NULL)
source_1_x_h = \
cogl-path-types.h \
$(NULL)
source_h = \
cogl-path.h \
$(source_1_x_h) \
cogl-path-functions.h \
$(NULL)
# glib-mkenums rules
glib_enum_h = cogl-path-enum-types.h
glib_enum_c = cogl-path-enum-types.c
glib_enum_headers = $(source_1_x_h)
include $(top_srcdir)/build/autotools/Makefile.am.enums
mutterlibdir = $(libdir)/mutter-@LIBMUTTER_API_VERSION@
mutterlib_LTLIBRARIES = libmutter-cogl-path-@LIBMUTTER_API_VERSION@.la
libmutter_cogl_path_@LIBMUTTER_API_VERSION@_la_SOURCES = $(source_c) $(source_h)
nodist_libmutter_cogl_path_@LIBMUTTER_API_VERSION@_la_SOURCES = $(BUILT_SOURCES)
libmutter_cogl_path_@LIBMUTTER_API_VERSION@_la_CFLAGS = $(COGL_DEP_CFLAGS) $(COGL_EXTRA_CFLAGS) $(MAINTAINER_CFLAGS)
libmutter_cogl_path_@LIBMUTTER_API_VERSION@_la_LIBADD = $(top_builddir)/cogl/libmutter-cogl-$(LIBMUTTER_API_VERSION).la
libmutter_cogl_path_@LIBMUTTER_API_VERSION@_la_LIBADD += $(COGL_DEP_LIBS) $(COGL_EXTRA_LDFLAGS)
libmutter_cogl_path_@LIBMUTTER_API_VERSION@_la_LDFLAGS = \
-export-dynamic \
-export-symbols-regex "^(cogl|cogl2)_(framebuffer|path|is|clip|[sg]et)_.*" \
-no-undefined \
-avoid-version \
-rpath $(mutterlibdir)
AM_CPPFLAGS = \
-DCOGL_COMPILATION \
-DG_LOG_DOMAIN=\"CoglPath\" \
-I$(srcdir)/tesselator \
-I$(top_srcdir)/cogl \
-I$(top_builddir)/cogl \
-I$(top_srcdir)/cogl/winsys \
-I$(top_srcdir) \
-I$(top_builddir)
cogl_base_includedir = $(includedir)/mutter-@LIBMUTTER_API_VERSION@
cogl_pathheadersdir = $(cogl_base_includedir)/cogl/cogl-path
cogl_pathheaders_HEADERS = $(source_h)
nodist_cogl_pathheaders_HEADERS = cogl-path-enum-types.h
pc_files = mutter-cogl-path-$(LIBMUTTER_API_VERSION).pc
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = $(pc_files)
DISTCLEANFILES += $(pc_files)

View File

@@ -68,15 +68,15 @@ libmutter_cogl_path_dep = declare_dependency(
install_headers(cogl_path_public_headers,
subdir: cogl_path_includedir)
pkg.generate(
pkg.generate(libmutter_cogl_path,
name: 'CoglPath',
filebase: 'mutter-cogl-path-' + libmutter_api_version,
description: 'A 2D path drawing library for Cogl in mutter',
libraries: [libmutter_cogl_path],
subdirs: join_paths(pkgname, 'cogl'),
requires: [cogl_pkg_deps, libmutter_cogl_name],
version: meson.project_version(),
variables: [
'apiversion=' + libmutter_api_version,
],
install_dir: pcdir,
)

View File

@@ -1,493 +0,0 @@
# preamble
NULL =
SUBDIRS =
BUILT_SOURCES =
EXTRA_DIST =
CLEANFILES =
DISTCLEANFILES =
AM_CPPFLAGS = \
-I$(top_srcdir) \
-I$(top_builddir) \
$(NULL)
AM_CPPFLAGS += \
-DG_LOG_DOMAIN=\"Cogl\" \
-DCOGL_COMPILATION \
-DCOGL_GL_LIBNAME=\"$(COGL_GL_LIBNAME)\" \
-DCOGL_GLES1_LIBNAME=\"$(COGL_GLES1_LIBNAME)\" \
-DCOGL_GLES2_LIBNAME=\"$(COGL_GLES2_LIBNAME)\" \
-DCOGL_LOCALEDIR=\""$(localedir)"\" \
$(NULL)
if HAVE_COGL_DEFAULT_DRIVER
AM_CPPFLAGS += \
-DCOGL_DEFAULT_DRIVER=\"$(COGL_DEFAULT_DRIVER)\"
endif
AM_CFLAGS = $(COGL_DEP_CFLAGS) $(COGL_EXTRA_CFLAGS) $(MAINTAINER_CFLAGS)
BUILT_SOURCES += cogl-defines.h cogl-egl-defines.h cogl-gl-header.h
DISTCLEANFILES += cogl-defines.h cogl-egl-defines.h cogl-gl-header.h
EXTRA_DIST += cogl-defines.h.in cogl-egl-defines.h.in cogl-gl-header.h.in
pc_files = mutter-cogl-$(LIBMUTTER_API_VERSION).pc
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = $(pc_files)
DISTCLEANFILES += $(pc_files)
cogl_deprecated_h = \
deprecated/cogl-material-compat.h \
deprecated/cogl-vertex-buffer.h \
deprecated/cogl-shader.h \
deprecated/cogl-clutter.h \
deprecated/cogl-type-casts.h \
deprecated/cogl-auto-texture.h \
$(NULL)
cogl_deprecated_nonintrospected_h = \
deprecated/cogl-framebuffer-deprecated.h \
$(NULL)
# public 1.x api headers
cogl_1_public_h = \
$(cogl_deprecated_h) \
cogl1-context.h \
cogl-bitmap.h \
cogl-color.h \
cogl-framebuffer.h \
cogl-matrix.h \
cogl-offscreen.h \
cogl-object.h \
cogl-onscreen.h \
cogl-pipeline.h \
cogl-pipeline-state.h \
cogl-pipeline-layer-state.h \
cogl-primitives.h \
cogl-texture.h \
cogl-types.h \
cogl.h \
$(NULL)
cogl_nonintrospected_h = \
cogl-renderer.h \
cogl-swap-chain.h \
cogl-onscreen-template.h \
cogl-display.h \
cogl-context.h \
cogl-snippet.h \
cogl-gles2.h \
cogl-gles2-types.h \
cogl-index-buffer.h \
cogl-attribute-buffer.h \
cogl-indices.h \
cogl-attribute.h \
cogl-primitive.h \
cogl-frame-info.h \
cogl-vector.h \
cogl-euler.h \
cogl-output.h \
cogl-quaternion.h \
cogl-matrix-stack.h \
cogl-poll.h \
cogl-texture-3d.h \
cogl-texture-2d.h \
cogl-texture-2d-gl.h \
cogl-texture-rectangle.h \
cogl-texture-2d-sliced.h \
cogl-sub-texture.h \
cogl-atlas-texture.h \
cogl-meta-texture.h \
cogl-primitive-texture.h \
cogl-depth-state.h \
cogl-buffer.h \
cogl-pixel-buffer.h \
cogl-macros.h \
cogl-fence.h \
cogl-version.h \
cogl-error.h \
cogl-bitmap.h \
cogl-color.h \
cogl-matrix.h \
cogl-texture.h \
cogl-types.h \
cogl-gtype-private.h \
cogl-mutter.h \
$(NULL)
cogl_nodist_h = \
$(NULL)
# nop driver
cogl_driver_sources = \
driver/nop/cogl-driver-nop.c \
driver/nop/cogl-framebuffer-nop-private.h \
driver/nop/cogl-framebuffer-nop.c \
driver/nop/cogl-attribute-nop-private.h \
driver/nop/cogl-attribute-nop.c \
driver/nop/cogl-clip-stack-nop-private.h \
driver/nop/cogl-clip-stack-nop.c \
driver/nop/cogl-texture-2d-nop-private.h \
driver/nop/cogl-texture-2d-nop.c \
$(NULL)
# gl driver sources
cogl_gl_prototypes_h = \
gl-prototypes/cogl-gles2-functions.h \
gl-prototypes/cogl-core-functions.h \
gl-prototypes/cogl-in-gles-core-functions.h \
gl-prototypes/cogl-in-gles2-core-functions.h \
gl-prototypes/cogl-glsl-functions.h \
$(NULL)
cogl_driver_sources += \
driver/gl/cogl-util-gl-private.h \
driver/gl/cogl-util-gl.c \
driver/gl/cogl-framebuffer-gl-private.h \
driver/gl/cogl-framebuffer-gl.c \
driver/gl/cogl-texture-gl-private.h \
driver/gl/cogl-texture-gl.c \
driver/gl/cogl-texture-2d-gl-private.h \
driver/gl/cogl-texture-2d-gl.c \
driver/gl/cogl-attribute-gl-private.h \
driver/gl/cogl-attribute-gl.c \
driver/gl/cogl-clip-stack-gl-private.h \
driver/gl/cogl-clip-stack-gl.c \
driver/gl/cogl-buffer-gl-private.h \
driver/gl/cogl-buffer-gl.c \
driver/gl/cogl-pipeline-opengl.c \
driver/gl/cogl-pipeline-opengl-private.h \
driver/gl/cogl-pipeline-fragend-glsl.c \
driver/gl/cogl-pipeline-fragend-glsl-private.h \
driver/gl/cogl-pipeline-vertend-glsl.c \
driver/gl/cogl-pipeline-vertend-glsl-private.h \
driver/gl/cogl-pipeline-progend-glsl.c \
driver/gl/cogl-pipeline-progend-glsl-private.h \
$(NULL)
if COGL_DRIVER_GL_SUPPORTED
cogl_driver_sources += \
driver/gl/gl/cogl-driver-gl.c \
driver/gl/gl/cogl-texture-driver-gl.c \
$(NULL)
endif
if COGL_DRIVER_GLES_SUPPORTED
cogl_driver_sources += \
driver/gl/gles/cogl-driver-gles.c \
driver/gl/gles/cogl-texture-driver-gles.c \
$(NULL)
endif
# winsys sources, common to all backends
cogl_winsys_common_sources = \
winsys/cogl-winsys-private.h \
winsys/cogl-winsys.c \
$(NULL)
# sources
cogl_sources_c = \
$(cogl_driver_sources) \
$(cogl_winsys_common_sources) \
cogl-private.h \
cogl-i18n-private.h \
cogl-debug.h \
cogl-debug-options.h \
cogl-gpu-info.c \
cogl-gpu-info-private.h \
cogl-context-private.h \
cogl-context.c \
cogl-renderer-private.h \
cogl-renderer.h \
cogl-renderer.c \
cogl-swap-chain-private.h \
cogl-swap-chain.h \
cogl-swap-chain.c \
cogl-onscreen-template-private.h \
cogl-onscreen-template.h \
cogl-onscreen-template.c \
cogl-display-private.h \
cogl-display.h \
cogl-display.c \
cogl-driver.h \
cogl.c \
cogl-object-private.h \
cogl-object.h \
cogl-object.c \
cogl-util.h \
cogl-util.c \
cogl-bitmap-private.h \
cogl-bitmap.c \
cogl-bitmap-conversion.c \
cogl-bitmap-packing.h \
cogl-primitives-private.h \
cogl-primitives.h \
cogl-primitives.c \
cogl-bitmap-pixbuf.c \
cogl-clip-stack.h \
cogl-clip-stack.c \
cogl-feature-private.h \
cogl-feature-private.c \
cogl-color-private.h \
cogl-color.c \
cogl-buffer-private.h \
cogl-buffer.c \
cogl-pixel-buffer-private.h \
cogl-pixel-buffer.c \
cogl-index-buffer-private.h \
cogl-index-buffer.c \
cogl-attribute-buffer-private.h \
cogl-attribute-buffer.c \
cogl-indices-private.h \
cogl-indices.c \
cogl-attribute-private.h \
cogl-attribute.c \
cogl-primitive-private.h \
cogl-primitive.c \
cogl-matrix.c \
cogl-vector.c \
cogl-euler.c \
cogl-quaternion-private.h \
cogl-quaternion.c \
cogl-matrix-private.h \
cogl-matrix-stack.c \
cogl-matrix-stack-private.h \
cogl-depth-state.c \
cogl-depth-state-private.h \
cogl-node.c \
cogl-node-private.h \
cogl-pipeline.c \
cogl-pipeline-private.h \
cogl-pipeline-layer.c \
cogl-pipeline-layer-private.h \
cogl-pipeline-state.c \
cogl-pipeline-layer-state-private.h \
cogl-pipeline-layer-state.c \
cogl-pipeline-state-private.h \
cogl-pipeline-debug.c \
cogl-glsl-shader.c \
cogl-glsl-shader-private.h \
cogl-glsl-shader-boilerplate.h \
cogl-pipeline-snippet-private.h \
cogl-pipeline-snippet.c \
cogl-pipeline-cache.h \
cogl-pipeline-cache.c \
cogl-pipeline-hash-table.h \
cogl-pipeline-hash-table.c \
cogl-sampler-cache.c \
cogl-sampler-cache-private.h \
cogl-blend-string.c \
cogl-blend-string.h \
cogl-debug.c \
cogl-sub-texture-private.h \
cogl-texture-private.h \
cogl-texture-2d-private.h \
cogl-texture-2d-sliced-private.h \
cogl-texture-3d-private.h \
cogl-texture-driver.h \
cogl-sub-texture.c \
cogl-texture.c \
cogl-texture-2d.c \
cogl-texture-2d-sliced.c \
cogl-texture-3d.c \
cogl-texture-rectangle-private.h \
cogl-texture-rectangle.c \
cogl-rectangle-map.h \
cogl-rectangle-map.c \
cogl-atlas.h \
cogl-atlas.c \
cogl-atlas-texture-private.h \
cogl-atlas-texture.c \
cogl-meta-texture.c \
cogl-primitive-texture.c \
cogl-blit.h \
cogl-blit.c \
cogl-spans.h \
cogl-spans.c \
cogl-journal-private.h \
cogl-journal.c \
cogl-frame-info-private.h \
cogl-frame-info.c \
cogl-framebuffer-private.h \
cogl-framebuffer.c \
cogl-onscreen-private.h \
cogl-onscreen.c \
cogl-output-private.h \
cogl-output.c \
cogl-profile.h \
cogl-profile.c \
cogl-flags.h \
cogl-bitmask.h \
cogl-bitmask.c \
cogl-gtype.c \
cogl-gtype-private.h \
cogl-point-in-poly-private.h \
cogl-point-in-poly.c \
cogl-list.c \
cogl-list.h \
winsys/cogl-winsys-stub-private.h \
winsys/cogl-winsys-stub.c \
cogl-config-private.h \
cogl-config.c \
cogl-boxed-value.h \
cogl-boxed-value.c \
cogl-snippet-private.h \
cogl-snippet.c \
cogl-poll-private.h \
cogl-poll.c \
gl-prototypes/cogl-all-functions.h \
gl-prototypes/cogl-gles2-functions.h \
gl-prototypes/cogl-core-functions.h \
gl-prototypes/cogl-in-gles-core-functions.h \
gl-prototypes/cogl-in-gles2-core-functions.h \
gl-prototypes/cogl-fixed-functions.h \
gl-prototypes/cogl-glsl-functions.h \
cogl-memory-stack-private.h \
cogl-memory-stack.c \
cogl-magazine-private.h \
cogl-magazine.c \
cogl-gles2-context-private.h \
cogl-gles2-context.c \
cogl-error-private.h \
cogl-error.c \
cogl-closure-list-private.h \
cogl-closure-list.c \
cogl-fence.c \
cogl-fence-private.h \
deprecated/cogl-vertex-buffer-private.h \
deprecated/cogl-vertex-buffer.c \
deprecated/cogl-material-compat.c \
deprecated/cogl-program.c \
deprecated/cogl-program-private.h \
deprecated/cogl-auto-texture.c \
deprecated/cogl-shader-private.h \
deprecated/cogl-shader.c \
deprecated/cogl-clutter.c \
deprecated/cogl-framebuffer-deprecated.c \
$(NULL)
cogl_nonintrospected_h += cogl-glib-source.h
cogl_sources_c += cogl-glib-source.c
if SUPPORT_XLIB
cogl_deprecated_nonintrospected_h += deprecated/cogl-clutter-xlib.h
cogl_1_public_h += cogl-xlib-renderer.h
cogl_nonintrospected_h += \
winsys/cogl-texture-pixmap-x11.h \
cogl-xlib.h
cogl_sources_c += \
cogl-x11-renderer-private.h \
cogl-xlib-renderer-private.h \
cogl-xlib-renderer.c \
cogl-xlib.c \
cogl-xlib-private.h \
winsys/cogl-texture-pixmap-x11.c \
winsys/cogl-texture-pixmap-x11-private.h
endif
if SUPPORT_GLX
cogl_nonintrospected_h += cogl-glx.h
cogl_sources_c += \
cogl-glx-renderer-private.h \
cogl-glx-display-private.h \
winsys/cogl-winsys-glx-feature-functions.h \
winsys/cogl-winsys-glx-private.h \
winsys/cogl-winsys-glx.c
endif
if SUPPORT_WAYLAND_EGL_SERVER
cogl_nonintrospected_h += cogl-wayland-server.h
endif
if SUPPORT_EGL_PLATFORM_XLIB
cogl_sources_c += \
winsys/cogl-winsys-egl-x11.c \
winsys/cogl-winsys-egl-x11-private.h
endif
if SUPPORT_EGL
cogl_nonintrospected_h += cogl-egl.h
cogl_nodist_h += cogl-egl-defines.h
cogl_sources_c += \
cogl-egl-private.h \
winsys/cogl-winsys-egl.c \
winsys/cogl-winsys-egl-feature-functions.h \
winsys/cogl-winsys-egl-private.h
endif
mutterlibdir = $(libdir)/mutter-@LIBMUTTER_API_VERSION@
mutterlib_LTLIBRARIES = libmutter-cogl-@LIBMUTTER_API_VERSION@.la
libmutter_cogl_@LIBMUTTER_API_VERSION@_la_LIBADD = $(LIBM) $(COGL_DEP_LIBS) $(COGL_EXTRA_LDFLAGS)
if UNIT_TESTS
libmutter_cogl_@LIBMUTTER_API_VERSION@_la_LIBADD += $(top_builddir)/test-fixtures/libtest-fixtures.la
endif
# XXX: The aim is to eventually get rid of all private API exports
# for cogl-pango.
libmutter_cogl_@LIBMUTTER_API_VERSION@_la_LDFLAGS = \
-no-undefined \
-avoid-version \
-export-dynamic \
-rpath $(mutterlibdir) \
-export-symbols-regex "^(cogl|_cogl_debug_flags|_cogl_atlas_new|_cogl_atlas_add_reorganize_callback|_cogl_atlas_reserve_space|_cogl_callback|_cogl_util_get_eye_planes_for_screen_poly|_cogl_atlas_texture_remove_reorganize_callback|_cogl_atlas_texture_add_reorganize_callback|_cogl_texture_get_format|_cogl_texture_foreach_sub_texture_in_region|_cogl_texture_set_region|_cogl_profile_trace_message|_cogl_context_get_default|_cogl_framebuffer_get_stencil_bits|_cogl_clip_stack_push_rectangle|_cogl_framebuffer_get_modelview_stack|_cogl_object_default_unref|_cogl_pipeline_foreach_layer_internal|_cogl_clip_stack_push_primitive|_cogl_buffer_unmap_for_fill_or_fallback|_cogl_framebuffer_draw_primitive|_cogl_debug_instances|_cogl_framebuffer_get_projection_stack|_cogl_pipeline_layer_get_texture|_cogl_buffer_map_for_fill_or_fallback|_cogl_texture_can_hardware_repeat|_cogl_pipeline_prune_to_n_layers|_cogl_primitive_draw|test_|unit_test_|_cogl_winsys_glx_get_vtable|_cogl_winsys_egl_xlib_get_vtable|_cogl_winsys_egl_get_vtable|_cogl_closure_disconnect|_cogl_onscreen_notify_complete|_cogl_onscreen_notify_frame_sync|_cogl_winsys_egl_renderer_connect_common|_cogl_winsys_error_quark|_cogl_set_error|_cogl_poll_renderer_add_fd|_cogl_poll_renderer_add_idle|_cogl_framebuffer_winsys_update_size|_cogl_winsys_egl_make_current|_cogl_winsys_egl_ensure_current|_cogl_pixel_format_get_bytes_per_pixel).*"
libmutter_cogl_@LIBMUTTER_API_VERSION@_la_SOURCES = $(cogl_sources_c)
nodist_libmutter_cogl_@LIBMUTTER_API_VERSION@_la_SOURCES = $(BUILT_SOURCES)
# Cogl installed headers
cogl_headers = \
$(cogl_1_public_h) \
cogl-deprecated.h \
cogl-pango.h \
$(NULL)
cogl_base_includedir = $(includedir)/mutter-@LIBMUTTER_API_VERSION@
cogldeprecatedincludedir = $(cogl_base_includedir)/cogl/cogl/deprecated
cogldeprecatedinclude_HEADERS = $(cogl_deprecated_h) $(cogl_deprecated_nonintrospected_h)
coglincludedir = $(cogl_base_includedir)/cogl/cogl
coglinclude_HEADERS = $(cogl_headers) $(cogl_nonintrospected_h)
nodist_coglinclude_HEADERS = $(cogl_nodist_h) cogl-defines.h
cogl_proto_includedir = $(cogl_base_includedir)/cogl/cogl/gl-prototypes
cogl_proto_include_HEADERS = $(cogl_gl_prototypes_h)
EXTRA_DIST += \
cogl.symbols
-include $(INTROSPECTION_MAKEFILE)
INTROSPECTION_GIRS =
if HAVE_INTROSPECTION
Cogl-@LIBMUTTER_API_VERSION@.gir: libmutter-cogl-$(LIBMUTTER_API_VERSION).la Makefile
Cogl_@LIBMUTTER_API_VERSION@_gir_NAMESPACE = Cogl
Cogl_@LIBMUTTER_API_VERSION@_gir_VERSION = $(LIBMUTTER_API_VERSION)
Cogl_@LIBMUTTER_API_VERSION@_gir_LIBS = libmutter-cogl-$(LIBMUTTER_API_VERSION).la
if UNIT_TESTS
Cogl_@LIBMUTTER_API_VERSION@_gir_LIBS += $(top_builddir)/test-fixtures/libtest-fixtures.la
endif
Cogl_@LIBMUTTER_API_VERSION@_gir_FILES = $(cogl_1_public_h)
Cogl_@LIBMUTTER_API_VERSION@_gir_CFLAGS = $(AM_CPPFLAGS) $(COGL_DEP_CFLAGS) -UCOGL_COMPILATION -D__COGL_H_INSIDE__ -D__COGL_XLIB_H_INSIDE__ -D__COGL_EGL_H_INSIDE__ -D__COGL_GLX_H_INSIDE__ -DCOGL_GIR_SCANNING
Cogl_@LIBMUTTER_API_VERSION@_gir_INCLUDES = GL-1.0 GObject-2.0
Cogl_@LIBMUTTER_API_VERSION@_gir_EXPORT_PACKAGES = mutter-cogl-@LIBMUTTER_API_VERSION@
Cogl_@LIBMUTTER_API_VERSION@_gir_SCANNERFLAGS = --warn-all --c-include='cogl/cogl.h'
INTROSPECTION_GIRS += Cogl-@LIBMUTTER_API_VERSION@.gir
girdir = $(mutterlibdir)
gir_DATA = $(INTROSPECTION_GIRS)
typelibdir = $(mutterlibdir)
typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
CLEANFILES += $(gir_DATA) $(typelib_DATA)
endif

View File

@@ -1025,6 +1025,7 @@ cogl_atlas_texture_vtable =
FALSE, /* not primitive */
_cogl_atlas_texture_allocate,
_cogl_atlas_texture_set_region,
NULL, /* is_get_data_supported */
NULL, /* get_data */
_cogl_atlas_texture_foreach_sub_texture_in_region,
_cogl_atlas_texture_get_max_waste,

View File

@@ -199,6 +199,9 @@ struct _CoglDriverVtable
int level,
CoglError **error);
CoglBool
(* texture_2d_is_get_data_supported) (CoglTexture2D *tex_2d);
/* Reads back the full contents of the given texture and write it to
* @data in the given @format and with the given @rowstride.
*

View File

@@ -59,7 +59,6 @@ typedef struct
CoglSwapChain *swap_chain;
CoglBool need_stencil;
int samples_per_pixel;
CoglBool swap_throttled;
CoglBool depth_texture_enabled;
CoglBool stereo_enabled;
} CoglFramebufferConfig;
@@ -193,6 +192,11 @@ struct _CoglFramebuffer
CoglFramebufferBits bits;
int samples_per_pixel;
/* Whether the depth buffer was enabled for this framebuffer,
* usually means it needs to be cleared before being reused next.
*/
CoglBool depth_buffer_clear_needed;
};
typedef enum {

View File

@@ -116,6 +116,7 @@ _cogl_framebuffer_init (CoglFramebuffer *framebuffer,
framebuffer->viewport_age_for_scissor_workaround = -1;
framebuffer->dither_enabled = TRUE;
framebuffer->depth_writing_enabled = TRUE;
framebuffer->depth_buffer_clear_needed = TRUE;
framebuffer->modelview_stack = cogl_matrix_stack_new (ctx);
framebuffer->projection_stack = cogl_matrix_stack_new (ctx);
@@ -267,6 +268,13 @@ cogl_framebuffer_clear4f (CoglFramebuffer *framebuffer,
int scissor_y1;
CoglBool saved_viewport_scissor_workaround;
if (!framebuffer->depth_buffer_clear_needed &&
(buffers & COGL_BUFFER_BIT_DEPTH))
buffers &= ~(COGL_BUFFER_BIT_DEPTH);
if (buffers == 0)
return;
_cogl_clip_stack_get_bounds (clip_stack,
&scissor_x0, &scissor_y0,
&scissor_x1, &scissor_y1);
@@ -414,6 +422,9 @@ cleared:
_cogl_framebuffer_mark_mid_scene (framebuffer);
_cogl_framebuffer_mark_clear_clip_dirty (framebuffer);
if (buffers & COGL_BUFFER_BIT_DEPTH)
framebuffer->depth_buffer_clear_needed = FALSE;
if (buffers & COGL_BUFFER_BIT_COLOR && buffers & COGL_BUFFER_BIT_DEPTH)
{
/* For our fast-path for reading back a single pixel of simple

View File

@@ -65,8 +65,6 @@ struct _CoglOnscreen
void *foreign_update_mask_data;
#endif
CoglBool swap_throttled;
CoglList frame_closures;
CoglBool resizable;

View File

@@ -62,7 +62,6 @@ cogl_onscreen_template_new (CoglSwapChain *swap_chain)
else
onscreen_template->config.swap_chain = cogl_swap_chain_new ();
onscreen_template->config.swap_throttled = TRUE;
onscreen_template->config.need_stencil = TRUE;
onscreen_template->config.samples_per_pixel = 0;
@@ -86,14 +85,6 @@ cogl_onscreen_template_set_samples_per_pixel (
onscreen_template->config.samples_per_pixel = samples_per_pixel;
}
void
cogl_onscreen_template_set_swap_throttled (
CoglOnscreenTemplate *onscreen_template,
CoglBool throttled)
{
onscreen_template->config.swap_throttled = throttled;
}
void
cogl_onscreen_template_set_stereo_enabled (
CoglOnscreenTemplate *onscreen_template,

View File

@@ -85,23 +85,6 @@ cogl_onscreen_template_set_samples_per_pixel (
CoglOnscreenTemplate *onscreen_template,
int n);
/**
* cogl_onscreen_template_set_swap_throttled:
* @onscreen_template: A #CoglOnscreenTemplate template framebuffer
* @throttled: Whether throttling should be enabled
*
* Requests that any future #CoglOnscreen framebuffers derived from this
* template should enable or disable swap throttling according to the given
* @throttled argument.
*
* Since: 1.10
* Stability: unstable
*/
void
cogl_onscreen_template_set_swap_throttled (
CoglOnscreenTemplate *onscreen_template,
CoglBool throttled);
/**
* cogl_onscreen_template_set_stereo_enabled:
* @onscreen_template: A #CoglOnscreenTemplate template framebuffer

View File

@@ -557,20 +557,6 @@ cogl_onscreen_remove_swap_buffers_callback (CoglOnscreen *onscreen,
cogl_onscreen_remove_frame_callback (onscreen, closure);
}
void
cogl_onscreen_set_swap_throttled (CoglOnscreen *onscreen,
CoglBool throttled)
{
CoglFramebuffer *framebuffer = COGL_FRAMEBUFFER (onscreen);
framebuffer->config.swap_throttled = throttled;
if (framebuffer->allocated)
{
const CoglWinsysVtable *winsys =
_cogl_framebuffer_get_winsys (framebuffer);
winsys->onscreen_update_swap_throttled (onscreen);
}
}
void
cogl_onscreen_show (CoglOnscreen *onscreen)
{

View File

@@ -162,23 +162,6 @@ uint32_t
cogl_x11_onscreen_get_visual_xid (CoglOnscreen *onscreen);
#endif /* COGL_HAS_X11 */
/**
* cogl_onscreen_set_swap_throttled:
* @onscreen: A #CoglOnscreen framebuffer
* @throttled: Whether swap throttling is wanted or not.
*
* Requests that the given @onscreen framebuffer should have swap buffer
* requests (made using cogl_onscreen_swap_buffers()) throttled either by a
* displays vblank period or perhaps some other mechanism in a composited
* environment.
*
* Since: 1.8
* Stability: unstable
*/
void
cogl_onscreen_set_swap_throttled (CoglOnscreen *onscreen,
CoglBool throttled);
/**
* cogl_onscreen_show:
* @onscreen: The onscreen framebuffer to make visible
@@ -554,9 +537,8 @@ typedef void (*CoglSwapBuffersNotify) (CoglFramebuffer *framebuffer,
* registered callbacks will be called if this feature is not supported.</note>
*
* We recommend using this mechanism when available to manually throttle your
* applications (in conjunction with cogl_onscreen_set_swap_throttled()) so
* your application will be able to avoid long blocks in the driver caused by
* throttling when you request to swap buffers too quickly.
* applications so your application will be able to avoid long blocks in the
* driver caused by throttling when you request to swap buffers too quickly.
*
* Return value: a unique identifier that can be used to remove to remove
* the callback later.

View File

@@ -428,6 +428,14 @@ _cogl_sub_texture_set_region (CoglTexture *tex,
error);
}
static CoglBool
_cogl_sub_texture_is_get_data_supported (CoglTexture *tex)
{
CoglSubTexture *sub_tex = COGL_SUB_TEXTURE (tex);
return cogl_texture_is_get_data_supported (sub_tex->full_texture);
}
static CoglPixelFormat
_cogl_sub_texture_get_format (CoglTexture *tex)
{
@@ -458,6 +466,7 @@ cogl_sub_texture_vtable =
FALSE, /* not primitive */
_cogl_sub_texture_allocate,
_cogl_sub_texture_set_region,
_cogl_sub_texture_is_get_data_supported,
NULL, /* get_data */
_cogl_sub_texture_foreach_sub_texture_in_region,
_cogl_sub_texture_get_max_waste,

View File

@@ -1524,6 +1524,7 @@ cogl_texture_2d_sliced_vtable =
FALSE, /* not primitive */
_cogl_texture_2d_sliced_allocate,
_cogl_texture_2d_sliced_set_region,
NULL, /* is_get_data_supported */
NULL, /* get_data */
_cogl_texture_2d_sliced_foreach_sub_texture_in_region,
_cogl_texture_2d_sliced_get_max_waste,

View File

@@ -629,6 +629,15 @@ _cogl_texture_2d_set_region (CoglTexture *tex,
return TRUE;
}
static CoglBool
_cogl_texture_2d_is_get_data_supported (CoglTexture *tex)
{
CoglTexture2D *tex_2d = COGL_TEXTURE_2D (tex);
CoglContext *ctx = tex->context;
return ctx->driver_vtable->texture_2d_is_get_data_supported (tex_2d);
}
static CoglBool
_cogl_texture_2d_get_data (CoglTexture *tex,
CoglPixelFormat format,
@@ -677,6 +686,7 @@ cogl_texture_2d_vtable =
TRUE, /* primitive */
_cogl_texture_2d_allocate,
_cogl_texture_2d_set_region,
_cogl_texture_2d_is_get_data_supported,
_cogl_texture_2d_get_data,
NULL, /* foreach_sub_texture_in_region */
_cogl_texture_2d_get_max_waste,

View File

@@ -737,6 +737,7 @@ cogl_texture_3d_vtable =
TRUE, /* primitive */
_cogl_texture_3d_allocate,
_cogl_texture_3d_set_region,
NULL, /* is_get_data_supported */
_cogl_texture_3d_get_data,
NULL, /* foreach_sub_texture_in_region */
_cogl_texture_3d_get_max_waste,

View File

@@ -91,6 +91,8 @@ struct _CoglTextureVtable
CoglBitmap *bitmap,
CoglError **error);
CoglBool (* is_get_data_supported) (CoglTexture *texture);
/* This should copy the image data of the texture into @data. The
requested format will have been first passed through
ctx->texture_driver->find_best_gl_get_data_format so it should

View File

@@ -755,6 +755,7 @@ cogl_texture_rectangle_vtable =
TRUE, /* primitive */
_cogl_texture_rectangle_allocate,
_cogl_texture_rectangle_set_region,
NULL, /* is_get_data_supported */
_cogl_texture_rectangle_get_data,
NULL, /* foreach_sub_texture_in_region */
_cogl_texture_rectangle_get_max_waste,

View File

@@ -203,6 +203,15 @@ _cogl_texture_is_foreign (CoglTexture *texture)
return FALSE;
}
CoglBool
cogl_texture_is_get_data_supported (CoglTexture *texture)
{
if (texture->vtable->is_get_data_supported)
return texture->vtable->is_get_data_supported (texture);
else
return TRUE;
}
unsigned int
cogl_texture_get_width (CoglTexture *texture)
{

View File

@@ -511,6 +511,12 @@ CoglBool
cogl_texture_allocate (CoglTexture *texture,
CoglError **error);
/**
* cogl_texture_is_get_data_supported: (skip)
*/
CoglBool
cogl_texture_is_get_data_supported (CoglTexture *texture);
G_END_DECLS
#endif /* __COGL_TEXTURE_H__ */

View File

@@ -125,15 +125,6 @@ cogl_handle_ref (CoglHandle handle);
void
cogl_handle_unref (CoglHandle handle);
/**
* CoglFuncPtr:
*
* The type used by cogl for function pointers, note that this type
* is used as a generic catch-all cast for function pointers and the
* actual arguments and return type may be different.
*/
typedef void (* CoglFuncPtr) (void);
/* We forward declare this in cogl-types to avoid circular dependencies
* between cogl-matrix.h, cogl-euler.h and cogl-quaterion.h */
typedef struct _CoglMatrix CoglMatrix;

View File

@@ -59,7 +59,7 @@
#include "deprecated/cogl-framebuffer-deprecated.h"
CoglFuncPtr
GCallback
cogl_get_proc_address (const char* name)
{
_COGL_GET_CONTEXT (ctx, NULL);

View File

@@ -578,7 +578,6 @@ cogl_onscreen_get_gtype
cogl_onscreen_get_resizable
cogl_onscreen_hide
cogl_onscreen_new
cogl_onscreen_set_swap_throttled
cogl_onscreen_remove_dirty_callback
cogl_onscreen_remove_frame_callback
cogl_onscreen_remove_resize_callback
@@ -587,7 +586,6 @@ cogl_onscreen_remove_swap_buffers_callback
cogl_onscreen_resize_closure_get_gtype
#endif
cogl_onscreen_set_resizable
cogl_onscreen_set_swap_throttled
cogl_onscreen_show
cogl_onscreen_swap_buffers
cogl_onscreen_swap_buffers_with_damage
@@ -597,7 +595,6 @@ cogl_onscreen_template_get_gtype
#endif
cogl_onscreen_template_new
cogl_onscreen_template_set_samples_per_pixel
cogl_onscreen_template_set_swap_throttled
cogl_ortho

View File

@@ -106,7 +106,7 @@ cogl_features_available (CoglFeatureFlags features);
* Return value: a pointer to the requested function or %NULL if the
* function is not available.
*/
CoglFuncPtr
GCallback
cogl_get_proc_address (const char *name);
/**

View File

@@ -378,7 +378,11 @@ flush_depth_state (CoglContext *ctx,
if (ctx->depth_test_enabled_cache != depth_state->test_enabled)
{
if (depth_state->test_enabled == TRUE)
GE (ctx, glEnable (GL_DEPTH_TEST));
{
GE (ctx, glEnable (GL_DEPTH_TEST));
if (ctx->current_draw_buffer)
ctx->current_draw_buffer->depth_buffer_clear_needed = TRUE;
}
else
GE (ctx, glDisable (GL_DEPTH_TEST));
ctx->depth_test_enabled_cache = depth_state->test_enabled;

View File

@@ -110,6 +110,9 @@ _cogl_texture_2d_gl_copy_from_bitmap (CoglTexture2D *tex_2d,
int level,
CoglError **error);
CoglBool
_cogl_texture_2d_gl_is_get_data_supported (CoglTexture2D *tex_2d);
void
_cogl_texture_2d_gl_get_data (CoglTexture2D *tex_2d,
CoglPixelFormat format,

View File

@@ -470,7 +470,12 @@ allocate_custom_egl_image_external (CoglTexture2D *tex_2d,
{
CoglTexture *tex = COGL_TEXTURE (tex_2d);
CoglContext *ctx = tex->context;
CoglPixelFormat internal_format = loader->src.egl_image_external.format;
CoglPixelFormat external_format;
CoglPixelFormat internal_format;
external_format = loader->src.egl_image_external.format;
internal_format = _cogl_texture_determine_internal_format (tex,
external_format);
_cogl_gl_util_clear_gl_errors (ctx);
@@ -833,6 +838,15 @@ _cogl_texture_2d_gl_copy_from_bitmap (CoglTexture2D *tex_2d,
return status;
}
CoglBool
_cogl_texture_2d_gl_is_get_data_supported (CoglTexture2D *tex_2d)
{
if (tex_2d->gl_target == GL_TEXTURE_EXTERNAL_OES)
return FALSE;
else
return TRUE;
}
void
_cogl_texture_2d_gl_get_data (CoglTexture2D *tex_2d,
CoglPixelFormat format,
@@ -858,12 +872,12 @@ _cogl_texture_2d_gl_get_data (CoglTexture2D *tex_2d,
width,
bpp);
_cogl_bind_gl_texture_transient (GL_TEXTURE_2D,
_cogl_bind_gl_texture_transient (tex_2d->gl_target,
tex_2d->gl_texture,
tex_2d->is_foreign);
ctx->texture_driver->gl_get_tex_image (ctx,
GL_TEXTURE_2D,
tex_2d->gl_target,
gl_format,
gl_type,
data);

View File

@@ -705,6 +705,7 @@ _cogl_driver_gl =
_cogl_texture_2d_gl_get_gl_handle,
_cogl_texture_2d_gl_generate_mipmap,
_cogl_texture_2d_gl_copy_from_bitmap,
_cogl_texture_2d_gl_is_get_data_supported,
_cogl_texture_2d_gl_get_data,
_cogl_gl_flush_attributes_state,
_cogl_clip_stack_gl_flush,

View File

@@ -469,6 +469,7 @@ _cogl_driver_gles =
_cogl_texture_2d_gl_get_gl_handle,
_cogl_texture_2d_gl_generate_mipmap,
_cogl_texture_2d_gl_copy_from_bitmap,
NULL, /* texture_2d_is_get_data_supported */
NULL, /* texture_2d_get_data */
_cogl_gl_flush_attributes_state,
_cogl_clip_stack_gl_flush,

View File

@@ -79,6 +79,7 @@ _cogl_driver_nop =
_cogl_texture_2d_nop_get_gl_handle,
_cogl_texture_2d_nop_generate_mipmap,
_cogl_texture_2d_nop_copy_from_bitmap,
NULL, /* texture_2d_is_get_data_supported */
NULL, /* texture_2d_get_data */
_cogl_nop_flush_attributes_state,
_cogl_clip_stack_nop_flush,

View File

@@ -488,14 +488,13 @@ if have_introspection
namespace: 'Cogl',
includes: ['GL-1.0', 'GObject-2.0'],
dependencies: [cogl_deps],
extra_args: [
extra_args: introspection_args + [
'-UCOGL_COMPILATION',
'-D__COGL_H_INSIDE__',
'-D__COGL_XLIB_H_INSIDE__',
'-D__COGL_EGL_H_INSIDE__',
'-D__COGL_GLX_H_INSIDE__',
'-DCOGL_GIR_SCANNING',
'-U_GNU_SOURCE',
],
install_dir_gir: pkglibdir,
install_dir_typelib: pkglibdir,
@@ -518,15 +517,16 @@ install_headers([
install_headers(cogl_gl_prototype_headers,
subdir: join_paths(cogl_cogl_includedir, 'gl-prototypes'))
pkg.generate(
pkg.generate(libmutter_cogl,
name: 'Cogl',
filebase: libmutter_cogl_name,
description: 'An object oriented GL/GLES Abstraction/Utility Layer in mutter',
libraries: [libmutter_cogl, m_dep],
libraries: [m_dep],
subdirs: join_paths(pkgname, 'cogl'),
requires: [cogl_pkg_deps],
version: meson.project_version(),
variables: [
'apiversion=' + libmutter_api_version,
],
install_dir: pcdir,
)

View File

@@ -1162,6 +1162,7 @@ cogl_texture_pixmap_x11_vtable =
FALSE, /* not primitive */
_cogl_texture_pixmap_x11_allocate,
_cogl_texture_pixmap_x11_set_region,
NULL, /* is_get_data_supported */
_cogl_texture_pixmap_x11_get_data,
_cogl_texture_pixmap_x11_foreach_sub_texture_in_region,
_cogl_texture_pixmap_x11_get_max_waste,

View File

@@ -147,3 +147,11 @@ COGL_WINSYS_FEATURE_BEGIN (surfaceless_context,
"surfaceless_context\0",
COGL_EGL_WINSYS_FEATURE_SURFACELESS_CONTEXT)
COGL_WINSYS_FEATURE_END ()
#ifdef EGL_IMG_context_priority
COGL_WINSYS_FEATURE_BEGIN (context_priority,
"IMG\0",
"context_priority\0",
COGL_EGL_WINSYS_FEATURE_CONTEXT_PRIORITY)
COGL_WINSYS_FEATURE_END ()
#endif

Some files were not shown because too many files have changed in this diff Show More