Commit Graph

6732 Commits

Author SHA1 Message Date
Marco Trevisan (Treviño)
4be4d85f84 clutter/stage: Cleanup the capture_view code
Reuse capture's rect parameter instead of passing a new one, and support the
case where there are no returned areas.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/3
2019-03-01 17:46:49 +00:00
Marco Trevisan (Treviño)
c695471475 clutter/stage: Add private API to get max view scale for rect
Move the same code from ClutterActor as this is something we can
reuse elsewhere.

https://bugzilla.gnome.org/show_bug.cgi?id=765011
https://gitlab.gnome.org/GNOME/mutter/merge_requests/3
2019-03-01 17:46:49 +00:00
Marco Trevisan (Treviño)
97a3b88f25 clutter/stage: Use rounded values to create image surfaces
This needs to be an integer, and since the assumptions we
have in Monitor this multiplication should always return
an integer, however in case of precision loss it could
return something very close to the next/prev integer, so
let's be sure this won't happen, by just rounding it.

https://bugzilla.gnome.org/show_bug.cgi?id=765011
https://gitlab.gnome.org/GNOME/mutter/merge_requests/3
2019-03-01 17:46:49 +00:00
Marco Trevisan (Treviño)
1e1cb4961b clutter/offscreen-effect: Make sure we use linear filter for fractional scaling
When we try to update the FB, we might face the case in which the effect target
framebuffer does not need any redraw, because it's already properly sized and
scaled, but the filter applied to the pipeline is not, because it has been
computed for a non-fractional scaling.

This is happens for example to clutter actors with a flattening effect (i.e.
override redirect mode set), that might have been generated properly for a
celied scaling level, but when we go fractional we need to ensure to use a
linear filter, as the 1:1 texel:pixel assumption is not true anymore.

https://bugzilla.gnome.org/show_bug.cgi?id=765011
https://gitlab.gnome.org/GNOME/mutter/merge_requests/3
2019-03-01 17:46:49 +00:00
Marco Trevisan (Treviño)
e3966882e8 clutter/offscreen-effect: Support adding effect to resource scaled actors
At this level we use ceiled resource-scale when painting fractional value

When using fractional scaling we still need to create an integer-sized
texture and then we should paint it using a size which is proportional
to the real actor size ratio, and only paint a subsample of it, but this
doesn't seem to work properly with some weird scaling values.

Then, it's just better to draw the texture ceiled and then we scale it
down to match the proper actor scaling at paint level.

https://bugzilla.gnome.org/show_bug.cgi?id=765011
https://gitlab.gnome.org/GNOME/mutter/merge_requests/3
2019-03-01 17:46:49 +00:00
Marco Trevisan (Treviño)
af3662775e clutter/text: Generate resource scaled text and paint it at proper scaling
When resource scale is set we need to generate a scaled PangoLayout (by adding
a new scale attribute, or adjusting the one we already have according the
resource scale), then it has to be painted with proper scaling matrix.

So everything that has to do with PangoLayout has to be in real coordinates,
then clutter logical coords multiplied by resource scaling.
While the actual size of the layout is the one of the PangoLayout divided by
resource scale.

We map the text positions to logical coords by default, while using
the pixel coordinates when painting.

We fall back to scale 1 when calculating preferred size if no scale is
known. The pango layout will not have set a layout scale attribute,
meaning it'll be 1, thus we should just assume the layout scale is 1 here.
Not doing so might result in the preferred size being 0x0 meaning the
actor won't be laid out properly.

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

https://bugzilla.gnome.org/show_bug.cgi?id=765011
https://gitlab.gnome.org/GNOME/mutter/merge_requests/3
2019-03-01 17:46:49 +00:00
Marco Trevisan (Treviño)
9234777e36 clutter/text: Add utility function to set the pango attributes
https://gitlab.gnome.org/GNOME/mutter/merge_requests/3
2019-03-01 17:46:49 +00:00
Marco Trevisan (Treviño)
02813d74e1 clutter/canvas: Implement clutter_canvas_{get,set}_scale_factor
https://bugzilla.gnome.org/show_bug.cgi?id=765011
https://gitlab.gnome.org/GNOME/mutter/merge_requests/3
2019-03-01 17:46:49 +00:00
Marco Trevisan (Treviño)
d3beb3ddb7 clutter/actor-box: Add clutter_actor_box_scale function
This allows to scale the box by given factor

