Compare commits

...

204 Commits

Author SHA1 Message Date
Florian Müllner
d03deb006c Bump version to 3.36.4
Update NEWS.
2020-07-07 20:41:54 +02:00
Jonas Dreßler
c2146b457e clutter/box-layout: Request the correct size for homogeneous layouts
In case the layout is homogeneous, all children aligned by the box
layout must be allocated the same size. In order to fit them all inside
the container, the size request of the box layout has to look for the
child with the largest size and use that size for all children.

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

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1333
2020-07-06 18:19:35 +02:00
Jonas Dreßler
77dc3a5065 clutter/box-layout: Add spacing when computing opposite orientation size
ClutterBoxLayout calculates the preferred size of the opposite
orientation (so for example the height if the orientation is horizontal)
by getting the preferred size of the real orientation first, and then
the preferred size of the opposite orientation, using the other size as
for_width/height when doing the request.

Right now, for non-homogeneous layouts this for_width/height does not
adjust for the spacing set on the box layout. This leads to children
being passed a slightly larger for_width/height, which in case of
ClutterText might cause the line to not wrap when it actually should.
This in turn means we can end up with an incorrect preferred size for
the opposite orientation, leading to a wrong allocation.

So fix that and adjust for the spacing just as we do for homogeneous
layouts by subtracting the total spacing from the available size that is
distributed between children.

This fixes the wrong height of the checkbox label reported in
https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2574.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1333
2020-07-06 18:19:35 +02:00
Carlos Garnacho
454875248a x11: Look up reason for selection clear events from XFixes
If the event originates from a XSetSelectionOwner request, the event
will contain a XFixesSetSelectionOwnerNotify subtype. The other
subtypes (meant for the selection window being destroyed, and the
client closing) are the situations where we mean to replace the
selection.

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

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1350

(cherry picked from commit 2f1f47d257)
2020-07-03 18:40:48 +02:00
Robert Mader
ae8acc9980 surface-actor: Add culling offset for geometry scale - take 2
41130b08eb added a fix for culling subsurfaces with geometry scale.
Unfortunately it only did so for the opaque regions, not for clip and
unobscured regions, as the effect was hidden by bug that was only
fixed by 3187fe8ebc.

Apply the same fix to clip and unobscured regions and use the chance
to move most of the slightly hackish geometry scale related code
into a single place.

We need to scale slightly differently in the two cases, indicated by
the new `ScalePerspectiveType` enum, as the scale is dependent on the
perspective - once from outside, once from inside of the scaled actor.

Closes https://gitlab.gnome.org/GNOME/mutter/-/issues/1312

(cherry picked from commit 86646679f1)
2020-06-30 22:33:52 +02:00
Olivier Fourdan
86d9cd1a66 remote-desktop: Check for screencast only when required
The portal API requires a screencast session only for absolution motion
with remote desktop, other methods including relative motion do not
require a screencast session.

There is no reason to be more strict than the API actually is, check for
a screencast session only when required, like for absolute motion events
and touch events.

Tested with https://gitlab.gnome.org/snippets/1122

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1307


(cherry picked from commit b8524504f4)
2020-06-29 18:38:28 +00:00
Daniel van Vugt
3a70ba7ae2 shaped-texture: Use the REPLACE combine function on opaque areas
We were setting the pipeline colour to all white (1.0, 1.0, 1.0, 1.0)
and so the default layer combine function multiplied each pixel
(R, G, B, A) by all ones. Obviously multiplying by one four times per
pixel is a waste of effort so we remove the colour setting *and* set
the layer combine function to a trivial shader that will ignore whatever
the current pipeline colour is set to. So now we do **zero** multiplies
per pixel.

On an i7-7700 at UHD 3840x2160 this results in 5% faster render times
and 10% lower power usage (says intel_gpu_top). The benefit is probably
much higher for virtual machines though, as they're no longer being
asked to do CPU-based math on every pixel of a window.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1331

(cherry picked from commit e5542c3210)
2020-06-27 12:31:02 +02:00
Jonas Ådahl
36a6235f3a wayland/xdg-shell: Don't use xdg_surface private to get window geometry
We already used the actual API in the same function, move that call a
bit higher up to and use the variable in more places.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1295

(cherry picked from commit 4c0aa2afca)
2020-06-26 10:15:58 +02:00
Jonas Ådahl
9b349cb25b wayland/shell: Apply geometry after subsurface state application
The subsurface state may affect the geometry end result, e.g. when
window decoration enlarging the toplevel window are applied. If we don't
wait with calculating the window geometry, intersecting the set region
with the subsurface tree extents will not include the subsurfaces.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/928

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1295

(cherry picked from commit d6af59612c)
2020-06-26 10:15:46 +02:00
Jonas Ådahl
a83d83f087 wayland: Remove a couple of stray newlines
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1295

(cherry picked from commit be59b514ca)
2020-06-26 10:15:28 +02:00
Sebastian Keller
b8bd39793a wayland/data-device: Don't create and leak unused memory on dnd
"offer" is overwritten with the result of meta_wayland_data_offer_new a
few lines later.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1293

(cherry picked from commit 99c9f4c1fa)
2020-06-24 22:02:34 +02:00
Sebastian Keller
70072c39dd wayland: Free selection streams streams after transfer
They were only being closed but never freed.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1293

(cherry picked from commit dd32ff018a)
2020-06-24 22:02:34 +02:00
Sebastian Keller
bb4bd4b5c0 core: Free clipboard selection source on shutdown
The clipboard manager is the only code to ever set the display selection
source, so it should also be responsible for unsetting it when the
clipboard manager gets shut down.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1293

(cherry picked from commit 019643bad0)
2020-06-24 22:02:34 +02:00
Sebastian Keller
ef848f10d1 core: Fix memory selection source leak after clipboard owner disappears
When an app disappears after some data from it has been copied to the
clipboard, the owner of the clipboard selection becomes a new memory
selection source. The initial reference this new selection source is
never unref'ed, which leads to this being leaked on the next clipboard
selection owner change.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1293

(cherry picked from commit a031ac067e)
2020-06-24 22:02:34 +02:00
Carlos Garnacho
59cb259fdd wayland: Add support for wayland-protocols primary selection protocol
This protocol was added some time ago. Supporting it fell through the
cracks. Add new data device/source/offer implementations for it,
interoperation between primary selection protocols (and X11 primary
selection for that matter) comes for free.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/943

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1255

(cherry picked from commit 2becb3dd29)
2020-06-24 22:02:34 +02:00
Carlos Garnacho
76e4b5de7a build: Build scaffolding for primary-selection wayland protocol
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1255

(cherry picked from commit 55f5177fe0)
2020-06-24 22:02:34 +02:00
Carlos Garnacho
9acb823603 wayland: Rename gtk primary protocol files to "legacy"
We want to make room for the wayland-protocols primary selection
protocol. Rename our private protocol as "legacy".

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1255

(cherry picked from commit 037b68ab8e)
2020-06-24 22:02:34 +02:00
Carlos Garnacho
d721750417 wayland: Send primary offer to all data devices from the same client
Make the data device track the keyboard focus, and use that list to
forward the primary selection to all data devices from the same
client.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1253

(cherry picked from commit b45d5ef3f5)
2020-06-24 22:02:34 +02:00
Carlos Garnacho
1ec91cc8ee wayland: Send clipboard offers to all data devices from the same client
Make the data device track the keyboard focus, and use that list to
forward the clipboard selection to all data devices from the same
client.

This is however not the case of DnD data offers, as the semantics
of multiple in-flight offers is unclear.

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

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1253

(cherry picked from commit 7e4e371466)
2020-06-24 22:02:34 +02:00
Carlos Garnacho
5c7b5ef0d9 wayland: Drop unused struct variable
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1193

(cherry picked from commit b7366b5b53)
2020-06-24 22:02:34 +02:00
Carlos Garnacho
e98e1c13dd wayland: Move the primary data device manager to its own file
Instead of having everything clumped at MetaWaylandDataManager,
split the primary selection to its own struct. This manager is
handled separately from wl_data_device_manager and other selection
managers, so they would be able to interoperate between them, even.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1193

(cherry picked from commit 5e8d8b9ade)
2020-06-24 22:02:34 +02:00
Carlos Garnacho
8b69e7902a wayland: Move primary data offers to their own file
Following the MetaWaylandDataOffer split.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1193

(cherry picked from commit 4726f3d5d3)
2020-06-24 22:02:34 +02:00
Carlos Garnacho
b52a0be288 wayland: Move MetaWaylandDataOffer to its own file
This is still an openly defined struct, as we will need accessed
by "subclasses". Same principle applies than with the
MetaWaylandDataSource refactor, this is not meant to introduce
functional changes, so just go with it.

On the bright side, the interactions are now clearer, so it could
be made saner in the future.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1193

(cherry picked from commit 91ef7515de)
2020-06-24 22:02:34 +02:00
Carlos Garnacho
1eb0812f0a wayland: Move MetaWaylandDataSourcePrimary to its own file
Following the MetaWaylandDataSource split, this goes next.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1193

