Compare commits

...

222 Commits

Author SHA1 Message Date
Florian Müllner
52e5d6fc94 Bump version to 3.36.1
Update NEWS.
2020-03-30 21:29:03 +02:00
Robert Mader
09a6031c69 window-actor: Force full actor geometry sync when mapping
Normally we bail out in `sync_actor_geometry()`. The comment there
states:
```
Normally we want freezing a window to also freeze its position; this allows
windows to atomically move and resize together, either under app control,
or because the user is resizing from the left/top. But on initial placement
we need to assign a position, since immediately after the window
is shown, the map effect will go into effect and prevent further geometry
updates.
```

The signal for the initial sync originates in `MetaWindow` though and predates
`xdg_toplevel_set_maximized`, which again calls `meta_window_force_placement`,
triggering the signal too early. As a result, Wayland clients that start up
maximized have a wrong map animation, starting in the top-left corner.

In order to fix this without changing big parts of the geometry logic and risking
regressions, force the initial sync again before mapping.

Solution suggested by Jonas Ådahl.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1164
2020-03-30 15:59:48 +00:00
Robert Mader
dbe919ef92 wayland/surface: Check for surface role in meta_wayland_surface_get_window()
The function can get called without valid surface role, e.g. from
`zwp_xwayland_keyboard_grab_manager_grab()`.

Debugged by @piegamesde

Fixes https://gitlab.gnome.org/GNOME/mutter/-/issues/1147
2020-03-30 16:08:13 +02:00
Christian Rauch
2907ee93cc wayland/pointer-constraints: Fix typo
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1163
2020-03-29 19:48:33 +01:00
Carlos Garnacho
aa136f4515 cogl-pango: Special case alpha of 0 for color glyphs
Like ed10aea44d, but for color glyphs. Since they do use the alpha
component from the given color.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1161
2020-03-29 12:53:39 +00:00
Florian Müllner
8748841094 cogl: Export two more functions
cogl_object_[get|set]_value_object() are annotated as [get|set]-value-func
for objects and primitives, so they must be visible for any derived types
to be usable from introspection.

https://gitlab.gnome.org/GNOME/mutter/-/issues/1146
2020-03-29 12:17:11 +00:00
Florian Müllner
86f2885e98 cogl: Remove obsolete .map file
Obsolete since commit 6885c37784.

https://gitlab.gnome.org/GNOME/mutter/-/issues/1146
2020-03-29 12:17:11 +00:00
Carlos Garnacho
bb5ea0580f wayland: Translate delete-surrounding properly to protocols
IBusInputContext/ClutterInputFocus/GtkIMContext all go for offset+len
for their ::delete-surrounding signals, with offset being a signed int
(neg. to delete towards left of selection, pos. to delete towards right
of selection) and len being an unsigned int from the offset (and
presumably, skipping the current selection).

The text-input protocols however pass in this event two unsigned integers,
one being the length of text to delete towards the left of the selection,
and another the length of text to delete towards the right of the selection.

To translate properly these semantics, positive offsets shouldn't account
for before_length, and negative offset+len shouldn't account for after_length.
The offset/length approach may of course represent deletions that are
detached from the current cursor/selection, we simply delete the whole range
from the cursor/selection positions then.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/517
2020-03-29 11:37:27 +00:00
Takao Fujiwara
2cfdbbd730 clutter: Enable negative offsets in delete surrounding text
The input method can assign a negative value to
clutter_input_method_delete_surrounding() to move the cursor to the left.
But Wayland protocol accepts positive values in delete_surrounding() and
GTK converts the values to the negative ones in
text_input_delete_surrounding_text_apply().

https://gitlab.gnome.org/GNOME/mutter/issues/539
2020-03-29 11:37:27 +00:00
Jonas Dreßler
9f31e7252c backends/native: Release virtual buttons on dispose instead of finalize
GObject recommends to break references to other objects on dispose
instead of finalize, also we want to release the pressed virtual buttons
as early as possible if we know the object is getting destroyed.

So release the pressed buttons and unref our virtual
MetaInputDeviceNative when the dispose vfunc is called, which also
allows us to release the buttons immediately from javascript instead of
waiting for the garbage collector by calling run_dispose() on the
object.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1157
2020-03-28 16:55:59 +00:00
Carlos Garnacho
e8ea5ecd8a cogl-pango: Factor in default color alpha again
In commit d846fabda we moved to using the override color alpha, however
it was missed that the actor opacity is transferred to the PangoRenderer
through the default color alpha, and the reason it was used there.

We actually want to factor in both alpha values, in order to respect
both foreground color alpha and actor opacity. This is done on the
unpremultiplied color, so we just need to change the alpha value.

Fixes effects on text actors that involve actor opacity.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1158
2020-03-28 12:48:11 +01:00
Florian Müllner
ed10aea44d cogl-pango: Special case alpha of 0
pango_renderer_get_alpha() returns 0 to indicate that the alpha value
should be inherited from the environment, but we are passing it on
(and therefore making the text fully translucent).

Instead, make the text fully opaque as expected.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1156
2020-03-28 01:04:17 +01:00
Georges Basile Stavracas Neto
fed5f4d9aa window-actor: Inhibit culling when blitting to screencast
This allows us to screencast any window continuously, even
without it being visible. Because it's still being painted,
clients continue to receive frame callbacks, and people
are happy again.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1129
2020-03-27 23:29:58 +00:00
Georges Basile Stavracas Neto
73250b8f4c clutter/actor: Add culling inhibiting API
This will allow us to continue painting actors that are
outside the visible boundaries of the stage view.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1129
2020-03-27 23:29:58 +00:00
Georges Basile Stavracas Neto
f6700f19a7 window-stream-src: Finish framebuffer after blitting
Just like what's done for monitor screencasting. Unfortunately, there's
no mechanism to share fences with PipeWire clients yet, which forces
us to guarantee that a frame is completed after blitting.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1129
2020-03-27 23:29:58 +00:00
Georges Basile Stavracas Neto
ea34915df3 window-stream-src: Implement cursor blitting
A regression compared to the old code, we're not drawing the cursor
when on EMBEDDED mode.

Blit the cursor to the screencast framebuffer when on EMBEDDED mode.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1129
2020-03-27 23:29:58 +00:00
Georges Basile Stavracas Neto
37742c5cde window-stream-src: Ensure initial frame is recorded
MetaScreenCastWindowStreamSrc connects to the "damaged" signal of
MetaWindowActor. This signal is not exactly tied to the paint cycle
of the stage, and a damage may take quite a while to arrive when
a client doesn't want to draw anything. For that reason, the window
screencast can start empty, waiting for a damage to arrive.

Ensure at least one frame is recorded when enabling the window stream.

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

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1129
2020-03-27 23:29:57 +00:00
Georges Basile Stavracas Neto
cdd27d0e53 window-actor: Clip before translate when blitting
cogl_framebuffer_push_rectangle_clip() acts on the current modelview
matrix. That means the result of clipping then translating will be
different of the result of translating then clipping.

What we want for window screencasting is the former, not the latter.
Move the translation code (and associated) to after clipping.

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

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1129
2020-03-27 23:29:57 +00:00
Georges Basile Stavracas Neto
82778f72a4 window-actor: Shuffle some lines around
Move the CoglColor assignment right above the cogl_framebuffer_clear() call,
and let these wonderful partners together to delight us with an easier to
read code.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1129
2020-03-27 23:29:57 +00:00
Carlos Garnacho
d846fabda2 cogl-pango: Forward alpha from correct color
Use the override color alpha, if set.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1155
2020-03-27 23:33:38 +01:00
Carlos Garnacho
2d94a34a14 cogl-pango: Honor foreground alpha PangoAttribute
Instead of hardcoding 0xff as alpha, forward this attribute.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1155
2020-03-27 23:33:35 +01:00
Jonas Dreßler
92710d8f89 clutter/stage-cogl: Check for buffer age early
Fix a regression that got introduced with
c483b52d24 where we started passing the
redraw_clip to paint_stage() instead of creating a temporary view_region
for unclipped redraws: In case we detect an invalid buffer age, we fall
back to doing an unclipped redraw after we passed the first check
setting up may_use_clipped_redraw. That means we didn't reset the
redraw_clip to the view_rect, and we're now going to redraw the stage
using the original redraw clip even though we're swapping the full
framebuffer without damage.

To fix that, check for the buffer age before setting up the
fb_clip_region and the redraw_clip and set may_use_clipped_redraw to
FALSE if the buffer age is invalid, too. This ensures the redraw_clip is
always going to be correctly set to the view rect when we want to force
a full redraw.

Fixes https://gitlab.gnome.org/GNOME/mutter/issues/1128
2020-03-27 16:37:45 +00:00
Hans de Goede
da600b8400 cursor-renderer-native: Take panel-orientation into account for sprite transform
When calculating the transform we should apply to the cursor sprite
before uploading it to the cursor plane, we must also take into
account non upright mounted LCD panels.

Otherwise the cursor ends up 90 degrees rotated on devices where the
LCD panel is mounted 90 degrees rotated in its enclosure.

This commit fixes this by calling meta_monitor_logical_to_crtc_transform
in get_common_crtc_sprite_transform_for_logical_monitors to adjust the
transform for each Monitor in the LogicalMonitor.

Fixes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1123

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1153
2020-03-27 15:10:35 +00:00
Robert Mader
6aa546145f core: Demote tiff and bmp image formats in the clipboard manager
Support for them appears to be way less common than e.g. png, which is
currently the preferred format from Firefox, Chromium, Libreoffice and others.
Adopt to that fact.

As a side effect, this works around a bug observed when copying images in
Firefox on Wayland.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1141
2020-03-27 14:37:29 +00:00
Georges Basile Stavracas Neto
3956ffd5e8 cogl/driver: Remove GError from context_init
It is not used by anyone, let's just remove it.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1152
2020-03-27 09:01:43 -03:00
Georges Basile Stavracas Neto
05341221d4 cogl/renderer: Remove documentation of nonexistent enum
We don't want to delve into the philosohical study of the not-being,
so let's just not document an enum value that doesn't exist anymore.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1151
2020-03-26 18:44:13 -03:00
Georges Basile Stavracas Neto
95642d05a6 cogl/gl: Move shared functions to shared file
Cogl shares some GL functions between the GLES and the big
GL drivers. Namely, it shares _cogl_driver_gl_context_init
and _cogl_driver_gl_context_deinit between these two drivers.

The plot twist is: even though these functions are shared and
their prototypes are in cogl-util-gl-private.h, they're actually
implemented inside cogl-driver-gl.c, which is strictly only
about the big GL driver.

This is problematic when building Mutter on ARM v7, where we
need to disable OpenGL, but keep GLES enabled.

Fix this by moving the shared GL functions to a shared GL file.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1151
2020-03-26 18:43:32 -03:00
Georges Basile Stavracas Neto
51cd8aed96 ci: Add a new 'build-without-opengl-and-glx' step
To make sure we don't regress with this specific set of flags.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1151
2020-03-26 18:24:54 -03:00
Jonas Ådahl
ac01e69a67 window-wayland: Don't use grab op for some other window when resizing
When resizing a window interactively, we'll set a grab operation and a
grab window, among other things. If we're resizing (including setting
initial size, i.e. mapping) another window, that didn't change position,
don't use the gravity of the grab operation when resizing our own
window.

This fixes an issue with jumpy popup position when moving a previously
mapped gtk popover.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/999
2020-03-26 17:44:09 +01:00
Jonas Ådahl
a68e6972a2 cursor-renderer-native: Set cursor hotspot metadata on plane assignment
This triggers the paths in the legacy KMS backend to use
drmModeSetCursor2(), making virtual machines using "seamless mouse mode"
behave correctly again.

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

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1136
2020-03-26 16:18:28 +00:00
Jonas Ådahl
55cf1c1496 kms/plane-assignment: Add API to set cursor hotspot metadata
The transactional KMS API has been modelled after atomic KMS. Atomic KMS
currently doesn't support forwarding cursor hotspot metadata, thus it
was left out of the transactional KMS API having the user set the simply
create a plane assigment with the cursor sprite assigned to a cursor
plane using regular coordinates.

This, however, proved to be inadequate for virtual machines using
"seamless mouse mode" where they rely on the cursor position to
correspond to the actual cursor position of the virtual machine, not the
cursor plane. In effect, this caused cursor positions to look "shifted".

Fix this by adding back the hotspot metadata, right now as a optional
field to the plane assignment. In the legacy KMS implementation, this is
translated into drmModeSetCursor2() just as before, while still falling
back to drmModeSetCursor() with the plane coordinates, if either there
was no hotspot set, or if drmModeSetCursor2() failed.

Eventually, the atomic KMS API will learn about hotspots, but when
adding our own atomic KMS backend to the transacitonal KMS API, we must
until then still fall back to legacy KMS for virtual machines.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1136
2020-03-26 16:18:28 +00:00
Jonas Ådahl
343de21af5 monitor-transform: Add API to transform point
Transforms a point in a rectangle with the origin (0, 0). To be used to
transform cursor hotspots within a cursor sprite.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1136
2020-03-26 16:18:28 +00:00
Jonas Ådahl
3c157242fa cursor-sprite: Add API to get dimension
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1136
2020-03-26 16:18:28 +00:00
Jonas Ådahl
32c99513c8 clutter/actor: Inherit cloned painting when calculating resource scale
When calculating the resource scale of a clone source, we might end up
in situations where we fail to do so, even though we're in a paint. A
real world example when this may happen if this happens:

 * A client creates a toplevel window
 * A client creates a modal dialog for said toplevel window
 * Said client commits a buffer to the modal before the toplevel

If GNOME Shell is in overview mode, the window group is hidden, and the
toplevel window actor is hidden. When the clone tries to paint, it fails
to calculate the resource scale, as the parent of the parent (window
group) is not currently mapped. It would have succeeded if only the
clone source was unmapped, as it deals with the unmapped actor painting
by setting intermediate state while painting, but this does not work
when the *parent* of the source is unmapped as well.

Fix this by inheriting the unmapped clone paint even when calculating
the resource scale.

This also adds a test case that mimics the sequence of events otherwise
triggered by a client. We can't add a Wayland client to test this, where
we actually crash is in the offscreen redirect effect used by the window
dimming feature in GNOME Shell.

Fixes: https://gitlab.gnome.org/GNOME/mutter/-/issues/808

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1147
2020-03-26 11:42:23 +01:00
Jonas Ådahl
40c345d6f3 cursor-sprite-xcursor: Emulate Wayland hotspot limitations
For HiDPI pointer cursors backed by Wayland surfaces, the hotspot must
be placed using integers on the logical pixel grid. In practice what
this means is that if the client loads a cursor sprite with the buffer
scale 2, and it's hotspot is not dividable by 2, it will be rounded
down to an integer that can. E.g. a wl_surface with buffer scale 2 and a
cursor image with hotspot coordinate (7, 7) will have the coordinate
(3.5, 3.5) in surface coordinate space, and will in practice be rounded
down to (3, 3) as the hotspot position in wl_pointer only takes
integers.

To not potentially shift by 1 pixel on HiDPI monitors when switching
between wl_surface backend cursor sprites and built-in ones, make the
built in one emulate the restrictions put up by the Wayland protocol.

This also initializes the theme scale of the xcursor sprite instances to
1, as they may not have been set prior to being used, it'll only happen
in response to "prepare-at" signals being emitted prior to rendering.

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

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1107
2020-03-26 08:47:37 +00:00
Jonas Ådahl
8beef8ccd0 shaped-texture: Fix use-nearest check when viewports are scaled
We checked that the content size was appropriately painted in the stage,
but didn't take into account that the size of the sampled texture
region, meaning that when stage views were scaled, we'd think that we
would draw a texture scaled, as e.g. a 200x200 sized texture with buffer
scale 2 would have the size 100x100. When stage views were not scaled,
we'd apply a geometry scale meaning it'd end up as 200x200 anyway, thus
pass the check, but when stage views are scaled, it'd still be painted
as a 100x100 shaped texture on the stage, thus failing the
are-we-unscaled test.

Fix this by comparing the transformed paint size with the sampled size,
instead of the paint size again, when checking whether we are being
painted scaled or not. For example, when stage views are scaled, our
200x200 buffer with buffer scale 2, thus content size 100x100 will
transform to a 200x200 paint command, thus passing the test. For
non-scaled stage views, our 200x200 buffer with buffer scale 2 thus
content size 100x100 will also transform into a 200x200 paint command,
and will also pass the check, as the texture sample region is still
200x200.

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

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1124
2020-03-26 08:32:46 +00:00
Jonas Ådahl
62d0dd907b clutter-utils: Fix a couple of coding style issues
Multiple assignments on the same line were split up, so was a super long
line.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1124
2020-03-26 08:32:46 +00:00
Jonas Ådahl
0462208d4e crtc-xrandr: Respect configured RANDR panning
A user may have configured an output to be panning, e.g. using xrandr
--output <output> --mode <mode> --panning <size>. Respect this by making
the logical monitor use the panning size, instead of the mode. This
makes e.g. makes the background cover the whole panning size, and panels
etc will cover the whole top of the panned area, instead of just the top
left part covering the monitor if having panned to (0, 0).

No support is added to configuring panning, i.e. a panned monitor
configuration cannot be stored in monitors.xml.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1085
2020-03-26 09:24:25 +01:00
Jonas Ådahl
6885c37784 cogl: Mark exported cogl symbols using COGL_EXPORT
Just like libmutter-clutter, and libmutter, mark exported symbols with
an COGL_EXPORT macro. This removes the .map and .map.in files previously
used, containing a list of semi private symbols. This symbol was out of
date, i.e. pointed to non-existing symbols, and was also replaced with
COGL_EXPORT macros.

unit_test_* symbols are exported by the help of the unit test defining
macro. test_* symbols are no longer supported as it proved unnecessary.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1059
2020-03-26 09:05:38 +01:00
Jonas Ådahl
238e41d493 cogl: Install cogl-trace.h and include from cogl.h
This is so that cogl-trace.h can start using things from cogl-macros.h,
and so that it doesn't leak cogl-config.h into the world, while exposing
it to e.g. gnome-shell so that it can make use of it as well. There is
no practical reason why we shouldn't just include cogl-trace.h via
cogl.h as we do with everything else.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1059
2020-03-26 09:05:38 +01:00
Carlos Garnacho
8699482475 backends: Check both input settings and mapper for tablet monitors
The upper layers (OSDs basically) want to know the monitor that a
tablet is currently assigned to, not the monitor just as configured
through settings.

This broke proper OSD positioning for display-attached tablets since
commit 87858a4e01, as the MetaInputMapper kicks in precisely when
there is no configured monitor for the given device.

Consulting both about the assigned output will make OSDs pop up
again in the right place.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/971
2020-03-25 19:09:32 +00:00
Carlos Garnacho
dcaa45fc0c backends/x11: Implement is_grouped for X11
If the devices have a wacom description, compare those. Otherwise,
look up the devices' VID:PID, if they match they should also be
grouped.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/971
2020-03-25 19:09:32 +00:00
Carlos Garnacho
3c4f5ddcb4 core: Let pad mode switch events always go through MetaInputSettings
We used to inhibit all pad actions while the OSD is shown, but one we
would actually want to handle are mode switches while the OSD is open.
So it has an opportunity to catch up to the mode switch.

This lets MetaInputSettings reflect the mode switch (eg. when querying
action labels), so the OSD has an opportunity to update the current
actions.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/975
2020-03-25 19:56:09 +01:00
Carlos Garnacho
3aece84499 cogl-pango: Make color glyphs unaffected by foreground color
Making color glyphs affected by the foreground color makes them become
"tinted" on any other color than white. Make it sure we always paint
those white by checking the cached glyph value, the foreground color
will be reset on the next iteration through glyphs.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/850

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1148
2020-03-25 11:14:33 +00:00
Carlos Garnacho
40fb06ca17 cogl-pango: Cache whether glyphs are backed up by a color font
This will be necessary later on.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1148
2020-03-25 11:14:33 +00:00
Florian Müllner
d4c070da88 window: Really propagate effective on-all-workspaces setting to transients
Commit cda9579034 fixed a corner case when setting the initial workspace
state of transient windows, but it still missed a case:

should_be_on_all_workspaces() returns whether the window should be on all
workspaces according to its properties/placement, but it doesn't take
transient relations into account.

That means in case of nested transients, we can still fail the assert:

 1. on-all-workspaces toplevel
 2. should_be_on_all_workspaces() is TRUE for the first transient's parent,
    as the window from (1) has on_all_workspaces_requested == TRUE
 3. should_be_on_all_workspaces() is FALSE for the second transient's
    parent, as the window from (2) is only on-all-workspace because
    of its parent

We can fix this by either using the state from the root ancestor
instead of the direct transient parent, or by using the parent's
on_all_workspaces_state.

The latter is simpler, so go with that.

https://gitlab.gnome.org/GNOME/mutter/issues/1083
2020-03-24 18:15:33 +00:00
Carlos Garnacho
d052f9c070 backends: Drop internal WacomDevice in MetaInputSettings
Use the one from MetaInputDevice instead. Since we no longer try
to ask for WacomDevices that weren't first retrieved:

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

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1109
2020-03-24 18:07:31 +00:00
Carlos Garnacho
3b88af94e3 backends/x11: Drop internal WacomDevice lookups
Just use the ones from MetaInputDevice.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1109
2020-03-24 18:07:31 +00:00
Carlos Garnacho
1f00aba92c backends: Add MetaInputDevice derivable class
This class sits between ClutterInputDevice and the backend implementations,
it will be the despositary of features we need across both backends, but
don't need to offer through Clutter's API.

As a first thing to have there, add a getter for a WacomDevice. This is
something scattered across and somewhat inconsistent (eg. different places
of the code create wacom devices for different device types). Just make it
here for all devices, so users can pick.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1109
2020-03-24 18:07:31 +00:00
Carlos Garnacho
ec1195e3ff backends: Fix configuration changes to tap[-and-drag]
Most people just see a harmless warning when applying this setting to
all touchpads (which this patch fixes). But tap[-and-drag] is supposed
to remain enabled for display-less Wacom tablets, despite configuration
changes.

Fix this by using the mapping function, so the setting is forced on for
wacom devices. This happens on a per-device basis, so the warning is
gone too.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1145
2020-03-24 17:05:12 +00:00
Carlos Garnacho
18b661cc93 backends: Add mapping function arg to settings_set_bool_setting()
This will be useful to actually determine on a per-device basis the
setting being applied, while still doing changes on a per-device-type
basis.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1145
2020-03-24 17:05:12 +00:00
Carlos Garnacho
8592a8591b wayland: Handle NULL preedit text
The preedit text may be NULL (eg. when unsetting it). This started
causing crashes since commit db9b60cc63, duh.

Fixes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1132
2020-03-24 16:07:44 +00:00
Peter Hutterer
7fa7c2aeb7 backends: use the enum name instead of a literal 0
No functional change.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1144
2020-03-24 15:46:43 +10:00
Robert Mader
41130b08eb surface-actor: Add culling offset for geometry scale
This fixes a case that was overlooked in
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1036 - when we
have a geometry scale > 1 and Wayland subsurfaces that have an offset
to their parent surface (which is often the case when the toplevel surface
includes decoration/shadows etc.), we have to add extra offset to their
opaque regions so they match their 'visible' location.

This is necessary as `meta_cullable_cull_out_children` moves the coordinate
system during culling, but does not know about geometry scale.

Also, remove the redundant check for `window_actor` - we only hit this code
path if a `window_actor` culls out its children.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1108
2020-03-23 20:28:59 +01:00
Robert Mader
1d20045247 surface-actor: Fix memory leak
When we create a new region for an opaque texture we need to free it.
While on it, simplify the check slightly.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1108
2020-03-23 18:10:28 +00:00
Carlos Garnacho
c131a9b7fa backends/x11: Observe multiple pad mode switch buttons in a group
Some tablets like the Cintiq 24HDT have several mode switch buttons
per group. Those are meant to jump straight to a given mode, however
we just handle cycling across modes (as most other tablets have a
single mode switch button per group).

So spice up the mode switch handling so we handle multiple mode
switch buttons, assigning each of them a mode. If the device only
has one mode switch button, we do the old-fashioned cycling.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/970
2020-03-20 21:30:30 +01:00
Carlos Garnacho
2ecbf6d746 x11: Handle windowing errors while writing selection INCR data
This error was just logged but not raised. Do as the code comment said
and raise a pipe error at that moment, and for subsequent operations
on the output stream (although none besides close() should be expected
after propagating the error properly).

Related: https://gitlab.gnome.org/GNOME/mutter/issues/1065
2020-03-20 16:14:07 +01:00
Daniel Șerbănescu
a13d60aae5 Update Romanian translation 2020-03-19 10:59:57 +00:00
Robert Mader
ed4b80cee5 clutter/stage: Rename parameters to match documentation
To silence warnings during GIR generation.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1133
2020-03-18 02:45:43 +01:00
Jonas Ådahl
0a6034ef3a monitor-manager: Remove 'mirror' capability
With per-CRTC views, there is nothing stopping NVIDA EGLStream based
rendering to not support monitor mirroring, so lets remove that
restriction.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1098
2020-03-18 00:46:20 +00:00
Jonas Ådahl
c9a5b2b22f kms-impl-simple: Handle lack of cached mode set in flip fallback
When a page flip fails with a certain error code, we've treated this as
a hint that page flipping is broken and we should try to use mode
setting instead.

On some drivers, it seems that this error is also reported when there
was no mode set, which means we'll have no cached mode set to use in the
fallback. The lack of prior mode set tends to happen when we hit a race
when the DRM objects change before we have the time to process a hotplug
event.

Handle the lack a missing mode set in the flip fallback path, with the
assumption that we'll get a hotplug event that'll fix things up for us
eventually.

Closes: https://gitlab.gnome.org/GNOME/mutter/issues/917
2020-03-18 00:33:03 +00:00
Carlos Garnacho
db9b60cc63 wayland: Represent preedit string cursor offset in bytes
Both IBus and ClutterInputFocus work in character offsets for the cursor
position in the preedit string. However the zwp_text_input protocol does
define the preedit string cursor offset to be in bytes.

Fixes client bugs in representing the caret within the preedit string,
as we were clearly giving the wrong offset.

Fixes: https://gitlab.gnome.org/GNOME/gtk/issues/2517

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1132
2020-03-17 22:15:52 +00:00
Jonas Ådahl
fa74da0039 wayland/window: Ignore state changes for popups
We send configure events for state changes e.g. for `appears-focused`,
etc. What we don't want to do is to do this for popup windows, as in
Wayland don't care about this state.

When the focus mode was configured to "sloppy focus" we'd get
`appears-focused` state changes for the popup window only by moving the
mouse cursor around, and while a popup may care about focus, it does not
care about related appearance, as there is no such state in xdg_popup.

What these state changes instead resulted in was absolute window
configuration events, intended for toplevel (xdg_toplevel) windows. In
the end this caused the popup to be positioned aginst at (0, 0) of the
parent window, as the assumptions when the configuration of the popup
was acknowledged is that it had received a relative position window
configuration.

Fix this by simply ignoring any state changes of the window if it is a
popup, meaning we won't send any configuration events intended for
toplevels for state changes. Currently we don't have any way to know
this other than checking whether it has a placement rule. Cleaning up
MetaWindow creation is left to be dealt with another day.

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

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1122
2020-03-17 21:59:02 +00:00
Corentin Noël
b310e1d9d7 clutter-stage: Add annotations to clutter_stage_capture
Especially document that out_captures is an array that is given as output.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1131
2020-03-17 15:14:57 +01:00
Corentin Noël
0053ef2e16 cogl-texture: Add some missing array annotations
This allows bindings to correctly understand that it is an array

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1130
2020-03-17 13:30:31 +01:00
Robert Mader
4133b73632 cursor-renderer/native: Skip hw cursor upload if we can't use it
If the CRTCs the cursor is visible on do not share a common scale
and transform, we can't use the cursor hardware plane as we only have one.
We therefore fall back to software / gl cursor.

The check for that currently happens after we tried to upload the cursor image
to the hardware plane though.
This is made worse by the fact that in the scaling step, where we scale the
cursor image to the desired size, until now we expected a valid common scale -
otherwise scaling the image by an uninitialized float.

Make sure we bail out early during the scale/upload step if we don't have common
scales and transforms - to avoid that bug and save some unnecessary work.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1125
2020-03-16 21:51:30 +01:00
Daniel van Vugt
074f4974dd input-settings: Specify middle-click-emulation key
Which exists, unlike `emulate-middle`.

Closes: https://gitlab.gnome.org/GNOME/mutter/issues/1124
2020-03-16 15:09:00 +08:00
Andrew Gaul
0700f3749f input-settings/x11: Fix typo in has_udev_property
https://gitlab.gnome.org/GNOME/mutter/merge_requests/256
2020-03-15 13:04:32 +09:00
Andrew Gaul
0487e6f11f input-settings: Wire up middle-emulation
This allows emulating middle click via simultaneous left and right
click.  Fixes #238.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/256
2020-03-15 13:04:32 +09:00
Carlos Garnacho
23da6c2426 keybindings: Check the special modifiers specifically
Make sure it is only the special modifier (hardcoded to 1 currently)
which is being pressed (not counting locked modifiers) before notifying
that the special modifier is pressed, as we are interested in it being
pressed alone and not in combination with other modifier keys.

This helps in two ways:
- Pressing alt, then ctrl, then releasing both won't trigger the locate
  pointer action.
- Pressing alt, then ctrl, then down/up to switch workspace won't interpret
  the last up/down keypress as an additional key on top of the special ctrl
  modifier, thus won't be forwarded down to the focused client in the last
  second.

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

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1014
2020-03-13 21:37:32 +01:00
Carlos Garnacho
67dd0b4fec keybindings: Avoid double calls to process_event() on the same event
If you first press a key that triggers the "special modifier key" paths
(ctrl, super), and then press another key that doesn't match (yet?) any
keybindings (eg. ctrl+alt, super+x), the second key press goes twice
through process_event(), once in the processing of this so far special
combination and another while we let the event through.

In order to keep things consistent, handle it differently depending on
whether we are a wayland compositor or not. For X11, consider the event
handled after the call to process_event() in process_special_modifier_key().
For Wayland, as XIAllowEvents is not the mechanism that allows clients see
the key event, we can just fall through the regular paths, without this
special handling.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1014
2020-03-13 21:22:28 +01:00
Andre Moreira Magalhaes
6989fea767 cogl: Fix build error when GL_ARB_sync is not defined
Commit 41992757e0 introduced a change to use CoglContext.glFenceSync
but this method is only available when GL_ARB_sync is defined (as
defined on gl-prototypes/cogl-all-functions.h).

This change fixes that.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1123
2020-03-12 18:05:10 -03:00
Corentin Noël
df33255162 cogl: Add main header for Cogl
This allows bindings linking to the C header to actually have the right one.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1101
2020-03-12 13:35:25 +00:00
Jonas Ådahl
5319949a45 kms-impl-device: Clean up state if drm resources disappear
It may happen that drmModeGetResources() starts returning NULL. Handle
this gracefully by removing all connectors, CRTCs and planes making the
device in practice defunct.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1121
2020-03-12 13:08:46 +00:00
Alynx Zhou
aba0b9ef64 keybindings: Move common window grab code out of X-only if statement
`3c8d4171` moved some common codes into X11-only code blocks by mistake,
and it prevents keyboard window resize/move mode under Wayland because
those variables are unset. This commit fixed it via moving such common
codes out of X11-only code blocks.

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

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/997
2020-03-12 08:42:04 +00:00
Jonas Ådahl
512bb7d1cd wayland: Don't crash when trying to fullscreen on inert wl_output
There is a race where an output can be used as a fullscreen target, but
it has already been removed due to a hotplug. Handle this gracefully by
ignoring said output in such situations.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1120
2020-03-11 14:37:09 +00:00
Jonas Ådahl
d2a12ee0fa crtc-xrandr: Compare right coordinate when checking assignment
Compare x with x, and y with y, not y with x.

Fixes an issue where only changing the scale doesn't actually apply the
new scale.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1119
2020-03-11 13:02:50 +00:00
Jonas Ådahl
531a195cf1 monitor-config-manager: Respect layout mode when calculating CRTC layout
The scale used when calculating the CRTC layout should only come from
the logical monitor scale if the layout mode of the corresponding
configuration is 'logical'.

This fixes an issue where the X11 screen size accidentally got set to a
size scaled down by the configured global UI scale.

Fixes: https://gitlab.gnome.org/GNOME/mutter/issues/1107
Fixes: https://gitlab.gnome.org/GNOME/mutter/issues/1109

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1118
2020-03-11 12:55:03 +00:00
Sebastian Keller
509e9ca5a0 xwayland: Fix mime type atom list leak on DnD with more than 3 types
Found using the clang static analyzer

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1117
2020-03-11 03:21:36 +01:00
Olivier Fourdan
0743381573 window/x11: Rename meta_window_x11_buffer_rect_to_frame_rect
To keep consistent and avoid confusion, rename the function:
    `meta_window_x11_buffer_rect_to_frame_rect()`
to:
    `meta_window_x11_surface_rect_to_frame_rect()`

As this function doesn't deal with the `window->buffer_rect` at all.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1091
2020-03-10 14:52:26 +01:00
Olivier Fourdan
267f712068 window-actor/x11: Use the new MetaShapedTexture API
The code in `build_and_scan_frame_mask` predates the introduction of the
`MetaShapedTexture` API to get the texture width hand height.

Use the new `meta_shaped_texture_get_width/height` API instead of using
the CoGL paint texture.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1091
2020-03-10 14:52:26 +01:00
Olivier Fourdan
0b102afb53 xwayland: Update regions on texture updates
For X11 clients running on Wayland, the actual texture is set by
Xwayland.

The shape, input and opaque regions, however are driven by X11
properties meaning that those may come at a different time than the
actual update of the content.

This results in black areas being visible at times on resize with
Xwayland clients.

To make sure we update all the regions at the same time the buffer is
updated, update the shape, input and opaque regions when the texture is
committed from when the Xwayland surface state is synchronized.

That fixes the remaining black areas being sometimes visible when
resizing client-side decorations windows on Xwayland.

Closes: https://gitlab.gnome.org/GNOME/mutter/issues/1007
https://gitlab.gnome.org/GNOME/mutter/merge_requests/1091
2020-03-10 14:52:26 +01:00
Olivier Fourdan
304a103659 window-actor: Add API to update regions
For X11 clients running on Xwayland, the opaque, input and shape regions
are processed from different properties and may occur at a different
time, before the actual buffer is eventually committed by Xwayland.

Add a new API `update_regions` to window actor to trigger the update of
those regions when needed.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1091
2020-03-10 14:52:26 +01:00
Olivier Fourdan
2d09e95934 window-actor/x11: Compute client area from surface size
Commit 7dbb4bc3 cached the client area when the client was frozen.

This is not sufficient though, because the buffer size might still be
lagging waiting for the buffer from Xwayland to be committed.

So instead of caching the client size from the expected size, deduce the
client area rectangle from the surface size, like we did for the frame
bounds in commit 1ce933e2.

This partly reverts commit 7dbb4bc3 - "window-actor/x11: Cache the
client area"

https://gitlab.gnome.org/GNOME/mutter/issues/1007
https://gitlab.gnome.org/GNOME/mutter/merge_requests/1091
2020-03-10 14:52:26 +01:00
Olivier Fourdan
be11525b28 window/x11: Add function to convert the surface to client area
Add a convenient function to get the client area rectangle from a given
surface rectangle.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1091
2020-03-10 14:52:26 +01:00
Robert Mader
adc38f902a window-actor/X11: Update shape, input and opaque region in order
As they depend on each other to be correct, we should set all of them
in the correct order. As we do already have a function for that, use it.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1091
2020-03-10 14:52:26 +01:00
Pekka Paalanen
8abdf16a39 cursor-renderer/native: Handle GPU hotplug
Listen for GPU hotplug events to initialize their cursor support.

This fixes one reason for why DisplayLink devices may not be using a hardware
cursor. Particularly, when a DisplayLink device is hotplugged for the first
time such that EVDI creates a new DRM device node after gnome-shell has already
started, we used to forget to initialize the cursor support.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1097
2020-03-10 08:26:17 +00:00
Pekka Paalanen
4cc29cfb61 cursor-renderer/native: Refactor init to per-gpu
Extract the code to initialize a single GPU cursor support into its own
function. The new function will be used by GPU hotplug in the future.

This is a pure refactoring without any behavioral changes.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1097
2020-03-10 08:26:17 +00:00
Mart Raudsepp
121c5d2a92 meson: Expand on xwayland_initfd option description
https://gitlab.gnome.org/GNOME/mutter/merge_requests/1104
2020-03-09 17:59:25 +00:00
Olivier Fourdan
50ff30bf2b xwayland: Log actual error message if available
If X11 initialization fails, print the actual error message if the error
is set, to help with debugging.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1102
2020-03-09 17:49:51 +00:00
Jonas Ådahl
26e1e495a0 screen-cast-stream-src: Don't leak GSource
For every stream src, we created and attached a GSource. Upon stream
src destruction, we g_source_destroy():ed the GSource. What
g_source_destroy() does, hawever, is not really "destroy" it but only
detaches it from the main context removing the reference the context had
added for it via g_source_attach(). This caused the GSource to leak,
although in a detached state, as the reference taken on creation was
still held.