https://bugzilla.gnome.org/show_bug.cgi?id=765011
https://gitlab.gnome.org/GNOME/mutter/merge_requests/3
2019-03-01 17:46:49 +00:00
Jonas Ådahl
ad5555bf42 clutter: Add API to get the resource scale of an actor
A clutter actor might be painted on a stage view with a view scale
other than 1. In this case, to show the content in full resolution, the
actor must use a higher resolution resource (e.g. texture), which will
be down scaled to the stage coordinate space, then scaled up again to
the stage view framebuffer scale.

Use a 'resource-scale' property to save information and notify when it
changes.

The resource scale is the ceiled value of the highest stage view scale a
actor is visible on. The value is ceiled because using a higher
resolution resource consistently results in better output quality. One
reason for this is that rendering is often not perfectly pixel aligned,
meaning even if we load a resource with a suitable size, due to us still
scaling ever so slightly, the quality is affected. Using a higher
resolution resource avoids this problem.

For situations inside clutter where the actual maximum view scale is
needed, a function _clutter_actor_get_real_resource_scale() is provided,
which returns the non-ceiled value.

Make sure we ignore resource scale computation requests during size
requests or allocation while ensure we've proper resource-scale on
pre-paint.

https://bugzilla.gnome.org/show_bug.cgi?id=765011
https://gitlab.gnome.org/GNOME/mutter/merge_requests/3
2019-03-01 17:46:49 +00:00
Marco Trevisan (Treviño)
789a3ef029 clutter/util: Add function to build a ClutterRect from a cairo rectangle
Utility functions to easily convert a cairo rectangle into a ClutterRect.