(cherry picked from commit 317f6c0910)
2020-06-24 22:02:34 +02:00
Carlos Garnacho
b98125a330 wayland: Split MetaWaylandDataSource into a separate file
The split wasn't 100% clean, and some extra private API had to be
added for it (but well, looking at the API, it's already evident
there's a cleanup/streamlining task due). This is meant to be a
refactor with no functional changes, so just go with it.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1193

(cherry picked from commit 6a3d521466)
2020-06-24 22:02:34 +02:00
Robert Mader
78248d8dd3 Revert "wayland: Send clipboard offers to all data devices from the same client"
This reverts commit 36f5a0a491.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1330
2020-06-24 22:02:29 +02:00
Robert Mader
849d8dfae9 Revert "wayland: Send primary offer to all data devices from the same client"
This reverts commit 493aeb65c8.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1330
2020-06-24 22:02:25 +02:00
Jonas Ådahl
1f896c9735 gpu-kms: Fix compilation issues from backport
The backport applied cleanly, but didn't build as function type
signatures called changed. This fixes the compilation issues.
2020-06-23 16:25:51 +02:00
Michel Dänzer
cc617b059c gpu/kms: Turn off CRTCs as well for DPMS
This avoids some issues which could happen on some setups[0] due to
meta-native-renderer.c:dummy_power_save_page_flip →
meta_onscreen_native_swap_drm_fb implicitly turning of the primary
plane (by destroying the KMS framebuffer assigned to it):

* drmModeObjectSetProperty could return an "Invalid argument" error
  between setting a non-empty cursor with drmModeSetCursor(2) and
  enabling the primary plane again:

  Failed to DPMS: Failed to set connector 69 property 2: Invalid argument

  (This was harmless other than the error message, as we always re-set
  a mode on the CRTC after setting the DPMS property to on, which
  enables the primary plane and implicitly sets the DRM property to on)

* drmModeSetCursor(2) could return an "Invalid argument" error between
  setting the DPMS property to on and enabling the primary plane again:

  Failed to set hardware cursor (drmModeSetCursor failed: Invalid argument), using OpenGL from now on

[0] E.g. with the amdgpu DC display code.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1240


(cherry picked from commit 2e5b767c01)
2020-06-23 14:13:39 +00:00
Robert Mader
44a3358125 shaped-texture: Reintroduce clip_region
In commit 4c1fde9d MetaCullable related code was moved out of
MetaShapedTexture into MetaSurfaceActor. While generally desirable,
this removed drawing optimizations in MetaShapedTexture for partial
redraws. The common case for fully obscured actors was still supposed
to work, but it was now discovered that it actually did not.

This commit revert parts of 4c1fde9d: it reintroduces clipping
to MetaShapedTexture but leaves all culling and actor related logic
in MetaSurfaceActor.

Thanks to Daniel van Vugt for uncovering the issue.

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

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1326


(cherry picked from commit 3187fe8ebc)
2020-06-22 16:16:37 +00:00
Sebastian Keller
81deb99435 clutter/stage: Make paint_to_buffer use the correct texture/buffer size
The size of the buffer the texture will be written to by
paint_to_buffer() is determined based on
meta_screen_cast_area_stream_src_get_specs() which uses roundf() to
calculate the width and height after scaling. Because the size of the
texture to be written to that buffer is calculated using ceilf(), it
might exceed the allocated buffer when using fractional scaling.

In 3.36 paint_to_buffer() is used from capture_view() which also uses
roundf() to allocate its buffer. Here this leads to a memory corruption
resulting in a crash when taking screenshots of an area.

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

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1320


(cherry picked from commit e216d9c6ad)
2020-06-17 19:36:46 +00:00
Sebastian Keller
f25417efcf clutter/paint-context: Fix NO_PAINT_SIGNAL flag enum value
This flag was using the same value as the NO_CURSORS flag.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1321
2020-06-17 17:52:24 +02:00
Corentin Noël
ecc2b91016 window-actor-x11: switch the signal callback argument and data on shadow factory change
invalidate_shadow takes the MetaWindowActorX11 as argument and not the MetaShadowFactory.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1314


(cherry picked from commit e09ac67698)
2020-06-16 16:04:38 +00:00
Jonas Ådahl
b002343dca stage/x11: Check that message is WM_PROTOCOLS before assuming so
When a touch sequence was rejected, we'd update the event timestamps of
incoming touch events to help with implementing grabs. This was done by
sending a ClientMessage with a counter, and comparing the counter to
decide whether we're seing a replayed event or not.

This had the unforseen consequence that we would potentially end up
destroying all actors including the stage, since, when mutter receives a
ClientMessage event, it would assume that it's a WM_PROTOCOLS event, and
handle it as such. The problem with this approach is that it would
ignore fact that there might be other ClientMessage types sent to it,
for example the touch synchronization one. What could happen is that the
touch count value would match up with the value of the WM_DELETE_WINDOW
atom, clutter would treat this as WM_PROTOCOLS:WM_DELETE_WINDOW, which
it'd translate to clutter_actor_destroy(stage).

Destroying the stage in such a way is not expected, and caused wierd
crashes in different places depending on what was going on.

This commit make sure we only treat WM_PROTOCOLS client messages as
WM_PROTOCOLS client messages effectively avoiding the issue.

This fixes crashes such as:

 #0  meta_window_get_buffer_rect (window=0x0, rect=rect@entry=0x7ffd7fc62e40) at core/window.c:4396
 #1  0x00007f1e2634837f in get_top_visible_window_actor (compositor=0x297d700, compositor=0x297d700) at compositor/compositor.c:1059
 #2  meta_compositor_sync_stack (compositor=0x297d700, stack=<optimized out>, stack@entry=0x26e3140) at compositor/compositor.c:1176
 #3  0x00007f1e263757ac in meta_stack_tracker_sync_stack (tracker=0x297dbc0) at core/stack-tracker.c:871
 #4  0x00007f1e26375899 in stack_tracker_sync_stack_later (data=<optimized out>) at core/stack-tracker.c:881
 #5  0x00007f1e26376914 in run_repaint_laters (laters_list=0x7f1e2663b7d8 <laters+24>) at core/util.c:809
 #6  run_all_repaint_laters (data=<optimized out>) at core/util.c:826
 #7  0x00007f1e26b18325 in _clutter_run_repaint_functions (flags=flags@entry=CLUTTER_REPAINT_FLAGS_PRE_PAINT) at clutter-main.c:3448
 #8  0x00007f1e26b18fc5 in master_clock_update_stages (master_clock=0x32d6a80, stages=0x4e5a740) at clutter-master-clock-default.c:437
 #9  clutter_clock_dispatch (source=<optimized out>, callback=<optimized out>, user_data=<optimized out>) at clutter-master-clock-default.c:567
 #10 0x00007f1e27e48049 in g_main_dispatch (context=0x225b8d0) at gmain.c:3175
 #11 g_main_context_dispatch (context=context@entry=0x225b8d0) at gmain.c:3828
 #12 0x00007f1e27e483a8 in g_main_context_iterate (context=0x225b8d0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3901
 #13 0x00007f1e27e4867a in g_main_loop_run (loop=0x24e29f0) at gmain.c:4097
 #14 0x00007f1e2636a3dc in meta_run () at core/main.c:666
 #15 0x000000000040219c in main (argc=1, argv=0x7ffd7fc63238) at ../src/main.c:534

and

 #0  0x00007f93943c1f25 in raise () at /usr/lib/libc.so.6
 #1  0x00007f93943ab897 in abort () at /usr/lib/libc.so.6
 #2  0x00007f9393e1e062 in g_assertion_message (domain=<optimized out>, file=<optimized out>, line=<optimized out>, func=0x7f93933e6860 <__func__.116322> "meta_x11_get_stage_window",
 #3  0x00007f9393e4ab1d in g_assertion_message_expr ()
 #4  0x00007f939338ecd7 in meta_x11_get_stage_window (stage=<optimized out>) at ../mutter/src/backends/x11/meta-stage-x11.c:923
 #5  0x00007f939339e599 in meta_backend_x11_cm_translate_device_event (x11=<optimized out>, device_event=0x55bc8bcfd6b0) at ../mutter/src/backends/x11/cm/meta-backend-x11-cm.c:381
 #6  0x00007f939339f2e2 in meta_backend_x11_translate_device_event (device_event=0x55bc8bcfd6b0, x11=0x55bc89dd5220) at ../mutter/src/backends/x11/meta-backend-x11.c:179
 #7  0x00007f939339f2e2 in translate_device_event (device_event=0x55bc8bcfd6b0, x11=0x55bc89dd5220) at ../mutter/src/backends/x11/meta-backend-x11.c:208
 #8  0x00007f939339f2e2 in maybe_spoof_event_as_stage_event (input_event=0x55bc8bcfd6b0, x11=0x55bc89dd5220) at ../mutter/src/backends/x11/meta-backend-x11.c:284
 #9  0x00007f939339f2e2 in handle_input_event (event=0x7fff62d60490, x11=0x55bc89dd5220) at ../mutter/src/backends/x11/meta-backend-x11.c:309
 #10 0x00007f939339f2e2 in handle_host_xevent (event=0x7fff62d60490, backend=0x55bc89dd5220) at ../mutter/src/backends/x11/meta-backend-x11.c:413
 #11 0x00007f939339f2e2 in x_event_source_dispatch (source=<optimized out>, callback=<optimized out>, user_data=<optimized out>) at ../mutter/src/backends/x11/meta-backend-x11.c:467
 #12 0x00007f9393e6c39e in g_main_dispatch (context=0x55bc89dd03e0) at ../glib/glib/gmain.c:3179
 #13 0x00007f9393e6c39e in g_main_context_dispatch (context=context@entry=0x55bc89dd03e0) at ../glib/glib/gmain.c:3844
 #14 0x00007f9393e6e1b1 in g_main_context_iterate (context=0x55bc89dd03e0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/glib/gmain.c:3917
 #15 0x00007f9393e6f0c3 in g_main_loop_run (loop=0x55bc8a042640) at ../glib/glib/gmain.c:4111
 #16 0x00007f9393369a0c in meta_run () at ../mutter/src/core/main.c:676
 #17 0x000055bc880f2426 in main (argc=<optimized out>, argv=<optimized out>) at ../gnome-shell/src/main.c:552

Related: https://gitlab.gnome.org/GNOME/mutter/-/issues/338
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/951

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1317
(cherry picked from commit e5ea8f5483)
2020-06-16 16:18:23 +02:00
Jonas Ådahl
0d9ded403f renderer-native: Don't leak DMA buffer CoglFramebuffer
When we created the DMA buffer backed CoglFramebuffer, we handed it over
to CoglDmaBufHandle which took its own reference. What we failed to do
was to release our own reference to it, effectively leaking it.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1283
(cherry picked from commit c823b5ddba)
2020-06-03 08:27:37 +02:00
Florian Müllner
dc75c7d297 Bump version to 3.36.3
Update NEWS.
2020-06-03 01:35:15 +02:00
Jonas Dreßler
33c008b90a clutter/actor: Sanity check new allocations
Apparently some shell extensions are setting invalid NaN allocations,
leading to weird crashes like
https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/1849.

Even though an implementation error like this probably deserves a crash,
those can be hard to debug since the crash can happen anywhere the
allocation is being used later. So let Clutter be the good guy and
prevent implementations from setting invalid allocations by
sanity-checking the ClutterActorBoxes using g_return_if_fail.

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

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1280
2020-06-03 01:35:15 +02:00
Jonas Ådahl
98a0c5cb35 screen-cast-src: Destroy hash dmabuf table after stream
The stream will clean up the buffers, so let it do that before we
destroy them under its feet. Note that it'll only do this after the
following PipeWire commit:

    commit fbaa4ddedd84afdffca16f090dcc4b0db8ccfc29
    Author: Wim Taymans <wtaymans@redhat.com>
    Date:   Mon Jun 1 15:36:09 2020 +0200

        stream: allow NULL param and 0 buffers in disconnect

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1283


(cherry picked from commit 97175f8fa1)
2020-06-02 19:01:01 +00:00
Carlos Garnacho
b425f11536 backends/native: Drop external keyboard detection for ::touch-mode
This cannot be made to work reliably. Some factoids:

- Internal devices may be connected via USB.
- The ACPI spec provides the _PLD (Physical location of device) hook to
  determine how is an USB device connected, with an anecdotal success
  rate. Internal devices may be seen as external and vice-versa, there is
  also an "unknown" value that is widely used.
- There may be non-USB keyboards, the old "AT Translated Set 2 Keyboard"
  interface does not change on hotplugging.
- Libinput has an internal series of quirks to classify keyboards as
  internal of external, also with an "unknown" value.

These heuristics are kinda hopeless to get right by our own hand. Drop
this external keyboard detection in the hope that there will be something
more deterministic to rely on in the future (e.g. the libinput quirks
made available to us directly or indirectly).

Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2378
Related: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2353

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1277


(cherry picked from commit f8e2234ce5)
2020-05-29 14:53:18 +00:00
Carlos Garnacho
a1bc2e0adc backends/x11: Implement ClutterSeat::touch-mode for the X11 backend
This only checks touchscreen availability as we have no access to
tablet-mode switch events as we do on the native backend.

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

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1278


(cherry picked from commit 38bbd9593b)
2020-05-29 14:52:34 +00:00
Jonas Ådahl
63fc71f05b screen-cast-src: Notify about the stream being closed after dispatch
We're iterating inside the PipeWire loop when detecting PipeWire errors,
and shouldn't destroy the PipeWire objects mid-iteration. Avoid this by
first disabling the stream src (effectively stopping the recording),
then notifying about it being closed in an idle callback. The
notification eventually makes the rest of the screen cast code clean up
the objects, including the src and the associated PipeWire objects, but
will do so outside the PipeWire loop iteration.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1251

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1251
(cherry picked from commit c8e12ead08)
2020-05-23 00:04:10 +02:00
Jonas Ådahl
31307720bf stage-x11: Move view management to renderer
In the native backend, the MetaRenderer manages the view by creating one
per CRTC, but until now the MetaStageX11 managed the view for the X11
backend. This caused some issues as it meant meta_renderer_get_views()
not returning anything, and that the view of the X11 screen not being a
MetaRendererView, while in the other backends, all views are.

Fix this by moving the view management responsibility to
MetaRendererX11Cm, and have MetaStageX11 only operate on it via
meta_renderer_x11_cm_*() API. The MetaRendererX11Cm takes care of making
sure the view is always added to the list in the renderer, and turning
X11 screen sizes into "layouts" etc.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1251
(cherry picked from commit 8a541c08fb)
2020-05-23 00:04:10 +02:00
Jonas Ådahl
cb7ba2e90f stage-x11: Clean up include macros
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1251
(cherry picked from commit dfed5f6a11)
2020-05-23 00:04:10 +02:00
Jonas Ådahl
ba1f4221e9 screen-cast-stream-src: Don't throttle if max framerate is 1/0
The max framerate 1/0 means variable without any particular max, so
don't throttle if that was set.

Not doing this would end up with a floating point exception.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1251
(cherry picked from commit 96dd794fd1)
2020-05-23 00:04:10 +02:00
Jonas Ådahl
6e6183ec08 renderer: Change 'set_legacy_view()' to 'add_view()'
"Legacy" is a misleading name, it's just how the native backend and the
X11 backend behaves differently. Instead rename it to 'add_view()' and
add the sanity check to the caller.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1251
(cherry picked from commit 73a436362a)
2020-05-23 00:04:10 +02:00
Carlos Garnacho
493aeb65c8 wayland: Send primary offer to all data devices from the same client
Make the data device track the keyboard focus, and use that list to
forward the primary selection to all data devices from the same
client.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1253

(cherry-pick of commit b45d5ef3f5)

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1262
2020-05-20 11:28:23 +00:00
Carlos Garnacho
36f5a0a491 wayland: Send clipboard offers to all data devices from the same client
Make the data device track the keyboard focus, and use that list to
forward the clipboard selection to all data devices from the same
client.

This is however not the case of DnD data offers, as the semantics
of multiple in-flight offers is unclear.

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

(cherry-pick of commit 7e4e371466)

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1262
2020-05-20 11:28:23 +00:00
Carlos Garnacho
3daf912449 backends: Make uniform checks on remote desktop input dbus methods
They all checked that the remote session service talked with the
correct peer, and some of them did check that there is an associated
screencast session.

Add a new check for the session being started (as it's state is
decoupled with screencast session availability) and move all checks
to a function that is called from all input-oriented DBus methods.

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

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1258


(cherry picked from commit c8837a8de5)
2020-05-20 11:05:51 +00:00
Carlos Garnacho
fadfca2e16 backends: Ensure remote desktop dbus interface state
Ensure that it does receive Start and Stop orderly, and error out
otherwise.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1258


(cherry picked from commit 283cccbe9f)
2020-05-20 11:05:41 +00:00
Daniel van Vugt
b1df6d08a5 backend-x11: Reintroduce XInitThreads
It was removed in 3.34 as part of 6ed5d2e2. And we thought that was the
only thread that might exist and use X11. But the top gnome-shell crasher
in 3.36 seems to suggest otherwise.

We don't know what or where the offending thread is, but since:

 1. We used XInitThreads for years already prior to 3.34; and

 2. Extensions or any change to mutter/gnome-shell could conceivably use
    threads to make X calls, directly or indirectly,

it's probably a good idea to reintroduce XInitThreads. The failing assertion
in libx11 is also accompanied by a strong hint:

```
fprintf(stderr, "[xcb] Most likely this is a multi-threaded client " \
                "and XInitThreads has not been called\n");
```

https://bugs.launchpad.net/bugs/1877075

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1252

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1256

(cherry picked from commit 1d5f9b6917)
2020-05-15 12:49:12 +02:00
Florian Müllner
63bf5f1150 Bump version to 3.36.2
Update NEWS.
2020-04-29 22:22:12 +02:00
Jonas Ådahl
d9d8732096 clutter/stage: Use new paint API to implement capture()
This changes the semantics a bit, e.g. we will never include the pointer
cursor sprite, as there is no way to know whether the caller wants to or
not.

We also change things a bit so that when we render to an offscreen paint
context, we don't emit the "paint" signal on actors, as doing so would
end up recursing in gnome-shell's screenshot and screencast code.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2567

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1222
2020-04-29 18:18:50 +02:00
Jonas Ådahl
797c349245 clutter/paint-context: Add 'no-cursors' paint flag
Will be used by the stage to not paint the overlays. We skip all
overlays since overlays are only ever used for pointer cursors when the
hardware cursors cannot or should not be used.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1222
2020-04-29 18:14:58 +02:00
Jonas Ådahl
b5691d6bf0 stage: Only invoke paint phase callbacks when painting views
These phase callbacks are not intended to be inovked when something
secondary is painting the stage, such as a screen cast stream, or
similar. Thus, only invoke the callbacks when there is a view associated
with the paint context, which will not be the case for offscreen
painting.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1222
2020-04-29 18:14:58 +02:00
Jonas Ådahl
c7ad9b33c2 clutter/stage: Add API to paint to a custom target
Either onto a framebuffer, or into a CPU memory buffer. The latter will
use an former API and then copy the result to CPU memory. The former
allocates an offscreen framebuffer, sets up the relevant framebuffer
matrices and paints part of the stage defined by the passed rectangle.

This will be used by a RecordArea screen cast API. The former to paint
directly onto PipeWire handled dma-buf framebuffers, and the latter for
PipeWire handled shared memory buffers.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1222
2020-04-29 18:14:58 +02:00
Jonas Ådahl
e49297975a stage: Pass paint context in phase callbacks
If there is a paint context available (i.e. for the phases that are
during the actual stage paint), pass it along the callbacks, so that
the callback implementations can change their operation depending on the
paint context state.

This also means we can get the current view from the paint context,
instead of the temporarily used field in the instance struct.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1222
2020-04-29 18:14:58 +02:00
Jonas Ådahl
858c12e73f clutter/paint-context: Add paint flag
A paint flag affects a paint operation in ways defined by the flags.
Currently no flags are defined, so no semantical changes are defined
yet. Eventually a flag aiming to avoid painting of cursors is going to
be added, so that screen cast streams can decide whether to include a
cursor or not.

Changes for gnome-3-36: Removed flag from offscreen context.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1222
2020-04-29 18:14:58 +02:00
Jonas Dreßler
b80b465a65 clutter/stage-cogl: Fix painting the redraw clip with the damage region
The redraw clip that's painted together with the damage region has to be
copied earlier than we do right now. That's because if
PAINT_DAMAGE_REGION is enabled, buffer age is disabled and thus
use_clipped_redraw is FALSE. That means the redraw_clip is updated and
set to the full view-rect. If we copy the queued_redraw_clip after that,
it's also going to be set to the full view-rect. So copy the redraw clip
a bit earlier to make sure we're actually passing the real redraw clip
to paint_damage_region().

Also keep the queued_redraw_clip around a bit longer so it can actually
be used by paint_damage_region() and isn't freed before that.

While at it, move paint_damage_region() from swap_framebuffer() into
clutter_stage_cogl_redraw_view() so we don't have to pass things to
swap_framebuffer() only for debugging.

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

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1208


(cherry picked from commit 793a9d45e1)
2020-04-28 16:46:28 +00:00
Olivier Fourdan
2cc8061f35 keybindings: Mask out the reserved modifiers mask
When switching layouts, special modifiers bits may be be set for
internal use by Xkb.

As we now ignore a set of modifiers when processing the special
modifiers keys, we ought to also mask out those reserved modifiers
otherwise we would discard the [Super] key after switching layouts
in X11.

Closes: https://gitlab.gnome.org/GNOME/mutter/issues/1144
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1219

(cherry picked from commit 61356caa06)
2020-04-27 18:28:19 +02:00
Laurent Bigonville
dbecb93233 compositor: Only include meta-window-actor-wayland.h when building with wayland
https://gitlab.gnome.org/GNOME/mutter/-/issues/1074

(cherry picked from commit d26dc4ae44)
2020-04-27 16:05:45 +02:00
Olivier Fourdan
adbe09afc3 window-actor/x11: Cache the frame bounds
When resizing an X11 window with client side decorations, the shadow is
clipped by the frame bounds so that we don't need to paint the shadow
under the opaque areas covered by the window and its frame.

When the X11 client uses the EMWH synchronization mechanism (like all
gtk-3 based clients), the actual window may not be updated so that the
actual window and it frame may be behind the expected window frame
bounds, which gives the impression of de-synchronized shadows.

To avoid the issue, keep a copy of the frame bounds as a cache and only
update it when the client is not frozen so that the clipping occurs on
the actual content.

Closes: https://gitlab.gnome.org/GNOME/mutter/issues/1178
https://gitlab.gnome.org/GNOME/mutter/merge_requests/1214

(cherry picked from commit bd45a00fa3)
2020-04-27 13:19:08 +02:00
Christian Kirbach
bfe9b333c0 Update German translation 2020-04-24 22:37:32 +00:00
Pekka Paalanen
06b0d41baf kms-impl/simple: Fix page_flip_data ref leak on fallback
If drmModePageFlip() or custom_page_flip_func fails, process_page_flip() was
forgetting to undo the ref taken for that call. This would leak page_flip_data.

The reference counting works like this:
- when created, ref count is 1
- when calling drmModePageFlip, ref count is increased to 2
- new: if flip failed, ref count is decreased back to 1
- if calling schedule_retry_page_flip(), it takes a ref internally
- if calling mode_set_fallback(), it takes a ref internally
- all return FALSE paths have an explicit unref
- return TRUE path has an explicit unref

This issue was found by code inspection and while debugging an unrelated issue
with debug prints sprinkled around. I am not aware of any end-user visible
issues being fixed by this, as the leak is small and probably very rare.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1209
(cherry picked from commit 36111270aa)
2020-04-24 14:19:44 +03:00
Pekka Paalanen
a62fe66a25 kms: Make GSource ready by default
When testing a laptop with intel and DisplayLink devices, attempting to set the
DL output as the only active output resulted in GNOME/Wayland freezing. The
main event loop was running fine, but nothing on screen would get updated once
the DL output become the only one. This patch fixes that issue.

DisplayLink USB 3 devices use an out-of-tree kernel DRM driver called EVDI.
EVDI can sometimes fail drmModePageFlip(). For me, the flip fails reliably when
hotplugging the DL dock and when changing display configuration to DL only.
Mutter has a workaround for failing flips, it just calls drmModeSetCrtc() and
that succeeds.

What does not work reliably in the fallback path is Mutter keeping track of the
pageflip. Since drmModePageFlip() failed, there will not be a pageflip event
coming and instead Mutter queues a callback in its stead. When you have more
than one output, some other output repainting will attempt to swap buffers and
calls wait_for_pending_flips() which has the side-effect of dispatching any
queued flip callbacks. With multiple outputs, you don't get stuck (unless they
all fail the exact same way at the same time?). When you have only one output,
it cannot proceed to repaint and buffer swap because the pageflip is not marked
complete yet. Nothing dispatches the flip callback, leading to the freeze.