Fix this by also removing our own reference to it when finalizing.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1106
2020-03-09 17:31:23 +00:00
Jonas Ådahl
480e7d44be screen-cast-stream-src: Don't complain when we can't dequeue buffer
PipeWire will be unable to dequeue a buffer if all are already busy.
This can happen for valid reasons, e.g. the stream consumer not being
fast enough, so don't complain in the journal if it happens.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1115
2020-03-09 17:46:54 +01:00
Марко Костић
1c1adb0036 Update Serbian translation 2020-03-08 20:20:38 +00:00
Florian Müllner
6b852e6cb3 Bump version to 3.36.0
Update NEWS.
2020-03-07 22:51:06 +01:00
Jonas Ådahl
6e966e47f2 cursor-renderer-native: Handle lack of cursor planes gracefully
While we will always have cursor planes, as we'll currently create fake
ones when real ones are missing (See #1058), eventually we will run into
situations where we can't create fake ones, for example for atomic KMS
drivers that don't advertise any cursor planes.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1079
2020-03-07 21:40:50 +00:00
Jonas Ådahl
227eea1e31 kms-impl-simple: Add fake cursor planes if no real ones
Non-atomic drivers may support drmModeSetCursor() even if no cursor
plane is advertised. To deal with this, add a fake cursor plane for
every CRTC when using MetaKmsImplSimple. This will eventually be
translated to drmModeSetCursor() calls without any explicit cursor plane
usage.

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

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1079
2020-03-07 21:40:50 +00:00
Nathan Follens
79920d66d4 Update Dutch translation 2020-03-07 21:11:51 +00:00
Jonas Ådahl
6cd0aa429f window: Force placement for first placement rule
If we don't force the placement, we enter the constrain machinery with
the position (0, 0), meaning we always get the "current work area" setup
to correspond to whatever logical monitor was at that position.

Avoid this by doing the same as "meta_window_force_placement()" and set
"window->calc_placement" to TRUE while move-resizing, causing the
move-resize to first calculate the initial position.

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

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1110
2020-03-06 17:28:09 +01:00
Aman Alam
15d3de0099 Update Punjabi translation 2020-03-05 03:53:57 +00:00
Andre Klapper
38fb59a6a6 Fix broken markup in Welsh UI translation 2020-03-05 00:43:05 +01:00
Daniel Korostil
748f5bb3e6 Update Ukrainian translation 2020-03-04 16:47:45 +00:00
Milo Casagrande
3c55475391 Update Italian translation 2020-03-03 10:43:50 +00:00
Guillaume Bernard
dd6e371bac Update French translation 2020-03-03 08:31:16 +00:00
Anders Jonsson
00d900e46d Update Swedish translation 2020-03-02 18:50:50 +00:00
Goran Vidović
a4f11bef47 Update Croatian translation 2020-03-01 15:55:04 +00:00
Aurimas Černius
c4f76622a6 Updated Lithuanian translation 2020-03-01 14:48:05 +02:00
Florian Müllner
f80e5dd8e4 Bump version to 3.35.92
Update NEWS.
2020-03-01 02:25:34 +01:00
Matej Urbančič
f484efaac1 Updated Slovenian translation 2020-02-29 22:48:56 +01:00
Jonas Ådahl
f97804f4f4 wayland/xdg-shell: Add support for explicit popup repositioning
This commit completes the implementation of `xdg_wm_base` version 3,
which introduces support for synchronized implicit and explicit popup
repositioning.

Explicit repositioning works by the client providing a new
`xdg_positioner` object via a new request `xdg_popup.reposition`. If the
repositioning is done in combination with the parent itself being
reconfigured, the to be committed state of the parent is provided by the
client via the `xdg_positioner` object, using
`xdg_positioner.set__parent_configure`.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/705
2020-02-29 21:01:50 +00:00
Jonas Ådahl
5c37f5104e wayland/xdg-shell: Add support implicit popup moving
This sets the `is_reactive` flag on the window placement rules, causing
the popups to be reconfigured as they are affected by environmental
changes, such as the parent moving in a way making the popup partially
offscreen.

As with synchronization, the implementation is dormant, as the
version of the advertised global isn't bumped yet, as the new protocol
version is not yet fully implemented.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/705
2020-02-29 21:01:50 +00:00
Jonas Ådahl
d08a8de265 window: Implement asynchronous popup moving
This commits adds support on the MetaWindow and constraints engine side
for asynchronously repositioning a window with a placement rule, either
due to environmental changes (e.g. parent moved) or explicitly done so
via `meta_window_update_placement_rule()`.

This is so far unused, as placement rules where this functionality is
triggered are not yet constructed by the xdg-shell implementation, and
no users of `meta_window_update_placement_rule()` exists yet.

To summarize, it works by making it possible to produce placement rules
with the parent rectangle a window should be placed against, while
creating a pending configuration that is not applied until acknowledged
by the client using the xdg-shell configure/ack_configure mechanisms.

An "temporary" constrain result is added to deal with situations
where the client window *must* move immediately even though it has not yet
acknowledged a new configuration that was sent. This happens for example
when the parent window is moved, causing the popup window to change its
relative position e.g. because it ended up partially off-screen. In this
situation, the temporary position corresponds to the result of the
movement of the parent, while the pending (asynchronously configured)
position is the relative one given the new constraining result.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/705
2020-02-29 21:01:50 +00:00
Jonas Ådahl
6c82feb1b8 wayland/window-configuration: Track resize flags and gravity too
Will later be used to determine in what way a pending configuration will
resize.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/705
2020-02-29 21:01:50 +00:00
Jonas Ådahl
0dac91cffc Add MetaGravity and replace X11 equivalent with it
MetaGravity is an enum, where the values match the X11 macros used for
gravity, with the exception that `ForgetGravity` was renamed
`META_GRAVITY_NONE` to have less of a obscure name.

The motivation for this is to rely less on libX11 data types and macros
in generic code.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/705
2020-02-29 21:01:50 +00:00
Jonas Ådahl
ff381d1d52 constraints: Pass constrained relative coordinates to window impl
A placement rule placed window positions itself relative to its parent,
thus converting between relative coordinates to absolute coordinates,
then back to relative coordinates implies unwanted restrictions for
example when the absolute coordinate should not be calculated againts
the current parent window position.

Deal with this by keeping track of the relative position all the way
from the constraining engine to the move-resize window implementation.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/705
2020-02-29 21:01:50 +00:00
Jonas Ådahl
05e9d6ab9e window: Put placement related fields in a anynomous struct
To organize things a bit better, put the fields related to the placement
rule state in its own anonymous struct inside MetaWindow. While at it,
rename the somewhat oddly named variable that in practice means the
current relative window position.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/705
2020-02-29 21:01:50 +00:00
Jonas Ådahl
d22f947bf5 wayland/window: Pass popup configuration using relative coordinates
After popup placement rules have gone through the constraints engine has
ended up resulting in an actual move, pass the window configuration down
the path using relative coordinates, as that is what the next layer
(xdg-shell implementation) actually cares about.

In the future, this will also be helpful when the configured position is
not against the current state of the parent.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/705
2020-02-29 21:01:50 +00:00
Jonas Ådahl
9b97e5ed58 place: Make placement rule processing provide relative coordinates
A placement rule is always about placing a window relative to its
parent. In order to eventually place it against predicted future parent
positions, make the placement rule processing output relative
coordinates, having the caller deal with turning them into absolute.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/705
2020-02-29 21:01:50 +00:00
Jonas Ådahl
7f9fac2ba2 window/wayland: Don't inhibit finishing moves if any window is resized
meta_window_wayland_finish_move_resize() inhibited window moves to be
finished if there was a resize grab active at the time, in order to
handle window resizing. Change this to only affect the grabbed window
itself, so that e.g. a popup can be positioned according to a pending
configuration while there is an active resize grab.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/705
2020-02-29 21:01:50 +00:00
Carlos Garnacho
64eaf70279 xwayland: Allow setting up maintenance processes
This is made a signal, so the upper layers (read: gnome-shell) may
decide what services to spawn. The signal argument contains a task
that will resume MetaX11Display startup after it is returned upon.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/945
2020-02-29 20:41:26 +00:00
Carlos Garnacho
e3149e6021 wayland: Pass private X connection on GNOME_SETUP_DISPLAY
This envvar will be picked up by the services spawned together with Xwayland
startup, and used instead of the regular DISPLAY meant for regular clients.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/945
2020-02-29 20:41:26 +00:00
Carlos Garnacho
166a464515 wayland: Set up initialization X11 socket
This is used by GDK and the X11 bits, but may also be used for
other initialization services we might need to run along with
Xwayland initialization.

However, as the -initfd argument in Xwayland is a fairly new
feature, add some meson build-time checks so that the feature
is handled transparently while allowing to explicitly set/unset
it.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/945
2020-02-29 20:41:26 +00:00
Carlos Garnacho
38e58b837b core: Use DISPLAY envvar to forward in the launch context
The meta_x11_get_display_name() will return our private connection, which
is not what we want to transfer to clients being launched.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/945
2020-02-29 20:41:26 +00:00
Robert Mader
39a8c047d1 background-actor: Do not copy empty clip/unobscured regions
Clip and unobscured regions stricly shrink during culling. If they
are already empty, simply reference the empty region to reduce allocations.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1082
2020-02-29 19:44:01 +00:00
Robert Mader
c979cd95aa surface-actor: Do not copy empty clip/unobscured regions
Clip and unobscured regions stricly shrink during culling. If they
are already empty, simply reference the empty region to reduce allocations.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1082
2020-02-29 19:44:01 +00:00
Robert Mader
6831f2edb4 window-actor/x11: Disable culling on window actor level
This shape region culling was wrongly implemented in f5a28aa9, as it
does not take frame offsets into account, and is also redundant, as
we already set the opaque region of the underlying surface accordingly.

The other parts were implemented in ac7aa114, the reason given in
the commit message:
```
Wayland clients do this through the opaque region in the surface
actor. However X11 clients were considered fully transparent for
culling purposes, which may result in mutter painting other bits
of the background or other windows that will be painted over in
reality.
```

is wrong though - culling on X11 actors works just fine and did only
not work in Wayland sessions because of a bug that got fixed in
19814497.

In conclusion the whole part appears to be redundand and some testing
done suggests the same. Drop it.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1082
2020-02-29 19:44:01 +00:00
Robert Mader
372d73e275 surface-actor: Cull out surfaces without alpha channel
If a opaque region is explicitly set we should not consider the surface
opaque, as that implies e.g. a shape region is set.

If no opque region is set but the texture does not have an alpha channel,
we can savely cull it out.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1082
2020-02-29 19:44:01 +00:00
Robert Mader
0ada90024f wayland/actor-surface: Check for MetaXwaylandSurface instead of window type
The previous check would not ignore subsurfaces. Use the chance to directly
check for the surface role instead - it's much cleaner.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1082
2020-02-29 19:44:01 +00:00
Jonas Dreßler
46e38ff61a cogl/clip-stack: Set color and depth mask when drawing rectangle clips
Just like with the other functions drawing to the stencil buffer, we
should make sure the depth and color masks are set to FALSE during
drawing.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1096
2020-02-29 19:29:31 +00:00
Jonas Dreßler
1e0b015ce8 cogl/clip-stack: Explicitely initialize the stencil mask
We need the stencil buffer to consist of binary values of 0 and 1
because we're doing additions and subtractions on the buffer, so even
though this is the default, explicitely set the stencil mask to 0x1.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1096
2020-02-29 19:29:31 +00:00
Jonas Dreßler
72054332c5 cogl/clip-stack: Restore old matrices after drawing to stencil buffer
When using a region clip and something has a rectangle clip pushed, a
special drawing method for ClutterTexts (emit_vertex_buffer_geometry()
in cogl-pango-display-list.c) starts to fail and clipping issues with
long texts (because emit_vertex_buffer_geometry() is only used for texts
longer than 25 characters) start to appear. This specifically happened
in Looking Glass, where the StViewport of the ScrollView sets a
rectangle clips and the texts are usually longer than 25 characters.

This is caused by the changing of the perspective and modelview matrix
when drawing to the stencil buffer and started happening when
region-clipping was introduced with commit 8598b654. Even though the
changing of the matrices was done before that, too, the issue probably
didn't happen because `rect->can_be_scissor` was TRUE and no stencil
buffer clipping was used at all.

To fix this, temporarily save the old matrices, then set the new ones
and restore the old ones when we're done drawing to the stencil buffer.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/issues/2246

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1096
2020-02-29 19:29:31 +00:00
Jonas Dreßler
d30ef0dd3b cogl/clip-stack: Use "merge" parameter for rectangle clips
Just like for the other sorts of clips, use a "merge" parameter instead
of a "first" parameter.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1096
2020-02-29 19:29:31 +00:00
sicklylife
84275688f3 Update Japanese translation 2020-02-29 16:06:38 +00:00
sicklylife
90a1eb4275 Update Japanese translation 2020-02-29 15:54:35 +00:00
Daniel van Vugt
73e3207a85 clutter-actor: Add detail to captured-event
So that subscribers can choose the class of events they're interested in
and not be woken by everything else.

Needed by: https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/925

Related to: https://gitlab.gnome.org/GNOME/mutter/issues/283

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1000
2020-02-29 13:34:00 +00:00
worldofpeace
8a6673bb55 build: ensure absolute path to sysprof dbus interface dir
We want sysprof's exact datadir for compatability with
platforms where software is installed into their own
individual immutable prefix's. Such that, mutter's prefix will
never equate to sysprof's. This depends on a MR in sysprof [0]
which adds datadir to its pkgconfig files, as these files will always
have the proper path we want.

This adds version a constraint on sysprof_dep, as datadir was added to
the .pc in this version.

[0]: https://gitlab.gnome.org/GNOME/sysprof/merge_requests/19

https://gitlab.gnome.org/GNOME/mutter/merge_requests/957
2020-02-29 13:17:40 +01:00
Piotr Drąg
35c16a9f4b Update Polish translation 2020-02-29 13:17:07 +01:00
Jonas Ådahl
390fd7ddcf cursor-renderer-native: Fix hw cursor for non-square sprites
wl_shm_buffer_get_width() was used where wl_shm_buffer_get_height()
should have used, resulting in only square cursors working. Make
rectangular cursors work again.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1099
2020-02-28 21:49:58 +00:00
Carlos Garnacho
4b513a31ae compositor: Shuffle x11 compositing bits in MetaCompositor
Given that on Wayland we are pretty much guaranteed to finish MetaX11Display
setup after the MetaCompositor is enabled, we may drop the
meta_compositor_manage() x11 initialization bits, and move them into the
MetaX11Compositor subclass where it's actually needed.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/944
2020-02-28 20:20:35 +00:00
Carlos Garnacho
25c9e66c73 xwayland: Do not block on Xwayland initialization
We artificially made Xwayland initialization synchronous, as we used
to rely on MetaX11Display and other bits during meta_display_open().
With support for Xwayland on demand and --no-x11, this is certainly
not the case.

So drop the main loop surrounding Xwayland initialization, and turn
it into an async operation called from meta_display_init_x11(). This
function is turned then into the high-level entry point that will
get you from no X server to having a MetaX11Display.

The role of meta_init() in Xwayland initialization is thus reduced
to setting up the sockets. Notably no processes are spawned from here,
deferring that till there is a MetaDisplay to poke.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/944
2020-02-28 20:20:35 +00:00
Carlos Garnacho
649911b6b3 core: Make meta_display_init_x11() an async function
This ATM completes the task right away, but we will want to do
further things here that are asynchronous in nature, so prepare
for this operation being async.

Since the X11 backend doesn't really need this, make it go on
the fast lane and open the MetaX11Display right away, the case
of mandatory Xwayland on a wayland session is now handled
separately.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/944
2020-02-28 20:20:35 +00:00
Carlos Garnacho
8c332a4704 tests: Set fatal log handler on clutter tests
With Xwayland initialization going async, these errors will seep
into the parts controlled by g_test*(), resulting in the harmless
errors about DBus names not acquired turned fatal.

Set an error log handler, and specifically ignore those.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/944
2020-02-28 20:20:35 +00:00
Carlos Garnacho
21994bb00d tests: Ensure MetaX11Display is initialized before running tests
It might not be available right on initialization time if X11 is started
asynchronously. As this is a requirement for our tests, ensure it is there
before proceeding with the test.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/944
2020-02-28 20:20:35 +00:00
Carlos Garnacho
87a06c63ad x11: Set up the compositing manager selection on meta_display_init_x11()
This used to be set on meta_compositor_manage(), but only if there is a
MetaX11Display. Given meta_display_init_x11() is Wayland only, and we can
always assume compositing to be enabled, just have it invariably set after
the X server is up.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/944
2020-02-28 20:20:35 +00:00
Georges Basile Stavracas Neto
09026e5f0e monitor-stream-src: Use cogl_framebuffer_finish()
Even though cogl_framebuffer_flush() was supposed to be enough,
it ends up creating streams with odd visual glitches that look
very much like unfinished frames.

Switch back to cogl_framebuffer_finish(), which is admittedly
an overkill, but it's what works for now. There is anedoctal
evidence showing it doesn't incur in worse performance.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1086
2020-02-28 15:52:19 -03:00
Georges Basile Stavracas Neto
1f190a7cfe screen-cast-stream-src: Remove unused parameter
The 'data' parameter is not used in maybe_record_cursor(), so remove
it.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1086
2020-02-28 15:52:19 -03:00
Georges Basile Stavracas Neto
86168b945c window-stream-source: Draw into DMA buffer image
Much like monitor streaming, implement window streaming by
making the window actor draw itself with a paint context
that used the passed framebuffer.

Now that all MetaScreenCastStreamSrc subclasses implement
blit_to_framebuffer, remove the conditional check from
meta_screen_cast_stream_src_blit_to_framebuffer().

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1086
2020-02-28 15:52:19 -03:00
Georges Basile Stavracas Neto
680a54aff6 monitor-stream-src: Implement blitting view framebuffers
Add the vfunc override that actually consume the new Cogl API. Every
view that fits into the logical monitor is rendered.

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

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1086
2020-02-28 15:52:03 -03:00
Georges Basile Stavracas Neto
548073ec27 screen-cast-stream-src: Support DMA buffer sharing
Implement PipeWire's add_buffer and remove buffer, try and export
a DMA buffer first and, on failure, fallback to memfd.

When DMA buffers are successfully created and shared, blit the
framebuffer contents when drawing instead of downloading the pixels.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1086
2020-02-28 15:29:03 -03:00
Georges Basile Stavracas Neto
d366fb335d renderer-native: Implement DMA buffer creation
Create a new gbm_bo using the same given geometry, and export the new
bo's DMA buffer fd. The new bo lives as long as necessary to be used,
and reused, by PipeWire.

Unfortunately, PipeWire doesn't support modifiers properly, so use the
linear format for now. For now, a hardcoded format of DRM_FORMAT_XRGB8888
is set, so we don't need to negotiate the format with PipeWire early.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1086
2020-02-28 15:29:02 -03:00
Georges Basile Stavracas Neto
7fbb47b2bb renderer-native: Move DMA buffer creation to an auxiliary function
This will be reused by the DMA buffer exporting function.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1086
2020-02-28 15:28:22 -03:00
Georges Basile Stavracas Neto
3881c1f952 cogl/context: Add cogl_renderer_create_dma_buf() and family
This is a winsys-specific API that allows exporting a DMA buffer fd.
The CoglDmaBufHandle structure allows passing the ownership of the
DMA buffer to whoever is using it, so the winsys doesn't need to
manually track it.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1086
2020-02-28 14:54:48 -03:00
Georges Basile Stavracas Neto
038a3170bf cogl/framebuffer: Add cogl_framebuffer_flush
In future patches, we'll create additional CoglFramebuffers that
will be shared via DMA-Buf with PipeWire. When recording frames,
we'll blit the current onscreen framebuffer into the shared one.

However, that presents a problem: cogl_framebuffer_blit() mimics
glBlitFramebuffer() semantics, and doesn't do an implicit flush
of the GPU command stream. As a consequence, clients may receive
unblitted or incomplete framebuffers.

We could use cogl_framebuffer_finish() to ensure the commands were
submitted to the GPU, but it is too harsh -- it blocks the CPU
completely until the commands are finished!

Add cogl_framebuffer_flush(), which ensures the command stream is
submitted to the GPU without blocking the CPU. Even though we don't
use the framebuffer specifically, it may be useful in the future
for e.g. a potential Vulkan backend to have access to the framebuffer.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1086
2020-02-28 10:52:34 -03:00
Alan Mortensen
f27de9620a Updated Danish translation 2020-02-28 14:01:26 +01:00
Robert Mader
969ad54feb cursor-renderer/native: Remove unnecessary endian check
Both cases have the same content.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/526
2020-02-28 10:22:11 +00:00
Robert Mader
987ce5bec0 cursor-renderer/native: Implement scaled/transformed hardware cursors
If the cursor sprite does not match the scale factor or transformation
of the monintor, we currently fall back to a software cursor, causing
redraws of the shell. This commit implements scaling and transforming
of the cursor sprite, so we can use it with hardware planes, too.

This commit does the following steps:

1. Make sure we reupload the cursor image if the cursor is over
a logical monitor not matching the scale or transform from the previous
update.
2. Before upload to the hardware plane, scale and transform the cursor
image if possible and necessary.
3. Make sure we always use the hardware cursor if possible (only fall
back to software/OGL cursor if it is visible on multiple logical monitors
with differet scales/transforms).
4. Transform or scale the cursor coordinates if necessary.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/526
2020-02-28 10:22:11 +00:00
Robert Mader
d600cd9aee monitor-transform: Add generic function to get relative transform
It takes transforms A and B and returns the transform to get from
A to B.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/526
2020-02-28 10:22:11 +00:00
Robert Mader
1fc7935858 backends/cursor: Add API to set and get the texture buffer transform
In Wayland clients can commit transformed surfaces, so the compositor
can directly use them on hardware planes. We already support that
for other surfaces, this is the first step to also support it on
cursor sprites.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/526
2020-02-28 10:22:11 +00:00
Kukuh Syafaat
b5354fb3cd Update Indonesian translation 2020-02-28 02:13:12 +00:00
Jonas Ådahl
01aaced129 crtc: Don't leak MetaCrtcConfig
We never freed it except when CRTC disabled during runtime.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1095
2020-02-27 20:35:07 +00:00
Jonas Ådahl
ff59b5d041 monitor: Move logical <-> CRTC transform helpers to MetaOutput
So that we avoid leaking the internal guts of MetaOutput into
MetaMonitor, while also making it possible to use it without a
MetaMonitor at hand.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1064
2020-02-27 09:47:22 +01:00
Jonas Ådahl
92f0eb9d14 monitor: Use transform helper when dealing with panel orientation
Replace the open coded monitor transform math with the new helper.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1064
2020-02-27 09:47:08 +01:00
Jonas Ådahl
e6913d1471 monitor-transform: Add meta_monitor_transform_transform() helper
Intended to replace various manual monitor transform enum math here and
there. Tests added as well, to test some hand picked transforms.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1064
2020-02-27 09:07:25 +01:00
Fran Dieguez
d495dc6c63 Update Galician translation 2020-02-26 20:57:31 +00:00
Carlos Garnacho
88bb24f66e backends/native: Shuffle udev client initialization in MetaSeatNative
This may be used indirectly before creation as we dispatch libinput events
right after creation (to let input devices be known), so those device
additions would trigger the touch-mode checks.

Creating it in advance results in checks being correctly performed, although
redundantly.

Spotted by Bastien Nocera.

Closes: https://gitlab.gnome.org/GNOME/mutter/issues/1067
2020-02-26 18:32:05 +00:00
Arun Raghavan
6e7316ef11 build: Use dbus interface dir from pkg-config
Using 'datadir' breaks prefixed builds (as we look for interface files
in the prefix we are going to install to).

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1094
2020-02-26 15:37:00 +00:00
Jonas Ådahl
9fa56176fd monitor-manager-xrandr: Don't try to disable disabled CRTC
When applying a configuration to XRANDR, we first disable CRTCs that
happen to extend outside of the to-be X11 screen size. While doing so,
we fail to actually check whether the CRTC is active or not, meaning
we'll try to query the content of the CRTC configuration even though it
has none, leading to a NULL pointer dereference.

Fix this by simply ignoring non-configured CRTCs.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1093
2020-02-26 16:14:04 +01:00
Marek Černocký
fb81199dec Updated Czech translation 2020-02-26 14:13:21 +01:00
Christian Hergert
b7f47ea17f clutter: add tracing for frameclock cycle
This adds a new frameclock tracing mark for a single cycle of the frame
clock. Doing so allows Sysprof to potentially do more with the information
that happens during the frameclock. For example, we can now find
allocations that happen while the frame clock is advancing.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1088
2020-02-26 12:33:00 +00:00
Sebastian Keller
71101cab82 clutter/cogl/stage: Remove duplicate region union
https://gitlab.gnome.org/GNOME/mutter/merge_requests/1089
2020-02-26 07:26:10 +00:00
Sebastian Keller
c4b28b0939 clutter/cogl/stage: Don't leak FB damage region on redraw
offset_scale_and_clamp_region() creates a new region resulting in
view_damage which at this point is the only thing left pointing to what
originally was fb_damage getting overwritten and being leaked.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1089
2020-02-26 07:26:10 +00:00
Florian Müllner
38954de11c ci: Adjust URL check
While the old merge request URLs still work, gitlab recently started
including an additional /- for merge requests.

Adjust the regex to account for that, so that simply copying the URL
from gitlab works again.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1090
2020-02-26 06:28:46 +00:00
Gwan-gyeong Mun
964ea60090 Update Korean translation 2020-02-26 03:00:37 +00:00
Jonas Ådahl
159c83b914 clutter: Move redraw clip management to views
The stage window handled the redraw clip in a global manner; this would
interfere if we want to paint views individually as it'd mean
intersecting views (i.e. mirrored monitors) would loose the redraw clip
once the first view was painted. It also is awkward to have a global
state for something that is built up before redrawing, and only really
valid during paint, due to buffer damage history.

This commits removes all redraw clip management from the stage window,
moving it all into the stage views. When a redraw clip is added to the
stage, every affected view will get the same redraw clip added to it,
and eventually when painted, the stage window (ClutterStageCogl) will
retrieve the redraw clip for each view as it repaints them.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1042
2020-02-25 19:18:54 +01:00
Jonas Ådahl
b68c630329 clutter/cogl/stage: Use g_clear_pointer() to clean up regions
https://gitlab.gnome.org/GNOME/mutter/merge_requests/1042
2020-02-25 19:18:54 +01:00
Jonas Ådahl
fe1ccea1e1 clutter: Pass redraw clip via paint context
Instead of users fetching it via `clutter_stage_get_redraw_clip()`, pass
it via the paint context. This is helpful as it is only valid during a
paint, making it more obvious that it needs to be handled differently
when there is no redraw clip (i.e. we're painting off-screen).

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1042
2020-02-25 19:18:54 +01:00
Jonas Ådahl
c483b52d24 clutter/stage: Pass redraw clip instead of extents when painting view
That's the struct we have ready, the callee can just call
cairo_region_get_extents() if it only cares about the extents rectangle.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1042
2020-02-25 19:18:54 +01:00
Jonas Ådahl
f3dcba27f5 clutter/cogl/stage: Simplify region transform code
Add a helper that scales and clamps a region, aimed to be used when
transforming between framebuffer coordinate space and view coordinate
spaces.

This helps readability by moving out the verbose for loops that deals
with the individual rects of a region to the helper, making the logic
where it's used much simpler.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1042
2020-02-25 19:18:54 +01:00
Jonas Ådahl
86ccc28413 clutter/cogl/stage: Rename have_clip to is_full_redraw
The 'have_clip' variable has repeatedly confused me to meaning that
there is a clip. What it actually means is that the effective clip
covers the whole view; the 'redraw_clip == NULL' meaning full redraw is
an important implementation detail for the context, and makes the
intention of the variable unclear; especially since we will after a
couple of blocks will *always* have a clip, just that it covers the
whole view.

Rename the variable to 'is_full_redraw' and negate the meaning, aiming
to make things a lot more clear.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1042
2020-02-25 18:39:51 +01:00
Jonas Ådahl
0d039c3ba3 clutter/view: Don't take paint rect after paint
It was unused, and will be become unused by the primary paint function
as well, so go ahead and remove it here first.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1042
2020-02-25 18:39:51 +01:00
Jonas Ådahl
adcbc2aa5f clutter/cogl/stage: Use fb size for for fallback fb clip region
When calculating the fallback framebuffer clip region, which should be
the region in framebuffer coordinates, we didn't scale the view layout
with the view framebuffer scale, meaning for any other scale than 1,
we'd draw a too small region of the view. Fix this by just using the
size of the framebuffer directly, avoiding any scale dependent
calculation all together.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1042
2020-02-25 18:39:51 +01:00
Jonas Ådahl
860906246e clutter/cogl/stage: Simplify swap_event boolean logic
We'll expect a swap event if any of the view paints resulted in a swap;
make the logic dealing with this clearer by making changing the less
vilible '|| swap_event' postfix with a up front '|=' operator.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1042
2020-02-25 18:39:51 +01:00
Jonas Ådahl
37d7df612b clutter/stage/cogl: Name variable to make coordinate space obvious
The ambiguous "clip" was renamed to "fb_clip_region", as it was called
at the call site. This should make it more clear that the clip is in
buffer coordinate space.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1042
2020-02-25 18:39:51 +01:00
Jonas Ådahl
0baf4578c8 clutter/stage/cogl: Remove some leftover whitespace
https://gitlab.gnome.org/GNOME/mutter/merge_requests/1042
2020-02-25 18:39:51 +01:00
Jonas Ådahl
2d6665950c crtc: Move logical monitor pointer to MetaMonitor
Since the last code fetching the logical monitor state directly from the
CRTC has been removed, we can move the logical monitor pointer to a more
natural place.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1042
2020-02-25 18:39:51 +01:00
Jonas Ådahl
1c98f01a65 renderer-native: Draw stage separately per CRTC
Prior to this commit the stage was drawn separately for each logical
monitor. This allowed to draw different parts of the stage with
different transformations, e.g. with a different viewport to implement
HiDPI support.

Go even further and have one view per CRTC. This causes the stage to
e.g. draw two mirrored monitors twice, instead of using the same
framebuffer on both. This enables us to do two things: one is to support
tiled monitors and monitor mirroring using the EGLStreams backend; the
other is that it'll enable us to tie rendering directly to the CRTC it
will render for. It is also a requirement for rendering being affected
by CRTC state, such as gamma.

It'll be possible to still inhibit re-drawing of the same content
twice, but it should be implemented differently, so that it will still
be possible to implement features requiring the CRTC split.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1042
2020-02-25 18:39:51 +01:00
Jonas Ådahl
e3f30371aa renderer-native: Fix a couple of style misses
Removed stray newline, and fixed an incorrect indentation.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1042
2020-02-25 18:39:51 +01:00
Jonas Ådahl
1a14c4d3c9 renderer-x11-nested: Remove stray newline
https://gitlab.gnome.org/GNOME/mutter/merge_requests/1042
2020-02-25 18:39:51 +01:00
Jonas Ådahl
292d2754ae clutter/stage: Remove stray newline
https://gitlab.gnome.org/GNOME/mutter/merge_requests/1042
2020-02-25 18:39:51 +01:00
Jonas Ådahl
fe42d56db3 crtc: Move configured state to separate struct
To make it more reliable to distinguish between values that are read
from the backend implementation (which is likely to be irrelevant for
anything but the backend implementation), split out those values (e.g.
layout).

This changes the meaning of what was MetaCrtc::rect, to a
MetaCrtcConfig::layout which is the layout the CRTC has in the global
coordinate space.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1042
2020-02-25 18:39:51 +01:00
Jonas Ådahl
a11f9bd513 boxes: Add 'round' rounding strategy
It just calls roundf(), and is intended to be used when the graphene
rectangle is approximately integer aligned.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1042
2020-02-25 18:39:51 +01:00
Jonas Ådahl
7f6cafa847 logical-monitor: Pass monitor in the for each CRTC helper callback
Will be used in later commits.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1042
2020-02-25 18:39:51 +01:00
Jonas Ådahl
1b67f49f7f monitor: Move logical to CRTC transform helper to MetaOutput
So that it can be used on a per output basis in the future.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1042
2020-02-25 18:39:51 +01:00
Balázs Úr
c447d76cd4 Update Hungarian translation 2020-02-25 06:32:01 +00:00
Christian Hergert
d327cedb83 clutter: avoid redundant _clutter_paint_node_init_types()
This only needs to be initialized once but is in the hot path of creating
new paint nodes (for which we create many). Instead, do this as part of
the clutter_init() workflow to keep it out of the hot path.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1087
2020-02-25 01:14:09 +00:00
Christian Hergert
0c55e87d8f cogl: reduce temporary allocations calculating redraw regions
When calculating regions, a lot of temporary allocations are created. For
the array of rects (which is often a short number of them) we can use
stack allocations up to 1 page (256 cairo_rectangle_int_t). For building
a region of rectangles, cairo and pixman are much faster if you have all
of the rectangles up front or else it mallocs quite a bit of temporary
memory.

If we re-use the cairo_rectangle_int_t array we've already allocated (and
preferably on the stack), we can delay the creation of regions until after
the tight loop.

Additionally, it requires fewer allocations to union two cairo_region_t
than to incrementally union the rectangles into the region.

Before (percentages are of total number of allocations)

     TOTAL    FUNCTION
[ 100.00%]    [Everything]
[ 100.00%]      [gnome-shell --wayland --display-server]
[  99.67%]        _start
[  99.67%]          __libc_start_main
[  99.67%]            main
[  98.60%]              meta_run
[  96.90%]                g_main_loop_run
[  96.90%]                  g_main_context_iterate.isra.0
[  96.90%]                    g_main_context_dispatch
[  90.27%]                      clutter_clock_dispatch
[  86.54%]                        _clutter_stage_do_update
[  85.00%]                          clutter_stage_cogl_redraw
[  84.98%]                            clutter_stage_cogl_redraw_view
[  81.09%]                              cairo_region_union_rectangle

After (overhead has much dropped)

     TOTAL    FUNCTION
[ 100.00%]    [Everything]
[  99.80%]      [gnome-shell --wayland --display-server]
[  99.48%]        _start
[  99.48%]          __libc_start_main
[  99.48%]            main
[  92.37%]              meta_run
[  81.49%]                g_main_loop_run
[  81.49%]                  g_main_context_iterate.isra.0
[  81.43%]                    g_main_context_dispatch
[  39.40%]                      clutter_clock_dispatch
[  26.93%]                        _clutter_stage_do_update
[  25.80%]                          clutter_stage_cogl_redraw
[  25.60%]                            clutter_stage_cogl_redraw_view

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1071
2020-02-24 22:44:35 +00:00
Christian Hergert
81d11ac0a8 clutter: avoid g_signal_emit_by_name() from ClutterActor
g_signal_emit_by_name() is used to emit signals on ClutterContainer when
actors are removed or added. It happens to do various interface lookups
which are a bit unneccessary and can allocate memory.

Simply using emission wrappers makes all of that go away.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1083
2020-02-24 22:36:27 +00:00
Asier Sarasua Garmendia
84261d1db3 Update Basque translation 2020-02-24 16:41:35 +00:00
Daniel Mustieles
a0441ad666 Updated Spanish translation 2020-02-24 16:48:17 +01:00
Emin Tufan Çetin
67152916e1 Update Turkish translation 2020-02-24 15:06:58 +00:00
Jonas Dreßler
b98ebe60b2 clutter/x11: Stop tracking stage changes on crossing events
On x11 we emulate pointer events from touch events as long as there's
only one touchpoint on screen, this obviously leads to x11 sending us
crossing events triggered by the emulated pointer. Now if we get a leave
event and set the stage of the ClutterInputDevice to NULL, new touch
events will be discarded by clutters backend because the core pointer
doesn't have a stage associated. This means Mutter completely loses
state of a touchpoint as soon as it crosses a shell actor.

An easy reproducer for this issue is to start the four-finger-workspace
gesture above a window and to move the pointer emulating touch outside
of the window, this will freeze the gesture as the gesture no longer
receives touch events.

To fix this, stop tracking stage changes on crossing events and simply
leave the ClutterInputDevice stage as-is. In our case there is only one
stage anyway and that won't change in the future.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/423
2020-02-24 10:54:56 +00:00
Jonas Dreßler
ad8ba69423 wayland/pointer: Use g_signal_connect_swapped for one signal
Remove the rather useless callback function that's currently used for
handling the "visibility-changed" signal and instead connect to the
signal using `g_signal_connect_swapped()`.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1077
2020-02-24 09:52:06 +00:00
Jonas Dreßler
bf24b816c2 wayland/pointer: Add support for the new ClutterSeat inhibit-unfocus API
The last commit added a new API to ClutterSeat to inhibit setting the
focus-surface of the MetaWaylandPointer to NULL, let's do that.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1077
2020-02-24 09:52:06 +00:00
Jonas Dreßler
a9b1134dfb clutter/seat: Add API to inhibit unfocus of the cursor surface/actor
Add API to ClutterSeat that allows inhibiting the unsetting of the
pointer focus surface. This can be useful for drawing custom cursor
textures like the magnifier of gnome-shell does.

In the future this API should also control unsetting of Clutters
focus-actor, not just the focus surface, that's not really needed right
now since we never unset the focus-actor anyway.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1077
2020-02-24 09:52:06 +00:00
Rafael Fontenelle
6fb6a23389 Update Brazilian Portuguese translation 2020-02-24 09:40:26 +00:00
Jonas Ådahl
2da27720ca display: Make check-alive timeout configureable
The check-alive feature is there for the user to be able to terminate
frozen applications more easily. However, sometimes applications are
implemented in a way where they fail to be reply to ping requests in a
timely manner, resulting in that, to the compositor, they are
indistinguishable from clients that have frozen indefinitely.

When using an application that has these issues, the GUI showed in
response to the failure to respond to ping requests can become annoying,
as it disrupts the visual presentation of the application.

To allow users to work-around these issues, add a setting allowing them
to configure the timeout waited until an application is considered
frozen, or disabling the check completely.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1080
2020-02-23 17:28:57 +00:00
Olivier Fourdan
f9326cfa3d wayland/data-device: Fix crash with offer from X11 client
If a data offer comes from an X11 client, the Wayland resource would be
NULL, causing a crash in `data_offer_choose_action()` trying to get the
resource version.

So instead of doing the version check in `data_offer_choose_action()`,
do it early when creating the data source.

Closes: https://gitlab.gnome.org/GNOME/mutter/issues/1057
https://gitlab.gnome.org/GNOME/mutter/merge_requests/1073
2020-02-23 16:36:16 +00:00
Olivier Fourdan
963108a9a6 wayland/data-device: Check resource version on cancel
For clarity, check the resource version needs the "cancelled" message in
the actual vmethod rather than from the caller function.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1073
2020-02-23 16:36:15 +00:00
Olivier Fourdan
b8355a6686 xwayland: Not all xwayland surface have a window
`meta_xwayland_surface_get_relative_coordinates()` may cause a crash if
the Xwayland surface has no window associated.

That can be observed when using drag and drop from an X11 window to a
Wayland native window:

```
    at src/core/window.c:4503
    at src/wayland/meta-xwayland-surface.c:200
    at src/wayland/meta-wayland-surface.c:1517
    at src/wayland/meta-wayland-pointer.c:1048
    at src/wayland/meta-wayland-pointer.c:840
    at src/wayland/meta-wayland-pointer.c:865
    at src/wayland/meta-wayland-pointer.c:954
    at src/wayland/meta-wayland-pointer.c:456
    at src/wayland/meta-wayland-pointer.c:993
    at src/wayland/meta-wayland-data-device.c:1004
    at src/wayland/meta-wayland-data-device.c:1278
    at src/wayland/meta-xwayland-dnd.c:326
```

Check if the xwayland surface has an associated MetaWindow prior to get
its buffer rect.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1073
2020-02-23 16:36:15 +00:00
Christian Hergert
4c421959dc clutter: fix hole in ClutterPaintNode
Fixing the missalignment takes the structure from 80 bytes down to 72.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1081
2020-02-21 22:36:31 +00:00
Sebastian Keller
aedcfcd010 sound-player: Fix invalid write after playback is cancelled early
The cancellable of a request might already be cancelled by the time
the cancelled_cb is connected resulting in finish_cb being called via
ca_context_cancel before g_cancellable_connect returns. In this case
the request that is written to has already been freed.

Fixes https://gitlab.gnome.org/GNOME/mutter/issues/1060
2020-02-21 16:06:18 +00:00
Jonas Dreßler
d7c7311ceb clutter/seat: Add gtkDoc comments for touch-mode property
It's not that easy to find out when the touch-mode is enabled without
reading the code, so document that.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1075
2020-02-21 15:24:58 +00:00
Jonas Dreßler
41d72e86e0 backends/native: Also check touch-mode on object initialization
On a Surface Pro 2017, touch-mode is currently only detected correctly
after detaching and attaching the Type Cover (detachable keyboard) once,
it seems that `has_external_keyboard` is only set to the correct value
after MetaSeatNative is initialized.

So fix that and call `update_touch_mode()` once again when the object is
initialized and the `has_external_keyboard` and `has_touchscreen`
properties have been finally updated.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1075
2020-02-21 15:24:58 +00:00
Daniel van Vugt
282b09c17e clutter/actor: Add CLUTTER_OFFSCREEN_REDIRECT_ON_IDLE
Which offscreens actor rendering only in cases where it hasn't changed for
2 frames or more. This avoids the performance penalty of offscreening an
actor whose content is trying to animate at full frame rate. It will
switch automatically.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1069
2020-02-21 18:07:46 +08:00
Wim Taymans
c5d2fc856a screen-cast: Update to PipeWire 0.3 API
Update to 0.3 API

[jadahl: update Dockerfile to include new enough pipewire]

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

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1062
2020-02-20 18:45:31 +01:00
Robert Mader
f5a28aa9e4 window-actor: Make culling of opaque windows X11 only
It is only useful for clients that do not set an opaque region but
still can be detected as being opaque. This is helpful for X11 clients
as opaque regions only got introduced around 2012 and only as part of EWMH
and are thus not used in many cases.
On Wayland however opaque regions have been part of the core protocol from the
beginnig and we can assume they are used more commonly.

As the current implementation in `MetaWindowActor` does not handle Wayland
subsurfaces well, instead of adding more complexity just move it to
`MetaWindowActorX11`.

While on it, take the shape region into account that is set when clients
use the X Nonrectangular Window Shape Extension Protocol, so we have exact
culling with those clients.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1058
2020-02-20 15:57:51 +00:00
Asier Sarasua Garmendia
6206511846 Update Basque translation 2020-02-20 15:42:44 +00:00
Jonas Ådahl
a209a14898 renderer-native: Use hardware acceleration check in generic layer
No need to duplicate it.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/838
2020-02-20 10:40:42 +00:00
Jonas Ådahl
3e6a55aff0 renderer: Add API to check whether renderer is hardware accelerated
Also expose an introspected variant via the MetaBackend.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/838
2020-02-20 10:40:42 +00:00
Jonas Ådahl
704fea6323 renderer-native: Move 'backend' field to MetaRenderer
So that it can be used by the generic MetaRenderer class, as well as
other sub types, as well.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/838
2020-02-20 10:40:42 +00:00
Jonas Ådahl
8c1e6ebde0 remote-access-handle: Expose disable-animations property
Set to TRUE if a screen cast session asked for animations to be
disabled.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/838
2020-02-20 10:40:42 +00:00
Jonas Ådahl
81512ad0dc screen-cast-session: Add 'disable-animations' property
Allow screen casters (e.g. VNC remote desktop services) to ask for
animations to be inhibited, in order to lower the number of frames sent
over the network.

Currently only sets a field on the screen cast session object. Later
it'll be exposed via the remote access handle and via D-Bus by
gnome-shell.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/838
2020-02-20 10:40:42 +00:00
Christian Hergert
d122b66abc clutter/actor: avoid transform node for identity matrix
If the transform matrix is an identity, then positioning wont change and
we can avoid creating the transform node altogether. This is based on
a similar find in GTK today while reducing temporary allocations.

This cuts the number of transforms created in clutter_actor_paint() by
about half under light testing of GNOME Shell from 6.8% to 2.4% of
allocations.

Before:

    ALLOCATED      TOTAL    FUNCTION
[   20.4 MiB] [  21.20%]    clutter_actor_paint
[   11.0 MiB] [  11.45%]      clutter_paint_node_paint
[    6.6 MiB] [   6.84%]      clutter_transform_node_new
[    2.5 MiB] [   2.61%]      clutter_actor_node_new

After:

    ALLOCATED      TOTAL    FUNCTION
[   33.4 MiB] [  24.12%]    clutter_actor_paint
[   26.2 MiB] [  18.91%]      clutter_paint_node_paint
[    3.4 MiB] [   2.43%]      clutter_actor_node_new
[    3.3 MiB] [   2.41%]      clutter_transform_node_new

Allocation amounts will have differed due to different amounts of running
time, but the % of allocations has now dropped below
clutter_actor_node_new() which should be expected.

https://gitlab.gnome.org/GNOME/mutter/issues/1056
2020-02-20 06:41:34 +00:00
339 changed files with 9032 additions and 7746 deletions

View File

@@ -28,6 +28,20 @@ build-mutter:
- merge_requests
- /^.*$/
build-without-opengl-and-glx:
stage: build
script:
- meson . build -Dbuildtype=debugoptimized -Dopengl=false -Dglx=false -Degl_device=true -Dwayland_eglstream=true --werror --prefix /usr
- ninja -C build
- ninja -C build install
artifacts:
expire_in: 1 day
paths:
- build
only:
- merge_requests
- /^.*$/
build-without-native-backend-and-wayland:
stage: build
script:

View File

@@ -11,6 +11,7 @@ RUN dnf -y update && dnf -y upgrade && \
dnf install -y 'dnf-command(builddep)' && \
dnf install -y 'dnf-command(copr)' && \
dnf copr enable -y fmuellner/gnome-shell-ci && \
dnf copr enable -y jadahl/mutter-ci && \
dnf -y update && dnf -y upgrade && \
dnf builddep -y mutter && \
@@ -26,4 +27,6 @@ RUN dnf -y update && dnf -y upgrade && \
dnf remove -y gnome-bluetooth-libs-devel dbus-glib-devel upower-devel python3-devel && \
dnf remove -y --noautoremove mutter mutter-devel && \
dnf upgrade -y 'pkgconfig(libpipewire-0.3)' && \
dnf clean all

View File

@@ -19,7 +19,7 @@ fi
function commit_message_has_url() {
commit=$1
commit_message=$(git show -s --format='format:%b' $commit)
echo "$commit_message" | grep -qe "\($CI_MERGE_REQUEST_PROJECT_URL/\(issues\|merge_requests\)/[0-9]\+\|https://bugzilla.gnome.org/show_bug.cgi?id=[0-9]\+\)"
echo "$commit_message" | grep -qe "\($CI_MERGE_REQUEST_PROJECT_URL/\(-/\)\?\(issues\|merge_requests\)/[0-9]\+\|https://bugzilla.gnome.org/show_bug.cgi?id=[0-9]\+\)"
return $?
}

95
NEWS
View File

@@ -1,3 +1,98 @@
3.36.1
======
* Fix hardware cursor on GPU hotplpug [Pekka; !1097]
* Fix black areas around XWayland windows when resizing [Robert, Olivier; !1091]
* Fix applying wrong scale to monitors on X11 [Jonas; !1118]
* Fix moving/resizing windows via keyboard on wayland [Alynx; !997]
* Fix locate-pointer feature interfering with keybindings [Carlos; !1014]
* Add support for middle-click emulation [Andrew; !256]
* Fix freeze when moving cursor between scaled monitors [Robert; !1125]
* Fix popup misplacement with focus-follows-mouse [Jonas Å.; !1122]
* Fix misplaced cursor in preedit strings [Carlos; !1132]
* Support mirroring with proprietary Nvidia driver [Jonas Å.; !1098]
* Support tablets with multiple mode switch buttons in a group [Carlos; !970]
* Ignore foreground color for color glyphs (emojis) [Carlos; !1148]
* Allow pad mode switches while showing OSD [Carlos; !975]
* Fix positioning of OSD for display-attached tablets [Carlos; !971]
* Respect configured RANDR panning on X11 [Jonas Å.; !1085]
* Use correct texture filtering with scaled displays [Jonas; !1124]
* Fix cursor hotspots in virtual machines [Jonas Å.; !1136]
* Fix build with GLES and no GL [Georges; !1151]
* Work around Firefox bug when copying images on wayland [Robert; !1141]
* Fix wrong cursor rotation on rotated displays [Hans; !1153]
* Fix glitches in window screencasts [Georges; !1129]
* Fix IM support for deleting surrounding text [Takao, Carlos; #539]
* Fix map animation of maximized windows [Robert; !1164]
* Fixed crashes [Jonas Å., Carlos, Florian, Robert; !1120, !1121,
#917, #1132, #1083, !1147, #1147]
* Misc. bug fixes and cleanups [Jonas Å., Olivier, Mart, Sebastian, Corentin,
Andre, Daniel, Robert, Carlos, Peter, Georges, Jonas D., Florian, Christian;
!1115, !1102, !1104, !1106, !1117, !1119, !1101, !1123, #1124, !1130, !1131,
!1133, #1065, !1108, !1144, !1145, !1109, !1059, !1107, !999, !1152, #1128,
!1155, !1156, !1158, !1157, #1146, !1161, !1163]
Contributors:
Jonas Dreßler, Olivier Fourdan, Takao Fujiwara, Carlos Garnacho, Andrew Gaul,
Hans de Goede, Peter Hutterer, Sebastian Keller, Robert Mader,
Andre Moreira Magalhaes, Florian Müllner, Georges Basile Stavracas Neto,
Corentin Noël, Pekka Paalanen, Christian Rauch, Mart Raudsepp,
Daniel van Vugt, Alynx Zhou, Jonas Ådahl
Translators:
Марко Костић [sr], Daniel Șerbănescu [ro]
3.36.0
======
* Fix placement of popup windows in multi-monitor setups [Jonas; !1110]
* Fix invisible mouse cursor on some hardware [Jonas; !1079]
Contributors:
Jonas Ådahl
Translators:
Aurimas Černius [lt], Goran Vidović [hr], Anders Jonsson [sv],
Guillaume Bernard [fr], Milo Casagrande [it], Daniel Korostil [uk],
Andre Klapper [cy], Aman Alam [pa], Nathan Follens [nl]
3.35.92
=======
* Fix visibility of initially hidden windows [Jonas Å.; !1066]
* Avoid flicker when (un)redirecting windows [Sebastian; #997]
* Let BindConstraints update the preferred size [Emmanuele; !1070]
* Learn about GLES3 [Adam; !882]
* Ping windows on every window focus [Jonas D.; !891]
* Remove overhead from hot code paths [Christian;
#1056, !1081, !1083, !1071, !1087]
* Allow remote desktop services to inhibit animations [Jonas Å.; !838]
* Update screen-cast code to PipeWire 0.3 API [Wim; !1062]
* Make check-alive timeouts configurable [Jonas Å.; !1080]
* Make each stage view correspond to a single CRTC [Jonas Å.; !1042]
* Implement scaled/transformed hardware cursors [Robert; !526]
* Use DMA buffers for screencasting if possible [Georges; !1086]
* Make Xwayland startup asynchronous [Carlos; !944]
* Fix clipping glitches in long text entries [Jonas D.; !1096]
* Add side channel for starting required X11 services [Carlos; !945]
* Support synchronized wayland popup moving [Jonas Å.; !705]
* Fixed crashes [Olivier, Jonas Å.; !1073, !1093]
* Plugged memory leaks [Sebastian, Jonas Å.; !1089, !1095]
* Misc. bug fixes and cleanups [Jonas Å, Olivier, Florian, Daniel, Jonas D.,
Robert, Sebastian, Christian, Arun, Carlos, worldofpeace; !1061, #1043,
!1067, !1068, !1065, !835, !1058, !1069, !1075, #1060, !1077, !423, !1090,
!1088, !1094, #1067, !1064, !1099, !957, !1000, !1082]
Contributors:
Emmanuele Bassi, Jonas Dreßler, Olivier Fourdan, Carlos Garnacho,
Christian Hergert, Adam Jackson, Sebastian Keller, Robert Mader,
Florian Müllner, Georges Basile Stavracas Neto, Arun Raghavan, Wim Taymans,
Daniel van Vugt, worldofpeace, Jonas Ådahl
Translators:
Yi-Jyun Pan [zh_TW], Asier Sarasua Garmendia [eu], Rafael Fontenelle [pt_BR],
Emin Tufan Çetin [tr], Daniel Mustieles [es], Balázs Úr [hu],
Gwan-gyeong Mun [ko], Marek Černocký [cs], Fran Dieguez [gl],
Kukuh Syafaat [id], Alan Mortensen [da], Piotr Drąg [pl], sicklylife [ja],
Matej Urbančič [sl]
3.35.91
=======
* Honor accelerometer orientation on monitor config changes [Hans; !959]

View File

@@ -600,10 +600,11 @@ cally_actor_real_remove_actor (ClutterActor *container,
g_return_val_if_fail (CLUTTER_IS_ACTOR (actor), 0);
atk_parent = ATK_OBJECT (data);
atk_child = clutter_actor_get_accessible (actor);
if (atk_child)
if (clutter_actor_has_accessible (actor))
{
atk_child = clutter_actor_get_accessible (actor);
g_value_init (&values.old_value, G_TYPE_POINTER);
g_value_set_pointer (&values.old_value, atk_parent);

View File

@@ -631,7 +631,7 @@
#include "clutter-color-static.h"
#include "clutter-color.h"
#include "clutter-constraint-private.h"
#include "clutter-container.h"
#include "clutter-container-private.h"
#include "clutter-content-private.h"
#include "clutter-debug.h"
#include "clutter-easing.h"
@@ -710,6 +710,7 @@ struct _ClutterActorPrivate
guint8 opacity;
gint opacity_override;
unsigned int inhibit_culling_counter;
ClutterOffscreenRedirect offscreen_redirect;
@@ -1124,6 +1125,20 @@ static GQuark quark_actor_layout_info = 0;
static GQuark quark_actor_transform_info = 0;
static GQuark quark_actor_animation_info = 0;
static GQuark quark_key = 0;
static GQuark quark_motion = 0;
static GQuark quark_pointer_focus = 0;
static GQuark quark_button = 0;
static GQuark quark_scroll = 0;
static GQuark quark_stage = 0;
static GQuark quark_destroy = 0;
static GQuark quark_client = 0;
static GQuark quark_delete = 0;
static GQuark quark_touch = 0;
static GQuark quark_touchpad = 0;
static GQuark quark_proximity = 0;
static GQuark quark_pad = 0;
G_DEFINE_TYPE_WITH_CODE (ClutterActor,
clutter_actor,
G_TYPE_INITIALLY_UNOWNED,
@@ -3474,8 +3489,8 @@ _clutter_actor_draw_paint_volume_full (ClutterActor *self,
cogl_pipeline_set_color (outline, &cogl_color);
pipeline_node = clutter_pipeline_node_new (outline);
clutter_paint_node_set_name (pipeline_node,
"ClutterActor (paint volume outline)");
clutter_paint_node_set_static_name (pipeline_node,
"ClutterActor (paint volume outline)");
clutter_paint_node_add_primitive (pipeline_node, prim);
clutter_paint_node_add_child (node, pipeline_node);
cogl_object_unref (prim);
@@ -3489,8 +3504,8 @@ _clutter_actor_draw_paint_volume_full (ClutterActor *self,
pango_layout_set_text (layout, label, -1);
text_node = clutter_text_node_new (layout, color);
clutter_paint_node_set_name (text_node,
"ClutterActor (paint volume label)");
clutter_paint_node_set_static_name (text_node,
"ClutterActor (paint volume label)");
clutter_paint_node_add_rectangle (text_node,
&(ClutterActorBox) {
.x1 = pv->vertices[0].x,
@@ -3586,8 +3601,8 @@ _clutter_actor_paint_cull_result (ClutterActor *self,
pango_layout_set_text (layout, label, -1);
text_node = clutter_text_node_new (layout, &color);
clutter_paint_node_set_name (text_node,
"ClutterActor (paint volume text)");
clutter_paint_node_set_static_name (text_node,
"ClutterActor (paint volume text)");
clutter_paint_node_add_rectangle (text_node,
&(ClutterActorBox) {
.x1 = 0.f,
@@ -3743,7 +3758,13 @@ needs_flatten_effect (ClutterActor *self)
CLUTTER_DEBUG_DISABLE_OFFSCREEN_REDIRECT))
return FALSE;
if (priv->offscreen_redirect & CLUTTER_OFFSCREEN_REDIRECT_ALWAYS)
/* We need to enable the effect immediately even in ON_IDLE because that can
* only be implemented efficiently within the effect itself.
* If it was implemented here using just priv->is_dirty then we would lose
* the ability to animate opacity without repaints.
*/
if ((priv->offscreen_redirect & CLUTTER_OFFSCREEN_REDIRECT_ALWAYS) ||
(priv->offscreen_redirect & CLUTTER_OFFSCREEN_REDIRECT_ON_IDLE))
return TRUE;
else if (priv->offscreen_redirect & CLUTTER_OFFSCREEN_REDIRECT_AUTOMATIC_FOR_OPACITY)
{
@@ -3862,7 +3883,7 @@ clutter_actor_paint_node (ClutterActor *actor,
clear_flags = COGL_BUFFER_BIT_DEPTH;
node = clutter_root_node_new (fb, &bg_color, clear_flags);
clutter_paint_node_set_name (node, "stageClear");
clutter_paint_node_set_static_name (node, "stageClear");
clutter_paint_node_add_rectangle (node, &box);
clutter_paint_node_add_child (root, node);
clutter_paint_node_unref (node);
@@ -3877,7 +3898,7 @@ clutter_actor_paint_node (ClutterActor *actor,
/ 255;
node = clutter_color_node_new (&bg_color);
clutter_paint_node_set_name (node, "backgroundColor");
clutter_paint_node_set_static_name (node, "backgroundColor");
clutter_paint_node_add_rectangle (node, &box);
clutter_paint_node_add_child (root, node);
clutter_paint_node_unref (node);
@@ -3931,6 +3952,7 @@ clutter_actor_paint (ClutterActor *self,
g_autoptr (ClutterPaintNode) root_node = NULL;
ClutterActorPrivate *priv;
ClutterActorBox clip;
gboolean culling_inhibited;
gboolean clip_set = FALSE;
g_return_if_fail (CLUTTER_IS_ACTOR (self));
@@ -3997,11 +4019,14 @@ clutter_actor_paint (ClutterActor *self,
clutter_actor_get_transform (self, &transform);
transform_node = clutter_transform_node_new (&transform);
clutter_paint_node_add_child (transform_node, root_node);
clutter_paint_node_unref (root_node);
if (!cogl_matrix_is_identity (&transform))
{
transform_node = clutter_transform_node_new (&transform);
clutter_paint_node_add_child (transform_node, root_node);
clutter_paint_node_unref (root_node);
root_node = g_steal_pointer (&transform_node);
root_node = g_steal_pointer (&transform_node);
}
#ifdef CLUTTER_ENABLE_DEBUG
/* Catch when out-of-band transforms have been made by actors not as part
@@ -4076,7 +4101,8 @@ clutter_actor_paint (ClutterActor *self,
* paint then the last-paint-volume would likely represent the new
* actor position not the old.
*/
if (!in_clone_paint ())
culling_inhibited = priv->inhibit_culling_counter > 0;
if (!culling_inhibited && !in_clone_paint ())
{
gboolean success;
/* annoyingly gcc warns if uninitialized even though
@@ -4158,7 +4184,7 @@ clutter_actor_continue_paint (ClutterActor *self,
*/
framebuffer = clutter_paint_context_get_base_framebuffer (paint_context);
dummy = _clutter_dummy_node_new (self, framebuffer);
clutter_paint_node_set_name (dummy, "Root");
clutter_paint_node_set_static_name (dummy, "Root");
/* XXX - for 1.12, we use the return value of paint_node() to
* decide whether we should emit the ::paint signal.
@@ -4198,6 +4224,11 @@ clutter_actor_continue_paint (ClutterActor *self,
run_flags |= CLUTTER_EFFECT_PAINT_ACTOR_DIRTY;
}
if (priv->current_effect == priv->flatten_effect &&
priv->offscreen_redirect & CLUTTER_OFFSCREEN_REDIRECT_ON_IDLE &&
run_flags & CLUTTER_EFFECT_PAINT_ACTOR_DIRTY)
run_flags |= CLUTTER_EFFECT_PAINT_BYPASS_EFFECT;
_clutter_effect_paint (priv->current_effect, paint_context, run_flags);
priv->current_effect = old_current_effect;
@@ -4568,7 +4599,7 @@ clutter_actor_remove_child_internal (ClutterActor *self,
/* we need to emit the signal before dropping the reference */
if (emit_actor_removed)
g_signal_emit_by_name (self, "actor-removed", child);
_clutter_container_emit_actor_removed (CLUTTER_CONTAINER (self), child);
if (notify_first_last)
{
@@ -6531,6 +6562,20 @@ clutter_actor_class_init (ClutterActorClass *klass)
quark_actor_transform_info = g_quark_from_static_string ("-clutter-actor-transform-info");
quark_actor_animation_info = g_quark_from_static_string ("-clutter-actor-animation-info");
quark_key = g_quark_from_static_string ("key");
quark_motion = g_quark_from_static_string ("motion");
quark_pointer_focus = g_quark_from_static_string ("pointer-focus");
quark_button = g_quark_from_static_string ("button");
quark_scroll = g_quark_from_static_string ("scroll");
quark_stage = g_quark_from_static_string ("stage");
quark_destroy = g_quark_from_static_string ("destroy");
quark_client = g_quark_from_static_string ("client");
quark_delete = g_quark_from_static_string ("delete");
quark_touch = g_quark_from_static_string ("touch");
quark_touchpad = g_quark_from_static_string ("touchpad");
quark_proximity = g_quark_from_static_string ("proximity");
quark_pad = g_quark_from_static_string ("pad");
object_class->constructor = clutter_actor_constructor;
object_class->set_property = clutter_actor_set_property;
object_class->get_property = clutter_actor_get_property;
@@ -8566,7 +8611,7 @@ clutter_actor_class_init (ClutterActorClass *klass)
actor_signals[CAPTURED_EVENT] =
g_signal_new (I_("captured-event"),
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED,
G_STRUCT_OFFSET (ClutterActorClass, captured_event),
_clutter_boolean_handled_accumulator, NULL,
_clutter_marshal_BOOLEAN__BOXED,
@@ -13212,7 +13257,7 @@ clutter_actor_add_child_internal (ClutterActor *self,
}
if (emit_actor_added)
g_signal_emit_by_name (self, "actor-added", child);
_clutter_container_emit_actor_added (CLUTTER_CONTAINER (self), child);
if (notify_first_last)
{
@@ -13876,8 +13921,70 @@ clutter_actor_event (ClutterActor *actor,
if (capture)
{
g_signal_emit (actor, actor_signals[CAPTURED_EVENT], 0,
event,
GQuark detail = 0;
switch (event->type)
{
case CLUTTER_NOTHING:
break;
case CLUTTER_KEY_PRESS:
case CLUTTER_KEY_RELEASE:
detail = quark_key;
break;
case CLUTTER_MOTION:
detail = quark_motion;
break;
case CLUTTER_ENTER:
case CLUTTER_LEAVE:
detail = quark_pointer_focus;
break;
case CLUTTER_BUTTON_PRESS:
case CLUTTER_BUTTON_RELEASE:
detail = quark_button;
break;
case CLUTTER_SCROLL:
detail = quark_scroll;
break;
case CLUTTER_STAGE_STATE:
detail = quark_stage;
break;
case CLUTTER_DESTROY_NOTIFY:
detail = quark_destroy;
break;
case CLUTTER_CLIENT_MESSAGE:
detail = quark_client;
break;
case CLUTTER_DELETE:
detail = quark_delete;
break;
case CLUTTER_TOUCH_BEGIN:
case CLUTTER_TOUCH_UPDATE:
case CLUTTER_TOUCH_END:
case CLUTTER_TOUCH_CANCEL:
detail = quark_touch;
break;
case CLUTTER_TOUCHPAD_PINCH:
case CLUTTER_TOUCHPAD_SWIPE:
detail = quark_touchpad;
break;
case CLUTTER_PROXIMITY_IN:
case CLUTTER_PROXIMITY_OUT:
detail = quark_proximity;
break;
case CLUTTER_PAD_BUTTON_PRESS:
case CLUTTER_PAD_BUTTON_RELEASE:
case CLUTTER_PAD_STRIP:
case CLUTTER_PAD_RING:
detail = quark_pad;
break;
case CLUTTER_EVENT_LAST: /* Just keep compiler warnings quiet */
break;
}
g_signal_emit (actor,
actor_signals[CAPTURED_EVENT],
detail,
event,
&retval);
goto out;
}
@@ -15898,6 +16005,63 @@ clutter_actor_get_opacity_override (ClutterActor *self)
return self->priv->opacity_override;
}
/**
* clutter_actor_inhibit_culling:
* @actor: a #ClutterActor
*
* Increases the culling inhibitor counter. Inhibiting culling
* forces the actor to be painted even when outside the visible
* bounds of the stage view.
*
* This is usually necessary when an actor is being painted on
* another paint context.
*
* Pair with clutter_actor_uninhibit_culling() when the actor doesn't
* need to be painted anymore.
*/
void
clutter_actor_inhibit_culling (ClutterActor *actor)
{
ClutterActorPrivate *priv;
g_return_if_fail (CLUTTER_IS_ACTOR (actor));
priv = actor->priv;
priv->inhibit_culling_counter++;
_clutter_actor_set_enable_paint_unmapped (actor, TRUE);
}
/**
* clutter_actor_uninhibit_culling:
* @actor: a #ClutterActor
*
* Decreases the culling inhibitor counter. See clutter_actor_inhibit_culling()
* for when inhibit culling is necessary.
*
* Calling this function without a matching call to
* clutter_actor_inhibit_culling() is a programming error.
*/
void
clutter_actor_uninhibit_culling (ClutterActor *actor)
{
ClutterActorPrivate *priv;
g_return_if_fail (CLUTTER_IS_ACTOR (actor));
priv = actor->priv;
if (priv->inhibit_culling_counter == 0)
{
g_critical ("Unpaired call to clutter_actor_uninhibit_culling");
return;
}
priv->inhibit_culling_counter--;
if (priv->inhibit_culling_counter == 0)
_clutter_actor_set_enable_paint_unmapped (actor, FALSE);
}
/* Allows you to disable applying the actors model view transform during
* a paint. Used by ClutterClone. */
void
@@ -17611,10 +17775,42 @@ _clutter_actor_compute_resource_scale (ClutterActor *self,
resource_scale))
{
if (priv->parent)
return _clutter_actor_compute_resource_scale (priv->parent,
resource_scale);
{
gboolean in_clone_paint;
gboolean was_parent_in_clone_paint;
gboolean was_parent_unmapped;
gboolean was_parent_paint_unmapped;
gboolean ret;
in_clone_paint = clutter_actor_is_in_clone_paint (self);
was_parent_unmapped = !clutter_actor_is_mapped (priv->parent);
was_parent_in_clone_paint =
clutter_actor_is_in_clone_paint (priv->parent);
was_parent_paint_unmapped = priv->parent->priv->enable_paint_unmapped;
if (in_clone_paint && was_parent_unmapped)
{
_clutter_actor_set_in_clone_paint (priv->parent, TRUE);
_clutter_actor_set_enable_paint_unmapped (priv->parent, TRUE);
}
ret = _clutter_actor_compute_resource_scale (priv->parent,
resource_scale);
if (in_clone_paint && was_parent_unmapped)
{
_clutter_actor_set_in_clone_paint (priv->parent,
was_parent_in_clone_paint);
_clutter_actor_set_enable_paint_unmapped (priv->parent,
was_parent_paint_unmapped);
}
return ret;
}
else
return FALSE;
{
return FALSE;
}
}
return TRUE;
@@ -21157,7 +21353,7 @@ clutter_actor_create_texture_paint_node (ClutterActor *self,
color.alpha = clutter_actor_get_paint_opacity_internal (self);
node = clutter_texture_node_new (texture, &color, priv->min_filter, priv->mag_filter);
clutter_paint_node_set_name (node, "Texture");
clutter_paint_node_set_static_name (node, "Texture");
if (priv->content_repeat == CLUTTER_REPEAT_NONE)
clutter_paint_node_add_rectangle (node, &box);
@@ -21178,3 +21374,14 @@ clutter_actor_create_texture_paint_node (ClutterActor *self,
return node;
}
gboolean
clutter_actor_has_accessible (ClutterActor *actor)
{
g_return_val_if_fail (CLUTTER_IS_ACTOR (actor), FALSE);
if (CLUTTER_ACTOR_GET_CLASS (actor)->has_accessible)
return CLUTTER_ACTOR_GET_CLASS (actor)->has_accessible (actor);
return TRUE;
}

View File

@@ -299,10 +299,11 @@ struct _ClutterActorClass
gboolean (* touch_event) (ClutterActor *self,
ClutterTouchEvent *event);
gboolean (* has_accessible) (ClutterActor *self);
/*< private >*/
/* padding for future expansion */
gpointer _padding_dummy[26];
gpointer _padding_dummy[25];
};
/**
@@ -380,6 +381,8 @@ CLUTTER_EXPORT
const gchar * clutter_actor_get_name (ClutterActor *self);
CLUTTER_EXPORT
AtkObject * clutter_actor_get_accessible (ClutterActor *self);
CLUTTER_EXPORT
gboolean clutter_actor_has_accessible (ClutterActor *self);
CLUTTER_EXPORT
gboolean clutter_actor_is_visible (ClutterActor *self);
@@ -881,6 +884,11 @@ void clutter_actor_set_opacity_override
CLUTTER_EXPORT
gint clutter_actor_get_opacity_override (ClutterActor *self);
CLUTTER_EXPORT
void clutter_actor_inhibit_culling (ClutterActor *actor);
CLUTTER_EXPORT
void clutter_actor_uninhibit_culling (ClutterActor *actor);
/**
* ClutterActorCreateChildFunc:
* @item: (type GObject): the item in the model

View File

@@ -352,7 +352,7 @@ clutter_canvas_paint_content (ClutterContent *content,
return;
node = clutter_actor_create_texture_paint_node (actor, priv->texture);
clutter_paint_node_set_name (node, "Canvas Content");
clutter_paint_node_set_static_name (node, "Canvas Content");
clutter_paint_node_add_child (root, node);
clutter_paint_node_unref (node);

View File

@@ -0,0 +1,36 @@
/*
* Clutter.
*
* An OpenGL based 'interactive canvas' library.
*
* Copyright 2020 Red Hat, Inc.
*
* 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/>.
*/
#ifndef __CLUTTER_CONTAINER_PRIVATE_H__
#define __CLUTTER_CONTAINER_PRIVATE_H__
#include <clutter/clutter-container.h>
G_BEGIN_DECLS
void _clutter_container_emit_actor_added (ClutterContainer *container,
ClutterActor *actor);
void _clutter_container_emit_actor_removed (ClutterContainer *container,
ClutterActor *actor);
G_END_DECLS
#endif /* __CLUTTER_CONTAINER_PRIVATE_H__ */

View File

@@ -37,6 +37,7 @@
#include "clutter-actor-private.h"
#include "clutter-child-meta.h"
#include "clutter-container-private.h"
#include "clutter-debug.h"
#include "clutter-main.h"
#include "clutter-marshal.h"
@@ -1250,3 +1251,23 @@ clutter_container_child_notify (ClutterContainer *container,
child,
pspec);
}
void
_clutter_container_emit_actor_added (ClutterContainer *container,
ClutterActor *actor)
{
g_return_if_fail (CLUTTER_IS_CONTAINER (container));
g_return_if_fail (CLUTTER_IS_ACTOR (actor));
g_signal_emit (container, container_signals[ACTOR_ADDED], 0, actor);
}
void
_clutter_container_emit_actor_removed (ClutterContainer *container,
ClutterActor *actor)
{
g_return_if_fail (CLUTTER_IS_CONTAINER (container));
g_return_if_fail (CLUTTER_IS_ACTOR (actor));
g_signal_emit (container, container_signals[ACTOR_REMOVED], 0, actor);
}

View File

@@ -538,6 +538,10 @@ typedef enum /*< prefix=CLUTTER_ACTOR >*/
* virtual returns %TRUE.
* @CLUTTER_OFFSCREEN_REDIRECT_ALWAYS: Always redirect the actor to an
* offscreen buffer even if it is fully opaque.
* @CLUTTER_OFFSCREEN_REDIRECT_ON_IDLE: Only redirect the actor if it is the
* most efficient thing to do based on its recent repaint behaviour. That
* means when its contents are changing less frequently than it's being used
* on stage.
*
* Possible flags to pass to clutter_actor_set_offscreen_redirect().
*
@@ -545,8 +549,9 @@ typedef enum /*< prefix=CLUTTER_ACTOR >*/
*/
typedef enum /*< prefix=CLUTTER_OFFSCREEN_REDIRECT >*/
{
CLUTTER_OFFSCREEN_REDIRECT_AUTOMATIC_FOR_OPACITY = 1<<0,
CLUTTER_OFFSCREEN_REDIRECT_ALWAYS = 1<<1
CLUTTER_OFFSCREEN_REDIRECT_AUTOMATIC_FOR_OPACITY = 1 << 0,
CLUTTER_OFFSCREEN_REDIRECT_ALWAYS = 1 << 1,
CLUTTER_OFFSCREEN_REDIRECT_ON_IDLE = 1 << 2
} ClutterOffscreenRedirect;
/**
@@ -673,12 +678,15 @@ typedef enum /*< prefix=CLUTTER_BIND >*/
* has queued a redraw before this paint. This implies that the effect
* should call clutter_actor_continue_paint() to chain to the next
* effect and can not cache any results from a previous paint.
* @CLUTTER_EFFECT_PAINT_BYPASS_EFFECT: The effect should not be used
* on this frame, but it will be asked to paint the actor still.
*
* Flags passed to the paint or pick method of #ClutterEffect.
*/
typedef enum /*< prefix=CLUTTER_EFFECT_PAINT >*/
{
CLUTTER_EFFECT_PAINT_ACTOR_DIRTY = (1 << 0)
CLUTTER_EFFECT_PAINT_ACTOR_DIRTY = (1 << 0),
CLUTTER_EFFECT_PAINT_BYPASS_EFFECT = (1 << 1)
} ClutterEffectPaintFlags;
/**

View File

@@ -130,7 +130,7 @@ clutter_image_paint_content (ClutterContent *content,
return;
node = clutter_actor_create_texture_paint_node (actor, priv->texture);
clutter_paint_node_set_name (node, "Image Content");
clutter_paint_node_set_static_name (node, "Image Content");
clutter_paint_node_add_child (root, node);
clutter_paint_node_unref (node);
}

View File

@@ -29,7 +29,7 @@ void clutter_input_focus_focus_out (ClutterInputFocus *focus);
void clutter_input_focus_commit (ClutterInputFocus *focus,
const gchar *text);
void clutter_input_focus_delete_surrounding (ClutterInputFocus *focus,
guint offset,
int offset,
guint len);
void clutter_input_focus_request_surrounding (ClutterInputFocus *focus);

View File

@@ -217,7 +217,7 @@ clutter_input_focus_commit (ClutterInputFocus *focus,
void
clutter_input_focus_delete_surrounding (ClutterInputFocus *focus,
guint offset,
int offset,
guint len)
{
g_return_if_fail (CLUTTER_IS_INPUT_FOCUS (focus));

View File

@@ -41,7 +41,7 @@ struct _ClutterInputFocusClass
void (* request_surrounding) (ClutterInputFocus *focus);
void (* delete_surrounding) (ClutterInputFocus *focus,
guint offset,
int offset,
guint len);
void (* commit_text) (ClutterInputFocus *focus,
const gchar *text);

View File

@@ -168,7 +168,7 @@ clutter_input_method_class_init (ClutterInputMethodClass *klass)
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
0, NULL, NULL, NULL,
G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT);
G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_UINT);
signals[REQUEST_SURROUNDING] =
g_signal_new ("request-surrounding",
G_TYPE_FROM_CLASS (object_class),
@@ -292,7 +292,7 @@ clutter_input_method_commit (ClutterInputMethod *im,
void
clutter_input_method_delete_surrounding (ClutterInputMethod *im,
guint offset,
int offset,
guint len)
{
ClutterInputMethodPrivate *priv;

View File

@@ -68,7 +68,7 @@ void clutter_input_method_commit (ClutterInputMethod *im,
const gchar *text);
CLUTTER_EXPORT
void clutter_input_method_delete_surrounding (ClutterInputMethod *im,
guint offset,
int offset,
guint len);
CLUTTER_EXPORT
void clutter_input_method_request_surrounding (ClutterInputMethod *im);

View File

@@ -63,6 +63,7 @@
#include "clutter-main.h"
#include "clutter-master-clock.h"
#include "clutter-mutter.h"
#include "clutter-paint-node-private.h"
#include "clutter-private.h"
#include "clutter-settings-private.h"
#include "clutter-stage-manager.h"
@@ -970,6 +971,9 @@ clutter_init_real (GError **error)
if (clutter_enable_accessibility)
cally_accessibility_init ();
/* Initialize types required for paint nodes */
_clutter_paint_node_init_types ();
return CLUTTER_INIT_SUCCESS;
}

View File

@@ -31,6 +31,8 @@
#include "clutter-build-config.h"
#include <cogl/cogl.h>
#include "clutter-master-clock.h"
#include "clutter-master-clock-default.h"
#include "clutter-debug.h"
@@ -461,6 +463,8 @@ clutter_clock_dispatch (GSource *source,
_clutter_threads_acquire_lock ();
COGL_TRACE_BEGIN (ClutterMasterClockTick, "Master Clock (tick)");
/* Get the time to use for this frame */
master_clock->cur_tick = g_source_get_time (source);
@@ -492,6 +496,8 @@ clutter_clock_dispatch (GSource *source,
g_slist_free_full (stages, g_object_unref);
COGL_TRACE_END (ClutterMasterClockTick);
_clutter_threads_release_lock ();
return TRUE;

View File

@@ -469,6 +469,13 @@ clutter_offscreen_effect_paint (ClutterEffect *effect,
ClutterOffscreenEffect *self = CLUTTER_OFFSCREEN_EFFECT (effect);
ClutterOffscreenEffectPrivate *priv = self->priv;
if (flags & CLUTTER_EFFECT_PAINT_BYPASS_EFFECT)
{
clutter_actor_continue_paint (priv->actor, paint_context);
cogl_clear_object (&priv->offscreen);
return;
}
/* If we've already got a cached image and the actor hasn't been redrawn
* then we can just use the cached image in the FBO.
*/

View File

@@ -20,7 +20,8 @@
#include "clutter-paint-context.h"
ClutterPaintContext * clutter_paint_context_new_for_view (ClutterStageView *view);
ClutterPaintContext * clutter_paint_context_new_for_view (ClutterStageView *view,
const cairo_region_t *redraw_clip);
gboolean clutter_paint_context_is_drawing_off_stage (ClutterPaintContext *paint_context);

View File

@@ -26,6 +26,8 @@ struct _ClutterPaintContext
GList *framebuffers;
ClutterStageView *view;
cairo_region_t *redraw_clip;
};
G_DEFINE_BOXED_TYPE (ClutterPaintContext, clutter_paint_context,
@@ -33,7 +35,8 @@ G_DEFINE_BOXED_TYPE (ClutterPaintContext, clutter_paint_context,
clutter_paint_context_unref)
ClutterPaintContext *
clutter_paint_context_new_for_view (ClutterStageView *view)
clutter_paint_context_new_for_view (ClutterStageView *view,
const cairo_region_t *redraw_clip)
{
ClutterPaintContext *paint_context;
CoglFramebuffer *framebuffer;
@@ -41,6 +44,7 @@ clutter_paint_context_new_for_view (ClutterStageView *view)
paint_context = g_new0 (ClutterPaintContext, 1);
g_ref_count_init (&paint_context->ref_count);
paint_context->view = view;
paint_context->redraw_clip = cairo_region_copy (redraw_clip);
framebuffer = clutter_stage_view_get_framebuffer (view);
clutter_paint_context_push_framebuffer (paint_context, framebuffer);
@@ -77,6 +81,7 @@ clutter_paint_context_dispose (ClutterPaintContext *paint_context)
g_list_free_full (paint_context->framebuffers,
cogl_object_unref);
paint_context->framebuffers = NULL;
g_clear_pointer (&paint_context->redraw_clip, cairo_region_destroy);
}
void
@@ -115,6 +120,12 @@ clutter_paint_context_pop_framebuffer (ClutterPaintContext *paint_context)
paint_context->framebuffers);
}
const cairo_region_t *
clutter_paint_context_get_redraw_clip (ClutterPaintContext *paint_context)
{
return paint_context->redraw_clip;
}
/**
* clutter_paint_context_get_framebuffer:
* @paint_context: The #ClutterPaintContext

View File

@@ -59,4 +59,7 @@ void clutter_paint_context_push_framebuffer (ClutterPaintContext *paint_context,
CLUTTER_EXPORT
void clutter_paint_context_pop_framebuffer (ClutterPaintContext *paint_context);
CLUTTER_EXPORT
const cairo_region_t * clutter_paint_context_get_redraw_clip (ClutterPaintContext *paint_context);
#endif /* CLUTTER_PAINT_CONTEXT_H */

View File

@@ -49,11 +49,11 @@ struct _ClutterPaintNode
ClutterPaintNode *next_sibling;
ClutterPaintNode *last_child;
guint n_children;
GArray *operations;
gchar *name;
const gchar *name;
guint n_children;
volatile int ref_count;
};

View File

@@ -171,8 +171,6 @@ clutter_paint_node_real_finalize (ClutterPaintNode *node)
{
ClutterPaintNode *iter;
g_free (node->name);
if (node->operations != NULL)
{
guint i;
@@ -297,7 +295,8 @@ clutter_paint_node_get_type (void)
*
* The @name will be used for debugging purposes.
*
* The @node will copy the passed string.
* The @node will intern @name using g_intern_string(). If you have access to a
* static string, use clutter_paint_node_set_static_name() instead.
*
* Since: 1.10
*/
@@ -307,8 +306,22 @@ clutter_paint_node_set_name (ClutterPaintNode *node,
{
g_return_if_fail (CLUTTER_IS_PAINT_NODE (node));
g_free (node->name);
node->name = g_strdup (name);
node->name = g_intern_string (name);
}
/**
* clutter_paint_node_set_static_name: (skip)
*
* Like clutter_paint_node_set_name() but uses a static or interned string
* containing the name.
*/
void
clutter_paint_node_set_static_name (ClutterPaintNode *node,
const char *name)
{
g_return_if_fail (CLUTTER_IS_PAINT_NODE (node));
node->name = name;
}
/**
@@ -1181,8 +1194,6 @@ _clutter_paint_node_create (GType gtype)
{
g_return_val_if_fail (g_type_is_a (gtype, CLUTTER_TYPE_PAINT_NODE), NULL);
_clutter_paint_node_init_types ();
return (gpointer) g_type_create_instance (gtype);
}

View File

@@ -56,6 +56,9 @@ void clutter_paint_node_paint (Clutter
CLUTTER_EXPORT
void clutter_paint_node_set_name (ClutterPaintNode *node,
const char *name);
CLUTTER_EXPORT
void clutter_paint_node_set_static_name (ClutterPaintNode *node,
const char *name);
CLUTTER_EXPORT
CoglFramebuffer * clutter_paint_node_get_framebuffer (ClutterPaintNode *node);

View File

@@ -248,6 +248,9 @@ gboolean _clutter_util_rectangle_intersection (const cairo_rectangle_int_t *src1
const cairo_rectangle_int_t *src2,
cairo_rectangle_int_t *dest);
gboolean clutter_util_rectangle_equal (const cairo_rectangle_int_t *src1,
const cairo_rectangle_int_t *src2);
struct _ClutterVertex4
{

View File

@@ -41,6 +41,7 @@ enum
PTR_A11Y_DWELL_CLICK_TYPE_CHANGED,
PTR_A11Y_TIMEOUT_STARTED,
PTR_A11Y_TIMEOUT_STOPPED,
IS_UNFOCUS_INHIBITED_CHANGED,
N_SIGNALS,
};
@@ -62,6 +63,8 @@ struct _ClutterSeatPrivate
{
ClutterBackend *backend;
unsigned int inhibit_unfocus_count;
/* Keyboard a11y */
ClutterKbdA11ySettings kbd_a11y_settings;
@@ -275,6 +278,22 @@ clutter_seat_class_init (ClutterSeatClass *klass)
G_TYPE_FROM_CLASS (object_class),
_clutter_marshal_VOID__OBJECT_FLAGS_BOOLEANv);
/**
* ClutterSeat::is-unfocus-inhibited-changed:
* @seat: the #ClutterSeat that emitted the signal
*
* The ::is-unfocus-inhibited-changed signal is emitted when the
* property to inhibit the unsetting of the focus-surface of the
* #ClutterSeat changed. To get the current state of this property,
* use clutter_seat_is_unfocus_inhibited().
*/
signals[IS_UNFOCUS_INHIBITED_CHANGED] =
g_signal_new (I_("is-unfocus-inhibited-changed"),
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
0, NULL, NULL, NULL,
G_TYPE_NONE, 0);
props[PROP_BACKEND] =
g_param_spec_object ("backend",
P_("Backend"),
@@ -282,6 +301,12 @@ clutter_seat_class_init (ClutterSeatClass *klass)
CLUTTER_TYPE_BACKEND,
CLUTTER_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
/**
* ClutterSeat:touch-mode:
*
* The current touch-mode of the #ClutterSeat, it is set to %TRUE if the
* requirements documented in clutter_seat_get_touch_mode() are fulfilled.
**/
props[PROP_TOUCH_MODE] =
g_param_spec_boolean ("touch-mode",
P_("Touch mode"),
@@ -508,6 +533,85 @@ clutter_seat_set_pointer_a11y_dwell_click_type (ClutterSeat
priv->pointer_a11y_settings.dwell_click_type = click_type;
}
/**
* clutter_seat_inhibit_unfocus:
* @seat: a #ClutterSeat
*
* Inhibits unsetting of the pointer focus-surface for the #ClutterSeat @seat,
* this allows to keep using the pointer even when it's hidden.
*
* This property is refcounted, so clutter_seat_uninhibit_unfocus() must be
* called the exact same number of times as clutter_seat_inhibit_unfocus()
* was called before.
**/
void
clutter_seat_inhibit_unfocus (ClutterSeat *seat)
{
ClutterSeatPrivate *priv;
g_return_if_fail (CLUTTER_IS_SEAT (seat));
priv = clutter_seat_get_instance_private (seat);
priv->inhibit_unfocus_count++;
if (priv->inhibit_unfocus_count == 1)
g_signal_emit (G_OBJECT (seat), signals[IS_UNFOCUS_INHIBITED_CHANGED], 0);
}
/**
* clutter_seat_uninhibit_unfocus:
* @seat: a #ClutterSeat
*
* Disables the inhibiting of unsetting of the pointer focus-surface
* previously enabled by calling clutter_seat_inhibit_unfocus().
*
* This property is refcounted, so clutter_seat_uninhibit_unfocus() must be
* called the exact same number of times as clutter_seat_inhibit_unfocus()
* was called before.
**/
void
clutter_seat_uninhibit_unfocus (ClutterSeat *seat)
{
ClutterSeatPrivate *priv;
g_return_if_fail (CLUTTER_IS_SEAT (seat));
priv = clutter_seat_get_instance_private (seat);
if (priv->inhibit_unfocus_count == 0)
{
g_warning ("Called clutter_seat_uninhibit_unfocus without inhibiting before");
return;
}
priv->inhibit_unfocus_count--;
if (priv->inhibit_unfocus_count == 0)
g_signal_emit (G_OBJECT (seat), signals[IS_UNFOCUS_INHIBITED_CHANGED], 0);
}
/**
* clutter_seat_is_unfocus_inhibited:
* @seat: a #ClutterSeat
*
* Gets whether unsetting of the pointer focus-surface is inhibited
* for the #ClutterSeat @seat.
*
* Returns: %TRUE if unsetting is inhibited, %FALSE otherwise
**/
gboolean
clutter_seat_is_unfocus_inhibited (ClutterSeat *seat)
{
ClutterSeatPrivate *priv;
g_return_val_if_fail (CLUTTER_IS_SEAT (seat), FALSE);
priv = clutter_seat_get_instance_private (seat);
return priv->inhibit_unfocus_count > 0;
}
/**
* clutter_seat_create_virtual_device:
* @seat: a #ClutterSeat
@@ -569,6 +673,21 @@ clutter_seat_warp_pointer (ClutterSeat *seat,
CLUTTER_SEAT_GET_CLASS (seat)->warp_pointer (seat, x, y);
}
/**
* clutter_seat_get_touch_mode:
* @seat: a #ClutterSeat
*
* Gets the current touch-mode state of the #ClutterSeat @seat.
* The #ClutterSeat:touch-mode property is set to %TRUE if the following
* requirements are fulfilled:
*
* - A touchscreen is available
* - No external keyboard is attached to the device
* - A tablet mode switch, if present, is enabled
*
* Returns: %TRUE if the device is a tablet that doesn't have an external
* keyboard attached, %FALSE otherwise.
**/
gboolean
clutter_seat_get_touch_mode (ClutterSeat *seat)
{

View File

@@ -159,6 +159,16 @@ void clutter_seat_get_pointer_a11y_settings (ClutterSeat *seat,
CLUTTER_EXPORT
void clutter_seat_set_pointer_a11y_dwell_click_type (ClutterSeat *seat,
ClutterPointerA11yDwellClickType click_type);
CLUTTER_EXPORT
void clutter_seat_inhibit_unfocus (ClutterSeat *seat);
CLUTTER_EXPORT
void clutter_seat_uninhibit_unfocus (ClutterSeat *seat);
CLUTTER_EXPORT
gboolean clutter_seat_is_unfocus_inhibited (ClutterSeat *seat);
CLUTTER_EXPORT
ClutterVirtualInputDevice *clutter_seat_create_virtual_device (ClutterSeat *seat,
ClutterInputDeviceType device_type);

View File

@@ -36,9 +36,9 @@ typedef struct _ClutterStageQueueRedrawEntry ClutterStageQueueRedrawEntry;
/* stage */
ClutterStageWindow *_clutter_stage_get_default_window (void);
void _clutter_stage_paint_view (ClutterStage *stage,
ClutterStageView *view,
const cairo_rectangle_int_t *clip);
void clutter_stage_paint_view (ClutterStage *stage,
ClutterStageView *view,
const cairo_region_t *redraw_clip);
void _clutter_stage_emit_after_paint (ClutterStage *stage);

View File

@@ -20,8 +20,7 @@
#include "clutter/clutter-stage-view.h"
void clutter_stage_view_after_paint (ClutterStageView *view,
const cairo_rectangle_int_t *clip);
void clutter_stage_view_after_paint (ClutterStageView *view);
gboolean clutter_stage_view_is_dirty_viewport (ClutterStageView *view);
@@ -33,7 +32,15 @@ gboolean clutter_stage_view_is_dirty_projection (ClutterStageView *view);
void clutter_stage_view_set_dirty_projection (ClutterStageView *view,
gboolean dirty);
void clutter_stage_view_add_redraw_clip (ClutterStageView *view,
cairo_rectangle_int_t *clip);
void clutter_stage_view_add_redraw_clip (ClutterStageView *view,
const cairo_rectangle_int_t *clip);
gboolean clutter_stage_view_has_full_redraw_clip (ClutterStageView *view);
gboolean clutter_stage_view_has_redraw_clip (ClutterStageView *view);
const cairo_region_t * clutter_stage_view_peek_redraw_clip (ClutterStageView *view);
cairo_region_t * clutter_stage_view_take_redraw_clip (ClutterStageView *view);
#endif /* __CLUTTER_STAGE_VIEW_PRIVATE_H__ */

View File

@@ -23,6 +23,8 @@
#include <cairo-gobject.h>
#include <math.h>
#include "clutter/clutter-private.h"
enum
{
PROP_0,
@@ -50,6 +52,9 @@ typedef struct _ClutterStageViewPrivate
CoglOffscreen *shadowfb;
CoglPipeline *shadowfb_pipeline;
gboolean has_redraw_clip;
cairo_region_t *redraw_clip;
guint dirty_viewport : 1;
guint dirty_projection : 1;
} ClutterStageViewPrivate;
@@ -166,12 +171,11 @@ clutter_stage_view_invalidate_offscreen_blit_pipeline (ClutterStageView *view)
}
static void
clutter_stage_view_copy_to_framebuffer (ClutterStageView *view,
const cairo_rectangle_int_t *rect,
CoglPipeline *pipeline,
CoglFramebuffer *src_framebuffer,
CoglFramebuffer *dst_framebuffer,
gboolean can_blit)
clutter_stage_view_copy_to_framebuffer (ClutterStageView *view,
CoglPipeline *pipeline,
CoglFramebuffer *src_framebuffer,
CoglFramebuffer *dst_framebuffer,
gboolean can_blit)
{
CoglMatrix matrix;
@@ -204,8 +208,7 @@ clutter_stage_view_copy_to_framebuffer (ClutterStageView *view,
}
void
clutter_stage_view_after_paint (ClutterStageView *view,
const cairo_rectangle_int_t *rect)
clutter_stage_view_after_paint (ClutterStageView *view)
{
ClutterStageViewPrivate *priv =
clutter_stage_view_get_instance_private (view);
@@ -222,7 +225,6 @@ clutter_stage_view_after_paint (ClutterStageView *view,
if (priv->shadowfb)
{
clutter_stage_view_copy_to_framebuffer (view,
rect,
priv->offscreen_pipeline,
priv->offscreen,
priv->shadowfb,
@@ -231,7 +233,6 @@ clutter_stage_view_after_paint (ClutterStageView *view,
else
{
clutter_stage_view_copy_to_framebuffer (view,
rect,
priv->offscreen_pipeline,
priv->offscreen,
priv->framebuffer,
@@ -243,7 +244,6 @@ clutter_stage_view_after_paint (ClutterStageView *view,
{
clutter_stage_view_ensure_shadowfb_blit_pipeline (view);
clutter_stage_view_copy_to_framebuffer (view,
rect,
priv->shadowfb_pipeline,
priv->shadowfb,
priv->framebuffer,
@@ -307,6 +307,86 @@ clutter_stage_view_get_offscreen_transformation_matrix (ClutterStageView *view,
view_class->get_offscreen_transformation_matrix (view, matrix);
}
void
clutter_stage_view_add_redraw_clip (ClutterStageView *view,
const cairo_rectangle_int_t *clip)
{
ClutterStageViewPrivate *priv =
clutter_stage_view_get_instance_private (view);
if (priv->has_redraw_clip && !priv->redraw_clip)
return;
if (!clip)
{
g_clear_pointer (&priv->redraw_clip, cairo_region_destroy);
priv->has_redraw_clip = TRUE;
return;
}
if (clip->width == 0 || clip->height == 0)
return;
if (!priv->redraw_clip)
{
if (!clutter_util_rectangle_equal (&priv->layout, clip))
priv->redraw_clip = cairo_region_create_rectangle (clip);
}
else
{
cairo_region_union_rectangle (priv->redraw_clip, clip);
if (cairo_region_num_rectangles (priv->redraw_clip) == 1)
{
cairo_rectangle_int_t redraw_clip_extents;
cairo_region_get_extents (priv->redraw_clip, &redraw_clip_extents);
if (clutter_util_rectangle_equal (&priv->layout, &redraw_clip_extents))
g_clear_pointer (&priv->redraw_clip, cairo_region_destroy);
}
}
priv->has_redraw_clip = TRUE;
}
gboolean
clutter_stage_view_has_redraw_clip (ClutterStageView *view)
{
ClutterStageViewPrivate *priv =
clutter_stage_view_get_instance_private (view);
return priv->has_redraw_clip;
}
gboolean
clutter_stage_view_has_full_redraw_clip (ClutterStageView *view)
{
ClutterStageViewPrivate *priv =
clutter_stage_view_get_instance_private (view);
return priv->has_redraw_clip && !priv->redraw_clip;
}
const cairo_region_t *
clutter_stage_view_peek_redraw_clip (ClutterStageView *view)
{
ClutterStageViewPrivate *priv =
clutter_stage_view_get_instance_private (view);
return priv->redraw_clip;
}
cairo_region_t *
clutter_stage_view_take_redraw_clip (ClutterStageView *view)
{
ClutterStageViewPrivate *priv =
clutter_stage_view_get_instance_private (view);
priv->has_redraw_clip = FALSE;
return g_steal_pointer (&priv->redraw_clip);
}
void
clutter_stage_view_transform_to_onscreen (ClutterStageView *view,
gfloat *x,
@@ -419,6 +499,7 @@ clutter_stage_view_dispose (GObject *object)
g_clear_pointer (&priv->offscreen, cogl_object_unref);
g_clear_pointer (&priv->offscreen_pipeline, cogl_object_unref);
g_clear_pointer (&priv->shadowfb_pipeline, cogl_object_unref);
g_clear_pointer (&priv->redraw_clip, cairo_region_destroy);
G_OBJECT_CLASS (clutter_stage_view_parent_class)->dispose (object);
}

View File

@@ -178,77 +178,6 @@ _clutter_stage_window_clear_update_time (ClutterStageWindow *window)
iface->clear_update_time (window);
}
void
_clutter_stage_window_add_redraw_clip (ClutterStageWindow *window,
cairo_rectangle_int_t *stage_clip)
{
ClutterStageWindowInterface *iface;
g_return_if_fail (CLUTTER_IS_STAGE_WINDOW (window));
iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window);
if (iface->add_redraw_clip != NULL)
iface->add_redraw_clip (window, stage_clip);
}
/* Determines if the backend will clip the rendering of the next
* frame.
*
* Note: at the start of each new frame there is an implied clip that
* clips everything (i.e. nothing would be drawn) so this function
* will return True at the start of a new frame if the backend
* supports clipped redraws.
*/
gboolean
_clutter_stage_window_has_redraw_clips (ClutterStageWindow *window)
{
ClutterStageWindowInterface *iface;
g_return_val_if_fail (CLUTTER_IS_STAGE_WINDOW (window), FALSE);
iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window);
if (iface->has_redraw_clips != NULL)
return iface->has_redraw_clips (window);
return FALSE;
}
/* Determines if the backend will discard any additional redraw clips
* and instead promote them to a full stage redraw.
*
* The ideas is that backend may have some heuristics that cause it to
* give up tracking redraw clips so this can be used to avoid the cost
* of calculating a redraw clip when we know it's going to be ignored
* anyway.
*/
gboolean
_clutter_stage_window_ignoring_redraw_clips (ClutterStageWindow *window)
{
ClutterStageWindowInterface *iface;
g_return_val_if_fail (CLUTTER_IS_STAGE_WINDOW (window), FALSE);
iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window);
if (iface->ignoring_redraw_clips != NULL)
return iface->ignoring_redraw_clips (window);
return TRUE;
}
cairo_region_t *
_clutter_stage_window_get_redraw_clip (ClutterStageWindow *window)
{
ClutterStageWindowInterface *iface;
g_return_val_if_fail (CLUTTER_IS_STAGE_WINDOW (window), FALSE);
iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window);
if (iface->get_redraw_clip != NULL)
return iface->get_redraw_clip (window);
return NULL;
}
void
_clutter_stage_window_set_accept_focus (ClutterStageWindow *window,
gboolean accept_focus)

View File

@@ -51,12 +51,6 @@ struct _ClutterStageWindowInterface
gint64 (* get_update_time) (ClutterStageWindow *stage_window);
void (* clear_update_time) (ClutterStageWindow *stage_window);
void (* add_redraw_clip) (ClutterStageWindow *stage_window,
cairo_rectangle_int_t *stage_rectangle);
gboolean (* has_redraw_clips) (ClutterStageWindow *stage_window);
gboolean (* ignoring_redraw_clips) (ClutterStageWindow *stage_window);
cairo_region_t * (* get_redraw_clip) (ClutterStageWindow *stage_window);
void (* set_accept_focus) (ClutterStageWindow *stage_window,
gboolean accept_focus);
@@ -94,12 +88,6 @@ void _clutter_stage_window_schedule_update (ClutterStageWin
gint64 _clutter_stage_window_get_update_time (ClutterStageWindow *window);
void _clutter_stage_window_clear_update_time (ClutterStageWindow *window);
void _clutter_stage_window_add_redraw_clip (ClutterStageWindow *window,
cairo_rectangle_int_t *stage_clip);
gboolean _clutter_stage_window_has_redraw_clips (ClutterStageWindow *window);
gboolean _clutter_stage_window_ignoring_redraw_clips (ClutterStageWindow *window);
cairo_region_t * _clutter_stage_window_get_redraw_clip (ClutterStageWindow *window);
void _clutter_stage_window_set_accept_focus (ClutterStageWindow *window,
gboolean accept_focus);

View File

@@ -78,7 +78,6 @@
#include "clutter-private.h"
#include "cogl/cogl.h"
#include "cogl/cogl-trace.h"
struct _ClutterStageQueueRedrawEntry
{
@@ -144,8 +143,6 @@ struct _ClutterStagePrivate
gpointer paint_data;
GDestroyNotify paint_notify;
cairo_rectangle_int_t view_clip;
int update_freeze_count;
guint redraw_pending : 1;
@@ -559,6 +556,33 @@ pick_record_contains_point (ClutterStage *stage,
return TRUE;
}
static void
clutter_stage_add_redraw_clip (ClutterStage *stage,
cairo_rectangle_int_t *clip)
{
GList *l;
for (l = _clutter_stage_peek_stage_views (stage); l; l = l->next)
{
ClutterStageView *view = l->data;
if (!clip)
{
clutter_stage_view_add_redraw_clip (view, NULL);
}
else
{
cairo_rectangle_int_t view_layout;
cairo_rectangle_int_t intersection;
clutter_stage_view_get_layout (view, &view_layout);
if (_clutter_util_rectangle_intersection (&view_layout, clip,
&intersection))
clutter_stage_view_add_redraw_clip (view, &intersection);
}
}
}
static inline void
queue_full_redraw (ClutterStage *stage)
{
@@ -577,7 +601,7 @@ queue_full_redraw (ClutterStage *stage)
if (stage_window == NULL)
return;
_clutter_stage_window_add_redraw_clip (stage_window, NULL);
clutter_stage_add_redraw_clip (stage, NULL);
}
static gboolean
@@ -903,15 +927,18 @@ setup_view_for_pick_or_paint (ClutterStage *stage,
}
static void
clutter_stage_do_paint_view (ClutterStage *stage,
ClutterStageView *view,
const cairo_rectangle_int_t *clip)
clutter_stage_do_paint_view (ClutterStage *stage,
ClutterStageView *view,
const cairo_region_t *redraw_clip)
{
ClutterPaintContext *paint_context;
cairo_rectangle_int_t clip_rect;
paint_context = clutter_paint_context_new_for_view (view);
paint_context = clutter_paint_context_new_for_view (view, redraw_clip);
cairo_region_get_extents (redraw_clip, &clip_rect);
setup_view_for_pick_or_paint (stage, view, &clip_rect);
setup_view_for_pick_or_paint (stage, view, clip);
clutter_actor_paint (CLUTTER_ACTOR (stage), paint_context);
clutter_paint_context_destroy (paint_context);
}
@@ -920,9 +947,9 @@ clutter_stage_do_paint_view (ClutterStage *stage,
* for picking or painting...
*/
void
_clutter_stage_paint_view (ClutterStage *stage,
ClutterStageView *view,
const cairo_rectangle_int_t *clip)
clutter_stage_paint_view (ClutterStage *stage,
ClutterStageView *view,
const cairo_region_t *redraw_clip)
{
ClutterStagePrivate *priv = stage->priv;
@@ -931,15 +958,11 @@ _clutter_stage_paint_view (ClutterStage *stage,
COGL_TRACE_BEGIN_SCOPED (ClutterStagePaintView, "Paint (view)");
priv->view_clip = *clip;
if (g_signal_has_handler_pending (stage, stage_signals[PAINT_VIEW],
0, TRUE))
g_signal_emit (stage, stage_signals[PAINT_VIEW], 0, view);
g_signal_emit (stage, stage_signals[PAINT_VIEW], 0, view, redraw_clip);
else
CLUTTER_STAGE_GET_CLASS (stage)->paint_view (stage, view);
priv->view_clip = (cairo_rectangle_int_t) { 0 };
CLUTTER_STAGE_GET_CLASS (stage)->paint_view (stage, view, redraw_clip);
}
void
@@ -1416,16 +1439,12 @@ clutter_stage_do_redraw (ClutterStage *stage)
static GSList *
_clutter_stage_check_updated_pointers (ClutterStage *stage)
{
ClutterStagePrivate *priv = stage->priv;
ClutterBackend *backend;
ClutterSeat *seat;
GSList *updating = NULL;
GList *l, *devices;
cairo_region_t *clip;
graphene_point_t point;
clip = _clutter_stage_window_get_redraw_clip (priv->impl);
backend = clutter_get_default_backend ();
seat = clutter_backend_get_default_seat (backend);
devices = clutter_seat_list_devices (seat);
@@ -1433,6 +1452,8 @@ _clutter_stage_check_updated_pointers (ClutterStage *stage)
for (l = devices; l; l = l->next)
{
ClutterInputDevice *dev = l->data;
ClutterStageView *view;
const cairo_region_t *clip;
if (clutter_input_device_get_device_mode (dev) !=
CLUTTER_INPUT_MODE_MASTER)
@@ -1448,6 +1469,11 @@ _clutter_stage_check_updated_pointers (ClutterStage *stage)
if (!clutter_input_device_get_coords (dev, NULL, &point))
continue;
view = clutter_stage_get_view_at (stage, point.x, point.y);
if (!view)
continue;
clip = clutter_stage_view_peek_redraw_clip (view);
if (!clip || cairo_region_contains_point (clip, point.x, point.y))
updating = g_slist_prepend (updating, dev);
break;
@@ -1557,6 +1583,22 @@ clutter_stage_real_queue_relayout (ClutterActor *self)
parent_class->queue_relayout (self);
}
static gboolean
is_full_stage_redraw_queued (ClutterStage *stage)
{
GList *l;
for (l = _clutter_stage_peek_stage_views (stage); l; l = l->next)
{
ClutterStageView *view = l->data;
if (!clutter_stage_view_has_full_redraw_clip (view))
return FALSE;
}
return TRUE;
}
static gboolean
clutter_stage_real_queue_redraw (ClutterActor *actor,
ClutterActor *leaf,
@@ -1578,12 +1620,12 @@ clutter_stage_real_queue_redraw (ClutterActor *actor,
if (stage_window == NULL)
return TRUE;
if (_clutter_stage_window_ignoring_redraw_clips (stage_window))
if (is_full_stage_redraw_queued (stage))
return FALSE;
if (redraw_clip == NULL)
{
_clutter_stage_window_add_redraw_clip (stage_window, NULL);
clutter_stage_add_redraw_clip (stage, NULL);
return FALSE;
}
@@ -1615,43 +1657,20 @@ clutter_stage_real_queue_redraw (ClutterActor *actor,
stage_clip.width = intersection_box.x2 - stage_clip.x;
stage_clip.height = intersection_box.y2 - stage_clip.y;
_clutter_stage_window_add_redraw_clip (stage_window, &stage_clip);
clutter_stage_add_redraw_clip (stage, &stage_clip);
return FALSE;
}
gboolean
_clutter_stage_has_full_redraw_queued (ClutterStage *stage)
{
ClutterStageWindow *stage_window = _clutter_stage_get_window (stage);
if (CLUTTER_ACTOR_IN_DESTRUCTION (stage) || stage_window == NULL)
if (CLUTTER_ACTOR_IN_DESTRUCTION (stage))
return FALSE;
if (stage->priv->redraw_pending &&
!_clutter_stage_window_has_redraw_clips (stage_window))
return TRUE;
else
if (!stage->priv->redraw_pending)
return FALSE;
}
cairo_region_t *
clutter_stage_get_redraw_clip (ClutterStage *stage)
{
ClutterStagePrivate *priv;
cairo_rectangle_int_t clip;
cairo_region_t *region;
g_return_val_if_fail (CLUTTER_IS_STAGE (stage), NULL);
priv = stage->priv;
region = _clutter_stage_window_get_redraw_clip (priv->impl);
if (region)
return region;
/* Set clip to the full extents of the stage */
_clutter_stage_window_get_geometry (priv->impl, &clip);
return cairo_region_create_rectangle (&clip);
return is_full_stage_redraw_queued (stage);
}
static ClutterActor *
@@ -1980,13 +1999,11 @@ clutter_stage_finalize (GObject *object)
}
static void
clutter_stage_real_paint_view (ClutterStage *stage,
ClutterStageView *view)
clutter_stage_real_paint_view (ClutterStage *stage,
ClutterStageView *view,
const cairo_region_t *redraw_clip)
{
ClutterStagePrivate *priv = stage->priv;
const cairo_rectangle_int_t *clip = &priv->view_clip;
clutter_stage_do_paint_view (stage, view, clip);
clutter_stage_do_paint_view (stage, view, redraw_clip);
}
static void
@@ -2212,6 +2229,7 @@ clutter_stage_class_init (ClutterStageClass *klass)
* ClutterStage::paint-view:
* @stage: the stage that received the event
* @view: a #ClutterStageView
* @redraw_clip: a #cairo_region_t with the redraw clip
*
* The ::paint-view signal is emitted before a #ClutterStageView is being
* painted.
@@ -2226,8 +2244,9 @@ clutter_stage_class_init (ClutterStageClass *klass)
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (ClutterStageClass, paint_view),
NULL, NULL, NULL,
G_TYPE_NONE, 1,
CLUTTER_TYPE_STAGE_VIEW);
G_TYPE_NONE, 2,
CLUTTER_TYPE_STAGE_VIEW,
G_TYPE_POINTER);
/**
* ClutterStage::presented: (skip)
@@ -2803,13 +2822,17 @@ clutter_stage_read_pixels (ClutterStage *stage,
.height = height,
});
cairo_region_get_extents (clip, &clip_rect);
cairo_region_destroy (clip);
if (clip_rect.width == 0 || clip_rect.height == 0)
return NULL;
{
cairo_region_destroy (clip);
return NULL;
}
framebuffer = clutter_stage_view_get_framebuffer (view);
clutter_stage_do_paint_view (stage, view, &clip_rect);
clutter_stage_do_paint_view (stage, view, clip);
cairo_region_destroy (clip);
view_scale = clutter_stage_view_get_scale (view);
pixel_width = roundf (clip_rect.width * view_scale);
@@ -4316,7 +4339,6 @@ capture_view (ClutterStage *stage,
texture_width, texture_height);
cairo_surface_set_device_scale (image, view_scale, view_scale);
data = cairo_image_surface_get_data (image);
stride = cairo_image_surface_get_stride (image);
@@ -4326,6 +4348,20 @@ capture_view (ClutterStage *stage,
cairo_surface_mark_dirty (capture->image);
}
/**
* clutter_stage_capture:
* @stage: a #ClutterStage
* @paint: whether to pain the frame
* @rect: a #cairo_rectangle_int_t in stage coordinates
* @out_captures: (out) (array length=out_n_captures): an array of
* #ClutterCapture
* @out_n_captures: (out): the number of captures in @out_captures
*
* Captures the stage pixels of @rect into @captures. @rect is in stage
* coordinates.
*
* Returns: %TRUE if a #ClutterCapture has been created, %FALSE otherwise
*/
gboolean
clutter_stage_capture (ClutterStage *stage,
gboolean paint,
@@ -4450,8 +4486,12 @@ capture_view_into (ClutterStage *stage,
if (paint)
{
cairo_region_t *region;
_clutter_stage_maybe_setup_viewport (stage, view);
clutter_stage_do_paint_view (stage, view, rect);
region = cairo_region_create_rectangle (rect);
clutter_stage_do_paint_view (stage, view, region);
cairo_region_destroy (region);
}
view_scale = clutter_stage_view_get_scale (view);
@@ -4477,49 +4517,42 @@ capture_view_into (ClutterStage *stage,
cogl_object_unref (bitmap);
}
static ClutterStageView *
get_view_at_rect (ClutterStage *stage,
cairo_rectangle_int_t *rect)
{
ClutterStagePrivate *priv = stage->priv;
GList *views = _clutter_stage_window_get_views (priv->impl);
GList *l;
for (l = views; l; l = l->next)
{
ClutterStageView *view = l->data;
cairo_rectangle_int_t view_layout;
cairo_region_t *region;
cairo_rectangle_int_t view_capture_rect;
clutter_stage_view_get_layout (view, &view_layout);
region = cairo_region_create_rectangle (&view_layout);
cairo_region_intersect_rectangle (region, rect);
cairo_region_get_extents (region, &view_capture_rect);
cairo_region_destroy (region);
if (view_capture_rect.width == 0 || view_capture_rect.height == 0)
continue;
g_assert (view_capture_rect.width == rect->width &&
view_capture_rect.height == rect->height);
return view;
}
return NULL;
}
void
clutter_stage_capture_into (ClutterStage *stage,
gboolean paint,
cairo_rectangle_int_t *rect,
uint8_t *data)
{
ClutterStageView *view;
ClutterStagePrivate *priv = stage->priv;
GList *l;
int bpp = 4;
int stride;
view = get_view_at_rect (stage, rect);
capture_view_into (stage, paint, view, rect, data, rect->width * bpp);
stride = rect->width * 4;
for (l = _clutter_stage_window_get_views (priv->impl); l; l = l->next)
{
ClutterStageView *view = l->data;
cairo_rectangle_int_t view_layout;
cairo_region_t *region;
cairo_rectangle_int_t capture_rect;
int x_offset, y_offset;
clutter_stage_view_get_layout (view, &view_layout);
region = cairo_region_create_rectangle (&view_layout);
cairo_region_intersect_rectangle (region, rect);
cairo_region_get_extents (region, &capture_rect);
cairo_region_destroy (region);
x_offset = capture_rect.x - rect->x;
y_offset = capture_rect.y - rect->y;
capture_view_into (stage, paint, view,
&capture_rect,
data + (x_offset * bpp) + (y_offset * stride),
stride);
}
}
/**

View File

@@ -84,8 +84,9 @@ struct _ClutterStageClass
gboolean (* delete_event) (ClutterStage *stage,
ClutterEvent *event);
void (* paint_view) (ClutterStage *stage,
ClutterStageView *view);
void (* paint_view) (ClutterStage *stage,
ClutterStageView *view,
const cairo_region_t *redraw_clip);
/*< private >*/
/* padding for future expansion */
@@ -205,8 +206,6 @@ guchar * clutter_stage_read_pixels (ClutterStage
gint width,
gint height);
CLUTTER_EXPORT
cairo_region_t * clutter_stage_get_redraw_clip (ClutterStage *stage);
CLUTTER_EXPORT
void clutter_stage_ensure_viewport (ClutterStage *stage);
CLUTTER_EXPORT
@@ -234,8 +233,8 @@ CLUTTER_EXPORT
gboolean clutter_stage_capture (ClutterStage *stage,
gboolean paint,
cairo_rectangle_int_t *rect,
ClutterCapture **captures,
int *n_captures);
ClutterCapture **out_captures,
int *out_n_captures);
CLUTTER_EXPORT
ClutterStageView * clutter_stage_get_view_at (ClutterStage *stage,
float x,

View File

@@ -348,13 +348,23 @@ clutter_text_input_focus_request_surrounding (ClutterInputFocus *focus)
static void
clutter_text_input_focus_delete_surrounding (ClutterInputFocus *focus,
guint offset,
int offset,
guint len)
{
ClutterText *clutter_text = CLUTTER_TEXT_INPUT_FOCUS (focus)->text;
int cursor;
int start;
cursor = clutter_text_get_cursor_position (clutter_text);
start = cursor + offset;
if (start < 0)
{
g_warning ("The offset '%d' of deleting surrounding is larger than the cursor pos '%d'",
offset, cursor);
return;
}
if (clutter_text_get_editable (clutter_text))
clutter_text_delete_text (clutter_text, offset, len);
clutter_text_delete_text (clutter_text, start, len);
}
static void

View File

@@ -214,6 +214,16 @@ _clutter_util_rectangle_intersection (const cairo_rectangle_int_t *src1,
}
}
gboolean
clutter_util_rectangle_equal (const cairo_rectangle_int_t *src1,
const cairo_rectangle_int_t *src2)
{
return ((src1->x == src2->x) &&
(src1->y == src2->y) &&
(src1->width == src2->width) &&
(src1->height == src2->height));
}
float
_clutter_util_matrix_determinant (const ClutterMatrix *matrix)
{

View File

@@ -47,7 +47,7 @@
#include "clutter-stage-private.h"
#include "clutter-stage-view-private.h"
#include "cogl/cogl-trace.h"
#define MAX_STACK_RECTS 256
typedef struct _ClutterStageViewCoglPrivate
{
@@ -288,97 +288,6 @@ clutter_stage_cogl_resize (ClutterStageWindow *stage_window,
{
}
static gboolean
clutter_stage_cogl_has_redraw_clips (ClutterStageWindow *stage_window)
{
ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_window);
/* NB: at the start of each new frame there is an implied clip that
* clips everything (i.e. nothing would be drawn) so we need to make
* sure we return True in the un-initialized case here.
*/
if (!stage_cogl->initialized_redraw_clip ||
(stage_cogl->initialized_redraw_clip &&
stage_cogl->redraw_clip))
return TRUE;
else
return FALSE;
}
static gboolean
clutter_stage_cogl_ignoring_redraw_clips (ClutterStageWindow *stage_window)
{
ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_window);
/* NB: a NULL clip means a full stage redraw is required */
if (stage_cogl->initialized_redraw_clip &&
!stage_cogl->redraw_clip)
return TRUE;
else
return FALSE;
}
/* A redraw clip represents (in stage coordinates) the bounding box of
* something that needs to be redrawn. Typically they are added to the
* StageWindow as a result of clutter_actor_queue_clipped_redraw() by
* actors such as ClutterGLXTexturePixmap. All redraw clips are
* discarded after the next paint.
*
* A NULL stage_clip means the whole stage needs to be redrawn.
*
* What we do with this information:
* - we keep track of the bounding box for all redraw clips
* - when we come to redraw; we scissor the redraw to that box and use
* glBlitFramebuffer to present the redraw to the front
* buffer.
*/
static void
clutter_stage_cogl_add_redraw_clip (ClutterStageWindow *stage_window,
cairo_rectangle_int_t *stage_clip)
{
ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_window);
/* If we are already forced to do a full stage redraw then bail early */
if (clutter_stage_cogl_ignoring_redraw_clips (stage_window))
return;
/* A NULL stage clip means a full stage redraw has been queued and
* we keep track of this by setting a NULL redraw_clip.
*/
if (stage_clip == NULL)
{
g_clear_pointer (&stage_cogl->redraw_clip, cairo_region_destroy);
stage_cogl->initialized_redraw_clip = TRUE;
return;
}
/* Ignore requests to add degenerate/empty clip rectangles */
if (stage_clip->width == 0 || stage_clip->height == 0)
return;
if (!stage_cogl->redraw_clip)
{
stage_cogl->redraw_clip = cairo_region_create_rectangle (stage_clip);
}
else
{
cairo_region_union_rectangle (stage_cogl->redraw_clip, stage_clip);
}
stage_cogl->initialized_redraw_clip = TRUE;
}
static cairo_region_t *
clutter_stage_cogl_get_redraw_clip (ClutterStageWindow *stage_window)
{
ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_window);
if (stage_cogl->using_clipped_redraw && stage_cogl->redraw_clip)
return cairo_region_copy (stage_cogl->redraw_clip);
return NULL;
}
static inline gboolean
valid_buffer_age (ClutterStageViewCogl *view_cogl,
int age)
@@ -395,7 +304,8 @@ valid_buffer_age (ClutterStageViewCogl *view_cogl,
static void
paint_damage_region (ClutterStageWindow *stage_window,
ClutterStageView *view,
cairo_region_t *swap_region)
cairo_region_t *swap_region,
cairo_region_t *queued_redraw_clip)
{
CoglFramebuffer *framebuffer = clutter_stage_view_get_onscreen (view);
CoglContext *ctx = cogl_framebuffer_get_context (framebuffer);
@@ -432,8 +342,7 @@ paint_damage_region (ClutterStageWindow *stage_window,
}
/* Red for the clip */
if (stage_cogl->initialized_redraw_clip &&
stage_cogl->redraw_clip)
if (queued_redraw_clip)
{
static CoglPipeline *overlay_red = NULL;
@@ -443,13 +352,13 @@ paint_damage_region (ClutterStageWindow *stage_window,
cogl_pipeline_set_color4ub (overlay_red, 0x33, 0x00, 0x00, 0x33);
}
n_rects = cairo_region_num_rectangles (stage_cogl->redraw_clip);
n_rects = cairo_region_num_rectangles (queued_redraw_clip);
for (i = 0; i < n_rects; i++)
{
cairo_rectangle_int_t rect;
float x_1, x_2, y_1, y_2;
cairo_region_get_rectangle (stage_cogl->redraw_clip, i, &rect);
cairo_region_get_rectangle (queued_redraw_clip, i, &rect);
x_1 = rect.x;
x_2 = rect.x + rect.width;
y_1 = rect.y;
@@ -466,13 +375,14 @@ static gboolean
swap_framebuffer (ClutterStageWindow *stage_window,
ClutterStageView *view,
cairo_region_t *swap_region,
gboolean swap_with_damage)
gboolean swap_with_damage,
cairo_region_t *queued_redraw_clip)
{
CoglFramebuffer *framebuffer = clutter_stage_view_get_onscreen (view);
int *damage, n_rects, i;
if (G_UNLIKELY ((clutter_paint_debug_flags & CLUTTER_DEBUG_PAINT_DAMAGE_REGION)))
paint_damage_region (stage_window, view, swap_region);
paint_damage_region (stage_window, view, swap_region, queued_redraw_clip);
n_rects = cairo_region_num_rectangles (swap_region);
damage = g_newa (int, n_rects * 4);
@@ -536,34 +446,52 @@ scale_and_clamp_rect (const graphene_rect_t *rect,
_clutter_util_rectangle_int_extents (&tmp, dest);
}
static cairo_region_t *
offset_scale_and_clamp_region (const cairo_region_t *region,
int offset_x,
int offset_y,
float scale)
{
int n_rects, i;
cairo_rectangle_int_t *rects;
g_autofree cairo_rectangle_int_t *freeme = NULL;
n_rects = cairo_region_num_rectangles (region);
if (n_rects == 0)
return cairo_region_create ();
if (n_rects < MAX_STACK_RECTS)
rects = g_newa (cairo_rectangle_int_t, n_rects);
else
rects = freeme = g_new (cairo_rectangle_int_t, n_rects);
for (i = 0; i < n_rects; i++)
cairo_region_get_rectangle (region, i, &rects[i]);
for (i = 0; i < n_rects; i++)
{
graphene_rect_t tmp;
_clutter_util_rect_from_rectangle (&rects[i], &tmp);
graphene_rect_offset (&tmp, offset_x, offset_y);
scale_and_clamp_rect (&tmp, scale, &rects[i]);
}
return cairo_region_create_rectangles (rects, n_rects);
}
static void
paint_stage (ClutterStageCogl *stage_cogl,
ClutterStageView *view,
cairo_region_t *clip)
paint_stage (ClutterStageCogl *stage_cogl,
ClutterStageView *view,
cairo_region_t *redraw_clip)
{
ClutterStage *stage = stage_cogl->wrapper;
cairo_rectangle_int_t clip_rect;
cairo_rectangle_int_t paint_rect;
cairo_rectangle_int_t view_rect;
graphene_rect_t rect;
float fb_scale;
clutter_stage_view_get_layout (view, &view_rect);
fb_scale = clutter_stage_view_get_scale (view);
cairo_region_get_extents (clip, &clip_rect);
_clutter_util_rect_from_rectangle (&clip_rect, &rect);
scale_and_clamp_rect (&rect, 1.0f / fb_scale, &paint_rect);
_clutter_util_rectangle_offset (&paint_rect,
view_rect.x,
view_rect.y,
&paint_rect);
_clutter_stage_maybe_setup_viewport (stage, view);
_clutter_stage_paint_view (stage, view, &paint_rect);
clutter_stage_paint_view (stage, view, redraw_clip);
clutter_stage_view_after_paint (view, &paint_rect);
clutter_stage_view_after_paint (view);
}
static void
@@ -683,7 +611,7 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
clutter_stage_view_cogl_get_instance_private (view_cogl);
CoglFramebuffer *fb = clutter_stage_view_get_framebuffer (view);
cairo_rectangle_int_t view_rect;
gboolean have_clip;
gboolean is_full_redraw;
gboolean may_use_clipped_redraw;
gboolean use_clipped_redraw;
gboolean can_blit_sub_buffer;
@@ -691,7 +619,8 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
gboolean do_swap_buffer;
gboolean swap_with_damage;
ClutterActor *wrapper;
cairo_region_t *redraw_clip = NULL;
cairo_region_t *redraw_clip;
cairo_region_t *queued_redraw_clip;
cairo_region_t *fb_clip_region;
cairo_region_t *swap_region;
cairo_rectangle_int_t redraw_rect;
@@ -699,6 +628,7 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
float fb_scale;
int subpixel_compensation = 0;
int fb_width, fb_height;
int buffer_age;
wrapper = CLUTTER_ACTOR (stage_cogl->wrapper);
@@ -713,55 +643,44 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
has_buffer_age = cogl_is_onscreen (fb) && is_buffer_age_enabled ();
redraw_clip = clutter_stage_view_take_redraw_clip (view);
/* NB: a NULL redraw clip == full stage redraw */
if (!stage_cogl->redraw_clip)
have_clip = FALSE;
if (!redraw_clip)
is_full_redraw = TRUE;
else
is_full_redraw = FALSE;
may_use_clipped_redraw =
_clutter_stage_window_can_clip_redraws (stage_window) &&
(can_blit_sub_buffer || has_buffer_age) &&
!is_full_redraw &&
/* some drivers struggle to get going and produce some junk
* frames when starting up... */
cogl_onscreen_get_frame_counter (COGL_ONSCREEN (fb)) > 3;
if (has_buffer_age)
{
cairo_region_t *view_region;
redraw_clip = cairo_region_copy (stage_cogl->redraw_clip);
view_region = cairo_region_create_rectangle (&view_rect);
cairo_region_intersect (redraw_clip, view_region);
have_clip = !cairo_region_equal (redraw_clip, view_region);
cairo_region_destroy (view_region);
buffer_age = cogl_onscreen_get_buffer_age (COGL_ONSCREEN (fb));
if (!valid_buffer_age (view_cogl, buffer_age))
{
CLUTTER_NOTE (CLIPPING, "Invalid back buffer(age=%d): forcing full redraw\n", buffer_age);
may_use_clipped_redraw = FALSE;
}
}
may_use_clipped_redraw = FALSE;
if (_clutter_stage_window_can_clip_redraws (stage_window) &&
(can_blit_sub_buffer || has_buffer_age) &&
have_clip &&
/* some drivers struggle to get going and produce some junk
* frames when starting up... */
cogl_onscreen_get_frame_counter (COGL_ONSCREEN (fb)) > 3)
if (may_use_clipped_redraw)
{
graphene_rect_t rect;
cairo_rectangle_int_t *rects;
int n_rects, i;
may_use_clipped_redraw = TRUE;
fb_clip_region = cairo_region_create ();
n_rects = cairo_region_num_rectangles (redraw_clip);
rects = g_new (cairo_rectangle_int_t, n_rects);
for (i = 0; i < n_rects; i++)
{
cairo_rectangle_int_t new_fb_clip_rect;
cairo_region_get_rectangle (redraw_clip, i, &rects[i]);
_clutter_util_rect_from_rectangle (&rects[i], &rect);
graphene_rect_offset (&rect, -view_rect.x, -view_rect.y);
scale_and_clamp_rect (&rect, fb_scale, &new_fb_clip_rect);
cairo_region_union_rectangle (fb_clip_region, &new_fb_clip_rect);
}
g_free (rects);
fb_clip_region = offset_scale_and_clamp_region (redraw_clip,
-view_rect.x,
-view_rect.y,
fb_scale);
if (fb_scale != floorf (fb_scale))
{
int n_rects, i;
cairo_rectangle_int_t *rects;
subpixel_compensation = ceilf (fb_scale);
n_rects = cairo_region_num_rectangles (fb_clip_region);
@@ -780,12 +699,20 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
}
else
{
cairo_rectangle_int_t rect = { 0, 0, view_rect.width, view_rect.height };
fb_clip_region = cairo_region_create_rectangle (&rect);
cairo_rectangle_int_t fb_rect;
fb_rect = (cairo_rectangle_int_t) {
.width = fb_width,
.height = fb_height,
};
fb_clip_region = cairo_region_create_rectangle (&fb_rect);
g_clear_pointer (&redraw_clip, cairo_region_destroy);
redraw_clip = cairo_region_copy (fb_clip_region);
redraw_clip = cairo_region_create_rectangle (&view_rect);
}
queued_redraw_clip = cairo_region_copy (redraw_clip);
if (may_use_clipped_redraw &&
G_LIKELY (!(clutter_paint_debug_flags & CLUTTER_DEBUG_DISABLE_CLIPPED_REDRAWS)))
use_clipped_redraw = TRUE;
@@ -799,62 +726,43 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
{
if (use_clipped_redraw && !clip_region_empty)
{
int age;
cairo_region_t *fb_damage;
cairo_region_t *view_damage;
int i;
age = cogl_onscreen_get_buffer_age (COGL_ONSCREEN (fb));
fill_current_damage_history (view, fb_clip_region);
if (valid_buffer_age (view_cogl, age))
fb_damage = cairo_region_create ();
for (i = 1; i <= buffer_age; i++)
{
graphene_rect_t rect;
cairo_rectangle_int_t damage_region;
cairo_rectangle_int_t *rects;
int n_rects, i;
int damage_index;
fill_current_damage_history (view, fb_clip_region);
for (i = 1; i <= age; i++)
{
cairo_region_t *fb_damage =
view_priv->damage_history[DAMAGE_HISTORY (view_priv->damage_index - i - 1)];
cairo_region_union (fb_clip_region, fb_damage);
}
/* Update the redraw clip state with the extra damage. */
n_rects = cairo_region_num_rectangles (fb_clip_region);
rects = g_newa (cairo_rectangle_int_t, n_rects);
for (i = 0; i < n_rects; i++)
{
cairo_region_get_rectangle (fb_clip_region, i, &rects[i]);
_clutter_util_rect_from_rectangle (&rects[i], &rect);
scale_and_clamp_rect (&rect, 1.0f / fb_scale, &damage_region);
_clutter_util_rectangle_offset (&damage_region,
view_rect.x,
view_rect.y,
&damage_region);
cairo_region_union_rectangle (stage_cogl->redraw_clip,
&damage_region);
}
CLUTTER_NOTE (CLIPPING, "Reusing back buffer(age=%d) - repairing region: num rects: %d\n",
age,
cairo_region_num_rectangles (fb_clip_region));
swap_with_damage = TRUE;
damage_index = DAMAGE_HISTORY (view_priv->damage_index - i - 1);
cairo_region_union (fb_damage,
view_priv->damage_history[damage_index]);
}
else
{
cairo_rectangle_int_t fb_damage;
CLUTTER_NOTE (CLIPPING, "Invalid back buffer(age=%d): forcing full redraw\n", age);
use_clipped_redraw = FALSE;
fb_damage = (cairo_rectangle_int_t) {
.x = 0,
.y = 0,
.width = ceilf (view_rect.width * fb_scale),
.height = ceilf (view_rect.height * fb_scale)
};
fill_current_damage_history_rectangle (view, &fb_damage);
}
/* Update the fb clip region with the extra damage. */
cairo_region_union (fb_clip_region, fb_damage);
view_damage = offset_scale_and_clamp_region (fb_damage,
0, 0,
1.0f / fb_scale);
cairo_region_translate (view_damage, view_rect.x, view_rect.y);
cairo_region_intersect_rectangle (view_damage, &view_rect);
/* Update the redraw clip region with the extra damage. */
cairo_region_union (redraw_clip, view_damage);
cairo_region_destroy (view_damage);
cairo_region_destroy (fb_damage);
CLUTTER_NOTE (CLIPPING, "Reusing back buffer(age=%d) - repairing region: num rects: %d\n",
buffer_age,
cairo_region_num_rectangles (fb_clip_region));
swap_with_damage = TRUE;
}
else if (!use_clipped_redraw)
{
@@ -879,8 +787,6 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
cairo_rectangle_int_t clip_rect;
cairo_rectangle_int_t scissor_rect;
stage_cogl->using_clipped_redraw = TRUE;
if (cairo_region_num_rectangles (fb_clip_region) == 1)
{
cairo_region_get_extents (fb_clip_region, &clip_rect);
@@ -908,11 +814,9 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
cogl_framebuffer_push_region_clip (fb, fb_clip_region);
}
paint_stage (stage_cogl, view, fb_clip_region);
paint_stage (stage_cogl, view, redraw_clip);
cogl_framebuffer_pop_clip (fb);
stage_cogl->using_clipped_redraw = FALSE;
}
else
{
@@ -940,24 +844,13 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
scissor_rect.width,
scissor_rect.height);
paint_stage (stage_cogl, view, fb_clip_region);
paint_stage (stage_cogl, view, redraw_clip);
cogl_framebuffer_pop_clip (fb);
}
else
{
cairo_rectangle_int_t clip;
cairo_region_t *view_region;
clip = (cairo_rectangle_int_t) {
.x = 0,
.y = 0,
.width = ceilf (view_rect.width * fb_scale),
.height = ceilf (view_rect.height * fb_scale)
};
view_region = cairo_region_create_rectangle (&clip);
paint_stage (stage_cogl, view, view_region);
cairo_region_destroy (view_region);
paint_stage (stage_cogl, view, redraw_clip);
}
}
@@ -1028,10 +921,9 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
do_swap_buffer = TRUE;
}
if (redraw_clip)
cairo_region_destroy (redraw_clip);
if (fb_clip_region)
cairo_region_destroy (fb_clip_region);
g_clear_pointer (&redraw_clip, cairo_region_destroy);
g_clear_pointer (&queued_redraw_clip, cairo_region_destroy);
g_clear_pointer (&fb_clip_region, cairo_region_destroy);
if (do_swap_buffer)
{
@@ -1054,7 +946,8 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
res = swap_framebuffer (stage_window,
view,
swap_region,
swap_with_damage);
swap_with_damage,
queued_redraw_clip);
cairo_region_destroy (swap_region);
@@ -1079,8 +972,10 @@ clutter_stage_cogl_redraw (ClutterStageWindow *stage_window)
{
ClutterStageView *view = l->data;
swap_event =
clutter_stage_cogl_redraw_view (stage_window, view) || swap_event;
if (!clutter_stage_view_has_redraw_clip (view))
continue;
swap_event |= clutter_stage_cogl_redraw_view (stage_window, view);
}
_clutter_stage_emit_after_paint (stage_cogl->wrapper);
@@ -1096,10 +991,6 @@ clutter_stage_cogl_redraw (ClutterStageWindow *stage_window)
stage_cogl->pending_swaps++;
}
/* reset the redraw clipping for the next paint... */
stage_cogl->initialized_redraw_clip = FALSE;
g_clear_pointer (&stage_cogl->redraw_clip, cairo_region_destroy);
stage_cogl->frame_count++;
COGL_TRACE_END (ClutterStageCoglRedraw);
@@ -1117,10 +1008,6 @@ clutter_stage_window_iface_init (ClutterStageWindowInterface *iface)
iface->schedule_update = clutter_stage_cogl_schedule_update;
iface->get_update_time = clutter_stage_cogl_get_update_time;
iface->clear_update_time = clutter_stage_cogl_clear_update_time;
iface->add_redraw_clip = clutter_stage_cogl_add_redraw_clip;
iface->has_redraw_clips = clutter_stage_cogl_has_redraw_clips;
iface->ignoring_redraw_clips = clutter_stage_cogl_ignoring_redraw_clips;
iface->get_redraw_clip = clutter_stage_cogl_get_redraw_clip;
iface->redraw = clutter_stage_cogl_redraw;
}

View File

@@ -55,14 +55,6 @@ struct _ClutterStageCogl
unsigned int frame_count;
gint last_sync_delay;
cairo_region_t *redraw_clip;
guint initialized_redraw_clip : 1;
/* TRUE if the current paint cycle has a clipped redraw. In that
case bounding_redraw_clip specifies the the bounds. */
guint using_clipped_redraw : 1;
};
struct _ClutterStageCoglClass

View File

@@ -81,6 +81,7 @@ struct _CoglPangoDisplayListNode
GArray *rectangles;
/* A primitive representing those vertices */
CoglPrimitive *primitive;
guint has_color : 1;
} texture;
struct
@@ -420,7 +421,9 @@ _cogl_pango_display_list_render (CoglFramebuffer *fb,
cogl_color_get_red_byte (&node->color),
cogl_color_get_green_byte (&node->color),
cogl_color_get_blue_byte (&node->color),
cogl_color_get_alpha_byte (color));
(cogl_color_get_alpha_byte (&node->color) *
cogl_color_get_alpha_byte (color) /
255));
else
draw_color = *color;
cogl_color_premultiply (&draw_color);

View File

@@ -58,27 +58,29 @@ struct _CoglPangoGlyphCacheValue
/* This will be set to TRUE when the glyph atlas is reorganized
which means the glyph will need to be redrawn */
gboolean dirty;
guint dirty : 1;
/* Set to TRUE if the glyph has colors (eg. emoji) */
guint has_color : 1;
};
typedef void (* CoglPangoGlyphCacheDirtyFunc) (PangoFont *font,
PangoGlyph glyph,
CoglPangoGlyphCacheValue *value);
CoglPangoGlyphCache *
COGL_EXPORT CoglPangoGlyphCache *
cogl_pango_glyph_cache_new (CoglContext *ctx,
gboolean use_mipmapping);
void
COGL_EXPORT void
cogl_pango_glyph_cache_free (CoglPangoGlyphCache *cache);
CoglPangoGlyphCacheValue *
COGL_EXPORT CoglPangoGlyphCacheValue *
cogl_pango_glyph_cache_lookup (CoglPangoGlyphCache *cache,
gboolean create,
PangoFont *font,
PangoGlyph glyph);
void
COGL_EXPORT void
cogl_pango_glyph_cache_clear (CoglPangoGlyphCache *cache);
void

View File

@@ -50,6 +50,7 @@
#include <pango/pangocairo.h>
#include <pango/pango-renderer.h>
#include <cairo.h>
#include <cairo-ft.h>
#include "cogl/cogl-debug.h"
#include "cogl/cogl-context-private.h"
@@ -526,6 +527,24 @@ cogl_pango_renderer_get_cached_glyph (PangoRenderer *renderer,
create, font, glyph);
}
static gboolean
font_has_color_glyphs (const PangoFont *font)
{
cairo_scaled_font_t *scaled_font;
gboolean has_color = FALSE;
scaled_font = pango_cairo_font_get_scaled_font ((PangoCairoFont *) font);
if (cairo_scaled_font_get_type (scaled_font) == CAIRO_FONT_TYPE_FT)
{
FT_Face ft_face = cairo_ft_scaled_font_lock_face (scaled_font);
has_color = (FT_HAS_COLOR (ft_face) != 0);
cairo_ft_scaled_font_unlock_face (scaled_font);
}
return has_color;
}
static void
cogl_pango_renderer_set_dirty_glyph (PangoFont *font,
PangoGlyph glyph,
@@ -600,6 +619,8 @@ cogl_pango_renderer_set_dirty_glyph (PangoFont *font,
cairo_image_surface_get_data (surface));
cairo_surface_destroy (surface);
value->has_color = font_has_color_glyphs (font);
}
static void
@@ -698,6 +719,7 @@ cogl_pango_renderer_set_color_for_part (PangoRenderer *renderer,
PangoRenderPart part)
{
PangoColor *pango_color = pango_renderer_get_color (renderer, part);
uint16_t alpha = pango_renderer_get_alpha (renderer, part);
CoglPangoRenderer *priv = COGL_PANGO_RENDERER (renderer);
if (pango_color)
@@ -708,7 +730,7 @@ cogl_pango_renderer_set_color_for_part (PangoRenderer *renderer,
pango_color->red >> 8,
pango_color->green >> 8,
pango_color->blue >> 8,
0xff);
alpha ? alpha >> 8 : 0xff);
_cogl_pango_display_list_set_color_override (priv->display_list, &color);
}
@@ -820,14 +842,13 @@ cogl_pango_renderer_draw_glyphs (PangoRenderer *renderer,
CoglPangoGlyphCacheValue *cache_value;
int i;
cogl_pango_renderer_set_color_for_part (renderer,
PANGO_RENDER_PART_FOREGROUND);
for (i = 0; i < glyphs->num_glyphs; i++)
{
PangoGlyphInfo *gi = glyphs->glyphs + i;
float x, y;
cogl_pango_renderer_set_color_for_part (renderer,
PANGO_RENDER_PART_FOREGROUND);
cogl_pango_renderer_get_device_units (renderer,
xi + gi->geometry.x_offset,
yi + gi->geometry.y_offset,
@@ -884,6 +905,19 @@ cogl_pango_renderer_draw_glyphs (PangoRenderer *renderer,
x += (float)(cache_value->draw_x);
y += (float)(cache_value->draw_y);
/* Do not override color if the glyph/font provide its own */
if (cache_value->has_color)
{
CoglColor color;
uint16_t alpha;
alpha = pango_renderer_get_alpha (renderer,
PANGO_RENDER_PART_FOREGROUND);
cogl_color_init_from_4ub (&color, 0xff, 0xff, 0xff,
alpha ? alpha >> 8 : 0xff);
_cogl_pango_display_list_set_color_override (priv->display_list, &color);
}
cogl_pango_renderer_draw_glyph (priv, cache_value, x, y);
}
}

View File

@@ -75,7 +75,7 @@ typedef PangoCairoFontMap CoglPangoFontMap;
*
* Since: 1.14
*/
PangoFontMap *
COGL_EXPORT PangoFontMap *
cogl_pango_font_map_new (void);
/**
@@ -86,7 +86,7 @@ cogl_pango_font_map_new (void);
*
* Returns: (transfer full): the newly created context: free with g_object_unref().
*/
PangoContext *
COGL_EXPORT PangoContext *
cogl_pango_font_map_create_context (CoglPangoFontMap *font_map);
/**
@@ -102,7 +102,7 @@ cogl_pango_font_map_create_context (CoglPangoFontMap *font_map);
*
* Since: 1.14
*/
void
COGL_EXPORT void
cogl_pango_font_map_set_resolution (CoglPangoFontMap *font_map,
double dpi);
@@ -114,7 +114,7 @@ cogl_pango_font_map_set_resolution (CoglPangoFontMap *font_map,
*
* Since: 1.0
*/
void
COGL_EXPORT void
cogl_pango_font_map_clear_glyph_cache (CoglPangoFontMap *font_map);
/**
@@ -129,7 +129,7 @@ cogl_pango_font_map_clear_glyph_cache (CoglPangoFontMap *font_map);
*
* Since: 1.0
*/
void
COGL_EXPORT void
cogl_pango_ensure_glyph_cache_for_layout (PangoLayout *layout);
/**
@@ -142,7 +142,7 @@ cogl_pango_ensure_glyph_cache_for_layout (PangoLayout *layout);
*
* Since: 1.0
*/
void
COGL_EXPORT void
cogl_pango_font_map_set_use_mipmapping (CoglPangoFontMap *font_map,
gboolean value);
@@ -157,7 +157,7 @@ cogl_pango_font_map_set_use_mipmapping (CoglPangoFontMap *font_map,
*
* Since: 1.0
*/
gboolean
COGL_EXPORT gboolean
cogl_pango_font_map_get_use_mipmapping (CoglPangoFontMap *font_map);
/**
@@ -170,7 +170,7 @@ cogl_pango_font_map_get_use_mipmapping (CoglPangoFontMap *font_map);
*
* Since: 1.0
*/
PangoRenderer *
COGL_EXPORT PangoRenderer *
cogl_pango_font_map_get_renderer (CoglPangoFontMap *font_map);
/**
@@ -187,7 +187,7 @@ cogl_pango_font_map_get_renderer (CoglPangoFontMap *font_map);
*
* Since: 1.14
*/
void
COGL_EXPORT void
cogl_pango_show_layout (CoglFramebuffer *framebuffer,
PangoLayout *layout,
float x,
@@ -208,7 +208,7 @@ cogl_pango_show_layout (CoglFramebuffer *framebuffer,
*
* Since: 1.14
*/
void
COGL_EXPORT void
cogl_pango_show_layout_line (CoglFramebuffer *framebuffer,
PangoLayoutLine *line,
float x,
@@ -227,7 +227,7 @@ cogl_pango_show_layout_line (CoglFramebuffer *framebuffer,
typedef struct _CoglPangoRenderer CoglPangoRenderer;
typedef struct _CoglPangoRendererClass CoglPangoRendererClass;
GType cogl_pango_renderer_get_type (void) G_GNUC_CONST;
COGL_EXPORT GType cogl_pango_renderer_get_type (void) G_GNUC_CONST;
G_END_DECLS

View File

@@ -1,6 +0,0 @@
{
global:
cogl_pango_*;
local:
*;
};

View File

@@ -20,19 +20,13 @@ cogl_pango_deps = [
libmutter_cogl_dep,
]
libmutter_cogl_pango_map = 'libmutter-cogl-pango.map'
libmutter_cogl_pango_link_args = [
'-Wl,--version-script,@0@/@1@'.format(meson.current_source_dir(),
libmutter_cogl_pango_map),
]
libmutter_cogl_pango = shared_library('mutter-cogl-pango-' + libmutter_api_version,
sources: [cogl_pango_sources, cogl_pango_public_headers],
version: '0.0.0',
soversion: 0,
c_args: cogl_c_args,
include_directories: [cogl_includepath, cogl_path_includepath],
link_depends: libmutter_cogl_pango_map,
link_args: libmutter_cogl_pango_link_args,
gnu_symbol_visibility: 'hidden',
dependencies: [cogl_pango_deps],
install_rpath: pkglibdir,
install_dir: pkglibdir,

View File

@@ -50,6 +50,7 @@ G_BEGIN_DECLS
*
* Returns: a #GType that can be used with the GLib type system.
*/
COGL_EXPORT
GType cogl_path_get_gtype (void);
#define cogl_path_new cogl2_path_new
@@ -64,7 +65,7 @@ GType cogl_path_get_gtype (void);
*
* Since: 2.0
*/
CoglPath *
COGL_EXPORT CoglPath *
cogl_path_new (void);
/**
@@ -82,7 +83,7 @@ cogl_path_new (void);
*
* Since: 2.0
*/
CoglPath *
COGL_EXPORT CoglPath *
cogl_path_copy (CoglPath *path);
/**
@@ -96,7 +97,7 @@ cogl_path_copy (CoglPath *path);
*
* Since: 2.0
*/
gboolean
COGL_EXPORT gboolean
cogl_is_path (void *object);
#define cogl_path_move_to cogl2_path_move_to
@@ -110,7 +111,7 @@ cogl_is_path (void *object);
*
* Since: 2.0
*/
void
COGL_EXPORT void
cogl_path_move_to (CoglPath *path,
float x,
float y);
@@ -127,7 +128,7 @@ cogl_path_move_to (CoglPath *path,
*
* Since: 2.0
*/
void
COGL_EXPORT void
cogl_path_rel_move_to (CoglPath *path,
float x,
float y);
@@ -143,7 +144,7 @@ cogl_path_rel_move_to (CoglPath *path,
*
* Since: 2.0
*/
void
COGL_EXPORT void
cogl_path_line_to (CoglPath *path,
float x,
float y);
@@ -159,7 +160,7 @@ cogl_path_line_to (CoglPath *path,
*
* Since: 2.0
*/
void
COGL_EXPORT void
cogl_path_rel_line_to (CoglPath *path,
float x,
float y);
@@ -187,7 +188,7 @@ cogl_path_rel_line_to (CoglPath *path,
*
* Since: 2.0
*/
void
COGL_EXPORT void
cogl_path_arc (CoglPath *path,
float center_x,
float center_y,
@@ -212,7 +213,7 @@ cogl_path_arc (CoglPath *path,
*
* Since: 2.0
*/
void
COGL_EXPORT void
cogl_path_curve_to (CoglPath *path,
float x_1,
float y_1,
@@ -238,7 +239,7 @@ cogl_path_curve_to (CoglPath *path,
*
* Since: 2.0
*/
void
COGL_EXPORT void
cogl_path_rel_curve_to (CoglPath *path,
float x_1,
float y_1,
@@ -256,7 +257,7 @@ cogl_path_rel_curve_to (CoglPath *path,
*
* Since: 2.0
*/
void
COGL_EXPORT void
cogl_path_close (CoglPath *path);
#define cogl_path_line cogl2_path_line
@@ -273,7 +274,7 @@ cogl_path_close (CoglPath *path);
*
* Since: 2.0
*/
void
COGL_EXPORT void
cogl_path_line (CoglPath *path,
float x_1,
float y_1,
@@ -301,7 +302,7 @@ cogl_path_line (CoglPath *path,
*
* Since: 2.0
*/
void
COGL_EXPORT void
cogl_path_polyline (CoglPath *path,
const float *coords,
int num_points);
@@ -323,7 +324,7 @@ cogl_path_polyline (CoglPath *path,
*
* Since: 2.0
*/
void
COGL_EXPORT void
cogl_path_polygon (CoglPath *path,
const float *coords,
int num_points);
@@ -341,7 +342,7 @@ cogl_path_polygon (CoglPath *path,
*
* Since: 2.0
*/
void
COGL_EXPORT void
cogl_path_rectangle (CoglPath *path,
float x_1,
float y_1,
@@ -361,7 +362,7 @@ cogl_path_rectangle (CoglPath *path,
*
* Since: 2.0
*/
void
COGL_EXPORT void
cogl_path_ellipse (CoglPath *path,
float center_x,
float center_y,
@@ -384,7 +385,7 @@ cogl_path_ellipse (CoglPath *path,
*
* Since: 2.0
*/
void
COGL_EXPORT void
cogl_path_round_rectangle (CoglPath *path,
float x_1,
float y_1,
@@ -406,7 +407,7 @@ cogl_path_round_rectangle (CoglPath *path,
*
* Since: 2.0
*/
void
COGL_EXPORT void
cogl_path_set_fill_rule (CoglPath *path, CoglPathFillRule fill_rule);
#define cogl_path_get_fill_rule cogl2_path_get_fill_rule
@@ -419,7 +420,7 @@ cogl_path_set_fill_rule (CoglPath *path, CoglPathFillRule fill_rule);
*
* Since: 2.0
*/
CoglPathFillRule
COGL_EXPORT CoglPathFillRule
cogl_path_get_fill_rule (CoglPath *path);
/**
@@ -441,7 +442,7 @@ cogl_path_get_fill_rule (CoglPath *path);
*
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_framebuffer_fill_path (CoglFramebuffer *framebuffer,
CoglPipeline *pipeline,
CoglPath *path);
@@ -458,7 +459,7 @@ cogl_framebuffer_fill_path (CoglFramebuffer *framebuffer,
*
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_framebuffer_stroke_path (CoglFramebuffer *framebuffer,
CoglPipeline *pipeline,
CoglPath *path);
@@ -476,7 +477,7 @@ cogl_framebuffer_stroke_path (CoglFramebuffer *framebuffer,
* Since: 1.0
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_framebuffer_push_path_clip (CoglFramebuffer *framebuffer,
CoglPath *path);

View File

@@ -1,17 +0,0 @@
{
global:
cogl_framebuffer_*;
cogl_path_*;
cogl_is_*;
cogl_clip_*;
cogl_get_*;
cogl_set_*;
cogl2_framebuffer_*;
cogl2_path_*;
cogl2_is_*;
cogl2_clip_*;
cogl2_get_*;
cogl2_set_*;
local:
*;
};

View File

@@ -53,19 +53,13 @@ cogl_path_c_args = [
cogl_c_args,
]
libmutter_cogl_path_map = 'libmutter-cogl-path.map'
libmutter_cogl_path_link_args = [
'-Wl,--version-script,@0@/@1@'.format(meson.current_source_dir(),
libmutter_cogl_path_map),
]
libmutter_cogl_path = shared_library('mutter-cogl-path-' + libmutter_api_version,
sources: [cogl_path_sources, cogl_path_public_headers],
version: '0.0.0',
soversion: 0,
c_args: cogl_path_c_args,
include_directories: [cogl_includepath, cogl_path_includepath],
link_depends: libmutter_cogl_path_map,
link_args: libmutter_cogl_path_link_args,
gnu_symbol_visibility: 'hidden',
dependencies: libmutter_cogl_dep,
install_rpath: pkglibdir,
install_dir: pkglibdir,

View File

@@ -65,12 +65,12 @@ CoglAtlasTexture *
_cogl_atlas_texture_new_from_bitmap (CoglBitmap *bmp,
gboolean can_convert_in_place);
void
COGL_EXPORT void
_cogl_atlas_texture_add_reorganize_callback (CoglContext *ctx,
GHookFunc callback,
void *user_data);
void
COGL_EXPORT void
_cogl_atlas_texture_remove_reorganize_callback (CoglContext *ctx,
GHookFunc callback,
void *user_data);

View File

@@ -74,6 +74,7 @@ typedef struct _CoglAtlasTexture CoglAtlasTexture;
*
* Returns: a #GType that can be used with the GLib type system.
*/
COGL_EXPORT
GType cogl_atlas_texture_get_gtype (void);
/**
@@ -108,7 +109,7 @@ GType cogl_atlas_texture_get_gtype (void);
* Since: 1.16
* Stability: unstable
*/
CoglAtlasTexture *
COGL_EXPORT CoglAtlasTexture *
cogl_atlas_texture_new_with_size (CoglContext *ctx,
int width,
int height);
@@ -146,7 +147,7 @@ cogl_atlas_texture_new_with_size (CoglContext *ctx,
* Since: 1.16
* Stability: unstable
*/
CoglAtlasTexture *
COGL_EXPORT CoglAtlasTexture *
cogl_atlas_texture_new_from_file (CoglContext *ctx,
const char *filename,
GError **error);
@@ -191,7 +192,7 @@ cogl_atlas_texture_new_from_file (CoglContext *ctx,
* Since: 1.16
* Stability: unstable
*/
CoglAtlasTexture *
COGL_EXPORT CoglAtlasTexture *
cogl_atlas_texture_new_from_data (CoglContext *ctx,
int width,
int height,
@@ -231,7 +232,7 @@ cogl_atlas_texture_new_from_data (CoglContext *ctx,
* Since: 1.16
* Stability: unstable
*/
CoglAtlasTexture *
COGL_EXPORT CoglAtlasTexture *
cogl_atlas_texture_new_from_bitmap (CoglBitmap *bmp);
/**
@@ -246,7 +247,7 @@ cogl_atlas_texture_new_from_bitmap (CoglBitmap *bmp);
* Since: 1.16
* Stability: Unstable
*/
gboolean
COGL_EXPORT gboolean
cogl_is_atlas_texture (void *object);
G_END_DECLS

View File

@@ -64,12 +64,12 @@ struct _CoglAtlas
GHookList post_reorganize_callbacks;
};
CoglAtlas *
COGL_EXPORT CoglAtlas *
_cogl_atlas_new (CoglPixelFormat texture_format,
CoglAtlasFlags flags,
CoglAtlasUpdatePositionCallback update_position_cb);
gboolean
COGL_EXPORT gboolean
_cogl_atlas_reserve_space (CoglAtlas *atlas,
unsigned int width,
unsigned int height,
@@ -87,7 +87,7 @@ _cogl_atlas_copy_rectangle (CoglAtlas *atlas,
int height,
CoglPixelFormat format);
void
COGL_EXPORT void
_cogl_atlas_add_reorganize_callback (CoglAtlas *atlas,
GHookFunc pre_callback,
GHookFunc post_callback,

View File

@@ -64,6 +64,7 @@ G_BEGIN_DECLS
*
* Returns: a #GType that can be used with the GLib type system.
*/
COGL_EXPORT
GType cogl_attribute_buffer_get_gtype (void);
/**
@@ -89,7 +90,7 @@ GType cogl_attribute_buffer_get_gtype (void);
*
* Stability: Unstable
*/
CoglAttributeBuffer *
COGL_EXPORT CoglAttributeBuffer *
cogl_attribute_buffer_new_with_size (CoglContext *context,
size_t bytes);
@@ -122,7 +123,7 @@ cogl_attribute_buffer_new_with_size (CoglContext *context,
* Since: 1.4
* Stability: Unstable
*/
CoglAttributeBuffer *
COGL_EXPORT CoglAttributeBuffer *
cogl_attribute_buffer_new (CoglContext *context,
size_t bytes,
const void *data);
@@ -139,7 +140,7 @@ cogl_attribute_buffer_new (CoglContext *context,
* Since: 1.4
* Stability: Unstable
*/
gboolean
COGL_EXPORT gboolean
cogl_is_attribute_buffer (void *object);
G_END_DECLS

View File

@@ -63,6 +63,7 @@ G_BEGIN_DECLS
*
* Returns: a #GType that can be used with the GLib type system.
*/
COGL_EXPORT
GType cogl_attribute_get_gtype (void);
/**
@@ -155,7 +156,7 @@ GType cogl_attribute_get_gtype (void);
*/
/* XXX: look for a precedent to see if the stride/offset args should
* have a different order. */
CoglAttribute *
COGL_EXPORT CoglAttribute *
cogl_attribute_new (CoglAttributeBuffer *attribute_buffer,
const char *name,
size_t stride,
@@ -183,7 +184,7 @@ cogl_attribute_new (CoglAttributeBuffer *attribute_buffer,
* Return value: (transfer full): A newly allocated #CoglAttribute
* representing the given constant @value.
*/
CoglAttribute *
COGL_EXPORT CoglAttribute *
cogl_attribute_new_const_1f (CoglContext *context,
const char *name,
float value);
@@ -210,7 +211,7 @@ cogl_attribute_new_const_1f (CoglContext *context,
* Return value: (transfer full): A newly allocated #CoglAttribute
* representing the given constant vector.
*/
CoglAttribute *
COGL_EXPORT CoglAttribute *
cogl_attribute_new_const_2f (CoglContext *context,
const char *name,
float component0,
@@ -242,7 +243,7 @@ cogl_attribute_new_const_2f (CoglContext *context,
* Return value: (transfer full): A newly allocated #CoglAttribute
* representing the given constant vector.
*/
CoglAttribute *
COGL_EXPORT CoglAttribute *
cogl_attribute_new_const_3f (CoglContext *context,
const char *name,
float component0,
@@ -277,7 +278,7 @@ cogl_attribute_new_const_3f (CoglContext *context,
* Return value: (transfer full): A newly allocated #CoglAttribute
* representing the given constant vector.
*/
CoglAttribute *
COGL_EXPORT CoglAttribute *
cogl_attribute_new_const_4f (CoglContext *context,
const char *name,
float component0,
@@ -306,7 +307,7 @@ cogl_attribute_new_const_4f (CoglContext *context,
* Return value: (transfer full): A newly allocated #CoglAttribute
* representing the given constant vector.
*/
CoglAttribute *
COGL_EXPORT CoglAttribute *
cogl_attribute_new_const_2fv (CoglContext *context,
const char *name,
const float *value);
@@ -335,7 +336,7 @@ cogl_attribute_new_const_2fv (CoglContext *context,
* Return value: (transfer full): A newly allocated #CoglAttribute
* representing the given constant vector.
*/
CoglAttribute *
COGL_EXPORT CoglAttribute *
cogl_attribute_new_const_3fv (CoglContext *context,
const char *name,
const float *value);
@@ -365,7 +366,7 @@ cogl_attribute_new_const_3fv (CoglContext *context,
* Return value: (transfer full): A newly allocated #CoglAttribute
* representing the given constant vector.
*/
CoglAttribute *
COGL_EXPORT CoglAttribute *
cogl_attribute_new_const_4fv (CoglContext *context,
const char *name,
const float *value);
@@ -398,7 +399,7 @@ cogl_attribute_new_const_4fv (CoglContext *context,
* Return value: (transfer full): A newly allocated #CoglAttribute
* representing the given constant matrix.
*/
CoglAttribute *
COGL_EXPORT CoglAttribute *
cogl_attribute_new_const_2x2fv (CoglContext *context,
const char *name,
const float *matrix2x2,
@@ -433,7 +434,7 @@ cogl_attribute_new_const_2x2fv (CoglContext *context,
* Return value: (transfer full): A newly allocated #CoglAttribute
* representing the given constant matrix.
*/
CoglAttribute *
COGL_EXPORT CoglAttribute *
cogl_attribute_new_const_3x3fv (CoglContext *context,
const char *name,
const float *matrix3x3,
@@ -468,7 +469,7 @@ cogl_attribute_new_const_3x3fv (CoglContext *context,
* Return value: (transfer full): A newly allocated #CoglAttribute
* representing the given constant matrix.
*/
CoglAttribute *
COGL_EXPORT CoglAttribute *
cogl_attribute_new_const_4x4fv (CoglContext *context,
const char *name,
const float *matrix4x4,
@@ -492,7 +493,7 @@ cogl_attribute_new_const_4x4fv (CoglContext *context,
* Stability: unstable
* Since: 1.10
*/
void
COGL_EXPORT void
cogl_attribute_set_normalized (CoglAttribute *attribute,
gboolean normalized);
@@ -506,7 +507,7 @@ cogl_attribute_set_normalized (CoglAttribute *attribute,
* Stability: unstable
* Since: 1.10
*/
gboolean
COGL_EXPORT gboolean
cogl_attribute_get_normalized (CoglAttribute *attribute);
/**
@@ -519,7 +520,7 @@ cogl_attribute_get_normalized (CoglAttribute *attribute);
* Stability: unstable
* Since: 1.10
*/
CoglAttributeBuffer *
COGL_EXPORT CoglAttributeBuffer *
cogl_attribute_get_buffer (CoglAttribute *attribute);
/**
@@ -532,7 +533,7 @@ cogl_attribute_get_buffer (CoglAttribute *attribute);
* Stability: unstable
* Since: 1.10
*/
void
COGL_EXPORT void
cogl_attribute_set_buffer (CoglAttribute *attribute,
CoglAttributeBuffer *attribute_buffer);
@@ -545,7 +546,7 @@ cogl_attribute_set_buffer (CoglAttribute *attribute,
* Return value: %TRUE if the @object references a #CoglAttribute,
* %FALSE otherwise
*/
gboolean
COGL_EXPORT gboolean
cogl_is_attribute (void *object);
G_END_DECLS

View File

@@ -54,6 +54,7 @@ G_BEGIN_DECLS
*
* Returns: a #GType that can be used with the GLib type system.
*/
COGL_EXPORT
GType cogl_bitmap_get_gtype (void);
/**
@@ -80,7 +81,7 @@ GType cogl_bitmap_get_gtype (void);
*
* Since: 1.0
*/
CoglBitmap *
COGL_EXPORT CoglBitmap *
cogl_bitmap_new_from_file (const char *filename,
GError **error);
@@ -103,7 +104,7 @@ cogl_bitmap_new_from_file (const char *filename,
* Since: 1.8
* Stability: unstable
*/
CoglBitmap *
COGL_EXPORT CoglBitmap *
cogl_bitmap_new_from_buffer (CoglBuffer *buffer,
CoglPixelFormat format,
int width,
@@ -140,7 +141,7 @@ cogl_bitmap_new_from_buffer (CoglBuffer *buffer,
* Since: 1.10
* Stability: Unstable
*/
CoglBitmap *
COGL_EXPORT CoglBitmap *
cogl_bitmap_new_with_size (CoglContext *context,
unsigned int width,
unsigned int height,
@@ -166,7 +167,7 @@ cogl_bitmap_new_with_size (CoglContext *context,
* Since: 1.10
* Stability: unstable
*/
CoglBitmap *
COGL_EXPORT CoglBitmap *
cogl_bitmap_new_for_data (CoglContext *context,
int width,
int height,
@@ -182,7 +183,7 @@ cogl_bitmap_new_for_data (CoglContext *context,
* Since: 1.10
* Stability: unstable
*/
CoglPixelFormat
COGL_EXPORT CoglPixelFormat
cogl_bitmap_get_format (CoglBitmap *bitmap);
/**
@@ -193,7 +194,7 @@ cogl_bitmap_get_format (CoglBitmap *bitmap);
* Since: 1.10
* Stability: unstable
*/
int
COGL_EXPORT int
cogl_bitmap_get_width (CoglBitmap *bitmap);
/**
@@ -204,7 +205,7 @@ cogl_bitmap_get_width (CoglBitmap *bitmap);
* Since: 1.10
* Stability: unstable
*/
int
COGL_EXPORT int
cogl_bitmap_get_height (CoglBitmap *bitmap);
/**
@@ -217,7 +218,7 @@ cogl_bitmap_get_height (CoglBitmap *bitmap);
* Since: 1.10
* Stability: unstable
*/
int
COGL_EXPORT int
cogl_bitmap_get_rowstride (CoglBitmap *bitmap);
/**
@@ -231,7 +232,7 @@ cogl_bitmap_get_rowstride (CoglBitmap *bitmap);
* Stability: unstable
* Since: 1.10
*/
CoglPixelBuffer *
COGL_EXPORT CoglPixelBuffer *
cogl_bitmap_get_buffer (CoglBitmap *bitmap);
/**
@@ -247,7 +248,7 @@ cogl_bitmap_get_buffer (CoglBitmap *bitmap);
*
* Since: 1.0
*/
gboolean
COGL_EXPORT gboolean
cogl_bitmap_get_size_from_file (const char *filename,
int *width,
int *height);
@@ -263,7 +264,7 @@ cogl_bitmap_get_size_from_file (const char *filename,
*
* Since: 1.0
*/
gboolean
COGL_EXPORT gboolean
cogl_is_bitmap (void *object);
/**
@@ -297,6 +298,7 @@ typedef enum
COGL_BITMAP_ERROR_CORRUPT_IMAGE
} CoglBitmapError;
COGL_EXPORT
uint32_t cogl_bitmap_error_quark (void);
G_END_DECLS

View File

@@ -168,10 +168,10 @@ void *
_cogl_buffer_map_range_for_fill_or_fallback (CoglBuffer *buffer,
size_t offset,
size_t size);
void *
COGL_EXPORT void *
_cogl_buffer_map_for_fill_or_fallback (CoglBuffer *buffer);
void
COGL_EXPORT void
_cogl_buffer_unmap_for_fill_or_fallback (CoglBuffer *buffer);
G_END_DECLS

View File

@@ -107,7 +107,7 @@ _cogl_buffer_error_domain (void);
* Since: 1.2
* Stability: unstable
*/
gboolean
COGL_EXPORT gboolean
cogl_is_buffer (void *object);
/**
@@ -121,7 +121,7 @@ cogl_is_buffer (void *object);
* Since: 1.2
* Stability: unstable
*/
unsigned int
COGL_EXPORT unsigned int
cogl_buffer_get_size (CoglBuffer *buffer);
/**
@@ -155,7 +155,7 @@ typedef enum /*< prefix=COGL_BUFFER_UPDATE_HINT >*/
* Since: 1.2
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_buffer_set_update_hint (CoglBuffer *buffer,
CoglBufferUpdateHint hint);
@@ -170,7 +170,7 @@ cogl_buffer_set_update_hint (CoglBuffer *buffer,
* Since: 1.2
* Stability: unstable
*/
CoglBufferUpdateHint
COGL_EXPORT CoglBufferUpdateHint
cogl_buffer_get_update_hint (CoglBuffer *buffer);
/**
@@ -244,7 +244,7 @@ typedef enum /*< prefix=COGL_BUFFER_MAP_HINT >*/
* Since: 1.2
* Stability: unstable
*/
void *
COGL_EXPORT void *
cogl_buffer_map (CoglBuffer *buffer,
CoglBufferAccess access,
CoglBufferMapHint hints);
@@ -281,7 +281,7 @@ cogl_buffer_map (CoglBuffer *buffer,
* Since: 2.0
* Stability: unstable
*/
void *
COGL_EXPORT void *
cogl_buffer_map_range (CoglBuffer *buffer,
size_t offset,
size_t size,
@@ -298,7 +298,7 @@ cogl_buffer_map_range (CoglBuffer *buffer,
* Since: 1.2
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_buffer_unmap (CoglBuffer *buffer);
/**
@@ -317,7 +317,7 @@ cogl_buffer_unmap (CoglBuffer *buffer);
* Since: 1.2
* Stability: unstable
*/
gboolean
COGL_EXPORT gboolean
cogl_buffer_set_data (CoglBuffer *buffer,
size_t offset,
const void *data,

View File

@@ -178,7 +178,7 @@ _cogl_clip_stack_push_window_rectangle (CoglClipStack *stack,
int width,
int height);
CoglClipStack *
COGL_EXPORT CoglClipStack *
_cogl_clip_stack_push_rectangle (CoglClipStack *stack,
float x_1,
float y_1,
@@ -188,7 +188,7 @@ _cogl_clip_stack_push_rectangle (CoglClipStack *stack,
CoglMatrixEntry *projection_entry,
const float *viewport);
CoglClipStack *
COGL_EXPORT CoglClipStack *
_cogl_clip_stack_push_primitive (CoglClipStack *stack,
CoglPrimitive *primitive,
float bounds_x1,

View File

@@ -65,7 +65,7 @@ typedef struct _CoglClosure
* Removes the given closure from the callback list it is connected to
* and destroys it. If the closure was created with a destroy function
* then it will be invoked. */
void
COGL_EXPORT void
_cogl_closure_disconnect (CoglClosure *closure);
void

View File

@@ -57,6 +57,7 @@ G_BEGIN_DECLS
*
* Returns: a #GType that can be used with the GLib type system.
*/
COGL_EXPORT
GType cogl_color_get_gtype (void);
/**
@@ -69,7 +70,7 @@ GType cogl_color_get_gtype (void);
*
* Since: 1.0
*/
CoglColor *
COGL_EXPORT CoglColor *
cogl_color_new (void);
/**
@@ -83,7 +84,7 @@ cogl_color_new (void);
*
* Since: 1.0
*/
CoglColor *
COGL_EXPORT CoglColor *
cogl_color_copy (const CoglColor *color);
/**
@@ -94,7 +95,7 @@ cogl_color_copy (const CoglColor *color);
*
* Since: 1.0
*/
void
COGL_EXPORT void
cogl_color_free (CoglColor *color);
/**
@@ -109,7 +110,7 @@ cogl_color_free (CoglColor *color);
*
* Since: 1.4
*/
void
COGL_EXPORT void
cogl_color_init_from_4ub (CoglColor *color,
uint8_t red,
uint8_t green,
@@ -128,7 +129,7 @@ cogl_color_init_from_4ub (CoglColor *color,
*
* Since: 1.4
*/
void
COGL_EXPORT void
cogl_color_init_from_4f (CoglColor *color,
float red,
float green,
@@ -144,7 +145,7 @@ cogl_color_init_from_4f (CoglColor *color,
*
* Since: 1.4
*/
void
COGL_EXPORT void
cogl_color_init_from_4fv (CoglColor *color,
const float *color_array);
@@ -159,7 +160,7 @@ cogl_color_init_from_4fv (CoglColor *color,
*
* Since: 1.0
*/
unsigned char
COGL_EXPORT unsigned char
cogl_color_get_red_byte (const CoglColor *color);
/**
@@ -173,7 +174,7 @@ cogl_color_get_red_byte (const CoglColor *color);
*
* Since: 1.0
*/
unsigned char
COGL_EXPORT unsigned char
cogl_color_get_green_byte (const CoglColor *color);
/**
@@ -187,7 +188,7 @@ cogl_color_get_green_byte (const CoglColor *color);
*
* Since: 1.0
*/
unsigned char
COGL_EXPORT unsigned char
cogl_color_get_blue_byte (const CoglColor *color);
/**
@@ -201,7 +202,7 @@ cogl_color_get_blue_byte (const CoglColor *color);
*
* Since: 1.0
*/
unsigned char
COGL_EXPORT unsigned char
cogl_color_get_alpha_byte (const CoglColor *color);
/**
@@ -215,7 +216,7 @@ cogl_color_get_alpha_byte (const CoglColor *color);
*
* Since: 1.0
*/
float
COGL_EXPORT float
cogl_color_get_red_float (const CoglColor *color);
/**
@@ -229,7 +230,7 @@ cogl_color_get_red_float (const CoglColor *color);
*
* Since: 1.0
*/
float
COGL_EXPORT float
cogl_color_get_green_float (const CoglColor *color);
/**
@@ -243,7 +244,7 @@ cogl_color_get_green_float (const CoglColor *color);
*
* Since: 1.0
*/
float
COGL_EXPORT float
cogl_color_get_blue_float (const CoglColor *color);
/**
@@ -257,7 +258,7 @@ cogl_color_get_blue_float (const CoglColor *color);
*
* Since: 1.0
*/
float
COGL_EXPORT float
cogl_color_get_alpha_float (const CoglColor *color);
/**
@@ -271,7 +272,7 @@ cogl_color_get_alpha_float (const CoglColor *color);
*
* Since: 1.0
*/
float
COGL_EXPORT float
cogl_color_get_red (const CoglColor *color);
/**
@@ -285,7 +286,7 @@ cogl_color_get_red (const CoglColor *color);
*
* Since: 1.0
*/
float
COGL_EXPORT float
cogl_color_get_green (const CoglColor *color);
/**
@@ -299,7 +300,7 @@ cogl_color_get_green (const CoglColor *color);
*
* Since: 1.0
*/
float
COGL_EXPORT float
cogl_color_get_blue (const CoglColor *color);
/**
@@ -313,7 +314,7 @@ cogl_color_get_blue (const CoglColor *color);
*
* Since: 1.0
*/
float
COGL_EXPORT float
cogl_color_get_alpha (const CoglColor *color);
/**
@@ -325,7 +326,7 @@ cogl_color_get_alpha (const CoglColor *color);
*
* Since: 1.4
*/
void
COGL_EXPORT void
cogl_color_set_red_byte (CoglColor *color,
unsigned char red);
@@ -338,7 +339,7 @@ cogl_color_set_red_byte (CoglColor *color,
*
* Since: 1.4
*/
void
COGL_EXPORT void
cogl_color_set_green_byte (CoglColor *color,
unsigned char green);
@@ -351,7 +352,7 @@ cogl_color_set_green_byte (CoglColor *color,
*
* Since: 1.4
*/
void
COGL_EXPORT void
cogl_color_set_blue_byte (CoglColor *color,
unsigned char blue);
@@ -364,7 +365,7 @@ cogl_color_set_blue_byte (CoglColor *color,
*
* Since: 1.4
*/
void
COGL_EXPORT void
cogl_color_set_alpha_byte (CoglColor *color,
unsigned char alpha);
@@ -377,7 +378,7 @@ cogl_color_set_alpha_byte (CoglColor *color,
*
* since: 1.4
*/
void
COGL_EXPORT void
cogl_color_set_red_float (CoglColor *color,
float red);
@@ -390,7 +391,7 @@ cogl_color_set_red_float (CoglColor *color,
*
* since: 1.4
*/
void
COGL_EXPORT void
cogl_color_set_green_float (CoglColor *color,
float green);
@@ -403,7 +404,7 @@ cogl_color_set_green_float (CoglColor *color,
*
* since: 1.4
*/
void
COGL_EXPORT void
cogl_color_set_blue_float (CoglColor *color,
float blue);
@@ -416,7 +417,7 @@ cogl_color_set_blue_float (CoglColor *color,
*
* since: 1.4
*/
void
COGL_EXPORT void
cogl_color_set_alpha_float (CoglColor *color,
float alpha);
@@ -429,7 +430,7 @@ cogl_color_set_alpha_float (CoglColor *color,
*
* Since: 1.4
*/
void
COGL_EXPORT void
cogl_color_set_red (CoglColor *color,
float red);
@@ -442,7 +443,7 @@ cogl_color_set_red (CoglColor *color,
*
* Since: 1.4
*/
void
COGL_EXPORT void
cogl_color_set_green (CoglColor *color,
float green);
@@ -455,7 +456,7 @@ cogl_color_set_green (CoglColor *color,
*
* Since: 1.4
*/
void
COGL_EXPORT void
cogl_color_set_blue (CoglColor *color,
float blue);
@@ -468,7 +469,7 @@ cogl_color_set_blue (CoglColor *color,
*
* Since: 1.4
*/
void
COGL_EXPORT void
cogl_color_set_alpha (CoglColor *color,
float alpha);
@@ -482,7 +483,7 @@ cogl_color_set_alpha (CoglColor *color,
*
* Since: 1.0
*/
void
COGL_EXPORT void
cogl_color_premultiply (CoglColor *color);
/**
@@ -495,7 +496,7 @@ cogl_color_premultiply (CoglColor *color);
*
* Since: 1.4
*/
void
COGL_EXPORT void
cogl_color_unpremultiply (CoglColor *color);
/**
@@ -512,7 +513,7 @@ cogl_color_unpremultiply (CoglColor *color);
*
* Since: 1.0
*/
gboolean
COGL_EXPORT gboolean
cogl_color_equal (const void *v1, const void *v2);
/**
@@ -529,7 +530,7 @@ cogl_color_equal (const void *v1, const void *v2);
*
* Since: 1.16
*/
void
COGL_EXPORT void
cogl_color_to_hsl (const CoglColor *color,
float *hue,
float *saturation,
@@ -547,7 +548,7 @@ cogl_color_to_hsl (const CoglColor *color,
*
* Since: 1.16
*/
void
COGL_EXPORT void
cogl_color_init_from_hsl (CoglColor *color,
float hue,
float saturation,

View File

@@ -300,7 +300,7 @@ struct _CoglContext
#undef COGL_EXT_END
};
CoglContext *
COGL_EXPORT CoglContext *
_cogl_context_get_default (void);
const CoglWinsysVtable *

View File

@@ -211,7 +211,7 @@ cogl_context_new (CoglDisplay *display,
return NULL;
}
if (!context->driver_vtable->context_init (context, error))
if (!context->driver_vtable->context_init (context))
{
cogl_object_unref (display);
g_free (context);

View File

@@ -99,6 +99,7 @@ G_BEGIN_DECLS
*
* Returns: a #GType that can be used with the GLib type system.
*/
COGL_EXPORT
GType cogl_context_get_gtype (void);
/**
@@ -113,7 +114,7 @@ GType cogl_context_get_gtype (void);
* Since: 1.8
* Stability: unstable
*/
CoglContext *
COGL_EXPORT CoglContext *
cogl_context_new (CoglDisplay *display,
GError **error);
@@ -132,7 +133,7 @@ cogl_context_new (CoglDisplay *display,
* Since: 1.8
* Stability: unstable
*/
CoglDisplay *
COGL_EXPORT CoglDisplay *
cogl_context_get_display (CoglContext *context);
/**
@@ -151,7 +152,7 @@ cogl_context_get_display (CoglContext *context);
* Since: 1.16
* Stability: unstable
*/
CoglRenderer *
COGL_EXPORT CoglRenderer *
cogl_context_get_renderer (CoglContext *context);
/**
@@ -166,7 +167,7 @@ cogl_context_get_renderer (CoglContext *context);
* Since: 1.10
* Stability: Unstable
*/
gboolean
COGL_EXPORT gboolean
cogl_is_context (void *object);
/* XXX: not guarded by the EXPERIMENTAL_API defines to avoid
@@ -234,7 +235,7 @@ typedef enum _CoglFeatureID
* Since: 1.10
* Stability: unstable
*/
gboolean
COGL_EXPORT gboolean
cogl_has_feature (CoglContext *context, CoglFeatureID feature);
/**
@@ -254,7 +255,7 @@ cogl_has_feature (CoglContext *context, CoglFeatureID feature);
* Since: 1.10
* Stability: unstable
*/
gboolean
COGL_EXPORT gboolean
cogl_has_features (CoglContext *context, ...);
/**
@@ -283,7 +284,7 @@ typedef void (*CoglFeatureCallback) (CoglFeatureID feature, void *user_data);
* Since: 1.10
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_foreach_feature (CoglContext *context,
CoglFeatureCallback callback,
void *user_data);
@@ -308,7 +309,7 @@ cogl_foreach_feature (CoglContext *context,
* Since: 1.14
* Stability: unstable
*/
int64_t
COGL_EXPORT int64_t
cogl_get_clock_time (CoglContext *context);
/**
@@ -350,7 +351,7 @@ typedef enum _CoglGraphicsResetStatus
*
* Return value: a #CoglGraphicsResetStatus
*/
CoglGraphicsResetStatus
COGL_EXPORT CoglGraphicsResetStatus
cogl_get_graphics_reset_status (CoglContext *context);
G_END_DECLS

View File

@@ -75,10 +75,12 @@ typedef enum
COGL_DEBUG_N_FLAGS
} CoglDebugFlags;
extern GHashTable *_cogl_debug_instances;
COGL_EXPORT
GHashTable *_cogl_debug_instances;
#define COGL_DEBUG_N_LONGS COGL_FLAGS_N_LONGS_FOR_SIZE (COGL_DEBUG_N_FLAGS)
extern unsigned long _cogl_debug_flags[COGL_DEBUG_N_LONGS];
COGL_EXPORT
unsigned long _cogl_debug_flags[COGL_DEBUG_N_LONGS];
#define COGL_DEBUG_ENABLED(flag) \
COGL_FLAGS_GET (_cogl_debug_flags, flag)

View File

@@ -46,3 +46,5 @@
#mesondefine COGL_HAS_X11_SUPPORT
#mesondefine COGL_HAS_XLIB
#mesondefine COGL_HAS_XLIB_SUPPORT
#mesondefine COGL_HAS_TRACING

View File

@@ -84,7 +84,7 @@ typedef struct {
* Since: 2.0
* Stability: Unstable
*/
void
COGL_EXPORT void
cogl_depth_state_init (CoglDepthState *state);
/**
@@ -112,7 +112,7 @@ cogl_depth_state_init (CoglDepthState *state);
* Since: 2.0
* Stability: Unstable
*/
void
COGL_EXPORT void
cogl_depth_state_set_test_enabled (CoglDepthState *state,
gboolean enable);
@@ -127,7 +127,7 @@ cogl_depth_state_set_test_enabled (CoglDepthState *state,
* Since: 2.0
* Stability: Unstable
*/
gboolean
COGL_EXPORT gboolean
cogl_depth_state_get_test_enabled (CoglDepthState *state);
/**
@@ -150,7 +150,7 @@ cogl_depth_state_get_test_enabled (CoglDepthState *state);
* Since: 2.0
* Stability: Unstable
*/
void
COGL_EXPORT void
cogl_depth_state_set_write_enabled (CoglDepthState *state,
gboolean enable);
@@ -165,7 +165,7 @@ cogl_depth_state_set_write_enabled (CoglDepthState *state,
* Since: 2.0
* Stability: Unstable
*/
gboolean
COGL_EXPORT gboolean
cogl_depth_state_get_write_enabled (CoglDepthState *state);
/**
@@ -186,7 +186,7 @@ cogl_depth_state_get_write_enabled (CoglDepthState *state);
* Since: 2.0
* Stability: Unstable
*/
void
COGL_EXPORT void
cogl_depth_state_set_test_function (CoglDepthState *state,
CoglDepthTestFunction function);
@@ -201,7 +201,7 @@ cogl_depth_state_set_test_function (CoglDepthState *state,
* Since: 2.0
* Stability: Unstable
*/
CoglDepthTestFunction
COGL_EXPORT CoglDepthTestFunction
cogl_depth_state_get_test_function (CoglDepthState *state);
/**
@@ -235,7 +235,7 @@ cogl_depth_state_get_test_function (CoglDepthState *state);
* Since: 2.0
* Stability: Unstable
*/
void
COGL_EXPORT void
cogl_depth_state_set_range (CoglDepthState *state,
float near_val,
float far_val);
@@ -253,7 +253,7 @@ cogl_depth_state_set_range (CoglDepthState *state,
* Since: 2.0
* Stability: Unstable
*/
void
COGL_EXPORT void
cogl_depth_state_get_range (CoglDepthState *state,
float *near_val,
float *far_val);

View File

@@ -75,6 +75,7 @@ typedef struct _CoglDisplay CoglDisplay;
*
* Returns: a #GType that can be used with the GLib type system.
*/
COGL_EXPORT
GType cogl_display_get_gtype (void);
/**
@@ -117,7 +118,7 @@ GType cogl_display_get_gtype (void);
* Since: 1.10
* Stability: unstable
*/
CoglDisplay *
COGL_EXPORT CoglDisplay *
cogl_display_new (CoglRenderer *renderer,
CoglOnscreenTemplate *onscreen_template);
@@ -132,7 +133,7 @@ cogl_display_new (CoglRenderer *renderer,
* Since: 1.10
* Stability: unstable
*/
CoglRenderer *
COGL_EXPORT CoglRenderer *
cogl_display_get_renderer (CoglDisplay *display);
/**
@@ -151,7 +152,7 @@ cogl_display_get_renderer (CoglDisplay *display);
* Since: 1.16
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_display_set_onscreen_template (CoglDisplay *display,
CoglOnscreenTemplate *onscreen_template);
@@ -186,7 +187,7 @@ cogl_display_set_onscreen_template (CoglDisplay *display,
* Since: 1.10
* Stability: unstable
*/
gboolean
COGL_EXPORT gboolean
cogl_display_setup (CoglDisplay *display,
GError **error);
@@ -201,7 +202,7 @@ cogl_display_setup (CoglDisplay *display,
* Since: 1.10
* Stability: unstable
*/
gboolean
COGL_EXPORT gboolean
cogl_is_display (void *object);
G_END_DECLS

View File

@@ -0,0 +1,94 @@
/*
* Cogl
*
* A Low Level GPU Graphics and Utilities API
*
* Copyright (C) 2020 Endless, Inc.
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use, copy,
* modify, merge, publish, distribute, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* Authors:
* Georges Basile Stavracas Neto <georges.stavracas@gmail.com>
*/
#include "cogl-config.h"
#include "cogl-dma-buf-handle.h"
#include "cogl-object.h"
#include <unistd.h>
struct _CoglDmaBufHandle
{
CoglFramebuffer *framebuffer;
int dmabuf_fd;
gpointer user_data;
GDestroyNotify destroy_func;
};
CoglDmaBufHandle *
cogl_dma_buf_handle_new (CoglFramebuffer *framebuffer,
int dmabuf_fd,
gpointer user_data,
GDestroyNotify destroy_func)
{
CoglDmaBufHandle *dmabuf_handle;
g_assert (framebuffer);
g_assert (dmabuf_fd != -1);
dmabuf_handle = g_new0 (CoglDmaBufHandle, 1);
dmabuf_handle->framebuffer = cogl_object_ref (framebuffer);
dmabuf_handle->dmabuf_fd = dmabuf_fd;
dmabuf_handle->user_data = user_data;
dmabuf_handle->destroy_func = destroy_func;
return dmabuf_handle;
}
void
cogl_dma_buf_handle_free (CoglDmaBufHandle *dmabuf_handle)
{
g_return_if_fail (dmabuf_handle != NULL);
g_clear_pointer (&dmabuf_handle->framebuffer, cogl_object_unref);
if (dmabuf_handle->destroy_func)
g_clear_pointer (&dmabuf_handle->user_data, dmabuf_handle->destroy_func);
if (dmabuf_handle->dmabuf_fd != -1)
close (dmabuf_handle->dmabuf_fd);
g_free (dmabuf_handle);
}
CoglFramebuffer *
cogl_dma_buf_handle_get_framebuffer (CoglDmaBufHandle *dmabuf_handle)
{
return dmabuf_handle->framebuffer;
}
int
cogl_dma_buf_handle_get_fd (CoglDmaBufHandle *dmabuf_handle)
{
return dmabuf_handle->dmabuf_fd;
}

View File

@@ -0,0 +1,83 @@
/*
* Cogl
*
* A Low Level GPU Graphics and Utilities API
*
* Copyright (C) 2020 Endless, Inc.
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use, copy,
* modify, merge, publish, distribute, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* Authors:
* Georges Basile Stavracas Neto <georges.stavracas@gmail.com>
*/
#if !defined(__COGL_H_INSIDE__) && !defined(COGL_COMPILATION)
#error "Only <cogl/cogl.h> can be included directly."
#endif
#ifndef __COGL_DMA_BUF_HANDLE_H__
#define __COGL_DMA_BUF_HANDLE_H__
#include <cogl/cogl-types.h>
#include <cogl/cogl-framebuffer.h>
/**
* cogl_dma_buf_handle_new: (skip)
*/
COGL_EXPORT CoglDmaBufHandle *
cogl_dma_buf_handle_new (CoglFramebuffer *framebuffer,
int dmabuf_fd,
gpointer data,
GDestroyNotify destroy_func);
/**
* cogl_dma_buf_handle_free: (skip)
*
* Releases @dmabuf_handle; it is a programming error to release
* an already released handle.
*/
COGL_EXPORT void
cogl_dma_buf_handle_free (CoglDmaBufHandle *dmabuf_handle);
/**
* cogl_dma_buf_handle_get_framebuffer: (skip)
*
* Retrieves the #CoglFramebuffer, backed by an exported DMABuf buffer,
* of @dmabuf_handle.
*
* Returns: (transfer none): a #CoglFramebuffer
*/
COGL_EXPORT CoglFramebuffer *
cogl_dma_buf_handle_get_framebuffer (CoglDmaBufHandle *dmabuf_handle);
/**
* cogl_dma_buf_handle_get_fd: (skip)
*
* Retrieves the file descriptor of @dmabuf_handle.
*
* Returns: a valid file descriptor
*/
COGL_EXPORT int
cogl_dma_buf_handle_get_fd (CoglDmaBufHandle *dmabuf_handle);
#endif /* __COGL_DMA_BUF_HANDLE_H__ */

View File

@@ -41,7 +41,7 @@ typedef struct _CoglDriverVtable CoglDriverVtable;
struct _CoglDriverVtable
{
gboolean
(* context_init) (CoglContext *context, GError **error);
(* context_init) (CoglContext *context);
void
(* context_deinit) (CoglContext *context);
@@ -93,6 +93,9 @@ struct _CoglDriverVtable
void
(* framebuffer_finish) (CoglFramebuffer *framebuffer);
void
(* framebuffer_flush) (CoglFramebuffer *framebuffer);
void
(* framebuffer_discard_buffers) (CoglFramebuffer *framebuffer,
unsigned long buffers);

View File

@@ -76,7 +76,7 @@ G_BEGIN_DECLS
* Since: 1.8
* Stability: unstable
*/
EGLDisplay
COGL_EXPORT EGLDisplay
cogl_egl_context_get_egl_display (CoglContext *context);
G_END_DECLS

View File

@@ -97,7 +97,7 @@ typedef struct _CoglFenceClosure CoglFenceClosure;
* Since: 2.0
* Stability: Unstable
*/
void *
COGL_EXPORT void *
cogl_fence_closure_get_user_data (CoglFenceClosure *closure);
/**
@@ -118,7 +118,7 @@ cogl_fence_closure_get_user_data (CoglFenceClosure *closure);
* Since: 2.0
* Stability: Unstable
*/
CoglFenceClosure *
COGL_EXPORT CoglFenceClosure *
cogl_framebuffer_add_fence_callback (CoglFramebuffer *framebuffer,
CoglFenceCallback callback,
void *user_data);
@@ -136,7 +136,7 @@ cogl_framebuffer_add_fence_callback (CoglFramebuffer *framebuffer,
* Since: 2.0
* Stability: Unstable
*/
void
COGL_EXPORT void
cogl_framebuffer_cancel_fence_callback (CoglFramebuffer *framebuffer,
CoglFenceClosure *closure);

View File

@@ -53,6 +53,7 @@ typedef struct _CoglFrameInfo CoglFrameInfo;
*
* Returns: a #GType that can be used with the GLib type system.
*/
COGL_EXPORT
GType cogl_frame_info_get_gtype (void);
/**
@@ -66,7 +67,7 @@ GType cogl_frame_info_get_gtype (void);
* Since: 2.0
* Stability: unstable
*/
gboolean
COGL_EXPORT gboolean
cogl_is_frame_info (void *object);
/**
@@ -80,6 +81,7 @@ cogl_is_frame_info (void *object);
* Since: 1.14
* Stability: unstable
*/
COGL_EXPORT
int64_t cogl_frame_info_get_frame_counter (CoglFrameInfo *info);
/**
@@ -101,6 +103,7 @@ int64_t cogl_frame_info_get_frame_counter (CoglFrameInfo *info);
* Since: 1.14
* Stability: unstable
*/
COGL_EXPORT
int64_t cogl_frame_info_get_presentation_time (CoglFrameInfo *info);
/**
@@ -120,6 +123,7 @@ int64_t cogl_frame_info_get_presentation_time (CoglFrameInfo *info);
* Since: 1.14
* Stability: unstable
*/
COGL_EXPORT
float cogl_frame_info_get_refresh_rate (CoglFrameInfo *info);
/**
@@ -133,12 +137,13 @@ float cogl_frame_info_get_refresh_rate (CoglFrameInfo *info);
* Since: 1.14
* Stability: unstable
*/
CoglOutput *
COGL_EXPORT CoglOutput *
cogl_frame_info_get_output (CoglFrameInfo *info);
/**
* cogl_frame_info_get_global_frame_counter: (skip)
*/
COGL_EXPORT
int64_t cogl_frame_info_get_global_frame_counter (CoglFrameInfo *info);
G_END_DECLS

View File

@@ -268,10 +268,10 @@ _cogl_framebuffer_mark_clear_clip_dirty (CoglFramebuffer *framebuffer);
CoglClipStack *
_cogl_framebuffer_get_clip_stack (CoglFramebuffer *framebuffer);
CoglMatrixStack *
COGL_EXPORT CoglMatrixStack *
_cogl_framebuffer_get_modelview_stack (CoglFramebuffer *framebuffer);
CoglMatrixStack *
COGL_EXPORT CoglMatrixStack *
_cogl_framebuffer_get_projection_stack (CoglFramebuffer *framebuffer);
void
@@ -393,7 +393,7 @@ _cogl_framebuffer_read_pixels_into_bitmap (CoglFramebuffer *framebuffer,
* Since: 2.0
* Stability: unstable
*/
int
COGL_EXPORT int
_cogl_framebuffer_get_stencil_bits (CoglFramebuffer *framebuffer);
#endif /* __COGL_FRAMEBUFFER_PRIVATE_H */

View File

@@ -1396,6 +1396,17 @@ cogl_framebuffer_finish (CoglFramebuffer *framebuffer)
ctx->driver_vtable->framebuffer_finish (framebuffer);
}
void
cogl_framebuffer_flush (CoglFramebuffer *framebuffer)
{
CoglContext *ctx = framebuffer->context;
_cogl_framebuffer_flush_journal (framebuffer);
ctx->driver_vtable->framebuffer_flush (framebuffer);
}
void
cogl_framebuffer_push_matrix (CoglFramebuffer *framebuffer)
{

View File

@@ -103,6 +103,7 @@ G_BEGIN_DECLS
*
* Returns: a #GType that can be used with the GLib type system.
*/
COGL_EXPORT
GType cogl_framebuffer_get_gtype (void);
/**
@@ -125,7 +126,7 @@ GType cogl_framebuffer_get_gtype (void);
* Since: 1.8
* Stability: unstable
*/
gboolean
COGL_EXPORT gboolean
cogl_framebuffer_allocate (CoglFramebuffer *framebuffer,
GError **error);
@@ -139,7 +140,7 @@ cogl_framebuffer_allocate (CoglFramebuffer *framebuffer,
* Since: 1.8
* Stability: unstable
*/
int
COGL_EXPORT int
cogl_framebuffer_get_width (CoglFramebuffer *framebuffer);
/**
@@ -152,7 +153,7 @@ cogl_framebuffer_get_width (CoglFramebuffer *framebuffer);
* Since: 1.8
* Stability: unstable
*/
int
COGL_EXPORT int
cogl_framebuffer_get_height (CoglFramebuffer *framebuffer);
/**
@@ -184,7 +185,7 @@ cogl_framebuffer_get_height (CoglFramebuffer *framebuffer);
* Since: 1.8
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_framebuffer_set_viewport (CoglFramebuffer *framebuffer,
float x,
float y,
@@ -202,7 +203,7 @@ cogl_framebuffer_set_viewport (CoglFramebuffer *framebuffer,
* Since: 1.8
* Stability: unstable
*/
float
COGL_EXPORT float
cogl_framebuffer_get_viewport_x (CoglFramebuffer *framebuffer);
/**
@@ -216,7 +217,7 @@ cogl_framebuffer_get_viewport_x (CoglFramebuffer *framebuffer);
* Since: 1.8
* Stability: unstable
*/
float
COGL_EXPORT float
cogl_framebuffer_get_viewport_y (CoglFramebuffer *framebuffer);
/**
@@ -230,7 +231,7 @@ cogl_framebuffer_get_viewport_y (CoglFramebuffer *framebuffer);
* Since: 1.8
* Stability: unstable
*/
float
COGL_EXPORT float
cogl_framebuffer_get_viewport_width (CoglFramebuffer *framebuffer);
/**
@@ -244,7 +245,7 @@ cogl_framebuffer_get_viewport_width (CoglFramebuffer *framebuffer);
* Since: 1.8
* Stability: unstable
*/
float
COGL_EXPORT float
cogl_framebuffer_get_viewport_height (CoglFramebuffer *framebuffer);
/**
@@ -262,7 +263,7 @@ cogl_framebuffer_get_viewport_height (CoglFramebuffer *framebuffer);
* Since: 1.8
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_framebuffer_get_viewport4fv (CoglFramebuffer *framebuffer,
float *viewport);
@@ -275,7 +276,7 @@ cogl_framebuffer_get_viewport4fv (CoglFramebuffer *framebuffer,
*
* Since: 1.10
*/
void
COGL_EXPORT void
cogl_framebuffer_push_matrix (CoglFramebuffer *framebuffer);
/**
@@ -286,7 +287,7 @@ cogl_framebuffer_push_matrix (CoglFramebuffer *framebuffer);
*
* Since: 1.10
*/
void
COGL_EXPORT void
cogl_framebuffer_pop_matrix (CoglFramebuffer *framebuffer);
/**
@@ -298,7 +299,7 @@ cogl_framebuffer_pop_matrix (CoglFramebuffer *framebuffer);
* Since: 1.10
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_framebuffer_identity_matrix (CoglFramebuffer *framebuffer);
/**
@@ -314,7 +315,7 @@ cogl_framebuffer_identity_matrix (CoglFramebuffer *framebuffer);
* Since: 1.10
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_framebuffer_scale (CoglFramebuffer *framebuffer,
float x,
float y,
@@ -333,7 +334,7 @@ cogl_framebuffer_scale (CoglFramebuffer *framebuffer,
* Since: 1.10
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_framebuffer_translate (CoglFramebuffer *framebuffer,
float x,
float y,
@@ -356,7 +357,7 @@ cogl_framebuffer_translate (CoglFramebuffer *framebuffer,
* Since: 1.10
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_framebuffer_rotate (CoglFramebuffer *framebuffer,
float angle,
float x,
@@ -374,7 +375,7 @@ cogl_framebuffer_rotate (CoglFramebuffer *framebuffer,
* Since: 2.0
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_framebuffer_rotate_euler (CoglFramebuffer *framebuffer,
const graphene_euler_t *euler);
@@ -388,7 +389,7 @@ cogl_framebuffer_rotate_euler (CoglFramebuffer *framebuffer,
* Since: 1.10
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_framebuffer_transform (CoglFramebuffer *framebuffer,
const CoglMatrix *matrix);
@@ -402,7 +403,7 @@ cogl_framebuffer_transform (CoglFramebuffer *framebuffer,
* Since: 1.10
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_framebuffer_get_modelview_matrix (CoglFramebuffer *framebuffer,
CoglMatrix *matrix);
@@ -416,7 +417,7 @@ cogl_framebuffer_get_modelview_matrix (CoglFramebuffer *framebuffer,
* Since: 1.10
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_framebuffer_set_modelview_matrix (CoglFramebuffer *framebuffer,
const CoglMatrix *matrix);
@@ -440,7 +441,7 @@ cogl_framebuffer_set_modelview_matrix (CoglFramebuffer *framebuffer,
* Since: 1.10
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_framebuffer_perspective (CoglFramebuffer *framebuffer,
float fov_y,
float aspect,
@@ -468,7 +469,7 @@ cogl_framebuffer_perspective (CoglFramebuffer *framebuffer,
* Since: 1.10
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_framebuffer_frustum (CoglFramebuffer *framebuffer,
float left,
float right,
@@ -497,7 +498,7 @@ cogl_framebuffer_frustum (CoglFramebuffer *framebuffer,
* Since: 1.10
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_framebuffer_orthographic (CoglFramebuffer *framebuffer,
float x_1,
float y_1,
@@ -516,7 +517,7 @@ cogl_framebuffer_orthographic (CoglFramebuffer *framebuffer,
* Since: 1.10
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_framebuffer_get_projection_matrix (CoglFramebuffer *framebuffer,
CoglMatrix *matrix);
@@ -530,7 +531,7 @@ cogl_framebuffer_get_projection_matrix (CoglFramebuffer *framebuffer,
* Since: 1.10
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_framebuffer_set_projection_matrix (CoglFramebuffer *framebuffer,
const CoglMatrix *matrix);
@@ -554,7 +555,7 @@ cogl_framebuffer_set_projection_matrix (CoglFramebuffer *framebuffer,
* Since: 1.10
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_framebuffer_push_scissor_clip (CoglFramebuffer *framebuffer,
int x,
int y,
@@ -581,7 +582,7 @@ cogl_framebuffer_push_scissor_clip (CoglFramebuffer *framebuffer,
* Since: 1.10
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_framebuffer_push_rectangle_clip (CoglFramebuffer *framebuffer,
float x_1,
float y_1,
@@ -617,7 +618,7 @@ cogl_framebuffer_push_rectangle_clip (CoglFramebuffer *framebuffer,
* Since: 1.10
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_framebuffer_push_primitive_clip (CoglFramebuffer *framebuffer,
CoglPrimitive *primitive,
float bounds_x1,
@@ -625,7 +626,7 @@ cogl_framebuffer_push_primitive_clip (CoglFramebuffer *framebuffer,
float bounds_x2,
float bounds_y2);
void
COGL_EXPORT void
cogl_framebuffer_push_region_clip (CoglFramebuffer *framebuffer,
cairo_region_t *region);
@@ -640,7 +641,7 @@ cogl_framebuffer_push_region_clip (CoglFramebuffer *framebuffer,
* Since: 1.10
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_framebuffer_pop_clip (CoglFramebuffer *framebuffer);
/**
@@ -654,7 +655,7 @@ cogl_framebuffer_pop_clip (CoglFramebuffer *framebuffer);
* Since: 1.8
* Stability: unstable
*/
int
COGL_EXPORT int
cogl_framebuffer_get_red_bits (CoglFramebuffer *framebuffer);
/**
@@ -668,7 +669,7 @@ cogl_framebuffer_get_red_bits (CoglFramebuffer *framebuffer);
* Since: 1.8
* Stability: unstable
*/
int
COGL_EXPORT int
cogl_framebuffer_get_green_bits (CoglFramebuffer *framebuffer);
/**
@@ -682,7 +683,7 @@ cogl_framebuffer_get_green_bits (CoglFramebuffer *framebuffer);
* Since: 1.8
* Stability: unstable
*/
int
COGL_EXPORT int
cogl_framebuffer_get_blue_bits (CoglFramebuffer *framebuffer);
/**
@@ -696,7 +697,7 @@ cogl_framebuffer_get_blue_bits (CoglFramebuffer *framebuffer);
* Since: 1.8
* Stability: unstable
*/
int
COGL_EXPORT int
cogl_framebuffer_get_alpha_bits (CoglFramebuffer *framebuffer);
/**
@@ -710,7 +711,7 @@ cogl_framebuffer_get_alpha_bits (CoglFramebuffer *framebuffer);
* Since: 2.0
* Stability: unstable
*/
int
COGL_EXPORT int
cogl_framebuffer_get_depth_bits (CoglFramebuffer *framebuffer);
/*
@@ -727,7 +728,7 @@ cogl_framebuffer_get_depth_bits (CoglFramebuffer *framebuffer);
* Since: 1.20
* Stability: unstable
*/
gboolean
COGL_EXPORT gboolean
cogl_framebuffer_get_is_stereo (CoglFramebuffer *framebuffer);
/**
@@ -745,7 +746,7 @@ cogl_framebuffer_get_is_stereo (CoglFramebuffer *framebuffer);
* Since: 1.8
* Stability: unstable
*/
gboolean
COGL_EXPORT gboolean
cogl_framebuffer_get_dither_enabled (CoglFramebuffer *framebuffer);
/**
@@ -770,7 +771,7 @@ cogl_framebuffer_get_dither_enabled (CoglFramebuffer *framebuffer);
* Since: 1.8
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_framebuffer_set_dither_enabled (CoglFramebuffer *framebuffer,
gboolean dither_enabled);
@@ -785,7 +786,7 @@ cogl_framebuffer_set_dither_enabled (CoglFramebuffer *framebuffer,
* Since: 1.18
* Stability: unstable
*/
gboolean
COGL_EXPORT gboolean
cogl_framebuffer_get_depth_write_enabled (CoglFramebuffer *framebuffer);
/**
@@ -803,7 +804,7 @@ cogl_framebuffer_get_depth_write_enabled (CoglFramebuffer *framebuffer);
* Since: 1.18
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_framebuffer_set_depth_write_enabled (CoglFramebuffer *framebuffer,
gboolean depth_write_enabled);
@@ -818,7 +819,7 @@ cogl_framebuffer_set_depth_write_enabled (CoglFramebuffer *framebuffer,
* Since: 1.20
* Stability: unstable
*/
CoglStereoMode
COGL_EXPORT CoglStereoMode
cogl_framebuffer_get_stereo_mode (CoglFramebuffer *framebuffer);
/**
@@ -838,7 +839,7 @@ cogl_framebuffer_get_stereo_mode (CoglFramebuffer *framebuffer);
* Since: 1.20
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_framebuffer_set_stereo_mode (CoglFramebuffer *framebuffer,
CoglStereoMode stereo_mode);
@@ -883,7 +884,7 @@ cogl_framebuffer_set_stereo_mode (CoglFramebuffer *framebuffer,
* Since: 1.8
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_framebuffer_set_samples_per_pixel (CoglFramebuffer *framebuffer,
int samples_per_pixel);
@@ -911,7 +912,7 @@ cogl_framebuffer_set_samples_per_pixel (CoglFramebuffer *framebuffer,
* Since: 1.10
* Stability: unstable
*/
int
COGL_EXPORT int
cogl_framebuffer_get_samples_per_pixel (CoglFramebuffer *framebuffer);
@@ -943,7 +944,7 @@ cogl_framebuffer_get_samples_per_pixel (CoglFramebuffer *framebuffer);
* Since: 1.8
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_framebuffer_resolve_samples (CoglFramebuffer *framebuffer);
/**
@@ -979,7 +980,7 @@ cogl_framebuffer_resolve_samples (CoglFramebuffer *framebuffer);
* Since: 1.8
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_framebuffer_resolve_samples_region (CoglFramebuffer *framebuffer,
int x,
int y,
@@ -999,7 +1000,7 @@ cogl_framebuffer_resolve_samples_region (CoglFramebuffer *framebuffer,
* Since: 1.8
* Stability: unstable
*/
CoglContext *
COGL_EXPORT CoglContext *
cogl_framebuffer_get_context (CoglFramebuffer *framebuffer);
/**
@@ -1016,7 +1017,7 @@ cogl_framebuffer_get_context (CoglFramebuffer *framebuffer);
* Since: 1.8
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_framebuffer_clear (CoglFramebuffer *framebuffer,
unsigned long buffers,
const CoglColor *color);
@@ -1041,7 +1042,7 @@ cogl_framebuffer_clear (CoglFramebuffer *framebuffer,
* Since: 1.8
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_framebuffer_clear4f (CoglFramebuffer *framebuffer,
unsigned long buffers,
float red,
@@ -1074,7 +1075,7 @@ cogl_framebuffer_clear4f (CoglFramebuffer *framebuffer,
* cogl_primitive_draw() instead
*/
COGL_DEPRECATED_FOR (cogl_primitive_draw)
void
COGL_EXPORT void
cogl_framebuffer_draw_primitive (CoglFramebuffer *framebuffer,
CoglPipeline *pipeline,
CoglPrimitive *primitive);
@@ -1103,7 +1104,7 @@ cogl_framebuffer_draw_primitive (CoglFramebuffer *framebuffer,
* Since: 1.10
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_framebuffer_draw_rectangle (CoglFramebuffer *framebuffer,
CoglPipeline *pipeline,
float x_1,
@@ -1154,7 +1155,7 @@ cogl_framebuffer_draw_rectangle (CoglFramebuffer *framebuffer,
* Since: 1.10
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_framebuffer_draw_textured_rectangle (CoglFramebuffer *framebuffer,
CoglPipeline *pipeline,
float x_1,
@@ -1225,7 +1226,7 @@ cogl_framebuffer_draw_textured_rectangle (CoglFramebuffer *framebuffer,
* Since: 1.10
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_framebuffer_draw_multitextured_rectangle (CoglFramebuffer *framebuffer,
CoglPipeline *pipeline,
float x_1,
@@ -1269,7 +1270,7 @@ cogl_framebuffer_draw_multitextured_rectangle (CoglFramebuffer *framebuffer,
* Since: 1.10
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_framebuffer_draw_rectangles (CoglFramebuffer *framebuffer,
CoglPipeline *pipeline,
const float *coordinates,
@@ -1323,7 +1324,7 @@ cogl_framebuffer_draw_rectangles (CoglFramebuffer *framebuffer,
* Since: 1.10
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_framebuffer_draw_textured_rectangles (CoglFramebuffer *framebuffer,
CoglPipeline *pipeline,
const float *coordinates,
@@ -1358,7 +1359,7 @@ cogl_framebuffer_draw_textured_rectangles (CoglFramebuffer *framebuffer,
* Since: 1.8
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_framebuffer_discard_buffers (CoglFramebuffer *framebuffer,
unsigned long buffers);
@@ -1379,7 +1380,7 @@ cogl_framebuffer_discard_buffers (CoglFramebuffer *framebuffer,
* Stability: unstable
* Since: 1.10
*/
void
COGL_EXPORT void
cogl_framebuffer_finish (CoglFramebuffer *framebuffer);
/**
@@ -1408,7 +1409,7 @@ cogl_framebuffer_finish (CoglFramebuffer *framebuffer);
* Since: 1.10
* Stability: unstable
*/
gboolean
COGL_EXPORT gboolean
cogl_framebuffer_read_pixels_into_bitmap (CoglFramebuffer *framebuffer,
int x,
int y,
@@ -1454,7 +1455,7 @@ cogl_framebuffer_read_pixels_into_bitmap (CoglFramebuffer *framebuffer,
* Since: 1.10
* Stability: unstable
*/
gboolean
COGL_EXPORT gboolean
cogl_framebuffer_read_pixels (CoglFramebuffer *framebuffer,
int x,
int y,
@@ -1463,7 +1464,7 @@ cogl_framebuffer_read_pixels (CoglFramebuffer *framebuffer,
CoglPixelFormat format,
uint8_t *pixels);
uint32_t
COGL_EXPORT uint32_t
cogl_framebuffer_error_quark (void);
/**
@@ -1489,7 +1490,7 @@ typedef enum /*< prefix=COGL_FRAMEBUFFER_ERROR >*/
* Since: 1.10
* Stability: unstable
*/
gboolean
COGL_EXPORT gboolean
cogl_is_framebuffer (void *object);
/**
@@ -1544,7 +1545,7 @@ cogl_is_framebuffer (void *object);
* and this function returns FALSE, an error object with a code from
* COGL_SYSTEM_ERROR will be created.
*/
gboolean
COGL_EXPORT gboolean
cogl_blit_framebuffer (CoglFramebuffer *src,
CoglFramebuffer *dest,
int src_x,
@@ -1555,6 +1556,18 @@ cogl_blit_framebuffer (CoglFramebuffer *src,
int height,
GError **error);
/**
* cogl_framebuffer_flush:
* @framebuffer: A #CoglFramebuffer pointer
*
* Flushes @framebuffer to ensure the current batch of commands is
* submitted to the GPU.
*
* Unlike cogl_framebuffer_finish(), this does not block the CPU.
*/
void
cogl_framebuffer_flush (CoglFramebuffer *framebuffer);
G_END_DECLS
#endif /* __COGL_FRAMEBUFFER_H */

View File

@@ -67,7 +67,7 @@ G_BEGIN_DECLS
* Stability: unstable
* Since: 1.10
*/
GSource *
COGL_EXPORT GSource *
cogl_glib_source_new (CoglContext *context,
int priority);
@@ -88,7 +88,7 @@ cogl_glib_source_new (CoglContext *context,
* Stability: unstable
* Since: 1.16
*/
GSource *
COGL_EXPORT GSource *
cogl_glib_renderer_source_new (CoglRenderer *renderer,
int priority);

View File

@@ -269,8 +269,10 @@ void _cogl_gtype_object_class_base_finalize (CoglObjectClass *klass);
void _cogl_gtype_object_class_init (CoglObjectClass *klass);
void _cogl_gtype_object_init (CoglObject *object);
COGL_EXPORT
void cogl_object_value_set_object (GValue *value,
gpointer object);
COGL_EXPORT
gpointer cogl_object_value_get_object (const GValue *value);
void _cogl_gtype_dummy_iface_init (gpointer iface);

View File

@@ -61,7 +61,7 @@ typedef struct _CoglIndexBuffer CoglIndexBuffer;
*
* Returns: a #GType that can be used with the GLib type system.
*/
GType cogl_index_buffer_get_gtype (void);
COGL_EXPORT GType cogl_index_buffer_get_gtype (void);
/**
* cogl_index_buffer_new:
@@ -78,7 +78,7 @@ GType cogl_index_buffer_get_gtype (void);
* Since: 1.4
* Stability: Unstable
*/
CoglIndexBuffer *
COGL_EXPORT CoglIndexBuffer *
cogl_index_buffer_new (CoglContext *context,
size_t bytes);
@@ -94,7 +94,7 @@ cogl_index_buffer_new (CoglContext *context,
* Since: 1.4
* Stability: Unstable
*/
gboolean
COGL_EXPORT gboolean
cogl_is_index_buffer (void *object);
G_END_DECLS

View File

@@ -112,33 +112,34 @@ G_BEGIN_DECLS
*
* Returns: a #GType that can be used with the GLib type system.
*/
COGL_EXPORT
GType cogl_indices_get_gtype (void);
CoglIndices *
COGL_EXPORT CoglIndices *
cogl_indices_new (CoglContext *context,
CoglIndicesType type,
const void *indices_data,
int n_indices);
CoglIndices *
COGL_EXPORT CoglIndices *
cogl_indices_new_for_buffer (CoglIndicesType type,
CoglIndexBuffer *buffer,
size_t offset);
CoglIndexBuffer *
COGL_EXPORT CoglIndexBuffer *
cogl_indices_get_buffer (CoglIndices *indices);
CoglIndicesType
COGL_EXPORT CoglIndicesType
cogl_indices_get_type (CoglIndices *indices);
size_t
COGL_EXPORT size_t
cogl_indices_get_offset (CoglIndices *indices);
void
COGL_EXPORT void
cogl_indices_set_offset (CoglIndices *indices,
size_t offset);
CoglIndices *
COGL_EXPORT CoglIndices *
cogl_get_rectangle_indices (CoglContext *context, int n_rectangles);
/**
@@ -152,7 +153,7 @@ cogl_get_rectangle_indices (CoglContext *context, int n_rectangles);
* Since: 1.10
* Stability: unstable
*/
gboolean
COGL_EXPORT gboolean
cogl_is_indices (void *object);
G_END_DECLS

View File

@@ -75,4 +75,6 @@
#endif /* COGL_DISABLE_DEPRECATION_WARNINGS */
#define COGL_EXPORT __attribute__((visibility("default"))) extern
#endif /* __COGL_MACROS_H__ */

View File

@@ -140,6 +140,7 @@ typedef struct _CoglMatrixStack CoglMatrixStack;
*
* Returns: a #GType that can be used with the GLib type system.
*/
COGL_EXPORT
GType cogl_matrix_stack_get_gtype (void);
/**
@@ -183,6 +184,7 @@ typedef struct _CoglMatrixEntry CoglMatrixEntry;
*
* Returns: a #GType that can be used with the GLib type system.
*/
COGL_EXPORT
GType cogl_matrix_entry_get_gtype (void);
@@ -214,7 +216,7 @@ GType cogl_matrix_entry_get_gtype (void);
*
* Return value: (transfer full): A newly allocated #CoglMatrixStack
*/
CoglMatrixStack *
COGL_EXPORT CoglMatrixStack *
cogl_matrix_stack_new (CoglContext *ctx);
/**
@@ -229,7 +231,7 @@ cogl_matrix_stack_new (CoglContext *ctx);
* called when going back up one layer to restore the previous
* transform of an ancestor.
*/
void
COGL_EXPORT void
cogl_matrix_stack_push (CoglMatrixStack *stack);
/**
@@ -242,7 +244,7 @@ cogl_matrix_stack_push (CoglMatrixStack *stack);
* This is usually called while traversing a scenegraph whenever you
* return up one level in the graph towards the root node.
*/
void
COGL_EXPORT void
cogl_matrix_stack_pop (CoglMatrixStack *stack);
/**
@@ -251,7 +253,7 @@ cogl_matrix_stack_pop (CoglMatrixStack *stack);
*
* Resets the current matrix to the identity matrix.
*/
void
COGL_EXPORT void
cogl_matrix_stack_load_identity (CoglMatrixStack *stack);
/**
@@ -264,7 +266,7 @@ cogl_matrix_stack_load_identity (CoglMatrixStack *stack);
* Multiplies the current matrix by one that scales the x, y and z
* axes by the given values.
*/
void
COGL_EXPORT void
cogl_matrix_stack_scale (CoglMatrixStack *stack,
float x,
float y,
@@ -280,7 +282,7 @@ cogl_matrix_stack_scale (CoglMatrixStack *stack,
* Multiplies the current matrix by one that translates along all
* three axes according to the given values.
*/
void
COGL_EXPORT void
cogl_matrix_stack_translate (CoglMatrixStack *stack,
float x,
float y,
@@ -300,7 +302,7 @@ cogl_matrix_stack_translate (CoglMatrixStack *stack,
* the axis-vector (0, 0, 1) causes a small counter-clockwise
* rotation.
*/
void
COGL_EXPORT void
cogl_matrix_stack_rotate (CoglMatrixStack *stack,
float angle,
float x,
@@ -315,7 +317,7 @@ cogl_matrix_stack_rotate (CoglMatrixStack *stack,
* Multiplies the current matrix by one that rotates according to the
* rotation described by @euler.
*/
void
COGL_EXPORT void
cogl_matrix_stack_rotate_euler (CoglMatrixStack *stack,
const graphene_euler_t *euler);
@@ -326,7 +328,7 @@ cogl_matrix_stack_rotate_euler (CoglMatrixStack *stack,
*
* Multiplies the current matrix by the given matrix.
*/
void
COGL_EXPORT void
cogl_matrix_stack_multiply (CoglMatrixStack *stack,
const CoglMatrix *matrix);
@@ -348,7 +350,7 @@ cogl_matrix_stack_multiply (CoglMatrixStack *stack,
* viewing frustum defined by 4 side clip planes that all cross
* through the origin and 2 near and far clip planes.
*/
void
COGL_EXPORT void
cogl_matrix_stack_frustum (CoglMatrixStack *stack,
float left,
float right,
@@ -374,7 +376,7 @@ cogl_matrix_stack_frustum (CoglMatrixStack *stack,
* since there wont be enough precision to identify the depth of
* objects near to each other.</note>
*/
void
COGL_EXPORT void
cogl_matrix_stack_perspective (CoglMatrixStack *stack,
float fov_y,
float aspect,
@@ -397,7 +399,7 @@ cogl_matrix_stack_perspective (CoglMatrixStack *stack,
*
* Replaces the current matrix with an orthographic projection matrix.
*/
void
COGL_EXPORT void
cogl_matrix_stack_orthographic (CoglMatrixStack *stack,
float x_1,
float y_1,
@@ -418,7 +420,7 @@ cogl_matrix_stack_orthographic (CoglMatrixStack *stack,
* for degenerate transformations that can't be inverted (in this case the
* @inverse matrix will simply be initialized with the identity matrix)
*/
gboolean
COGL_EXPORT gboolean
cogl_matrix_stack_get_inverse (CoglMatrixStack *stack,
CoglMatrix *inverse);
@@ -440,7 +442,7 @@ cogl_matrix_stack_get_inverse (CoglMatrixStack *stack,
* Return value: (transfer none): A pointer to the #CoglMatrixEntry
* representing the current matrix stack transform.
*/
CoglMatrixEntry *
COGL_EXPORT CoglMatrixEntry *
cogl_matrix_stack_get_entry (CoglMatrixStack *stack);
/**
@@ -469,7 +471,7 @@ cogl_matrix_stack_get_entry (CoglMatrixStack *stack);
* and in that case @matrix will be initialized with
* the value of the current transform.
*/
CoglMatrix *
COGL_EXPORT CoglMatrix *
cogl_matrix_stack_get (CoglMatrixStack *stack,
CoglMatrix *matrix);
@@ -500,7 +502,7 @@ cogl_matrix_stack_get (CoglMatrixStack *stack,
* and in that case @matrix will be initialized with
* the effective transform represented by @entry.
*/
CoglMatrix *
COGL_EXPORT CoglMatrix *
cogl_matrix_entry_get (CoglMatrixEntry *entry,
CoglMatrix *matrix);
@@ -514,7 +516,7 @@ cogl_matrix_entry_get (CoglMatrixEntry *entry,
* since the last time cogl_matrix_stack_push() was called or since
* the stack was initialized.
*/
void
COGL_EXPORT void
cogl_matrix_stack_set (CoglMatrixStack *stack,
const CoglMatrix *matrix);
@@ -527,7 +529,7 @@ cogl_matrix_stack_set (CoglMatrixStack *stack,
* Return value: %TRUE if @object is a #CoglMatrixStack, otherwise
* %FALSE.
*/
gboolean
COGL_EXPORT gboolean
cogl_is_matrix_stack (void *object);
/**
@@ -549,7 +551,7 @@ cogl_is_matrix_stack (void *object);
* @entry0 and the transform of @entry1 is a translation,
* otherwise %FALSE.
*/
gboolean
COGL_EXPORT gboolean
cogl_matrix_entry_calculate_translation (CoglMatrixEntry *entry0,
CoglMatrixEntry *entry1,
float *x,
@@ -570,7 +572,7 @@ cogl_matrix_entry_calculate_translation (CoglMatrixEntry *entry0,
* Return value: %TRUE if @entry is definitely an identity transform,
* otherwise %FALSE.
*/
gboolean
COGL_EXPORT gboolean
cogl_matrix_entry_is_identity (CoglMatrixEntry *entry);
/**
@@ -588,7 +590,7 @@ cogl_matrix_entry_is_identity (CoglMatrixEntry *entry);
* Return value: %TRUE if @entry0 represents the same transform as
* @entry1, otherwise %FALSE.
*/
gboolean
COGL_EXPORT gboolean
cogl_matrix_entry_equal (CoglMatrixEntry *entry0,
CoglMatrixEntry *entry1);
@@ -599,7 +601,7 @@ cogl_matrix_entry_equal (CoglMatrixEntry *entry0,
* Allows visualizing the operations that build up the given @entry
* for debugging purposes by printing to stdout.
*/
void
COGL_EXPORT void
cogl_debug_matrix_entry_print (CoglMatrixEntry *entry);
/**
@@ -613,7 +615,7 @@ cogl_debug_matrix_entry_print (CoglMatrixEntry *entry);
* It is an error to pass an @entry pointer to cogl_object_ref() and
* cogl_object_unref()
*/
CoglMatrixEntry *
COGL_EXPORT CoglMatrixEntry *
cogl_matrix_entry_ref (CoglMatrixEntry *entry);
/**
@@ -624,7 +626,7 @@ cogl_matrix_entry_ref (CoglMatrixEntry *entry);
* cogl_matrix_entry_unref() or to release the reference given when
* calling cogl_matrix_stack_get_entry().
*/
void
COGL_EXPORT void
cogl_matrix_entry_unref (CoglMatrixEntry *entry);
#endif /* _COGL_MATRIX_STACK_H_ */

View File

@@ -135,7 +135,7 @@ COGL_STRUCT_SIZE_ASSERT (CoglMatrix, 128 + sizeof (unsigned long) * 3);
* .wx=0; .wy=0; .wz=0; .ww=1;
* ]|
*/
void
COGL_EXPORT void
cogl_matrix_init_identity (CoglMatrix *matrix);
/**
@@ -156,7 +156,7 @@ cogl_matrix_init_identity (CoglMatrix *matrix);
*
* Since: 2.0
*/
void
COGL_EXPORT void
cogl_matrix_init_translation (CoglMatrix *matrix,
float tx,
float ty,
@@ -174,7 +174,7 @@ cogl_matrix_init_translation (CoglMatrix *matrix,
* <note>It is possible to multiply the @a matrix in-place, so
* @result can be equal to @a but can't be equal to @b.</note>
*/
void
COGL_EXPORT void
cogl_matrix_multiply (CoglMatrix *result,
const CoglMatrix *a,
const CoglMatrix *b);
@@ -190,7 +190,7 @@ cogl_matrix_multiply (CoglMatrix *result,
* Multiplies @matrix with a rotation matrix that applies a rotation
* of @angle degrees around the specified 3D vector.
*/
void
COGL_EXPORT void
cogl_matrix_rotate (CoglMatrix *matrix,
float angle,
float x,
@@ -207,7 +207,7 @@ cogl_matrix_rotate (CoglMatrix *matrix,
*
* Since: 2.0
*/
void
COGL_EXPORT void
cogl_matrix_rotate_euler (CoglMatrix *matrix,
const graphene_euler_t *euler);
@@ -221,7 +221,7 @@ cogl_matrix_rotate_euler (CoglMatrix *matrix,
* Multiplies @matrix with a transform matrix that translates along
* the X, Y and Z axis.
*/
void
COGL_EXPORT void
cogl_matrix_translate (CoglMatrix *matrix,
float x,
float y,
@@ -237,7 +237,7 @@ cogl_matrix_translate (CoglMatrix *matrix,
* Multiplies @matrix with a transform matrix that scales along the X,
* Y and Z axis.
*/
void
COGL_EXPORT void
cogl_matrix_scale (CoglMatrix *matrix,
float sx,
float sy,
@@ -286,7 +286,7 @@ cogl_matrix_scale (CoglMatrix *matrix,
* Since: 1.8
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_matrix_look_at (CoglMatrix *matrix,
float eye_position_x,
float eye_position_y,
@@ -314,7 +314,7 @@ cogl_matrix_look_at (CoglMatrix *matrix,
*
* Multiplies @matrix by the given frustum perspective matrix.
*/
void
COGL_EXPORT void
cogl_matrix_frustum (CoglMatrix *matrix,
float left,
float right,
@@ -339,7 +339,7 @@ cogl_matrix_frustum (CoglMatrix *matrix,
* since there wont be enough precision to identify the depth of
* objects near to each other.</note>
*/
void
COGL_EXPORT void
cogl_matrix_perspective (CoglMatrix *matrix,
float fov_y,
float aspect,
@@ -365,7 +365,7 @@ cogl_matrix_perspective (CoglMatrix *matrix,
* Since: 1.10
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_matrix_orthographic (CoglMatrix *matrix,
float x_1,
float y_1,
@@ -404,7 +404,7 @@ cogl_matrix_orthographic (CoglMatrix *matrix,
* Since: 1.8
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_matrix_view_2d_in_frustum (CoglMatrix *matrix,
float left,
float right,
@@ -443,7 +443,7 @@ cogl_matrix_view_2d_in_frustum (CoglMatrix *matrix,
* Since: 1.8
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_matrix_view_2d_in_perspective (CoglMatrix *matrix,
float fov_y,
float aspect,
@@ -459,7 +459,7 @@ cogl_matrix_view_2d_in_perspective (CoglMatrix *matrix,
*
* Initializes @matrix with the contents of @array
*/
void
COGL_EXPORT void
cogl_matrix_init_from_array (CoglMatrix *matrix,
const float *array);
@@ -471,7 +471,7 @@ cogl_matrix_init_from_array (CoglMatrix *matrix,
*
* Return value: a pointer to the float array
*/
const float *
COGL_EXPORT const float *
cogl_matrix_get_array (const CoglMatrix *matrix);
/**
@@ -481,7 +481,7 @@ cogl_matrix_get_array (const CoglMatrix *matrix);
*
* Initializes @matrix from a #graphene_euler_t rotation.
*/
void
COGL_EXPORT void
cogl_matrix_init_from_euler (CoglMatrix *matrix,
const graphene_euler_t *euler);
@@ -497,7 +497,7 @@ cogl_matrix_init_from_euler (CoglMatrix *matrix,
*
* Since: 1.4
*/
gboolean
COGL_EXPORT gboolean
cogl_matrix_equal (const void *v1, const void *v2);
/**
@@ -512,7 +512,7 @@ cogl_matrix_equal (const void *v1, const void *v2);
*
* Since: 1.6
*/
CoglMatrix *
COGL_EXPORT CoglMatrix *
cogl_matrix_copy (const CoglMatrix *matrix);
/**
@@ -524,7 +524,7 @@ cogl_matrix_copy (const CoglMatrix *matrix);
*
* Since: 1.6
*/
void
COGL_EXPORT void
cogl_matrix_free (CoglMatrix *matrix);
/**
@@ -547,7 +547,7 @@ cogl_matrix_free (CoglMatrix *matrix);
*
* Since: 1.2
*/
gboolean
COGL_EXPORT gboolean
cogl_matrix_get_inverse (const CoglMatrix *matrix,
CoglMatrix *inverse);
@@ -566,7 +566,7 @@ cogl_matrix_get_inverse (const CoglMatrix *matrix,
* Transforms a point whos position is given and returned as four float
* components.
*/
void
COGL_EXPORT void
cogl_matrix_transform_point (const CoglMatrix *matrix,
float *x,
float *y,
@@ -622,7 +622,7 @@ cogl_matrix_transform_point (const CoglMatrix *matrix,
*
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_matrix_transform_points (const CoglMatrix *matrix,
int n_components,
size_t stride_in,
@@ -677,7 +677,7 @@ cogl_matrix_transform_points (const CoglMatrix *matrix,
*
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_matrix_project_points (const CoglMatrix *matrix,
int n_components,
size_t stride_in,
@@ -695,7 +695,7 @@ cogl_matrix_project_points (const CoglMatrix *matrix,
* Returns: %TRUE if @matrix is an identity matrix else %FALSE
* Since: 1.8
*/
gboolean
COGL_EXPORT gboolean
cogl_matrix_is_identity (const CoglMatrix *matrix);
/**
@@ -707,7 +707,7 @@ cogl_matrix_is_identity (const CoglMatrix *matrix);
*
* Since: 1.10
*/
void
COGL_EXPORT void
cogl_matrix_transpose (CoglMatrix *matrix);
/**
@@ -718,7 +718,7 @@ cogl_matrix_transpose (CoglMatrix *matrix);
*
* Since: 2.0
*/
void
COGL_EXPORT void
cogl_debug_matrix_print (const CoglMatrix *matrix);
#define COGL_GTYPE_TYPE_MATRIX (cogl_matrix_get_gtype ())
@@ -728,6 +728,7 @@ cogl_debug_matrix_print (const CoglMatrix *matrix);
*
* Returns: a #GType that can be used with the GLib type system.
*/
COGL_EXPORT
GType cogl_matrix_get_gtype (void);
/**
@@ -739,7 +740,7 @@ GType cogl_matrix_get_gtype (void);
*
* Deprecated: 1.18: Use cogl_matrix_get_gtype() instead.
*/
GType
COGL_EXPORT GType
cogl_gtype_matrix_get_type (void);
G_END_DECLS

View File

@@ -177,7 +177,7 @@ typedef void (*CoglMetaTextureCallback) (CoglTexture *sub_texture,
* Since: 1.10
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_meta_texture_foreach_in_region (CoglMetaTexture *meta_texture,
float tx_1,
float ty_1,

View File

@@ -43,6 +43,7 @@
#endif
#include <cogl/winsys/cogl-winsys-private.h>
COGL_EXPORT
void cogl_renderer_set_custom_winsys (CoglRenderer *renderer,
CoglCustomWinsysVtableGetter winsys_vtable_getter,
void *user_data);

View File

@@ -279,7 +279,7 @@ _cogl_object_set_user_data (CoglObject *object,
void *user_data,
CoglUserDataDestroyInternalCallback destroy);
void
COGL_EXPORT void
_cogl_object_default_unref (void *obj);
#endif /* __COGL_OBJECT_PRIVATE_H */

View File

@@ -52,6 +52,7 @@ typedef struct _CoglObject CoglObject;
*
* Returns: a #GType that can be used with the GLib type system.
*/
COGL_EXPORT
GType cogl_object_get_gtype (void);
/**
@@ -62,7 +63,7 @@ GType cogl_object_get_gtype (void);
*
* Returns: the @object, with its reference count increased
*/
void *
COGL_EXPORT void *
cogl_object_ref (void *object);
/**
@@ -72,7 +73,7 @@ cogl_object_ref (void *object);
* Drecreases the reference count of @object by 1; if the reference
* count reaches 0, the resources allocated by @object will be freed
*/
void
COGL_EXPORT void
cogl_object_unref (void *object);
/**
@@ -187,7 +188,7 @@ typedef void
*
* Since: 1.4
*/
void
COGL_EXPORT void
cogl_object_set_user_data (CoglObject *object,
CoglUserDataKey *key,
void *user_data,
@@ -209,7 +210,7 @@ cogl_object_set_user_data (CoglObject *object,
*
* Since: 1.4
*/
void *
COGL_EXPORT void *
cogl_object_get_user_data (CoglObject *object,
CoglUserDataKey *key);
@@ -226,7 +227,7 @@ cogl_object_get_user_data (CoglObject *object,
* Since: 1.8
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_debug_object_foreach_type (CoglDebugObjectForeachTypeCallback func,
void *user_data);
@@ -241,7 +242,7 @@ cogl_debug_object_foreach_type (CoglDebugObjectForeachTypeCallback func,
* Since: 1.8
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_debug_object_print_instances (void);
G_END_DECLS

View File

@@ -59,6 +59,7 @@ typedef struct _CoglOffscreen CoglOffscreen;
*
* Returns: a #GType that can be used with the GLib type system.
*/
COGL_EXPORT
GType cogl_offscreen_get_gtype (void);
/* Offscreen api */
@@ -95,7 +96,7 @@ GType cogl_offscreen_get_gtype (void);
* Return value: (transfer full): a newly instantiated #CoglOffscreen
* framebuffer.
*/
CoglOffscreen *
COGL_EXPORT CoglOffscreen *
cogl_offscreen_new_with_texture (CoglTexture *texture);
/**
@@ -119,7 +120,7 @@ cogl_offscreen_new_with_texture (CoglTexture *texture);
* Deprecated: 1.16: Use cogl_offscreen_new_with_texture instead.
*/
COGL_DEPRECATED_FOR (cogl_offscreen_new_with_texture)
CoglOffscreen *
COGL_EXPORT CoglOffscreen *
cogl_offscreen_new_to_texture (CoglTexture *texture);
/**
@@ -132,13 +133,13 @@ cogl_offscreen_new_to_texture (CoglTexture *texture);
* Returns: %TRUE if @object is a #CoglOffscreen framebuffer,
* %FALSE otherwise
*/
gboolean
COGL_EXPORT gboolean
cogl_is_offscreen (void *object);
/**
* cogl_offscreen_get_texture: (skip)
*/
CoglTexture *
COGL_EXPORT CoglTexture *
cogl_offscreen_get_texture (CoglOffscreen *offscreen);
G_END_DECLS

View File

@@ -78,7 +78,7 @@ struct _CoglOnscreen
CoglOnscreen *
_cogl_onscreen_new (void);
void
COGL_EXPORT void
_cogl_framebuffer_winsys_update_size (CoglFramebuffer *framebuffer,
int width, int height);
@@ -87,10 +87,10 @@ _cogl_onscreen_queue_event (CoglOnscreen *onscreen,
CoglFrameEvent type,
CoglFrameInfo *info);
void
COGL_EXPORT void
_cogl_onscreen_notify_frame_sync (CoglOnscreen *onscreen, CoglFrameInfo *info);
void
COGL_EXPORT void
_cogl_onscreen_notify_complete (CoglOnscreen *onscreen, CoglFrameInfo *info);
void

View File

@@ -52,9 +52,10 @@ typedef struct _CoglOnscreenTemplate CoglOnscreenTemplate;
*
* Returns: a #GType that can be used with the GLib type system.
*/
COGL_EXPORT
GType cogl_onscreen_template_get_gtype (void);
CoglOnscreenTemplate *
COGL_EXPORT CoglOnscreenTemplate *
cogl_onscreen_template_new (CoglSwapChain *swap_chain);
/**
@@ -80,7 +81,7 @@ cogl_onscreen_template_new (CoglSwapChain *swap_chain);
* Since: 1.10
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_onscreen_template_set_samples_per_pixel (
CoglOnscreenTemplate *onscreen_template,
int n);
@@ -99,7 +100,7 @@ cogl_onscreen_template_set_samples_per_pixel (
* Since: 1.20
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_onscreen_template_set_stereo_enabled (
CoglOnscreenTemplate *onscreen_template,
gboolean enabled);
@@ -114,7 +115,7 @@ cogl_onscreen_template_set_stereo_enabled (
* Since: 1.10
* Stability: unstable
*/
gboolean
COGL_EXPORT gboolean
cogl_is_onscreen_template (void *object);
G_END_DECLS

View File

@@ -55,6 +55,7 @@ typedef struct _CoglOnscreen CoglOnscreen;
*
* Returns: a #GType that can be used with the GLib type system.
*/
COGL_EXPORT
GType cogl_onscreen_get_gtype (void);
/**
@@ -71,7 +72,7 @@ GType cogl_onscreen_get_gtype (void);
* Since: 1.8
* Stability: unstable
*/
CoglOnscreen *
COGL_EXPORT CoglOnscreen *
cogl_onscreen_new (CoglContext *context, int width, int height);
#ifdef COGL_HAS_X11
@@ -92,7 +93,7 @@ cogl_onscreen_new (CoglContext *context, int width, int height);
* Since: 1.10
* Stability: unstable
*/
uint32_t
COGL_EXPORT uint32_t
cogl_x11_onscreen_get_window_xid (CoglOnscreen *onscreen);
#endif /* COGL_HAS_X11 */
@@ -125,7 +126,7 @@ cogl_x11_onscreen_get_window_xid (CoglOnscreen *onscreen);
* Since: 2.0
* Stability: Unstable
*/
void
COGL_EXPORT void
cogl_onscreen_show (CoglOnscreen *onscreen);
/**
@@ -150,7 +151,7 @@ cogl_onscreen_show (CoglOnscreen *onscreen);
* Since: 2.0
* Stability: Unstable
*/
void
COGL_EXPORT void
cogl_onscreen_hide (CoglOnscreen *onscreen);
/**
@@ -174,7 +175,7 @@ cogl_onscreen_hide (CoglOnscreen *onscreen);
* Since: 1.10
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_onscreen_swap_buffers (CoglOnscreen *onscreen);
@@ -227,7 +228,7 @@ cogl_onscreen_swap_buffers (CoglOnscreen *onscreen);
* Since: 1.14
* Stability: stable
*/
int
COGL_EXPORT int
cogl_onscreen_get_buffer_age (CoglOnscreen *onscreen);
/**
@@ -278,7 +279,7 @@ cogl_onscreen_get_buffer_age (CoglOnscreen *onscreen);
* Since: 1.16
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_onscreen_swap_buffers_with_damage (CoglOnscreen *onscreen,
const int *rectangles,
int n_rectangles);
@@ -303,7 +304,7 @@ cogl_onscreen_swap_buffers_with_damage (CoglOnscreen *onscreen,
* Since: 1.10
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_onscreen_swap_region (CoglOnscreen *onscreen,
const int *rectangles,
int n_rectangles);
@@ -388,6 +389,7 @@ typedef struct _CoglClosure CoglFrameClosure;
*
* Returns: a #GType that can be used with the GLib type system.
*/
COGL_EXPORT
GType cogl_frame_closure_get_gtype (void);
/**
@@ -427,7 +429,7 @@ GType cogl_frame_closure_get_gtype (void);
* Since: 1.14
* Stability: unstable
*/
CoglFrameClosure *
COGL_EXPORT CoglFrameClosure *
cogl_onscreen_add_frame_callback (CoglOnscreen *onscreen,
CoglFrameCallback callback,
void *user_data,
@@ -449,7 +451,7 @@ cogl_onscreen_add_frame_callback (CoglOnscreen *onscreen,
* Since: 1.14
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_onscreen_remove_frame_callback (CoglOnscreen *onscreen,
CoglFrameClosure *closure);
@@ -482,7 +484,7 @@ cogl_onscreen_remove_frame_callback (CoglOnscreen *onscreen,
*
* Since: 2.0
*/
void
COGL_EXPORT void
cogl_onscreen_set_resizable (CoglOnscreen *onscreen,
gboolean resizable);
@@ -509,7 +511,7 @@ cogl_onscreen_set_resizable (CoglOnscreen *onscreen,
* resizable or not.
* Since: 2.0
*/
gboolean
COGL_EXPORT gboolean
cogl_onscreen_get_resizable (CoglOnscreen *onscreen);
/**
@@ -560,6 +562,7 @@ typedef struct _CoglClosure CoglOnscreenResizeClosure;
*
* Returns: a #GType that can be used with the GLib type system.
*/
COGL_EXPORT
GType cogl_onscreen_resize_closure_get_gtype (void);
/**
@@ -594,7 +597,7 @@ GType cogl_onscreen_resize_closure_get_gtype (void);
* remove the callback and associated @user_data later.
* Since: 2.0
*/
CoglOnscreenResizeClosure *
COGL_EXPORT CoglOnscreenResizeClosure *
cogl_onscreen_add_resize_callback (CoglOnscreen *onscreen,
CoglOnscreenResizeCallback callback,
void *user_data,
@@ -610,7 +613,7 @@ cogl_onscreen_add_resize_callback (CoglOnscreen *onscreen,
*
* Since: 2.0
*/
void
COGL_EXPORT void
cogl_onscreen_remove_resize_callback (CoglOnscreen *onscreen,
CoglOnscreenResizeClosure *closure);
@@ -674,6 +677,7 @@ typedef struct _CoglClosure CoglOnscreenDirtyClosure;
*
* Returns: a #GType that can be used with the GLib type system.
*/
COGL_EXPORT
GType cogl_onscreen_dirty_closure_get_gtype (void);
/**
@@ -706,7 +710,7 @@ GType cogl_onscreen_dirty_closure_get_gtype (void);
* Since: 1.16
* Stability: unstable
*/
CoglOnscreenDirtyClosure *
COGL_EXPORT CoglOnscreenDirtyClosure *
cogl_onscreen_add_dirty_callback (CoglOnscreen *onscreen,
CoglOnscreenDirtyCallback callback,
void *user_data,
@@ -728,7 +732,7 @@ cogl_onscreen_add_dirty_callback (CoglOnscreen *onscreen,
* Since: 1.16
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_onscreen_remove_dirty_callback (CoglOnscreen *onscreen,
CoglOnscreenDirtyClosure *closure);
@@ -743,7 +747,7 @@ cogl_onscreen_remove_dirty_callback (CoglOnscreen *onscreen,
* Since: 1.10
* Stability: unstable
*/
gboolean
COGL_EXPORT gboolean
cogl_is_onscreen (void *object);
/**
@@ -758,7 +762,7 @@ cogl_is_onscreen (void *object);
* Since: 1.14
* Stability: unstable
*/
int64_t
COGL_EXPORT int64_t
cogl_onscreen_get_frame_counter (CoglOnscreen *onscreen);
G_END_DECLS

View File

@@ -73,6 +73,7 @@ typedef struct _CoglOutput CoglOutput;
*
* Returns: a #GType that can be used with the GLib type system.
*/
COGL_EXPORT
GType cogl_output_get_gtype (void);
/**
@@ -127,7 +128,7 @@ typedef enum
* Since: 1.14
* Stability: unstable
*/
gboolean
COGL_EXPORT gboolean
cogl_is_output (void *object);
/**
@@ -142,7 +143,7 @@ cogl_is_output (void *object);
* Since: 1.14
* Stability: unstable
*/
int
COGL_EXPORT int
cogl_output_get_x (CoglOutput *output);
/**
@@ -157,7 +158,7 @@ cogl_output_get_x (CoglOutput *output);
* Since: 1.14
* Stability: unstable
*/
int
COGL_EXPORT int
cogl_output_get_y (CoglOutput *output);
/**
@@ -170,7 +171,7 @@ cogl_output_get_y (CoglOutput *output);
* Since: 1.14
* Stability: unstable
*/
int
COGL_EXPORT int
cogl_output_get_width (CoglOutput *output);
/**
@@ -183,7 +184,7 @@ cogl_output_get_width (CoglOutput *output);
* Since: 1.14
* Stability: unstable
*/
int
COGL_EXPORT int
cogl_output_get_height (CoglOutput *output);
/**
@@ -200,7 +201,7 @@ cogl_output_get_height (CoglOutput *output);
* Since: 1.14
* Stability: unstable
*/
int
COGL_EXPORT int
cogl_output_get_mm_width (CoglOutput *output);
/**
@@ -217,7 +218,7 @@ cogl_output_get_mm_width (CoglOutput *output);
* Since: 1.14
* Stability: unstable
*/
int
COGL_EXPORT int
cogl_output_get_mm_height (CoglOutput *output);
/**
@@ -232,7 +233,7 @@ cogl_output_get_mm_height (CoglOutput *output);
* Since: 1.14
* Stability: unstable
*/
CoglSubpixelOrder
COGL_EXPORT CoglSubpixelOrder
cogl_output_get_subpixel_order (CoglOutput *output);
/**
@@ -247,7 +248,7 @@ cogl_output_get_subpixel_order (CoglOutput *output);
* Since: 1.14
* Stability: unstable
*/
float
COGL_EXPORT float
cogl_output_get_refresh_rate (CoglOutput *output);
G_END_DECLS

View File

@@ -332,7 +332,7 @@ typedef enum
CoglPipelineLayerType
_cogl_pipeline_layer_get_type (CoglPipelineLayer *layer);
CoglTexture *
COGL_EXPORT CoglTexture *
_cogl_pipeline_layer_get_texture (CoglPipelineLayer *layer);
CoglTexture *

View File

@@ -150,7 +150,7 @@ typedef enum
* Since: 2.0
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_pipeline_set_layer_texture (CoglPipeline *pipeline,
int layer_index,
CoglTexture *texture);
@@ -172,7 +172,7 @@ cogl_pipeline_set_layer_texture (CoglPipeline *pipeline,
* Since: 1.10
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_pipeline_set_layer_null_texture (CoglPipeline *pipeline,
int layer_index);
@@ -186,7 +186,7 @@ cogl_pipeline_set_layer_null_texture (CoglPipeline *pipeline,
* Stability: unstable
* Since: 1.10
*/
CoglTexture *
COGL_EXPORT CoglTexture *
cogl_pipeline_get_layer_texture (CoglPipeline *pipeline,
int layer_index);
@@ -199,7 +199,7 @@ cogl_pipeline_get_layer_texture (CoglPipeline *pipeline,
* Since: 1.10
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_pipeline_remove_layer (CoglPipeline *pipeline,
int layer_index);
@@ -297,7 +297,7 @@ cogl_pipeline_remove_layer (CoglPipeline *pipeline,
* Since: 2.0
* Stability: unstable
*/
gboolean
COGL_EXPORT gboolean
cogl_pipeline_set_layer_combine (CoglPipeline *pipeline,
int layer_index,
const char *blend_string,
@@ -316,7 +316,7 @@ cogl_pipeline_set_layer_combine (CoglPipeline *pipeline,
* Since: 2.0
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_pipeline_set_layer_combine_constant (CoglPipeline *pipeline,
int layer_index,
const CoglColor *constant);
@@ -333,7 +333,7 @@ cogl_pipeline_set_layer_combine_constant (CoglPipeline *pipeline,
* Since: 1.10
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_pipeline_set_layer_matrix (CoglPipeline *pipeline,
int layer_index,
const CoglMatrix *matrix);
@@ -349,7 +349,7 @@ cogl_pipeline_set_layer_matrix (CoglPipeline *pipeline,
* Since: 2.0
* Stability: unstable
*/
int
COGL_EXPORT int
cogl_pipeline_get_n_layers (CoglPipeline *pipeline);
/**
@@ -370,7 +370,7 @@ cogl_pipeline_get_n_layers (CoglPipeline *pipeline);
* Since: 1.10
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_pipeline_set_layer_filters (CoglPipeline *pipeline,
int layer_index,
CoglPipelineFilter min_filter,
@@ -393,7 +393,7 @@ cogl_pipeline_set_layer_filters (CoglPipeline *pipeline,
* Since: 1.10
* Stability: unstable
*/
CoglPipelineFilter
COGL_EXPORT CoglPipelineFilter
cogl_pipeline_get_layer_min_filter (CoglPipeline *pipeline,
int layer_index);
@@ -414,7 +414,7 @@ cogl_pipeline_get_layer_min_filter (CoglPipeline *pipeline,
* Since: 1.10
* Stability: unstable
*/
CoglPipelineFilter
COGL_EXPORT CoglPipelineFilter
cogl_pipeline_get_layer_mag_filter (CoglPipeline *pipeline,
int layer_index);
@@ -436,7 +436,7 @@ cogl_pipeline_get_layer_mag_filter (CoglPipeline *pipeline,
* Since: 2.0
* Stability: unstable
*/
gboolean
COGL_EXPORT gboolean
cogl_pipeline_set_layer_point_sprite_coords_enabled (CoglPipeline *pipeline,
int layer_index,
gboolean enable,
@@ -456,7 +456,7 @@ cogl_pipeline_set_layer_point_sprite_coords_enabled (CoglPipeline *pipeline,
* Since: 2.0
* Stability: unstable
*/
gboolean
COGL_EXPORT gboolean
cogl_pipeline_get_layer_point_sprite_coords_enabled (CoglPipeline *pipeline,
int layer_index);
@@ -474,7 +474,7 @@ cogl_pipeline_get_layer_point_sprite_coords_enabled (CoglPipeline *pipeline,
* Since: 1.6
* Stability: unstable
*/
CoglPipelineWrapMode
COGL_EXPORT CoglPipelineWrapMode
cogl_pipeline_get_layer_wrap_mode_s (CoglPipeline *pipeline,
int layer_index);
@@ -489,7 +489,7 @@ cogl_pipeline_get_layer_wrap_mode_s (CoglPipeline *pipeline,
* Since: 2.0
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_pipeline_set_layer_wrap_mode_s (CoglPipeline *pipeline,
int layer_index,
CoglPipelineWrapMode mode);
@@ -508,7 +508,7 @@ cogl_pipeline_set_layer_wrap_mode_s (CoglPipeline *pipeline,
* Since: 1.6
* Stability: unstable
*/
CoglPipelineWrapMode
COGL_EXPORT CoglPipelineWrapMode
cogl_pipeline_get_layer_wrap_mode_t (CoglPipeline *pipeline,
int layer_index);
@@ -524,7 +524,7 @@ cogl_pipeline_get_layer_wrap_mode_t (CoglPipeline *pipeline,
* Since: 2.0
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_pipeline_set_layer_wrap_mode_t (CoglPipeline *pipeline,
int layer_index,
CoglPipelineWrapMode mode);
@@ -543,7 +543,7 @@ cogl_pipeline_set_layer_wrap_mode_t (CoglPipeline *pipeline,
* Since: 2.0
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_pipeline_set_layer_wrap_mode (CoglPipeline *pipeline,
int layer_index,
CoglPipelineWrapMode mode);
@@ -563,7 +563,7 @@ cogl_pipeline_set_layer_wrap_mode (CoglPipeline *pipeline,
* Since: 1.10
* Stability: Unstable
*/
void
COGL_EXPORT void
cogl_pipeline_add_layer_snippet (CoglPipeline *pipeline,
int layer,
CoglSnippet *snippet);

View File

@@ -775,7 +775,7 @@ _cogl_pipeline_get_layer_combine_constant (CoglPipeline *pipeline,
int layer_index,
float *constant);
void
COGL_EXPORT void
_cogl_pipeline_prune_to_n_layers (CoglPipeline *pipeline, int n);
@@ -786,7 +786,7 @@ _cogl_pipeline_prune_to_n_layers (CoglPipeline *pipeline, int n);
typedef gboolean (*CoglPipelineInternalLayerCallback) (CoglPipelineLayer *layer,
void *user_data);
void
COGL_EXPORT void
_cogl_pipeline_foreach_layer_internal (CoglPipeline *pipeline,
CoglPipelineInternalLayerCallback callback,
void *user_data);

View File

@@ -58,7 +58,7 @@ G_BEGIN_DECLS
* Since: 2.0
* Stability: Unstable
*/
void
COGL_EXPORT void
cogl_pipeline_set_color (CoglPipeline *pipeline,
const CoglColor *color);
@@ -77,7 +77,7 @@ cogl_pipeline_set_color (CoglPipeline *pipeline,
* Since: 2.0
* Stability: Unstable
*/
void
COGL_EXPORT void
cogl_pipeline_set_color4ub (CoglPipeline *pipeline,
uint8_t red,
uint8_t green,
@@ -99,7 +99,7 @@ cogl_pipeline_set_color4ub (CoglPipeline *pipeline,
* Since: 2.0
* Stability: Unstable
*/
void
COGL_EXPORT void
cogl_pipeline_set_color4f (CoglPipeline *pipeline,
float red,
float green,
@@ -116,7 +116,7 @@ cogl_pipeline_set_color4f (CoglPipeline *pipeline,
* Since: 2.0
* Stability: Unstable
*/
void
COGL_EXPORT void
cogl_pipeline_get_color (CoglPipeline *pipeline,
CoglColor *color);
@@ -173,7 +173,7 @@ typedef enum
* Since: 2.0
* Stability: Unstable
*/
void
COGL_EXPORT void
cogl_pipeline_set_alpha_test_function (CoglPipeline *pipeline,
CoglPipelineAlphaFunc alpha_func,
float alpha_reference);
@@ -187,7 +187,7 @@ cogl_pipeline_set_alpha_test_function (CoglPipeline *pipeline,
* Since: 2.0
* Stability: Unstable
*/
CoglPipelineAlphaFunc
COGL_EXPORT CoglPipelineAlphaFunc
cogl_pipeline_get_alpha_test_function (CoglPipeline *pipeline);
/**
@@ -199,7 +199,7 @@ cogl_pipeline_get_alpha_test_function (CoglPipeline *pipeline);
* Since: 2.0
* Stability: Unstable
*/
float
COGL_EXPORT float
cogl_pipeline_get_alpha_test_reference (CoglPipeline *pipeline);
/**
@@ -284,7 +284,7 @@ cogl_pipeline_get_alpha_test_reference (CoglPipeline *pipeline);
* Since: 2.0
* Stability: Unstable
*/
gboolean
COGL_EXPORT gboolean
cogl_pipeline_set_blend (CoglPipeline *pipeline,
const char *blend_string,
GError **error);
@@ -300,7 +300,7 @@ cogl_pipeline_set_blend (CoglPipeline *pipeline,
* Since: 2.0
* Stability: Unstable
*/
void
COGL_EXPORT void
cogl_pipeline_set_blend_constant (CoglPipeline *pipeline,
const CoglColor *constant_color);
@@ -325,7 +325,7 @@ cogl_pipeline_set_blend_constant (CoglPipeline *pipeline,
* Since: 2.0
* Stability: Unstable
*/
void
COGL_EXPORT void
cogl_pipeline_set_point_size (CoglPipeline *pipeline,
float point_size);
@@ -341,7 +341,7 @@ cogl_pipeline_set_point_size (CoglPipeline *pipeline,
* Since: 2.0
* Stability: Unstable
*/
float
COGL_EXPORT float
cogl_pipeline_get_point_size (CoglPipeline *pipeline);
/**
@@ -365,7 +365,7 @@ cogl_pipeline_get_point_size (CoglPipeline *pipeline);
* Stability: Unstable
* Return value: %TRUE if the change suceeded or %FALSE otherwise
*/
gboolean
COGL_EXPORT gboolean
cogl_pipeline_set_per_vertex_point_size (CoglPipeline *pipeline,
gboolean enable,
GError **error);
@@ -380,7 +380,7 @@ cogl_pipeline_set_per_vertex_point_size (CoglPipeline *pipeline,
* enabled or %FALSE otherwise. The per-vertex point size can be
* enabled with cogl_pipeline_set_per_vertex_point_size().
*/
gboolean
COGL_EXPORT gboolean
cogl_pipeline_get_per_vertex_point_size (CoglPipeline *pipeline);
/**
@@ -395,7 +395,7 @@ cogl_pipeline_get_per_vertex_point_size (CoglPipeline *pipeline);
* Since: 2.0
* Stability: Unstable
*/
CoglHandle
COGL_EXPORT CoglHandle
cogl_pipeline_get_user_program (CoglPipeline *pipeline);
/**
@@ -440,7 +440,7 @@ cogl_pipeline_get_user_program (CoglPipeline *pipeline);
* Since: 2.0
* Stability: Unstable
*/
void
COGL_EXPORT void
cogl_pipeline_set_user_program (CoglPipeline *pipeline,
CoglHandle program);
@@ -464,7 +464,7 @@ cogl_pipeline_set_user_program (CoglPipeline *pipeline,
* Since: 2.0
* Stability: Unstable
*/
gboolean
COGL_EXPORT gboolean
cogl_pipeline_set_depth_state (CoglPipeline *pipeline,
const CoglDepthState *state,
GError **error);
@@ -480,7 +480,7 @@ cogl_pipeline_set_depth_state (CoglPipeline *pipeline,
* Since: 2.0
* Stability: Unstable
*/
void
COGL_EXPORT void
cogl_pipeline_get_depth_state (CoglPipeline *pipeline,
CoglDepthState *state_out);
@@ -524,7 +524,7 @@ typedef enum
* Status: Unstable
* Since: 2.0
*/
void
COGL_EXPORT void
cogl_pipeline_set_cull_face_mode (CoglPipeline *pipeline,
CoglPipelineCullFaceMode cull_face_mode);
@@ -537,7 +537,7 @@ cogl_pipeline_set_cull_face_mode (CoglPipeline *pipeline,
* Status: Unstable
* Since: 2.0
*/
CoglPipelineCullFaceMode
COGL_EXPORT CoglPipelineCullFaceMode
cogl_pipeline_get_cull_face_mode (CoglPipeline *pipeline);
/**
@@ -556,7 +556,7 @@ cogl_pipeline_get_cull_face_mode (CoglPipeline *pipeline);
* Status: Unstable
* Since: 2.0
*/
void
COGL_EXPORT void
cogl_pipeline_set_front_face_winding (CoglPipeline *pipeline,
CoglWinding front_winding);
@@ -577,7 +577,7 @@ cogl_pipeline_set_front_face_winding (CoglPipeline *pipeline,
* Status: Unstable
* Since: 2.0
*/
CoglWinding
COGL_EXPORT CoglWinding
cogl_pipeline_get_front_face_winding (CoglPipeline *pipeline);
/**
@@ -600,7 +600,7 @@ cogl_pipeline_get_front_face_winding (CoglPipeline *pipeline);
* Since: 2.0
* Stability: Unstable
*/
void
COGL_EXPORT void
cogl_pipeline_set_uniform_1f (CoglPipeline *pipeline,
int uniform_location,
float value);
@@ -625,7 +625,7 @@ cogl_pipeline_set_uniform_1f (CoglPipeline *pipeline,
* Since: 2.0
* Stability: Unstable
*/
void
COGL_EXPORT void
cogl_pipeline_set_uniform_1i (CoglPipeline *pipeline,
int uniform_location,
int value);
@@ -654,7 +654,7 @@ cogl_pipeline_set_uniform_1i (CoglPipeline *pipeline,
* Since: 2.0
* Stability: Unstable
*/
void
COGL_EXPORT void
cogl_pipeline_set_uniform_float (CoglPipeline *pipeline,
int uniform_location,
int n_components,
@@ -685,7 +685,7 @@ cogl_pipeline_set_uniform_float (CoglPipeline *pipeline,
* Since: 2.0
* Stability: Unstable
*/
void
COGL_EXPORT void
cogl_pipeline_set_uniform_int (CoglPipeline *pipeline,
int uniform_location,
int n_components,
@@ -722,7 +722,7 @@ cogl_pipeline_set_uniform_int (CoglPipeline *pipeline,
* Since: 2.0
* Stability: Unstable
*/
void
COGL_EXPORT void
cogl_pipeline_set_uniform_matrix (CoglPipeline *pipeline,
int uniform_location,
int dimensions,
@@ -743,7 +743,7 @@ cogl_pipeline_set_uniform_matrix (CoglPipeline *pipeline,
* Since: 1.10
* Stability: Unstable
*/
void
COGL_EXPORT void
cogl_pipeline_add_snippet (CoglPipeline *pipeline,
CoglSnippet *snippet);

View File

@@ -69,6 +69,7 @@ G_BEGIN_DECLS
*
* Returns: a #GType that can be used with the GLib type system.
*/
COGL_EXPORT
GType cogl_pipeline_get_gtype (void);
/**
@@ -83,7 +84,7 @@ GType cogl_pipeline_get_gtype (void);
* Since: 2.0
* Stability: Unstable
*/
CoglPipeline *
COGL_EXPORT CoglPipeline *
cogl_pipeline_new (CoglContext *context);
/**
@@ -104,7 +105,7 @@ cogl_pipeline_new (CoglContext *context);
* Since: 2.0
* Stability: Unstable
*/
CoglPipeline *
COGL_EXPORT CoglPipeline *
cogl_pipeline_copy (CoglPipeline *source);
/**
@@ -119,7 +120,7 @@ cogl_pipeline_copy (CoglPipeline *source);
* Since: 2.0
* Stability: Unstable
*/
gboolean
COGL_EXPORT gboolean
cogl_is_pipeline (void *object);
/**
@@ -151,7 +152,7 @@ typedef gboolean (*CoglPipelineLayerCallback) (CoglPipeline *pipeline,
* Since: 2.0
* Stability: Unstable
*/
void
COGL_EXPORT void
cogl_pipeline_foreach_layer (CoglPipeline *pipeline,
CoglPipelineLayerCallback callback,
void *user_data);
@@ -176,7 +177,7 @@ cogl_pipeline_foreach_layer (CoglPipeline *pipeline,
* Since: 2.0
* Stability: Unstable
*/
int
COGL_EXPORT int
cogl_pipeline_get_uniform_location (CoglPipeline *pipeline,
const char *uniform_name);

View File

@@ -61,6 +61,7 @@ G_BEGIN_DECLS
*
* Returns: a #GType that can be used with the GLib type system.
*/
COGL_EXPORT
GType cogl_pixel_buffer_get_gtype (void);
/**
@@ -82,7 +83,7 @@ GType cogl_pixel_buffer_get_gtype (void);
* Since: 1.10
* Stability: unstable
*/
CoglPixelBuffer *
COGL_EXPORT CoglPixelBuffer *
cogl_pixel_buffer_new (CoglContext *context,
size_t size,
const void *data);
@@ -99,7 +100,7 @@ cogl_pixel_buffer_new (CoglContext *context,
* Since: 1.2
* Stability: Unstable
*/
gboolean
COGL_EXPORT gboolean
cogl_is_pixel_buffer (void *object);
G_END_DECLS

View File

@@ -39,6 +39,7 @@
#include <stddef.h>
#include <cogl/cogl-defines.h>
#include <cogl/cogl-macros.h>
#include <glib.h>
#include <glib-object.h>
@@ -251,7 +252,7 @@ typedef enum /*< prefix=COGL_PIXEL_FORMAT >*/
*
* Returns: The number of bytes per pixel in the given format's given plane.
*/
int
COGL_EXPORT int
cogl_pixel_format_get_bytes_per_pixel (CoglPixelFormat format,
int plane);
@@ -302,7 +303,7 @@ _cogl_pixel_format_is_endian_dependant (CoglPixelFormat format);
*
* Returns: The no. of planes of @format (at most %COGL_PIXEL_FORMAT_MAX_PLANES)
*/
int
COGL_EXPORT int
cogl_pixel_format_get_n_planes (CoglPixelFormat format);
/**
@@ -313,7 +314,7 @@ cogl_pixel_format_get_n_planes (CoglPixelFormat format);
*
* Returns: (transfer none): A string representation of @format.
*/
const char *
COGL_EXPORT const char *
cogl_pixel_format_to_string (CoglPixelFormat format);
G_END_DECLS

View File

@@ -41,7 +41,7 @@ _cogl_poll_renderer_remove_fd (CoglRenderer *renderer, int fd);
typedef int64_t (*CoglPollPrepareCallback) (void *user_data);
typedef void (*CoglPollDispatchCallback) (void *user_data, int revents);
void
COGL_EXPORT void
_cogl_poll_renderer_add_fd (CoglRenderer *renderer,
int fd,
CoglPollFDEvent events,
@@ -68,7 +68,7 @@ _cogl_poll_renderer_remove_source (CoglRenderer *renderer,
typedef void (*CoglIdleCallback) (void *user_data);
CoglClosure *
COGL_EXPORT CoglClosure *
_cogl_poll_renderer_add_idle (CoglRenderer *renderer,
CoglIdleCallback idle_cb,
void *user_data,

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