And add ability to offset a cairo rect.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/3
2019-03-01 17:46:49 +00:00
Adam Jackson
bc657c9feb clutter: Remove unused deprecated/clutter-input-device-deprecated.c
https://gitlab.gnome.org/GNOME/mutter/merge_requests/464
2019-02-28 13:01:36 -05:00
Adam Jackson
52e074b08a clutter: Remove unused deprecated/clutter-{list-,}model.c
https://gitlab.gnome.org/GNOME/mutter/merge_requests/464
2019-02-28 13:01:32 -05:00
Adam Jackson
f1b148e488 clutter: Remove tests/conform/model.c
The clutter model code is deprecated and this is the only consumer.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/464
2019-02-28 13:01:29 -05:00
Adam Jackson
df3d2389a9 clutter: Remove unused deprecated/clutter-behaviour-rotate.c
https://gitlab.gnome.org/GNOME/mutter/merge_requests/461
2019-02-28 10:51:12 -05:00
Adam Jackson
ac7ca3265e clutter: Remove tests/interactive/test-{depth,multistage.c}
These are the only consumers of deprecated/clutter-behaviour-rotate.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/461
2019-02-28 10:35:39 -05:00
Adam Jackson
cc07702386 clutter: Remove unused deprecated/clutter-behaviour-path.c
https://gitlab.gnome.org/GNOME/mutter/merge_requests/461
2019-02-28 10:35:29 -05:00
Adam Jackson
1f796f1fbf clutter: Remove unused deprecated/clutter-timeout-interval.c
https://gitlab.gnome.org/GNOME/mutter/merge_requests/461
2019-02-28 10:35:29 -05:00
Adam Jackson
65312be59d clutter: Remove unused deprecated/clutter-behaviour-ellipse.c
https://gitlab.gnome.org/GNOME/mutter/merge_requests/461
2019-02-28 10:35:29 -05:00
Adam Jackson
5a6a602da8 clutter: Remove unused deprecated/clutter-shader.c
https://gitlab.gnome.org/GNOME/mutter/merge_requests/461
2019-02-28 10:35:29 -05:00
Niels De Graef
1c6ea5d1db Use a consistent style for enum braces
https://gitlab.gnome.org/GNOME/mutter/merge_requests/361
2019-02-28 09:31:01 +01:00
Niels De Graef
16a2eab290 clutter: Animatable: Use G_DECLARE_INTERFACE()
It cuts away a bit of the GObject boilerplate, gives us support for
`g_autoptr`, and removes the typedef hack inside clutter-scroll-actor.c.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/380
2019-02-27 16:44:24 +00:00
Niels De Graef
41a69f194d clutter: MasterClock: Use G_DECLARE_INTERFACE()
It cuts away a bit of the GObject boilerplate, gives us support for
`g_autoptr`, and removes the typedef hack inside clutter-master-clock.c.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/380
2019-02-27 16:44:24 +00:00
Niels De Graef
b77e6f0c98 clutter: Content: Use G_DECLARE_INTERFACE()
It cuts away a bit of the GObject boilerplate, gives us support for
`g_autoptr`, and removes the typedef hack inside clutter-content.c.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/380
2019-02-27 16:44:24 +00:00
Niels De Graef
b67394dcd1 clutter: StageWindow: Use G_DECLARE_INTERFACE()
It cuts away a bit of the GObject boilerplate, gives us support for
`g_autoptr`, and removes the typedef hack inside clutter-stage-window.c.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/380
2019-02-27 16:44:24 +00:00
Olivier Fourdan
f9e33a89fd clutter: cleanup/remove core input X11 backend
We don't use the core input X11 backend, remove it.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/459
2019-02-27 12:07:24 +01:00
Adam Jackson
39e9e53871 clutter: Remove the rest of deprecated/clutter-animator.c
https://gitlab.gnome.org/GNOME/mutter/merge_requests/452
2019-02-27 03:32:21 +00:00
Adam Jackson
7f3fda6df6 clutter: Simplify clutter_state_change
clutter_state_get_animator now always returns NULL, because
_set_animator is never called.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/452
2019-02-27 03:32:21 +00:00
Adam Jackson
73ce5b3a8d clutter: Remove tests/interactive/test-state-animator.c
This is the only caller of the (deprecated) clutter_state_set_animator.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/452
2019-02-27 03:32:21 +00:00
Adam Jackson
53319a121f clutter: Remove unused deprecated code from clutter-actor-deprecated.c
Since clutter_actor_set_shader() is never called, none of this has any
effect.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/452
2019-02-27 03:32:21 +00:00
Adam Jackson
cf2d06e9b9 clutter: Remove deprecated clutter-score.c
https://gitlab.gnome.org/GNOME/mutter/merge_requests/452
2019-02-27 03:32:21 +00:00
Adam Jackson
d39211f438 clutter: Remove deprecated clutter_egl{,x}_display
https://gitlab.gnome.org/GNOME/mutter/merge_requests/452
2019-02-27 03:32:21 +00:00
Adam Jackson
909464f749 clutter: Remove deprecated XInput code
https://gitlab.gnome.org/GNOME/mutter/merge_requests/452
2019-02-27 03:32:21 +00:00
Adam Jackson
5669b64021 clutter: Remove unused clutter-glx-texture-pixmap.c and friends
https://gitlab.gnome.org/GNOME/mutter/merge_requests/452
2019-02-27 03:32:21 +00:00
Adam Jackson
8f0b4767de clutter: Remove deprecated clutter_x11_get_stage_visual
https://gitlab.gnome.org/GNOME/mutter/merge_requests/452
2019-02-27 03:32:21 +00:00
Jonas Ådahl
6372e3e4db clutter: Add clutter_actor_has_damage() API
Will be used to check whether there are any damage to an actor.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/413
2019-02-26 13:39:11 +00:00
Carlos Garnacho
bf12a2497b clutter: Make docs match with signal description
Makes gobject-introspection happy again.

Pointed out by Robert Mader at:
https://gitlab.gnome.org/GNOME/mutter/merge_requests/196
2019-02-25 20:12:21 +01:00
Carlos Garnacho
55d168d01a clutter: Add ClutterPaintVolume argument to ClutterActor::queue_redraw
This is an ABI break, hopefully an unimportant one since this signal/vmethod
is barely overridden.

The signal has been added an extra ClutterPaintVolume argument, and has been
given a boolean return value. The recursion to the parents has been taken
out of the default implementation and into the caller, using the returned
boolean parameter to control further propagation.

Passing the ClutterPaintVolume is easier on performance, as we don't need
setting this pointer as gobject data just to retrieve/unset it further
in propagation.