The flip callback is intended to be an idle callback, implemented with a
GSource. It is supposed to be called as soon as execution returns to the main
event loop. The setup of the GSource is incomplete, so it will never dispatch.

Fix the GSource setup by setting its ready-time to be always in the past. That
gets it dispatched on the next cycle of the main event loop. This is now the
default behavior for all sources created by meta_kms_add_source_in_impl().
Sources that need a delay continue to do that by overriding the ready-time
explicitly.

An alternative solution could have been to implement GSource prepare and check
callbacks returning TRUE. However, since meta_kms_add_source_in_impl() is used
by flip retry code as well, and that code needs a delay through the ready-time,
I was afraid I might break the flip retry code. Hence I decided to use
ready-time instead.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1209
(cherry picked from commit 6e0cfd3e55)
2020-04-24 14:19:44 +03:00
Carlos Garnacho
5f40493c84 core: Add private function to get the current selection owner
This is a bit untidy to expose, however may be necessary internally.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1186

(cherry picked from commit fbd6366edd)
2020-04-22 01:33:10 +02:00
Carlos Garnacho
e8d9996c9c x11: Allow X11 clients to clear the selection
According to the XSetSelectionOwner libX11 documentation:

  [...] If the owner window it has specified in the request is later
  destroyed, the owner of the selection automatically reverts to None,
  but the last-change time is not affected.

This is indeed visible through the selection_timestamp field in
XFixesSelectionNotify events.

Use this to check whether the selection time is recent-ish (thus
likely coming from an explicit XSetSelectionOwner request) and honor
the client intent by setting a "NULL" owner. If the selection time
is too old, it's definitely an indication of the owner client being
closed, the scenario where we do want the clipboard manager to take
over.

This fixes two usecases:
- X11 LibreOffice / WPS clear the selection each time before copying
  its own content. Mutter's clipboard manager would see each of those
  as a hint to take over, competing with the client over selection
  ownership. This would simply no longer happen
- Password managers may want to clear the selection, which would be
  frustrated by our clipboard manager.

There's a slight window of opportunity for the heuristics to fail
though, if a X11 client sets the selection and closes within 50ms, we
would miss the clipboard manager taking over.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1206

(cherry picked from commit 5671f0a284)
2020-04-22 01:20:11 +02:00
Carlos Garnacho
5465c912c7 x11: Generalize x11 selection owner checks
Shuffle things so the x11 selection can check the current owner directly,
instead of its type.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1206

(cherry picked from commit a7e63bea6c)
2020-04-22 01:20:11 +02:00
Carlos Garnacho
a32bb758f7 x11: Clear X11 selection source after unsetting owner
The X11 selection source was being preserved after unsetting its
ownership. This is no leak as it would be eventually replaced by
another source, or destroyed on finalize. But it's pointless to
keep it.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1206

(cherry picked from commit 94b3c334e5)
2020-04-22 01:20:11 +02:00
Carlos Garnacho
ac8075bbf5 x11: Forward current selection state when initializing X11 selections
Most visible with xwayland-on-demand, at the time of setting things up
for X11 selections, we don't forward the current state. This makes the
first started X11 app oblivious to eg. the current clipboard.

Syncing selections up at the time of initializing the X11 selection
stuff ensures that doesn't happen.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1186

(cherry picked from commit 167fd07e01)
2020-04-22 01:20:11 +02:00
Carlos Garnacho
da9eb4718b wayland: Rely on MetaSelection::owner-changed for .selection event emission
We already have a signal callback that translates selection ownership changes to
data_device/primary .selection events. Given both will be run when a data source
is being replaced, and this event emission being deleted is kinda short sighted
in that in only knows about Wayland, rely entirely on MetaSelection::owner-changed
emission.

Fixes spurious .selection(null) events being sent when a compositor-local source
takes over the selection without the focus changing (eg. screenshot to clipboard).

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1160

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1204

(cherry picked from commit 1363246d44)
2020-04-19 21:51:33 +02:00
Carlos Garnacho
9ad61fe02f wayland: Do not cancel old data source when setting new selection
This is taken care already by the MetaSelection machinery, by
deactivating the previous selection source when setting a new one.
That works across X11 and internal selection sources. This
only works when replacing one wayland source with another, and
actually results in doubly .cancelled events due to the other
paths.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1177

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1203

(cherry picked from commit 0b6560fac4)
2020-04-19 21:51:06 +02:00
Carlos Garnacho
7a09d07b9c wayland: Shuffle wl_data_source.cancelled version checks on DnD
We are meant to send a .cancelled event after the drop is performed
in certain situations, but only for version>3 clients. Since this is
all version 3 business, only set the drop_performed flag for v3
clients. This drops the need to perform version checks at the time
of cancelling (which is present for other usecases in v1).

Fixes emission of wl_data_source.cancelled for v1 clients.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1177

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1203

(cherry picked from commit d4c3870286)
2020-04-19 21:50:48 +02:00
Carlos Garnacho
456e6f345d core: Cater for reading selection in chunks
For the cases where we read a fixed size from the selection (eg. imposing
limits for the clipboard manager), g_input_stream_read_bytes_async() might
not read up to this given size if the other side is spoonfeeding it content.

Cater for multiple read/write cycles here, until (maximum) transfer size is
reached.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1198

(cherry picked from commit 4bdf9a1e70)
2020-04-19 21:48:31 +02:00
Carlos Garnacho
20cf6b630d x11: Do not trust there is task in error paths
Flushing the X11 selection output stream may happen synchronously or
implicitly, in which case there is not a task to complete. Check there
is actually a task before returning errors. We additionally set the
pipe_error flag, so future operations will fail with an error, albeit
with a more generic message.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1198

(cherry picked from commit 1909977a67)
2020-04-19 21:48:09 +02:00
Carlos Garnacho
1e17f8813b x11: Don't stall on write_async()
If a write_async() comes up while we are flushing on the background,
the task will be queued, but not deemed a reason on itself to keep
flushing (and finish the task) after a property delete event.

To fix this, do not ever queue up write_async tasks (this leaves
priv->pending_task only used for flush(), so the "flush to end"
behavior in the background is consistent). We only start a
background flush if there's reasons to do it, but the tasks are
immediately finished.

All data will still be ensured to be transfered on flush/close,
this makes the caller in this situation still able to reach to it.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1198

(cherry picked from commit 655a783891)
2020-04-19 21:47:49 +02:00
Carlos Garnacho
d985517573 x11: Fix iterative INCR property checks
It does not make sense to check for the stream not being closed,
this might happen multiple times during the lifetime of the stream
for a single transfer. We want to notify the INCR transfer just
once.

Check for the explicit conditions that we want, that the remaining
data is bigger than we can transfer at once, and that we are not
yet within the INCR transfer.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1198

(cherry picked from commit a4596becc4)
2020-04-19 21:47:27 +02:00
Carlos Garnacho
107bb3d9c2 x11: Don't exceed transfer size in INCR chunks
The stream automatically flushes after data size exceeds the
size we deem for INCR chunks, but we still try to copy it all.
Actually limit the data we copy, and leave the rest for future
INCR chunks.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1198

(cherry picked from commit 7015bb3efd)
2020-04-19 21:47:06 +02:00
Carlos Garnacho
b1c47c6213 x11: Don't invariably queue a pending delete request
We don't need doing this roundtrip for non-INCR transfers.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1198

(cherry picked from commit d2c762cc66)
2020-04-19 21:46:36 +02:00
Carlos Garnacho
c43f178495 x11: Finish INCR transfers properly
INCR transfers are mandated to finish with a final 0-size XChangeProperty
roundtrip after the final data chunk. Actually honor this and ensure we
iterate just once more for this.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1198

(cherry picked from commit 04d429b743)
2020-04-19 21:46:14 +02:00
Carlos Garnacho
c46bea9dff x11: Wait till data is flushed before notifying on the pending task
It does not make sense to notify flushes mid-transfer. We should wait
till the data is actually finished before notifying on the pending
task.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1198

(cherry picked from commit 0b21dcfe08)
2020-04-19 21:45:36 +02:00
Carlos Garnacho
622e8c348f x11: Only send SelectionNotify on first INCR chunk
This should only be sent if the selection can be sent at once, or
if we are right about to notify on the first chunk of an INCR
transfer.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1198

(cherry picked from commit 7c939d78c2)
2020-04-19 21:45:15 +02:00
Carlos Garnacho
51b65b98f5 x11: Ensure flush() Flushes all output stream data
This seemed to work under the assumption that a flush() call can
only result in one INCR roundtrip. This is evidently not true, so
we should hold things off until all pending data is actually flushed.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1198

(cherry picked from commit 8a2b82897d)
2020-04-19 21:44:42 +02:00
Carlos Garnacho
7ec0a9dd68 x11: Unset pending flush flag right before notifying on task
Together with some other state. We can do this altogether on task
notification, instead of lost somewhere in this function flow.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1198

(cherry picked from commit e95c365cf0)
2020-04-19 21:44:23 +02:00
Carlos Garnacho
6ce42e100f x11: Intern INCR atom
We want to use it, despite it not existing previously.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1198