https://bugzilla.gnome.org/show_bug.cgi?id=782344
2019-02-25 18:17:34 +00:00
Adam Jackson
0d9295523e clutter: Remove deprecate/clutter-frame-source.h
https://gitlab.gnome.org/GNOME/mutter/merge_requests/445
2019-02-15 23:01:01 +00:00
Adam Jackson
a4443885a3 clutter: Remove deprecated/clutter-timeout-pool.h
https://gitlab.gnome.org/GNOME/mutter/merge_requests/445
2019-02-15 23:01:01 +00:00
Adam Jackson
ef8f2876e3 clutter: Remove deprecated/clutter-backend.h
https://gitlab.gnome.org/GNOME/mutter/merge_requests/445
2019-02-15 23:01:01 +00:00
Adam Jackson
75071aba68 clutter: Remove deprecated/clutter-util.h
https://gitlab.gnome.org/GNOME/mutter/merge_requests/445
2019-02-15 23:01:01 +00:00
Niels De Graef
a81435ab5f cogl: Remove CoglBool, use gboolean instead
This basically reverts commit 54735dec, which tried to avoid the
GLib-defined types in favor the standard C ones. One exception to this
is the bool type, for which the commit introduces a new type CoglBool.

Let's just get rid of this type in favor of having consistency with the
GLib types. Note by the way that neither CoglBool nor gboolean (which
has a size of `int`) are completely compatible with bool (size `char`).

https://gitlab.gnome.org/GNOME/mutter/merge_requests/321
2019-02-15 16:35:46 +01:00
Georges Basile Stavracas Neto
317414ab26 clutter/paint-nodes: Push/pop framebuffer
Unfortunately, many parts of GNOME Shell and Mutter and Clutter
still use the implicit Cogl1 API. As such, it as a transition
between the old and new APIs, it is important to keep the
implicit draw framebuffer updated.

ClutterRootNode does not keep it updated though, and it might
lead to problems when rendering offscreen textures.

Fix that by pushing and popping the root node framebuffer on
pre- and post-draw, respectively.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/405
2019-02-01 12:42:12 +00:00
Georges Basile Stavracas Neto
b63e104561 clutter/paint-nodes: Expose ClutterRootNode
The ClutterRootNode paint node is theoretically the
top-most node of a paint nodes tree, except that we
are not in the point of having full rendering trees
in Clutter (all rendering performed by paint nodes
is still local and immediate).

When controlling the rendering tree, MetaShapedTexture
may need to paint into an offscreen framebuffer under
some circumstations.

Expose ClutterRootNode so that MetaShapedTexture can
use it to render to offscreen framebuffers.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/405
2019-02-01 12:42:12 +00:00
Georges Basile Stavracas Neto
02b184bfd7 clutter/paint-node: Expose clutter_paint_node_paint()
When painting to an offscreen framebuffer, MetaShapedTexture will
need to have full control of the painting routines of paint nodes.
As such, expose clutter_paint_node_paint() to allow forcing a
paint nodes paint from MetaShapedTexture.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/405
2019-02-01 12:42:12 +00:00
Georges Basile Stavracas Neto
d8c7583922 clutter/paint-node: Add multitexture API
The multitexture API is not a shortcut for multiple calls
to the single texture API. It is meant to wrap calls to
cogl_framebuffer_draw_multitexture_rectangle(), which
uses the passed texture coordinates at different layers of
the pipeline.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/405
2019-02-01 12:42:12 +00:00
Georges Basile Stavracas Neto
25f36b3892 clutter/image: Also invalidate size
ClutterImage is a ClutterContent implementation that
has an internally managed CoglTexture. This texture
is recreated when new image data is set.

ClutterContent implementations may have control over
the allocation of the widgets they're attached to,
through CLUTTER_REQUEST_CONTENT_SIZE. On those cases,
if the new image data differs in size from the previous
data, it is important to notify those actors about the
size change. However, currently ClutterImage does not
notify them.

With the introduction of clutter_content_invalidate_size(),
it is possible to report the size changes to attached
actors.

Adapt ClutterImage to invalidate_size() when image data
has different sizes.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/405
2019-02-01 12:42:12 +00:00
Georges Basile Stavracas Neto
0f0b411f6e clutter/content: Add clutter_content_invalidate_size()
ClutterContent has the ability to dictate the layout of any
given actor, through the CLUTTER_REQUEST_CONTENT_SIZE request
mode.

However, there is no way for ClutterContent implementations
to notify their attached actors that the content size changed.

Add a new optional ClutterContent.invalidate_size() vfunc and
clutter_content_invalidate_size().

https://gitlab.gnome.org/GNOME/mutter/merge_requests/405
2019-02-01 12:42:12 +00:00
Ole Jørgen Brønner
5a71ed4411 clutter-event: Correctly annotate some methods
https://gitlab.gnome.org/GNOME/mutter/merge_requests/181
2019-01-31 16:50:04 +00:00