(cherry picked from commit a32cb7133b)
2020-04-19 21:44:06 +02:00
Carlos Garnacho
13a23f16c1 x11: Flag flushes despite having less than the element size
If say we want 32bit data, but have 2 bytes stored, we would simply
ignore flush requests. Allow (and don't clear) the needs_flush flag
if we have less than the element size accumulated.

Instead handle this in can_flush(), so it's triggered whenever we
have enough data to fill 1 element, or if the stream is closing
(seems a broken situation, but triggered by the caller).

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1198

(cherry picked from commit 967966cdee)
2020-04-19 21:43:45 +02:00
Carlos Garnacho
40dc22659b x11: XMaxRequestSize returns 4-byte units
XMaxRequestSize/XMaxExtendedRequestSize are documented to return
the maximum size in 4-byte units, whereas we are comparing this
to byte lenghts. We can afford 4x the data here.

Since I don't know the payload size of the XChangeProperty request,
be generous and allot 400 bytes for it, we have some to spare.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1198

(cherry picked from commit 06d67b6abf)
2020-04-19 21:43:20 +02:00
Marco Trevisan (Treviño)
fdcb68f4d0 monitor-unit-tests: Ensure configuration is preserved in laptop with closed lid
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1200


(cherry picked from commit f15ce01e2b)
2020-04-16 16:09:54 +00:00
Marco Trevisan (Treviño)
17491bae06 monitor-config-manager: Fallback to closed laptop lid configuration
When closing the lid of a laptop, we reconfigure all the monitors in order
to update the CRTCs and (if enabled) the global UI scaling factor.

To do this, we try first to reuse the current configuration for the usable
monitors, but if we have only monitor enabled and this one is on the laptop
lid we just end up creating a new configuration where the primary monitor is
the laptop one (as per find_primary_monitor() in MetaMonitorConfigManager),
but ignoring the user parameters.

In case the user selected a different resolution / scaling compared to the
default one, while the laptop lid is closed we might change the monitors
layout, causing applications to rescale or reposition.

To avoid this, when creating the monitors configuration from the current
current state, in case we have only one monitor available and that one is
the laptop panel, let's just reuse this configuration.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1200


(cherry picked from commit e48516679c)
2020-04-16 16:09:38 +00:00
Jonas Ådahl
568876da95 cursor-renderer-native: Take CRTC transform into account
The CRTC level transform (not necessarily the hw transform) must be
taken into account when calculating the position of the CRTC in the
stage coordinate space, when placing the hw cursor, otherwise we'll
place the cursor as if the monitor was not rotated.

This wasn't a problem in the past, as with rotation, we always used the
OpenGL cursor, so the issue newer showed.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1199
2020-04-15 17:53:50 +02:00
Jonas Ådahl
ea546a8b90 renderer-native: Use CRTC layout in stage view
The port to per CRTC views was incomplete; we still used the logical
monitor layout as the stage view layout, while still using one view per
CRTC.

This worked fine for most cases, e.g. regular monitors, tiled or
non-tiled, transformed or non-transformed. Where it broke, however, was
when a monitor consists of multiple CRTCs. We already have the layout a
CRTC corresponds to on the stage kept with the CRTC metadata, so use
this directly.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1170

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1199`
2020-04-15 17:53:50 +02:00
Jonas Ådahl
e8f29a3336 tests/monitor-unit-tests: Test non-hw-transform rotated tiled monitors
Should affect the assigned transform, but not the layout, as that is the
layout on the stage, not the coordinates in any buffer.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1199
2020-04-15 17:53:50 +02:00
Jonas Ådahl
5e9986bbcb monitor-config-manager: Only use crtc transform for assignment
The CRTC level transform (i.e. not necessarily the one set on the
hardware) is what is relevant for calculating the layout the CRTC will
have on the stage, so only use the one that can be handled by the
hardware for the CRTC assignment.

This makes the CRTC layout valid for tiled monitors.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1199
2020-04-15 17:53:50 +02:00
Jonas Ådahl
3edf6a5292 monitor: Fix tile coordinate calculation
Previously the tile coordinate was used to offset a CRTC scanout
coordinate within a larger framebuffer. Since 3.36 we're always
scanning out from (0, 0) as we always have one framebuffer per CRTC; we
instead use the tile coordinate to calculate the coordinate the tile has
in the stage view. Adapt calculation to fulfil this promise instead of
the old one.

This also corrects the tiled custom monitor test case.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1199
2020-04-15 17:53:50 +02:00
Phillip Wood
ad500ef4e5 input-settings: fix device list iteration
Dereference the loop variable rather than the original list head. This
fixes a regression introduced in 4413b86a3 ("backends: Replace
ClutterDeviceManager usage in favor of ClutterSeat", 2019-10-04) which
broke button scrolling with trackballs.

Closes:https://gitlab.gnome.org/GNOME/mutter/-/issues/1120

(cherry picked from commit 3e967d731a)
2020-04-12 23:43:01 +02:00
Olivier Fourdan
9a2471db47 wayland: preserve xkb_state on VT switch
On VT switch, the devices are removed, which means for Wayland disabling
the keyboard.

When the keyboard is disabled, the associated `xkb_state` is freed and
recreated whenever the keyboard is re-enabled when switching back to the
compositor VT.

That means the `xkb_state` for Wayland is lost whereas the same for
clutter is kept, which causes to a discrepancy with locked modifiers on
VT switch.

To avoid that issue, preserve the XKB info only to dispose it when the
keyboard is eventually finalized.

Closes: https://gitlab.gnome.org/GNOME/mutter/issues/344
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1185


(cherry picked from commit 5b30a52bbd)
2020-04-08 14:04:02 +00:00
Carlos Garnacho
db164bcfa2 wayland/xdnd: Add error traps around Xdnd* IPC
Make all of them spew criticals, except for XdndLeave as it's feasible
to expect the window we are sending the event to did disappear in the
way (eg. if the window is destroyed while the DnD operation is ongoing
and the pointer is over the window).

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

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1184
2020-04-07 20:38:02 +02:00
Jonas Troeger
83553e3f6e backends/native: Translate coordinates of absolute motion events
The motion events of tablets for example need to be mapped on the
selected screen area if the input device is configured to use only a
part of the active logical monitor.
To achieve this behavior each motion event is transformed using the
transformation matrix set for the input device.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1118
2020-04-07 20:37:53 +02:00
Carlos Garnacho
3b2f6ae93d backends/x11: Fix access to WacomDevice
At some point we crossed the streams... In a short timespan we had
1f00aba92c merged, pushing WacomDevice to a common parent object,
and dcaa45fc0c implementing device grouping for X11.

The latter did not rely on the former, and just happened to
merge/compile without issues, but would promptly trigger a crash
whenever the API would be used.

Drop all traces of the WacomDevice internal to MetaInputDeviceX11.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1183


(cherry picked from commit f0718c7d95)
2020-04-07 17:48:09 +00:00
Jonas Dreßler
bc47f0a1ac clutter/stage: Don't assume stage relayouts reallocate everything
With the introduction of "shallow" relayouts, we are now able to enter
allocation cycles not only at the stage but also deeper down the
hierarchy if we know an actors allocation isn't affected by its children
since the NO_LAYOUT flag is set.

Now that means when queuing relayouts it's possible that
`priv->needs_allocation` gets set to TRUE for some actors down the
hierarchy, but not for actors higher up in the hierarchy. An actor tree
where that happens could look like that:

stage -> container -> container2 (NO_LAYOUT) -> textActor

With that tree, if the "textActor" queues a relayout, "container2" will
be added to the relayout hashtable of the stage and the actors "stage"
and "container" will have `priv->needs_allocation` set to FALSE.

Now if another relayout on the stage actor is queued,
`clutter_stage_queue_actor_relayout()` currently removes all the other
hashtable entries in favour of the stage entry, (wrongly) assuming that
will allocate everything. It doesn't allocate everything because in the
example above "container" has `priv->needs_allocation` set to FALSE,
which makes clutter_actor_allocate() return early before allocating its
children, so in the end "container2" will never get a new allocation.

To fix this, stop flushing the relayout hashtable when queuing a
stage-relayout and still add new entries to the hashtable if a stage
relayout is already queued to make sure we still go through all the
previously queued "shallow" relayouts. That shouldn't hurt performance,
too, because as soon as an actor got allocated once, it doesn't need an
allocation anymore and should bail out in clutter_actor_allocate() as
long as it's absolute position didn't change.

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

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1173


(cherry picked from commit e74c2e42cf)
2020-04-07 16:47:32 +00:00
Jonas Ådahl
c8986d19e5 window: Check aliveness a bit less aggressively
Currently we check whether a window is alive everytime it's focused.
This means that an application that doesn't respond to the check-alive
event during startup always showing the "application froze" dialog,
without the user ever trying to interact with it.

An example where this tends to to happen is with games, and for this
particular scenario, it's purely an annoyance, as I never tried to
interact with the game window in the first place, so I don't care that
it's not responding - it's loading.

To avoid these unnecessary particular "app-is-frozen" popups, remove the
alive check from the focus function, and instead move it back to the
"meta_window_activate_full()" call. To also trigger it slightly more
often, also add it to the path that triggers the window focus when a
user actively clicks on the window.

This means that we currently check whether a window is alive on:

  * Any time the window is activated. This means e.g. alt-tab or
    selecting the window in the overview.
  * The user clicks on the window.

Note that the second only works for an already focused window on
Wayland, as on X11, we don't refocus it. This particular case isn't
changed with this commit, as we didn't call meta_window_focus() to begin
with here.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1182


(cherry picked from commit 8df3b21a51)
2020-04-07 13:23:21 +00:00
Christian Rauch
7baabc7ed0 x11: fix compilation if 'libwacom=false'
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1168


(cherry picked from commit a8f6cada88)
2020-04-06 14:57:57 +00:00
Dušan Kazik
b0709504ea Update Slovak translation 2020-04-05 20:22:08 +00:00
Jonas Ådahl
7e94311e2e window-actor: Set viewport when blitting to screencast fb
This fixes an issue where a non-maximized screen casted window would be
stretched to fill the whole screen cast stream, instead of just the crop
that corresponds to the current window size.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1174


(cherry picked from commit a6f94696e2)
2020-04-03 16:30:26 +00:00
Simon McVittie
e339a57ddf cogl: Defend against empty or unallocated framebuffers
It isn't immediately obvious that this is impossible, because there's some
"action at a distance" going on with framebuffers that have their size
set lazily, after their textures get allocated; so let's make this a
critical warning rather than crashing.

In particular, this works around a crash when gnome-shell tries to blur a
background that hasn't yet had any space allocated for it - which it seems
is really an actor layout bug, but more robustness seems good to have.

Workaround for <https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2538>.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1172

Signed-off-by: Simon McVittie <smcv@debian.org>

(cherry picked from commit c389aadff9)
2020-04-03 13:49:34 +02:00
Simon McVittie
e3b2b90c72 cogl: Don't allow creating sized textures with 0 pixels
A texture with no pixels isn't a useful thing to have, and breaks
assumptions elsewhere. For example, CoglFramebuffer assumes that after
a texture has been allocated, it will have width and height both greater
than 0.

In particular, this works around a crash when gnome-shell tries to blur a
background that hasn't yet had any space allocated for it - which it seems
is really an actor layout bug, but more robustness seems good to have.

Workaround for <https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2538>.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1172

Signed-off-by: Simon McVittie <smcv@debian.org>

(cherry picked from commit 37eda498f2)
2020-04-03 13:48:46 +02:00
Daniel van Vugt
6f094bd399 clutter/master-clock-default: Sync timelines to hardware vsync
Previously clutter timelines advanced according to `g_source_get_time`.
But that meant the spatial stepping of animations was visibly sensitive to
any irregularities in the main loop. It also represented a time older [1]
than the intended presentation time of each frame.

Now we instead use `master_clock_get_next_presentation_time`. This ensures
we get the smoothness of hardware vsync as well as being closer to the
actual presentation time.

This means, for example, backends like Xorg that move the hardware cursor
independently of repaints will have their animations more closely matching
the hardware cursor position. So the cursor appears to stick more closely
when dragging windows or on the lock screen etc.

[1] "older" = (refresh_interval - sync_delay) = ~14ms for 60Hz

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

https://gitlab.gnome.org/GNOME/mutter/merge_requests/724
2020-04-03 10:59:36 +00:00
Daniel van Vugt
2c805524b4 clutter/stage: Add API to get_next_presentation_time
https://gitlab.gnome.org/GNOME/mutter/merge_requests/724
2020-04-03 10:59:36 +00:00
Andre Moreira Magalhaes
95c1baf3d1 clutter/click-action: Do not process captured event if action is disabled
Disabling a click action after a button-press but before a
button-release is captured makes ClutterClickAction connect to
captured-event and never disconnect.

This change fixes it by making sure the captured-event is only
processed if the action is still enabled, otherwise releasing
the action (reset state) and propagating the event.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1170


(cherry picked from commit 5f5ce08ba4)
2020-04-02 17:09:24 +00:00
Georges Basile Stavracas Neto
6f9b5edd4d tests/actor-pick: Allocate actor before picking
Picking now only happens on allocated actors, but the
callback in the actor-pick test is not waiting for the
stage to run an allocation cycle. Ideally, we'd wait
for this cycle, but for now, forcing an allocation works
as well.

Allocate the overlay actor in the actor-pick test.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1169


(cherry picked from commit 7f488e3e1d)
2020-03-31 23:13:42 +00:00
Georges Basile Stavracas Neto
31809e1214 tests/actor-pick: Remove tabs
They're evil.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1169


(cherry picked from commit 059d2144b2)
2020-03-31 23:13:15 +00:00
Andre Moreira Magalhaes
82f3bdd14e clutter/actor: Fix pick when actor is not allocated
When selecting the pick regions for an actor we were not considering
whether the actor was allocated and that was causing issues where the
preferred width/height of the actor was used when deciding whether
the actor should be considered as a pick target.

Check if the actor has a valid allocation, in addition to being mapped
and being in pick mode, in clutter_actor_should_pick_paint().

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1169


(cherry picked from commit 902302a174)
2020-03-31 23:12:44 +00:00
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
256 changed files with 6957 additions and 3132 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:

102
NEWS
View File

@@ -1,3 +1,105 @@
3.36.4
======
* Fix crash on area screenshots with fractional scaling [Sebastian; !1320]
* Do not paint textures of fully obscured windows [Robert; !1326]
* Turn off CRTCs as well when enabling DPMS [Michel; !1240]
* Improve selection support
[Robert, Carlos, Sebastian; !1330, !1193, !1253, !1255, !1293, !1350]
* Use a more appropriate combine function on opaque areas [Daniel; !1331]
* Fix remote desktop being broken without screencast session [Olivier; #1307]
* Fix popovers disappearing on wayland and HiDPI [Robert; #1312]
* Fixed crashes [Jonas Å.; !1317]
* Plugged memory leaks [Jonas Å.; !1283]
* Misc. bug fixes and cleanups
[Corentin, Sebastian, Jonas Å., Jonas D.; !1314, !1321, !1295, !1333]
Contributors:
Jonas Dreßler, Michel Dänzer, Olivier Fourdan, Carlos Garnacho,
Sebastian Keller, Robert Mader, Corentin Noël, Daniel van Vugt, Jonas Ådahl
3.36.3
======
* Broadcast clipboard/primary offers [Carlos; !1262]
* Fix monitor screen cast on X11 [Jonas Å.; !1251]
* Implement touch-mode detecation for the X11 backend [Carlos; !1278]
* Drop external keyboard detection from touch-mode heuristics [Carlos; !1277]
* Fix leaked DMA buffers in screencasts [Jonas; !1283]
* Fixed crashes [Daniel, Carlos, Jonas D.; !1256, !1258, !1280]
Contributors:
Carlos Garnacho, Daniel van Vugt, Jonas Ådahl
3.36.2
======
* Sync timelines to hardware vsync [Daniel; !724]
* Fix screencasting non-maximized windows [Jonas; !1174]
* Make window-aliveness checks less aggressive [Jonas; !1182]
* Fix stylus coordinates when using screen rotation [Jonas T.; #1118]
* Preserve keyboard state on VT switch [Olivier; !1185]
* Fix trackball button scrolling [Phillip; #1120]
* Fix tiled monitor support [Jonas Å.; !1199]
* Fix various clipboard issues [Carlos; !1198, !1203, !1204, !1186, !1206]
* Synchronize shadows to server-side decorations [Olivier; !1214]
* Fix overview key on X11 when using multiple keyboard layouts [Olivier; !1219]
* Fix capturing with multiple stage views [Jonas Å.; !1222]
* Fixed crashes [Jonas D., Carlos; !1173, !1183]
* Misc. bug fixes and cleanups [Andre, Georges, Simon, Christian, Carlos, Marco,
Pekka, Laurent, Jonas D.; !1169, !1170, !1172, !1168, !1184, !1200, !1209,
#1074, !1208]
Contributors:
Marco Trevisan (Treviño), Laurent Bigonville, Jonas Dreßler, Olivier Fourdan,
Carlos Garnacho, Andre Moreira Magalhaes, Simon McVittie,
Georges Basile Stavracas Neto, Pekka Paalanen, Christian Rauch, Jonas Troeger,
Daniel van Vugt, Phillip Wood, Jonas Ådahl
Translators:
Dušan Kazik [sk], Christian Kirbach [de]
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]

View File

@@ -710,6 +710,7 @@ struct _ClutterActorPrivate
guint8 opacity;
gint opacity_override;
unsigned int inhibit_culling_counter;
ClutterOffscreenRedirect offscreen_redirect;
@@ -2409,6 +2410,7 @@ clutter_actor_should_pick_paint (ClutterActor *self)
g_return_val_if_fail (CLUTTER_IS_ACTOR (self), FALSE);
if (CLUTTER_ACTOR_IS_MAPPED (self) &&
clutter_actor_has_allocation (self) &&
(_clutter_context_get_pick_mode () == CLUTTER_PICK_ALL ||
CLUTTER_ACTOR_IS_REACTIVE (self)))
return TRUE;
@@ -2602,6 +2604,9 @@ clutter_actor_set_allocation_internal (ClutterActor *self,
gboolean retval;
ClutterActorBox old_alloc = { 0, };
g_return_val_if_fail (!isnan (box->x1) && !isnan (box->x2) &&
!isnan (box->y1) && !isnan (box->y2), FALSE);
obj = G_OBJECT (self);
g_object_freeze_notify (obj);
@@ -3951,6 +3956,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));
@@ -4099,7 +4105,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
@@ -4190,7 +4197,9 @@ clutter_actor_continue_paint (ClutterActor *self,
clutter_paint_node_unref (dummy);
/* XXX:2.0 - Call the paint() virtual directly */
if (g_signal_has_handler_pending (self, actor_signals[PAINT],
if (!(clutter_paint_context_get_paint_flags (paint_context) &
CLUTTER_PAINT_FLAG_NO_PAINT_SIGNAL) &&
g_signal_has_handler_pending (self, actor_signals[PAINT],
0, TRUE))
g_signal_emit (self, actor_signals[PAINT], 0, paint_context);
else
@@ -10360,6 +10369,11 @@ clutter_actor_allocate (ClutterActor *self,
old_allocation = priv->allocation;
real_allocation = *box;
g_return_if_fail (!isnan (real_allocation.x1) &&
!isnan (real_allocation.x2) &&
!isnan (real_allocation.y1) &&
!isnan (real_allocation.y2));
/* constraints are allowed to modify the allocation only here; we do
* this prior to all the other checks so that we can bail out if the
* allocation did not change
@@ -16002,6 +16016,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
@@ -17715,10 +17786,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;

View File

@@ -884,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

@@ -475,8 +475,10 @@ get_preferred_size_for_orientation (ClutterBoxLayout *self,
ClutterActor *child;
gint n_children = 0;
gfloat minimum, natural;
float largest_min_size, largest_nat_size;
minimum = natural = 0;
largest_min_size = largest_nat_size = 0;
clutter_actor_iter_init (&iter, container);
while (clutter_actor_iter_next (&iter, &child))
@@ -491,8 +493,22 @@ get_preferred_size_for_orientation (ClutterBoxLayout *self,
get_child_size (child, priv->orientation,
for_size, &child_min, &child_nat);
minimum += child_min;
natural += child_nat;
if (priv->is_homogeneous)
{
largest_min_size = MAX (largest_min_size, child_min);
largest_nat_size = MAX (largest_nat_size, child_nat);
}
else
{
minimum += child_min;
natural += child_nat;
}
}
if (priv->is_homogeneous)
{
minimum = largest_min_size * n_children;
natural = largest_nat_size * n_children;
}
if (n_children > 1)
@@ -623,6 +639,8 @@ get_preferred_size_for_opposite_orientation (ClutterBoxLayout *self,
}
else
{
size -= (nvis_children - 1) * priv->spacing;
/* Bring children up to size first */
if (isnormal (size) || size == 0)
{

View File

@@ -346,6 +346,12 @@ on_captured_event (ClutterActor *stage,
ClutterModifierType modifier_state;
gboolean has_button = TRUE;
if (!clutter_actor_meta_get_enabled (CLUTTER_ACTOR_META (action)))
{
clutter_click_action_release (action);
return CLUTTER_EVENT_PROPAGATE;
}
actor = clutter_actor_meta_get_actor (CLUTTER_ACTOR_META (action));
switch (clutter_event_type (event))

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

@@ -29,10 +29,10 @@
* of #ClutterMasterClock.
*/
#include <cogl/cogl-trace.h>
#include "clutter-build-config.h"
#include <cogl/cogl.h>
#include "clutter-master-clock.h"
#include "clutter-master-clock-default.h"
#include "clutter-debug.h"
@@ -190,6 +190,26 @@ master_clock_get_swap_wait_time (ClutterMasterClockDefault *master_clock)
}
}
static int64_t
master_clock_get_next_presentation_time (ClutterMasterClockDefault *master_clock)
{
ClutterStageManager *stage_manager = clutter_stage_manager_get_default ();
const GSList *stages, *l;
int64_t earliest = -1;
stages = clutter_stage_manager_peek_stages (stage_manager);
for (l = stages; l != NULL; l = l->next)
{
gint64 t = _clutter_stage_get_next_presentation_time (l->data);
if (earliest == -1 || (t != -1 && t < earliest))
earliest = t;
}
return earliest;
}
static void
master_clock_schedule_stage_updates (ClutterMasterClockDefault *master_clock)
{
@@ -466,7 +486,11 @@ clutter_clock_dispatch (GSource *source,
COGL_TRACE_BEGIN (ClutterMasterClockTick, "Master Clock (tick)");
/* Get the time to use for this frame */
master_clock->cur_tick = g_source_get_time (source);
master_clock->cur_tick = master_clock_get_next_presentation_time (master_clock);
/* On the first frame the backend might not have an answer */
if (master_clock->cur_tick <= 0)
master_clock->cur_tick = g_source_get_time (source);
#ifdef CLUTTER_ENABLE_DEBUG
master_clock->remaining_budget = master_clock->frame_budget;

View File

@@ -30,6 +30,7 @@
#include "clutter-input-device-private.h"
#include "clutter-input-pointer-a11y-private.h"
#include "clutter-macros.h"
#include "clutter-paint-context-private.h"
#include "clutter-private.h"
#include "clutter-stage-private.h"
#include "clutter-stage-view.h"
@@ -48,6 +49,23 @@ void clutter_stage_capture_into (ClutterStage *stage,
cairo_rectangle_int_t *rect,
uint8_t *data);
CLUTTER_EXPORT
void clutter_stage_paint_to_framebuffer (ClutterStage *stage,
CoglFramebuffer *framebuffer,
const cairo_rectangle_int_t *rect,
float scale,
ClutterPaintFlag paint_flags);
CLUTTER_EXPORT
gboolean clutter_stage_paint_to_buffer (ClutterStage *stage,
const cairo_rectangle_int_t *rect,
float scale,
uint8_t *data,
int stride,
CoglPixelFormat format,
ClutterPaintFlag paint_flags,
GError **error);
CLUTTER_EXPORT
void clutter_stage_freeze_updates (ClutterStage *stage);

View File

@@ -20,11 +20,22 @@
#include "clutter-paint-context.h"
typedef enum _ClutterPaintFlag
{
CLUTTER_PAINT_FLAG_NONE = 0,
CLUTTER_PAINT_FLAG_NO_CURSORS = 1 << 0,
CLUTTER_PAINT_FLAG_NO_PAINT_SIGNAL = 1 << 1,
} ClutterPaintFlag;
ClutterPaintContext * clutter_paint_context_new_for_view (ClutterStageView *view,
const cairo_region_t *redraw_clip);
const cairo_region_t *redraw_clip,
ClutterPaintFlag paint_flags);
gboolean clutter_paint_context_is_drawing_off_stage (ClutterPaintContext *paint_context);
CoglFramebuffer * clutter_paint_context_get_base_framebuffer (ClutterPaintContext *paint_context);
CLUTTER_EXPORT
ClutterPaintFlag clutter_paint_context_get_paint_flags (ClutterPaintContext *paint_context);
#endif /* CLUTTER_PAINT_CONTEXT_PRIVATE_H */

View File

@@ -23,6 +23,8 @@ struct _ClutterPaintContext
{
grefcount ref_count;
ClutterPaintFlag paint_flags;
GList *framebuffers;
ClutterStageView *view;
@@ -36,7 +38,8 @@ G_DEFINE_BOXED_TYPE (ClutterPaintContext, clutter_paint_context,
ClutterPaintContext *
clutter_paint_context_new_for_view (ClutterStageView *view,
const cairo_region_t *redraw_clip)
const cairo_region_t *redraw_clip,
ClutterPaintFlag paint_flags)
{
ClutterPaintContext *paint_context;
CoglFramebuffer *framebuffer;
@@ -45,6 +48,7 @@ clutter_paint_context_new_for_view (ClutterStageView *view,
g_ref_count_init (&paint_context->ref_count);
paint_context->view = view;
paint_context->redraw_clip = cairo_region_copy (redraw_clip);
paint_context->paint_flags = paint_flags;
framebuffer = clutter_stage_view_get_framebuffer (view);
clutter_paint_context_push_framebuffer (paint_context, framebuffer);
@@ -62,6 +66,8 @@ clutter_paint_context_new_for_framebuffer (CoglFramebuffer *framebuffer)
paint_context = g_new0 (ClutterPaintContext, 1);
g_ref_count_init (&paint_context->ref_count);
paint_context->paint_flags = (CLUTTER_PAINT_FLAG_NO_CURSORS |
CLUTTER_PAINT_FLAG_NO_PAINT_SIGNAL);
clutter_paint_context_push_framebuffer (paint_context, framebuffer);
@@ -170,3 +176,12 @@ clutter_paint_context_is_drawing_off_stage (ClutterPaintContext *paint_context)
return !paint_context->view;
}
/**
* clutter_paint_context_get_paint_flags: (skip)
*/
ClutterPaintFlag
clutter_paint_context_get_paint_flags (ClutterPaintContext *paint_context)
{
return paint_context->paint_flags;
}

View File

@@ -682,7 +682,6 @@ clutter_seat_warp_pointer (ClutterSeat *seat,
* 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

View File

@@ -78,6 +78,7 @@ void _clutter_stage_schedule_update (ClutterStage *stage);
gint64 _clutter_stage_get_update_time (ClutterStage *stage);
void _clutter_stage_clear_update_time (ClutterStage *stage);
gboolean _clutter_stage_has_full_redraw_queued (ClutterStage *stage);
int64_t _clutter_stage_get_next_presentation_time (ClutterStage *stage);
void clutter_stage_log_pick (ClutterStage *stage,
const graphene_point_t *vertices,

View File

@@ -178,6 +178,22 @@ _clutter_stage_window_clear_update_time (ClutterStageWindow *window)
iface->clear_update_time (window);
}
int64_t
_clutter_stage_window_get_next_presentation_time (ClutterStageWindow *window)
{
ClutterStageWindowInterface *iface;
g_return_val_if_fail (CLUTTER_IS_STAGE_WINDOW (window), 0);
iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window);
/* If not implemented then just revert to the old behaviour... */
if (iface->get_next_presentation_time == NULL)
return _clutter_stage_window_get_update_time (window);
return iface->get_next_presentation_time (window);
}
void
_clutter_stage_window_set_accept_focus (ClutterStageWindow *window,
gboolean accept_focus)

View File

@@ -61,6 +61,8 @@ struct _ClutterStageWindowInterface
GList *(* get_views) (ClutterStageWindow *stage_window);
int64_t (* get_frame_counter) (ClutterStageWindow *stage_window);
void (* finish_frame) (ClutterStageWindow *stage_window);
int64_t (* get_next_presentation_time) (ClutterStageWindow *stage_window);
};
ClutterActor * _clutter_stage_window_get_wrapper (ClutterStageWindow *window);
@@ -101,6 +103,8 @@ void _clutter_stage_window_finish_frame (ClutterStageWin
int64_t _clutter_stage_window_get_frame_counter (ClutterStageWindow *window);
int64_t _clutter_stage_window_get_next_presentation_time (ClutterStageWindow *window);
G_END_DECLS
#endif /* __CLUTTER_STAGE_WINDOW_H__ */

View File

@@ -78,7 +78,6 @@
#include "clutter-private.h"
#include "cogl/cogl.h"
#include "cogl/cogl-trace.h"
struct _ClutterStageQueueRedrawEntry
{
@@ -935,7 +934,8 @@ clutter_stage_do_paint_view (ClutterStage *stage,
ClutterPaintContext *paint_context;
cairo_rectangle_int_t clip_rect;
paint_context = clutter_paint_context_new_for_view (view, redraw_clip);
paint_context = clutter_paint_context_new_for_view (view, redraw_clip,
CLUTTER_PAINT_FLAG_NONE);
cairo_region_get_extents (redraw_clip, &clip_rect);
setup_view_for_pick_or_paint (stage, view, &clip_rect);
@@ -1321,15 +1321,9 @@ clutter_stage_queue_actor_relayout (ClutterStage *stage,
{
ClutterStagePrivate *priv = stage->priv;
if (g_hash_table_contains (priv->pending_relayouts, stage))
return;
if (g_hash_table_size (priv->pending_relayouts) == 0)
_clutter_stage_schedule_update (stage);
if (actor == (ClutterActor *) stage)
g_hash_table_remove_all (priv->pending_relayouts);
g_hash_table_add (priv->pending_relayouts, g_object_ref (actor));
priv->pending_relayouts_version++;
}
@@ -3752,6 +3746,21 @@ _clutter_stage_clear_update_time (ClutterStage *stage)
_clutter_stage_window_clear_update_time (stage_window);
}
int64_t
_clutter_stage_get_next_presentation_time (ClutterStage *stage)
{
ClutterStageWindow *stage_window;
if (CLUTTER_ACTOR_IN_DESTRUCTION (stage))
return 0;
stage_window = _clutter_stage_get_window (stage);
if (stage_window == NULL)
return 0;
return _clutter_stage_window_get_next_presentation_time (stage_window);
}
ClutterPaintVolume *
_clutter_stage_paint_volume_stack_allocate (ClutterStage *stage)
{
@@ -4349,6 +4358,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,6 +4473,100 @@ clutter_stage_get_capture_final_size (ClutterStage *stage,
return TRUE;
}
/**
* clutter_stage_paint_to_framebuffer: (skip)
*/
void
clutter_stage_paint_to_framebuffer (ClutterStage *stage,
CoglFramebuffer *framebuffer,
const cairo_rectangle_int_t *rect,
float scale,
ClutterPaintFlag paint_flags)
{
ClutterStagePrivate *priv = stage->priv;
ClutterPaintContext *paint_context;
cairo_region_t *redraw_clip;
redraw_clip = cairo_region_create_rectangle (rect);
paint_context = clutter_paint_context_new_for_framebuffer (framebuffer);
cairo_region_destroy (redraw_clip);
cogl_framebuffer_push_matrix (framebuffer);
cogl_framebuffer_set_projection_matrix (framebuffer, &priv->projection);
cogl_framebuffer_set_viewport (framebuffer,
-(rect->x * scale),
-(rect->y * scale),
priv->viewport[2] * scale,
priv->viewport[3] * scale);
clutter_actor_paint (CLUTTER_ACTOR (stage), paint_context);
cogl_framebuffer_pop_matrix (framebuffer);
clutter_paint_context_destroy (paint_context);
}
/**
* clutter_stage_paint_to_buffer: (skip)
*/
gboolean
clutter_stage_paint_to_buffer (ClutterStage *stage,
const cairo_rectangle_int_t *rect,
float scale,
uint8_t *data,
int stride,
CoglPixelFormat format,
ClutterPaintFlag paint_flags,
GError **error)
{
ClutterBackend *clutter_backend = clutter_get_default_backend ();
CoglContext *cogl_context =
clutter_backend_get_cogl_context (clutter_backend);
int texture_width, texture_height;
CoglTexture2D *texture;
CoglOffscreen *offscreen;
CoglFramebuffer *framebuffer;
CoglBitmap *bitmap;
texture_width = (int) roundf (rect->width * scale);
texture_height = (int) roundf (rect->height * scale);
texture = cogl_texture_2d_new_with_size (cogl_context,
texture_width,
texture_height);
if (!texture)
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
"Failed to create %dx%d texture",
texture_width, texture_height);
return FALSE;
}
offscreen = cogl_offscreen_new_with_texture (COGL_TEXTURE (texture));
framebuffer = COGL_FRAMEBUFFER (offscreen);
cogl_object_unref (texture);
if (!cogl_framebuffer_allocate (framebuffer, error))
return FALSE;
clutter_stage_paint_to_framebuffer (stage, framebuffer,
rect, scale, paint_flags);
bitmap = cogl_bitmap_new_for_data (cogl_context,
texture_width, texture_height,
format,
stride,
data);
cogl_framebuffer_read_pixels_into_bitmap (framebuffer,
0, 0,
COGL_READ_PIXELS_COLOR_BUFFER,
bitmap);
cogl_object_unref (bitmap);
cogl_object_unref (framebuffer);
return TRUE;
}
static void
capture_view_into (ClutterStage *stage,
gboolean paint,
@@ -4458,50 +4575,17 @@ capture_view_into (ClutterStage *stage,
uint8_t *data,
int stride)
{
CoglFramebuffer *framebuffer;
ClutterBackend *backend;
CoglContext *context;
CoglBitmap *bitmap;
cairo_rectangle_int_t view_layout;
g_autoptr (GError) error = NULL;
float view_scale;
float texture_width;
float texture_height;
g_return_if_fail (CLUTTER_IS_STAGE (stage));
framebuffer = clutter_stage_view_get_framebuffer (view);
if (paint)
{
cairo_region_t *region;
_clutter_stage_maybe_setup_viewport (stage, view);
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);
texture_width = roundf (rect->width * view_scale);
texture_height = roundf (rect->height * view_scale);
backend = clutter_get_default_backend ();
context = clutter_backend_get_cogl_context (backend);
bitmap = cogl_bitmap_new_for_data (context,
texture_width, texture_height,
CLUTTER_CAIRO_FORMAT_ARGB32,
stride,
data);
clutter_stage_view_get_layout (view, &view_layout);
cogl_framebuffer_read_pixels_into_bitmap (framebuffer,
roundf ((rect->x - view_layout.x) * view_scale),
roundf ((rect->y - view_layout.y) * view_scale),
COGL_READ_PIXELS_COLOR_BUFFER,
bitmap);
cogl_object_unref (bitmap);
if (!clutter_stage_paint_to_buffer (stage, rect, view_scale, data, stride,
CLUTTER_CAIRO_FORMAT_ARGB32,
CLUTTER_PAINT_FLAG_NO_CURSORS,
&error))
g_warning ("Failed to capture stage: %s", error->message);
}
void

View File

@@ -233,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

@@ -47,8 +47,6 @@
#include "clutter-stage-private.h"
#include "clutter-stage-view-private.h"
#include "cogl/cogl-trace.h"
#define MAX_STACK_RECTS 256
typedef struct _ClutterStageViewCoglPrivate
@@ -237,7 +235,12 @@ clutter_stage_cogl_schedule_update (ClutterStageWindow *stage_window,
stage_cogl->update_time = next_presentation_time - max_render_time_allowed;
if (stage_cogl->update_time == stage_cogl->last_update_time)
stage_cogl->update_time = stage_cogl->last_update_time + refresh_interval;
{
stage_cogl->update_time += refresh_interval;
next_presentation_time += refresh_interval;
}
stage_cogl->next_presentation_time = next_presentation_time;
}
static gint64
@@ -258,6 +261,29 @@ clutter_stage_cogl_clear_update_time (ClutterStageWindow *stage_window)
stage_cogl->last_update_time = stage_cogl->update_time;
stage_cogl->update_time = -1;
stage_cogl->next_presentation_time = -1;
}
static int64_t
clutter_stage_cogl_get_next_presentation_time (ClutterStageWindow *stage_window)
{
ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_window);
int64_t now = g_get_monotonic_time ();
if (stage_cogl->next_presentation_time > 0 &&
stage_cogl->next_presentation_time <= now)
{
CLUTTER_NOTE (BACKEND,
"Missed some frames. Something blocked for over "
"%" G_GINT64_FORMAT "ms.",
(now - stage_cogl->next_presentation_time) / 1000);
stage_cogl->update_time = -1;
clutter_stage_cogl_schedule_update (stage_window,
stage_cogl->last_sync_delay);
}
return stage_cogl->next_presentation_time;
}
static ClutterActor *
@@ -377,15 +403,11 @@ static gboolean
swap_framebuffer (ClutterStageWindow *stage_window,
ClutterStageView *view,
cairo_region_t *swap_region,
gboolean swap_with_damage,
cairo_region_t *queued_redraw_clip)
gboolean swap_with_damage)
{
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, queued_redraw_clip);
n_rects = cairo_region_num_rectangles (swap_region);
damage = g_newa (int, n_rects * 4);
for (i = 0; i < n_rects; i++)
@@ -622,7 +644,7 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
gboolean swap_with_damage;
ClutterActor *wrapper;
cairo_region_t *redraw_clip;
cairo_region_t *queued_redraw_clip;
cairo_region_t *queued_redraw_clip = NULL;
cairo_region_t *fb_clip_region;
cairo_region_t *swap_region;
cairo_rectangle_int_t redraw_rect;
@@ -630,6 +652,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);
@@ -645,6 +668,8 @@ 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);
if (G_UNLIKELY (clutter_paint_debug_flags & CLUTTER_DEBUG_PAINT_DAMAGE_REGION))
queued_redraw_clip = cairo_region_copy (redraw_clip);
/* NB: a NULL redraw clip == full stage redraw */
if (!redraw_clip)
@@ -652,16 +677,26 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
else
is_full_redraw = FALSE;
may_use_clipped_redraw = FALSE;
if (_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)
{
may_use_clipped_redraw = TRUE;
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)
{
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;
}
}
if (may_use_clipped_redraw)
{
fb_clip_region = offset_scale_and_clamp_region (redraw_clip,
-view_rect.x,
-view_rect.y,
@@ -702,8 +737,6 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
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;
@@ -717,64 +750,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++)
{
cairo_region_t *fb_damage;
cairo_region_t *view_damage;
int i;
int damage_index;
fill_current_damage_history (view, fb_clip_region);
fb_damage = cairo_region_create ();
for (i = 1; i <= age; i++)
{
int damage_index;
damage_index = DAMAGE_HISTORY (view_priv->damage_index - i - 1);
cairo_region_union (fb_damage,
view_priv->damage_history[damage_index]);
}
/* 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",
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)
{
@@ -934,7 +946,6 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
}
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)
@@ -955,11 +966,17 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
swap_region = transformed_swap_region;
}
if (queued_redraw_clip)
{
paint_damage_region (stage_window, view,
swap_region, queued_redraw_clip);
cairo_region_destroy (queued_redraw_clip);
}
res = swap_framebuffer (stage_window,
view,
swap_region,
swap_with_damage,
queued_redraw_clip);
swap_with_damage);
cairo_region_destroy (swap_region);
@@ -967,6 +984,7 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
}
else
{
g_clear_pointer (&queued_redraw_clip, cairo_region_destroy);
return FALSE;
}
}
@@ -1020,6 +1038,7 @@ 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->get_next_presentation_time = clutter_stage_cogl_get_next_presentation_time;
iface->redraw = clutter_stage_cogl_redraw;
}
@@ -1065,6 +1084,7 @@ _clutter_stage_cogl_init (ClutterStageCogl *stage)
stage->refresh_rate = 0.0;
stage->update_time = -1;
stage->next_presentation_time = -1;
}
static void

View File

@@ -48,6 +48,7 @@ struct _ClutterStageCogl
gint64 last_presentation_time;
gint64 update_time;
int64_t last_update_time;
int64_t next_presentation_time;
/* We only enable clipped redraws after 2 frames, since we've seen
* a lot of drivers can struggle to get going and may output some

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

@@ -43,7 +43,7 @@
/**
* cogl_dma_buf_handle_new: (skip)
*/
CoglDmaBufHandle *
COGL_EXPORT CoglDmaBufHandle *
cogl_dma_buf_handle_new (CoglFramebuffer *framebuffer,
int dmabuf_fd,
gpointer data,
@@ -55,7 +55,7 @@ cogl_dma_buf_handle_new (CoglFramebuffer *framebuffer,
* Releases @dmabuf_handle; it is a programming error to release
* an already released handle.
*/
void
COGL_EXPORT void
cogl_dma_buf_handle_free (CoglDmaBufHandle *dmabuf_handle);
/**
@@ -66,7 +66,7 @@ cogl_dma_buf_handle_free (CoglDmaBufHandle *dmabuf_handle);
*
* Returns: (transfer none): a #CoglFramebuffer
*/
CoglFramebuffer *
COGL_EXPORT CoglFramebuffer *
cogl_dma_buf_handle_get_framebuffer (CoglDmaBufHandle *dmabuf_handle);
/**
@@ -76,7 +76,7 @@ cogl_dma_buf_handle_get_framebuffer (CoglDmaBufHandle *dmabuf_handle);
*
* Returns: a valid file descriptor
*/
int
COGL_EXPORT int
cogl_dma_buf_handle_get_fd (CoglDmaBufHandle *dmabuf_handle);

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);

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

@@ -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,

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,

View File

@@ -157,7 +157,7 @@ typedef struct {
* Stability: unstable
* Since: 1.16
*/
int
COGL_EXPORT int
cogl_poll_renderer_get_info (CoglRenderer *renderer,
CoglPollFD **poll_fds,
int *n_poll_fds,
@@ -185,7 +185,7 @@ cogl_poll_renderer_get_info (CoglRenderer *renderer,
* Stability: unstable
* Since: 1.16
*/
void
COGL_EXPORT void
cogl_poll_renderer_dispatch (CoglRenderer *renderer,
const CoglPollFD *poll_fds,
int n_poll_fds);

View File

@@ -63,7 +63,7 @@ _cogl_primitive_immutable_ref (CoglPrimitive *primitive);
void
_cogl_primitive_immutable_unref (CoglPrimitive *primitive);
void
COGL_EXPORT void
_cogl_primitive_draw (CoglPrimitive *primitive,
CoglFramebuffer *framebuffer,
CoglPipeline *pipeline,

View File

@@ -102,7 +102,7 @@ cogl_is_primitive_texture (void *object);
* Since: 2.0
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_primitive_texture_set_auto_mipmap (CoglPrimitiveTexture *primitive_texture,
gboolean value);

View File

@@ -70,6 +70,7 @@ G_BEGIN_DECLS
*
* Returns: a #GType that can be used with the GLib type system.
*/
COGL_EXPORT
GType cogl_primitive_get_gtype (void);
/**
@@ -249,7 +250,7 @@ typedef struct {
* Since: 1.6
* Stability: Unstable
*/
CoglPrimitive *
COGL_EXPORT CoglPrimitive *
cogl_primitive_new (CoglVerticesMode mode,
int n_vertices,
...);
@@ -275,7 +276,7 @@ cogl_primitive_new (CoglVerticesMode mode,
* Since: 1.6
* Stability: Unstable
*/
CoglPrimitive *
COGL_EXPORT CoglPrimitive *
cogl_primitive_new_with_attributes (CoglVerticesMode mode,
int n_vertices,
CoglAttribute **attributes,
@@ -329,7 +330,7 @@ cogl_primitive_new_with_attributes (CoglVerticesMode mode,
* Since: 1.6
* Stability: Unstable
*/
CoglPrimitive *
COGL_EXPORT CoglPrimitive *
cogl_primitive_new_p2 (CoglContext *context,
CoglVerticesMode mode,
int n_vertices,
@@ -383,7 +384,7 @@ cogl_primitive_new_p2 (CoglContext *context,
* Since: 1.6
* Stability: Unstable
*/
CoglPrimitive *
COGL_EXPORT CoglPrimitive *
cogl_primitive_new_p3 (CoglContext *context,
CoglVerticesMode mode,
int n_vertices,
@@ -439,7 +440,7 @@ cogl_primitive_new_p3 (CoglContext *context,
* Since: 1.6
* Stability: Unstable
*/
CoglPrimitive *
COGL_EXPORT CoglPrimitive *
cogl_primitive_new_p2c4 (CoglContext *context,
CoglVerticesMode mode,
int n_vertices,
@@ -495,7 +496,7 @@ cogl_primitive_new_p2c4 (CoglContext *context,
* Since: 1.6
* Stability: Unstable
*/
CoglPrimitive *
COGL_EXPORT CoglPrimitive *
cogl_primitive_new_p3c4 (CoglContext *context,
CoglVerticesMode mode,
int n_vertices,
@@ -551,7 +552,7 @@ cogl_primitive_new_p3c4 (CoglContext *context,
* Since: 1.6
* Stability: Unstable
*/
CoglPrimitive *
COGL_EXPORT CoglPrimitive *
cogl_primitive_new_p2t2 (CoglContext *context,
CoglVerticesMode mode,
int n_vertices,
@@ -607,7 +608,7 @@ cogl_primitive_new_p2t2 (CoglContext *context,
* Since: 1.6
* Stability: Unstable
*/
CoglPrimitive *
COGL_EXPORT CoglPrimitive *
cogl_primitive_new_p3t2 (CoglContext *context,
CoglVerticesMode mode,
int n_vertices,
@@ -663,7 +664,7 @@ cogl_primitive_new_p3t2 (CoglContext *context,
* Since: 1.6
* Stability: Unstable
*/
CoglPrimitive *
COGL_EXPORT CoglPrimitive *
cogl_primitive_new_p2t2c4 (CoglContext *context,
CoglVerticesMode mode,
int n_vertices,
@@ -719,15 +720,15 @@ cogl_primitive_new_p2t2c4 (CoglContext *context,
* Since: 1.6
* Stability: Unstable
*/
CoglPrimitive *
COGL_EXPORT CoglPrimitive *
cogl_primitive_new_p3t2c4 (CoglContext *context,
CoglVerticesMode mode,
int n_vertices,
const CoglVertexP3T2C4 *data);
int
COGL_EXPORT int
cogl_primitive_get_first_vertex (CoglPrimitive *primitive);
void
COGL_EXPORT void
cogl_primitive_set_first_vertex (CoglPrimitive *primitive,
int first_vertex);
@@ -753,7 +754,7 @@ cogl_primitive_set_first_vertex (CoglPrimitive *primitive,
* Since: 1.8
* Stability: unstable
*/
int
COGL_EXPORT int
cogl_primitive_get_n_vertices (CoglPrimitive *primitive);
/**
@@ -774,14 +775,14 @@ cogl_primitive_get_n_vertices (CoglPrimitive *primitive);
* Since: 1.8
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_primitive_set_n_vertices (CoglPrimitive *primitive,
int n_vertices);
CoglVerticesMode
COGL_EXPORT CoglVerticesMode
cogl_primitive_get_mode (CoglPrimitive *primitive);
void
COGL_EXPORT void
cogl_primitive_set_mode (CoglPrimitive *primitive,
CoglVerticesMode mode);
@@ -796,7 +797,7 @@ cogl_primitive_set_mode (CoglPrimitive *primitive,
* Since: 1.6
* Stability: Unstable
*/
void
COGL_EXPORT void
cogl_primitive_set_attributes (CoglPrimitive *primitive,
CoglAttribute **attributes,
int n_attributes);
@@ -829,7 +830,7 @@ cogl_primitive_set_attributes (CoglPrimitive *primitive,
* Since: 1.10
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_primitive_set_indices (CoglPrimitive *primitive,
CoglIndices *indices,
int n_indices);
@@ -844,7 +845,7 @@ cogl_primitive_set_indices (CoglPrimitive *primitive,
* Since: 1.10
* Stability: unstable
*/
CoglIndices *
COGL_EXPORT CoglIndices *
cogl_primitive_get_indices (CoglPrimitive *primitive);
/**
@@ -859,7 +860,7 @@ cogl_primitive_get_indices (CoglPrimitive *primitive);
* Since: 1.10
* Stability: unstable
*/
CoglPrimitive *
COGL_EXPORT CoglPrimitive *
cogl_primitive_copy (CoglPrimitive *primitive);
/**
@@ -874,7 +875,7 @@ cogl_primitive_copy (CoglPrimitive *primitive);
* Since: 1.6
* Stability: Unstable
*/
gboolean
COGL_EXPORT gboolean
cogl_is_primitive (void *object);
/**
@@ -909,7 +910,7 @@ typedef gboolean (* CoglPrimitiveAttributeCallback) (CoglPrimitive *primitive,
* Since: 1.10
* Stability: Unstable
*/
void
COGL_EXPORT void
cogl_primitive_foreach_attribute (CoglPrimitive *primitive,
CoglPrimitiveAttributeCallback callback,
void *user_data);
@@ -932,7 +933,7 @@ cogl_primitive_foreach_attribute (CoglPrimitive *primitive,
* Stability: unstable
* Since: 1.16
*/
void
COGL_EXPORT void
cogl_primitive_draw (CoglPrimitive *primitive,
CoglFramebuffer *framebuffer,
CoglPipeline *pipeline);

View File

@@ -48,7 +48,7 @@ extern UProfContext *_cogl_uprof_context;
void
_cogl_uprof_init (void);
void
COGL_EXPORT void
_cogl_profile_trace_message (const char *format, ...);
#else

View File

@@ -80,7 +80,7 @@ G_BEGIN_DECLS
*/
#define COGL_RENDERER_ERROR cogl_renderer_error_quark ()
uint32_t
COGL_EXPORT uint32_t
cogl_renderer_error_quark (void);
typedef struct _CoglRenderer CoglRenderer;
@@ -90,6 +90,7 @@ typedef struct _CoglRenderer CoglRenderer;
*
* Returns: a #GType that can be used with the GLib type system.
*/
COGL_EXPORT
GType cogl_renderer_get_gtype (void);
/**
@@ -102,7 +103,7 @@ GType cogl_renderer_get_gtype (void);
* Since: 1.10
* Stability: unstable
*/
gboolean
COGL_EXPORT gboolean
cogl_is_renderer (void *object);
/**
@@ -145,7 +146,7 @@ cogl_is_renderer (void *object);
* Since: 1.10
* Stability: unstable
*/
CoglRenderer *
COGL_EXPORT CoglRenderer *
cogl_renderer_new (void);
/* optional configuration APIs */
@@ -184,7 +185,7 @@ typedef enum
*
* This may only be called on an un-connected #CoglRenderer.
*/
void
COGL_EXPORT void
cogl_renderer_set_winsys_id (CoglRenderer *renderer,
CoglWinsysID winsys_id);
@@ -199,7 +200,7 @@ cogl_renderer_set_winsys_id (CoglRenderer *renderer,
* Returns: The #CoglWinsysID corresponding to the chosen window
* system backend.
*/
CoglWinsysID
COGL_EXPORT CoglWinsysID
cogl_renderer_get_winsys_id (CoglRenderer *renderer);
/**
@@ -216,7 +217,7 @@ cogl_renderer_get_winsys_id (CoglRenderer *renderer);
* Since: 1.10
* Stability: unstable
*/
gboolean
COGL_EXPORT gboolean
cogl_renderer_check_onscreen_template (CoglRenderer *renderer,
CoglOnscreenTemplate *onscreen_template,
GError **error);
@@ -238,7 +239,7 @@ cogl_renderer_check_onscreen_template (CoglRenderer *renderer,
* Since: 1.10
* Stability: unstable
*/
gboolean
COGL_EXPORT gboolean
cogl_renderer_connect (CoglRenderer *renderer, GError **error);
/**
@@ -284,7 +285,7 @@ typedef enum
* Since: 1.10
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_renderer_add_constraint (CoglRenderer *renderer,
CoglRendererConstraint constraint);
@@ -301,7 +302,7 @@ cogl_renderer_add_constraint (CoglRenderer *renderer,
* Since: 1.10
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_renderer_remove_constraint (CoglRenderer *renderer,
CoglRendererConstraint constraint);
@@ -311,7 +312,6 @@ cogl_renderer_remove_constraint (CoglRenderer *renderer,
* @COGL_DRIVER_NOP: A No-Op driver.
* @COGL_DRIVER_GL: An OpenGL driver.
* @COGL_DRIVER_GL3: An OpenGL driver using the core GL 3.1 profile
* @COGL_DRIVER_GLES1: An OpenGL ES 1.1 driver.
* @COGL_DRIVER_GLES2: An OpenGL ES 2.0 driver.
*
* Identifiers for underlying hardware drivers that may be used by
@@ -346,7 +346,7 @@ typedef enum
* Since: 1.10
* Stability: unstable
*/
void
COGL_EXPORT void
cogl_renderer_set_driver (CoglRenderer *renderer,
CoglDriver driver);
@@ -361,7 +361,7 @@ cogl_renderer_set_driver (CoglRenderer *renderer,
* Since: 1.10
* Stability: unstable
*/
CoglDriver
COGL_EXPORT CoglDriver
cogl_renderer_get_driver (CoglRenderer *renderer);
/**
@@ -393,7 +393,7 @@ typedef void (*CoglOutputCallback) (CoglOutput *output, void *user_data);
* Since: 1.14
* Stability: Unstable
*/
void
COGL_EXPORT void
cogl_renderer_foreach_output (CoglRenderer *renderer,
CoglOutputCallback callback,
void *user_data);
@@ -413,7 +413,7 @@ cogl_renderer_foreach_output (CoglRenderer *renderer,
* return result must be released with cogl_dma_buf_handle_free()
* after use.
*/
CoglDmaBufHandle *
COGL_EXPORT CoglDmaBufHandle *
cogl_renderer_create_dma_buf (CoglRenderer *renderer,
int width,
int height,

View File

@@ -345,6 +345,7 @@ typedef struct _CoglSnippet CoglSnippet;
*
* Returns: a #GType that can be used with the GLib type system.
*/
COGL_EXPORT
GType cogl_snippet_get_gtype (void);
/* Enumeration of all the hook points that a snippet can be attached
@@ -690,7 +691,7 @@ typedef enum
* Since: 1.10
* Stability: Unstable
*/
CoglSnippet *
COGL_EXPORT CoglSnippet *
cogl_snippet_new (CoglSnippetHook hook,
const char *declarations,
const char *post);
@@ -704,7 +705,7 @@ cogl_snippet_new (CoglSnippetHook hook,
* Since: 1.10
* Stability: Unstable
*/
CoglSnippetHook
COGL_EXPORT CoglSnippetHook
cogl_snippet_get_hook (CoglSnippet *snippet);
/**
@@ -719,7 +720,7 @@ cogl_snippet_get_hook (CoglSnippet *snippet);
* Since: 1.10
* Stability: Unstable
*/
gboolean
COGL_EXPORT gboolean
cogl_is_snippet (void *object);
/**
@@ -740,7 +741,7 @@ cogl_is_snippet (void *object);
* Since: 1.10
* Stability: Unstable
*/
void
COGL_EXPORT void
cogl_snippet_set_declarations (CoglSnippet *snippet,
const char *declarations);
@@ -754,7 +755,7 @@ cogl_snippet_set_declarations (CoglSnippet *snippet,
* Since: 1.10
* Stability: Unstable
*/
const char *
COGL_EXPORT const char *
cogl_snippet_get_declarations (CoglSnippet *snippet);
/**
@@ -774,7 +775,7 @@ cogl_snippet_get_declarations (CoglSnippet *snippet);
* Since: 1.10
* Stability: Unstable
*/
void
COGL_EXPORT void
cogl_snippet_set_pre (CoglSnippet *snippet,
const char *pre);
@@ -788,7 +789,7 @@ cogl_snippet_set_pre (CoglSnippet *snippet,
* Since: 1.10
* Stability: Unstable
*/
const char *
COGL_EXPORT const char *
cogl_snippet_get_pre (CoglSnippet *snippet);
/**
@@ -808,7 +809,7 @@ cogl_snippet_get_pre (CoglSnippet *snippet);
* Since: 1.10
* Stability: Unstable
*/
void
COGL_EXPORT void
cogl_snippet_set_replace (CoglSnippet *snippet,
const char *replace);
@@ -822,7 +823,7 @@ cogl_snippet_set_replace (CoglSnippet *snippet,
* Since: 1.10
* Stability: Unstable
*/
const char *
COGL_EXPORT const char *
cogl_snippet_get_replace (CoglSnippet *snippet);
/**
@@ -842,7 +843,7 @@ cogl_snippet_get_replace (CoglSnippet *snippet);
* Since: 1.10
* Stability: Unstable
*/
void
COGL_EXPORT void
cogl_snippet_set_post (CoglSnippet *snippet,
const char *post);
@@ -856,7 +857,7 @@ cogl_snippet_set_post (CoglSnippet *snippet,
* Since: 1.10
* Stability: Unstable
*/
const char *
COGL_EXPORT const char *
cogl_snippet_get_post (CoglSnippet *snippet);
G_END_DECLS

View File

@@ -90,7 +90,7 @@ GType cogl_sub_texture_get_gtype (void);
* Since: 1.10
* Stability: unstable
*/
CoglSubTexture *
COGL_EXPORT CoglSubTexture *
cogl_sub_texture_new (CoglContext *ctx,
CoglTexture *parent_texture,
int sub_x,
@@ -111,7 +111,7 @@ cogl_sub_texture_new (CoglContext *ctx,
* Since: 1.10
* Stability: unstable
*/
CoglTexture *
COGL_EXPORT CoglTexture *
cogl_sub_texture_get_parent (CoglSubTexture *sub_texture);
/**
@@ -126,7 +126,7 @@ cogl_sub_texture_get_parent (CoglSubTexture *sub_texture);
* Since: 1.10
* Stability: unstable
*/
gboolean
COGL_EXPORT gboolean
cogl_is_sub_texture (void *object);
G_END_DECLS

View File

@@ -46,20 +46,21 @@ typedef struct _CoglSwapChain CoglSwapChain;
*
* Returns: a #GType that can be used with the GLib type system.
*/
COGL_EXPORT
GType cogl_swap_chain_get_gtype (void);
CoglSwapChain *
COGL_EXPORT CoglSwapChain *
cogl_swap_chain_new (void);
void
COGL_EXPORT void
cogl_swap_chain_set_has_alpha (CoglSwapChain *swap_chain,
gboolean has_alpha);
void
COGL_EXPORT void
cogl_swap_chain_set_length (CoglSwapChain *swap_chain,
int length);
gboolean
COGL_EXPORT gboolean
cogl_is_swap_chain (void *object);
G_END_DECLS

View File

@@ -75,6 +75,7 @@ typedef struct _CoglTexture2DSliced CoglTexture2DSliced;
*
* Returns: a #GType that can be used with the GLib type system.
*/
COGL_EXPORT
GType cogl_texture_2d_sliced_get_gtype (void);
/**
@@ -118,7 +119,7 @@ GType cogl_texture_2d_sliced_get_gtype (void);
* Since: 1.10
* Stability: unstable
*/
CoglTexture2DSliced *
COGL_EXPORT CoglTexture2DSliced *
cogl_texture_2d_sliced_new_with_size (CoglContext *ctx,
int width,
int height,
@@ -166,7 +167,7 @@ cogl_texture_2d_sliced_new_with_size (CoglContext *ctx,
*
* Since: 1.16
*/
CoglTexture2DSliced *
COGL_EXPORT CoglTexture2DSliced *
cogl_texture_2d_sliced_new_from_file (CoglContext *ctx,
const char *filename,
int max_waste,
@@ -227,7 +228,7 @@ cogl_texture_2d_sliced_new_from_file (CoglContext *ctx,
*
* Since: 1.16
*/
CoglTexture2DSliced *
COGL_EXPORT CoglTexture2DSliced *
cogl_texture_2d_sliced_new_from_data (CoglContext *ctx,
int width,
int height,
@@ -278,7 +279,7 @@ cogl_texture_2d_sliced_new_from_data (CoglContext *ctx,
*
* Since: 1.16
*/
CoglTexture2DSliced *
COGL_EXPORT CoglTexture2DSliced *
cogl_texture_2d_sliced_new_from_bitmap (CoglBitmap *bmp,
int max_waste);
@@ -293,7 +294,7 @@ cogl_texture_2d_sliced_new_from_bitmap (CoglBitmap *bmp,
* Since: 1.10
* Stability: unstable
*/
gboolean
COGL_EXPORT gboolean
cogl_is_texture_2d_sliced (void *object);
#endif /* __COGL_TEXURE_2D_SLICED_H */

View File

@@ -121,6 +121,9 @@ cogl_texture_2d_new_with_size (CoglContext *ctx,
{
CoglTextureLoader *loader;
g_return_val_if_fail (width >= 1, NULL);
g_return_val_if_fail (height >= 1, NULL);
loader = _cogl_texture_create_loader ();
loader->src_type = COGL_TEXTURE_SOURCE_TYPE_SIZED;
loader->src.sized.width = width;

View File

@@ -71,6 +71,7 @@ typedef enum _CoglEglImageFlags
*
* Returns: a #GType that can be used with the GLib type system.
*/
COGL_EXPORT
GType cogl_texture_2d_get_gtype (void);
/**
@@ -83,7 +84,7 @@ GType cogl_texture_2d_get_gtype (void);
* Return value: %TRUE if the object references a #CoglTexture2D,
* %FALSE otherwise
*/
gboolean
COGL_EXPORT gboolean
cogl_is_texture_2d (void *object);
/**
@@ -110,7 +111,7 @@ cogl_is_texture_2d (void *object);
*
* Since: 2.0
*/
CoglTexture2D *
COGL_EXPORT CoglTexture2D *
cogl_texture_2d_new_with_size (CoglContext *ctx,
int width,
int height);
@@ -139,7 +140,7 @@ cogl_texture_2d_new_with_size (CoglContext *ctx,
*
* Since: 1.16
*/
CoglTexture2D *
COGL_EXPORT CoglTexture2D *
cogl_texture_2d_new_from_file (CoglContext *ctx,
const char *filename,
GError **error);
@@ -177,7 +178,7 @@ cogl_texture_2d_new_from_file (CoglContext *ctx,
*
* Since: 2.0
*/
CoglTexture2D *
COGL_EXPORT CoglTexture2D *
cogl_texture_2d_new_from_data (CoglContext *ctx,
int width,
int height,
@@ -209,7 +210,7 @@ cogl_texture_2d_new_from_data (CoglContext *ctx,
* Since: 2.0
* Stability: unstable
*/
CoglTexture2D *
COGL_EXPORT CoglTexture2D *
cogl_texture_2d_new_from_bitmap (CoglBitmap *bitmap);
/**
@@ -219,7 +220,7 @@ cogl_texture_2d_new_from_bitmap (CoglBitmap *bitmap);
/* NB: The reason we require the width, height and format to be passed
* even though they may seem redundant is because GLES 1/2 don't
* provide a way to query these properties. */
CoglTexture2D *
COGL_EXPORT CoglTexture2D *
cogl_egl_texture_2d_new_from_image (CoglContext *ctx,
int width,
int height,
@@ -235,7 +236,7 @@ typedef gboolean (*CoglTexture2DEGLImageExternalAlloc) (CoglTexture2D *tex_2d,
/**
* cogl_texture_2d_new_from_egl_image_external: (skip)
*/
CoglTexture2D *
COGL_EXPORT CoglTexture2D *
cogl_texture_2d_new_from_egl_image_external (CoglContext *ctx,
int width,
int height,
@@ -244,10 +245,10 @@ cogl_texture_2d_new_from_egl_image_external (CoglContext *ctx,
GDestroyNotify destroy,
GError **error);
void
COGL_EXPORT void
cogl_texture_2d_egl_image_external_bind (CoglTexture2D *tex_2d);
void
COGL_EXPORT void
cogl_texture_2d_egl_image_external_alloc_finish (CoglTexture2D *tex_2d,
void *user_data,
GDestroyNotify destroy);

View File

@@ -272,7 +272,7 @@ _cogl_texture_register_texture_type (const CoglObjectClass *klass);
(TypeName, type_name, \
_cogl_texture_register_texture_type (&_cogl_##type_name##_class))
gboolean
COGL_EXPORT gboolean
_cogl_texture_can_hardware_repeat (CoglTexture *texture);
void
@@ -346,7 +346,7 @@ _cogl_texture_spans_foreach_in_region (CoglSpan *x_spans,
CoglMetaTextureCallback callback,
void *user_data);
gboolean
COGL_EXPORT gboolean
_cogl_texture_set_region (CoglTexture *texture,
int width,
int height,
@@ -390,7 +390,7 @@ _cogl_texture_set_allocated (CoglTexture *texture,
int width,
int height);
CoglPixelFormat
COGL_EXPORT CoglPixelFormat
_cogl_texture_get_format (CoglTexture *texture);
CoglTextureLoader *

View File

@@ -76,6 +76,7 @@ G_BEGIN_DECLS
*
* Returns: a #GType that can be used with the GLib type system.
*/
COGL_EXPORT
GType cogl_texture_get_gtype (void);
/**
@@ -108,6 +109,7 @@ typedef enum
COGL_TEXTURE_ERROR_TYPE
} CoglTextureError;
COGL_EXPORT
uint32_t cogl_texture_error_quark (void);
/**
@@ -119,7 +121,7 @@ uint32_t cogl_texture_error_quark (void);
* Return value: %TRUE if the @object references a texture, and
* %FALSE otherwise
*/
gboolean
COGL_EXPORT gboolean
cogl_is_texture (void *object);
/**
@@ -171,7 +173,7 @@ typedef enum _CoglTextureComponents
*
* Since: 1.18
*/
void
COGL_EXPORT void
cogl_texture_set_components (CoglTexture *texture,
CoglTextureComponents components);
@@ -189,7 +191,7 @@ cogl_texture_set_components (CoglTexture *texture,
*
* Since: 1.18
*/
CoglTextureComponents
COGL_EXPORT CoglTextureComponents
cogl_texture_get_components (CoglTexture *texture);
/**
@@ -223,7 +225,7 @@ cogl_texture_get_components (CoglTexture *texture);
*
* Since: 1.18
*/
void
COGL_EXPORT void
cogl_texture_set_premultiplied (CoglTexture *texture,
gboolean premultiplied);
@@ -242,7 +244,7 @@ cogl_texture_set_premultiplied (CoglTexture *texture,
* value or %FALSE if not.
* Since: 1.18
*/
gboolean
COGL_EXPORT gboolean
cogl_texture_get_premultiplied (CoglTexture *texture);
/**
@@ -253,7 +255,7 @@ cogl_texture_get_premultiplied (CoglTexture *texture);
*
* Return value: the width of the GPU side texture in pixels
*/
unsigned int
COGL_EXPORT unsigned int
cogl_texture_get_width (CoglTexture *texture);
/**
@@ -264,7 +266,7 @@ cogl_texture_get_width (CoglTexture *texture);
*
* Return value: the height of the GPU side texture in pixels
*/
unsigned int
COGL_EXPORT unsigned int
cogl_texture_get_height (CoglTexture *texture);
/**
@@ -276,7 +278,7 @@ cogl_texture_get_height (CoglTexture *texture);
*
* Return value: the maximum waste
*/
int
COGL_EXPORT int
cogl_texture_get_max_waste (CoglTexture *texture);
/**
@@ -289,7 +291,7 @@ cogl_texture_get_max_waste (CoglTexture *texture);
* Return value: %TRUE if the texture is sliced, %FALSE if the texture
* is stored as a single GPU texture
*/
gboolean
COGL_EXPORT gboolean
cogl_texture_is_sliced (CoglTexture *texture);
/**
@@ -308,7 +310,7 @@ cogl_texture_is_sliced (CoglTexture *texture);
* Return value: %TRUE if the handle was successfully retrieved, %FALSE
* if the handle was invalid
*/
gboolean
COGL_EXPORT gboolean
cogl_texture_get_gl_texture (CoglTexture *texture,
unsigned int *out_gl_handle,
unsigned int *out_gl_target);
@@ -320,8 +322,8 @@ cogl_texture_get_gl_texture (CoglTexture *texture,
* @rowstride: the rowstride of @data in bytes or pass 0 to calculate
* from the bytes-per-pixel of @format multiplied by the
* @texture width.
* @data: memory location to write the @texture's contents, or %NULL
* to only query the data size through the return value.
* @data: (array) (nullable): memory location to write the @texture's contents,
* or %NULL to only query the data size through the return value.
*
* Copies the pixel data from a cogl texture to system memory.
*
@@ -332,7 +334,7 @@ cogl_texture_get_gl_texture (CoglTexture *texture,
*
* Return value: the size of the texture data in bytes
*/
int
COGL_EXPORT int
cogl_texture_get_data (CoglTexture *texture,
CoglPixelFormat format,
unsigned int rowstride,
@@ -354,7 +356,7 @@ cogl_texture_get_data (CoglTexture *texture,
* @format: the #CoglPixelFormat used in the source buffer.
* @rowstride: rowstride of source buffer (computed from width if none
* specified)
* @data: the actual pixel data.
* @data: (array): the actual pixel data.
*
* Sets the pixels in a rectangular subregion of @texture from an in-memory
* buffer containing pixel data.
@@ -364,7 +366,7 @@ cogl_texture_get_data (CoglTexture *texture,
* Return value: %TRUE if the subregion upload was successful, and
* %FALSE otherwise
*/
gboolean
COGL_EXPORT gboolean
cogl_texture_set_region (CoglTexture *texture,
int src_x,
int src_y,
@@ -384,7 +386,7 @@ cogl_texture_set_region (CoglTexture *texture,
* @format: the #CoglPixelFormat used in the source @data buffer.
* @rowstride: rowstride of the source @data buffer (computed from
* the texture width and @format if it equals 0)
* @data: the source data, pointing to the first top-left pixel to set
* @data: (array): the source data, pointing to the first top-left pixel to set
* @level: The mipmap level to update (Normally 0 for the largest,
* base texture)
* @error: A #GError to return exceptional errors
@@ -430,7 +432,7 @@ cogl_texture_set_region (CoglTexture *texture,
* Return value: %TRUE if the data upload was successful, and
* %FALSE otherwise
*/
gboolean
COGL_EXPORT gboolean
cogl_texture_set_data (CoglTexture *texture,
CoglPixelFormat format,
int rowstride,
@@ -463,7 +465,7 @@ cogl_texture_set_data (CoglTexture *texture,
* Since: 1.8
* Stability: unstable
*/
gboolean
COGL_EXPORT gboolean
cogl_texture_set_region_from_bitmap (CoglTexture *texture,
int src_x,
int src_y,
@@ -491,14 +493,14 @@ cogl_texture_set_region_from_bitmap (CoglTexture *texture,
* otherwise %FALSE and @error will be updated if it
* wasn't %NULL.
*/
gboolean
COGL_EXPORT gboolean
cogl_texture_allocate (CoglTexture *texture,
GError **error);
/**
* cogl_texture_is_get_data_supported: (skip)
*/
gboolean
COGL_EXPORT gboolean
cogl_texture_is_get_data_supported (CoglTexture *texture);
G_END_DECLS

View File

@@ -23,6 +23,8 @@
#ifdef HAVE_TRACING
#include <sysprof-capture.h>
#include <sysprof-capture-writer.h>
#include <sysprof-clock.h>
#include <syscall.h>
#include <sys/types.h>
#include <unistd.h>
@@ -30,6 +32,18 @@
#define COGL_TRACE_OUTPUT_FILE "cogl-trace-sp-capture.syscap"
#define BUFFER_LENGTH (4096 * 4)
struct _CoglTraceContext
{
SysprofCaptureWriter *writer;
};
typedef struct _CoglTraceThreadContext
{
int cpu_id;
GPid pid;
char *group;
} CoglTraceThreadContext;
typedef struct
{
int fd;
@@ -228,6 +242,37 @@ cogl_set_tracing_disabled_on_thread (GMainContext *main_context)
g_source_unref (source);
}
void
cogl_trace_end (CoglTraceHead *head)
{
SysprofTimeStamp end_time;
CoglTraceContext *trace_context;
CoglTraceThreadContext *trace_thread_context;
end_time = g_get_monotonic_time () * 1000;
trace_context = cogl_trace_context;
trace_thread_context = g_private_get (&cogl_trace_thread_data);
g_mutex_lock (&cogl_trace_mutex);
if (!sysprof_capture_writer_add_mark (trace_context->writer,
head->begin_time,
trace_thread_context->cpu_id,
trace_thread_context->pid,
(uint64_t) end_time - head->begin_time,
trace_thread_context->group,
head->name,
NULL))
{
/* XXX: g_main_context_get_thread_default() might be wrong, it probably
* needs to store the GMainContext in CoglTraceThreadContext when creating
* and use it here.
*/
if (errno == EPIPE)
cogl_set_tracing_disabled_on_thread (g_main_context_get_thread_default ());
}
g_mutex_unlock (&cogl_trace_mutex);
}
#else
#include <string.h>

View File

@@ -19,47 +19,42 @@
#ifndef COGL_TRACE_H
#define COGL_TRACE_H
#include "cogl-config.h"
#ifdef HAVE_TRACING
#include <glib.h>
#include <sysprof-capture-writer.h>
#include <sysprof-clock.h>
#include <stdint.h>
#include <errno.h>
typedef struct _CoglTraceContext
{
SysprofCaptureWriter *writer;
} CoglTraceContext;
#include "cogl/cogl-defines.h"
#include "cogl/cogl-macros.h"
typedef struct _CoglTraceThreadContext
{
int cpu_id;
GPid pid;
char *group;
} CoglTraceThreadContext;
#ifdef COGL_HAS_TRACING
typedef struct _CoglTraceContext CoglTraceContext;
typedef struct _CoglTraceHead
{
SysprofTimeStamp begin_time;
uint64_t begin_time;
const char *name;
} CoglTraceHead;
extern GPrivate cogl_trace_thread_data;
extern CoglTraceContext *cogl_trace_context;
extern GMutex cogl_trace_mutex;
COGL_EXPORT
GPrivate cogl_trace_thread_data;
COGL_EXPORT
CoglTraceContext *cogl_trace_context;
COGL_EXPORT
GMutex cogl_trace_mutex;
void cogl_set_tracing_enabled_on_thread_with_fd (GMainContext *main_context,
const char *group,
int fd);
COGL_EXPORT void
cogl_set_tracing_enabled_on_thread_with_fd (GMainContext *main_context,
const char *group,
int fd);
void cogl_set_tracing_enabled_on_thread (GMainContext *main_context,
const char *group,
const char *filename);
COGL_EXPORT void
cogl_set_tracing_enabled_on_thread (GMainContext *main_context,
const char *group,
const char *filename);
void cogl_set_tracing_disabled_on_thread (GMainContext *main_context);
COGL_EXPORT void
cogl_set_tracing_disabled_on_thread (GMainContext *main_context);
static inline void
cogl_trace_begin (CoglTraceHead *head,
@@ -69,36 +64,8 @@ cogl_trace_begin (CoglTraceHead *head,
head->name = name;
}
static inline void
cogl_trace_end (CoglTraceHead *head)
{
SysprofTimeStamp end_time;
CoglTraceContext *trace_context;
CoglTraceThreadContext *trace_thread_context;
end_time = g_get_monotonic_time () * 1000;
trace_context = cogl_trace_context;
trace_thread_context = g_private_get (&cogl_trace_thread_data);
g_mutex_lock (&cogl_trace_mutex);
if (!sysprof_capture_writer_add_mark (trace_context->writer,
head->begin_time,
trace_thread_context->cpu_id,
trace_thread_context->pid,
(uint64_t) end_time - head->begin_time,
trace_thread_context->group,
head->name,
NULL))
{
/* XXX: g_main_context_get_thread_default() might be wrong, it probably
* needs to store the GMainContext in CoglTraceThreadContext when creating
* and use it here.
*/
if (errno == EPIPE)
cogl_set_tracing_disabled_on_thread (g_main_context_get_thread_default ());
}
g_mutex_unlock (&cogl_trace_mutex);
}
COGL_EXPORT void
cogl_trace_end (CoglTraceHead *head);
static inline void
cogl_auto_trace_end_helper (CoglTraceHead **head)
@@ -126,7 +93,7 @@ cogl_auto_trace_end_helper (CoglTraceHead **head)
ScopedCoglTrace##Name = &CoglTrace##Name; \
}
#else /* HAVE_TRACING */
#else /* COGL_HAS_TRACING */
#include <stdio.h>
@@ -134,14 +101,17 @@ cogl_auto_trace_end_helper (CoglTraceHead **head)
#define COGL_TRACE_END(Name) (void) 0
#define COGL_TRACE_BEGIN_SCOPED(Name, description) (void) 0
void cogl_set_tracing_enabled_on_thread_with_fd (void *data,
const char *group,
int fd);
void cogl_set_tracing_enabled_on_thread (void *data,
const char *group,
const char *filename);
void cogl_set_tracing_disabled_on_thread (void *data);
COGL_EXPORT void
cogl_set_tracing_enabled_on_thread_with_fd (void *data,
const char *group,
int fd);
COGL_EXPORT void
cogl_set_tracing_enabled_on_thread (void *data,
const char *group,
const char *filename);
COGL_EXPORT void
cogl_set_tracing_disabled_on_thread (void *data);
#endif /* HAVE_TRACING */
#endif /* COGL_HAS_TRACING */
#endif /* COGL_TRACE_H */

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>
@@ -81,7 +82,7 @@ typedef struct { \
typedef void * CoglHandle;
#define COGL_TYPE_HANDLE (cogl_handle_get_type ())
GType
COGL_EXPORT GType
cogl_handle_get_type (void) G_GNUC_CONST;
/* We forward declare this in cogl-types to avoid circular dependencies
@@ -276,7 +277,7 @@ typedef enum /*< prefix=COGL_ERROR >*/
COGL_SYSTEM_ERROR_NO_MEMORY
} CoglSystemError;
uint32_t
COGL_EXPORT uint32_t
_cogl_system_error_quark (void);
/**

View File

@@ -44,7 +44,7 @@
* Return value: @a if @a is already a power of two, otherwise returns
* the next nearest power of two.
*/
int
COGL_EXPORT int
_cogl_util_next_p2 (int a)
{
int rval = 1;

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