mirror of
https://github.com/brl/mutter.git
synced 2025-06-13 16:59:30 +00:00
Replace ClutterVertex by graphene_point3d_t
Pretty direct and straightforward port. This requires a GNOME Shell counterpart. In addition to that, include a progress function. https://gitlab.gnome.org/GNOME/mutter/merge_requests/458
This commit is contained in:
@ -66,11 +66,11 @@ round_to_fixed (float x)
|
||||
* in @x_origin and @y_origin.
|
||||
*/
|
||||
gboolean
|
||||
meta_actor_vertices_are_untransformed (ClutterVertex *verts,
|
||||
float widthf,
|
||||
float heightf,
|
||||
int *x_origin,
|
||||
int *y_origin)
|
||||
meta_actor_vertices_are_untransformed (graphene_point3d_t *verts,
|
||||
float widthf,
|
||||
float heightf,
|
||||
int *x_origin,
|
||||
int *y_origin)
|
||||
{
|
||||
int width, height;
|
||||
int v0x, v0y, v1x, v1y, v2x, v2y, v3x, v3y;
|
||||
@ -119,7 +119,7 @@ meta_actor_is_untransformed (ClutterActor *actor,
|
||||
int *y_origin)
|
||||
{
|
||||
gfloat widthf, heightf;
|
||||
ClutterVertex verts[4];
|
||||
graphene_point3d_t verts[4];
|
||||
|
||||
clutter_actor_get_size (actor, &widthf, &heightf);
|
||||
clutter_actor_get_abs_allocation_vertices (actor, verts);
|
||||
@ -153,7 +153,7 @@ meta_actor_painting_untransformed (CoglFramebuffer *fb,
|
||||
int *y_origin)
|
||||
{
|
||||
CoglMatrix modelview, projection, modelview_projection;
|
||||
ClutterVertex vertices[4];
|
||||
graphene_point3d_t vertices[4];
|
||||
float viewport[4];
|
||||
int i;
|
||||
|
||||
|
@ -23,11 +23,11 @@
|
||||
|
||||
#include "clutter/clutter.h"
|
||||
|
||||
gboolean meta_actor_vertices_are_untransformed (ClutterVertex *verts,
|
||||
float widthf,
|
||||
float heightf,
|
||||
int *x_origin,
|
||||
int *y_origin);
|
||||
gboolean meta_actor_vertices_are_untransformed (graphene_point3d_t *verts,
|
||||
float widthf,
|
||||
float heightf,
|
||||
int *x_origin,
|
||||
int *y_origin);
|
||||
gboolean meta_actor_is_untransformed (ClutterActor *actor,
|
||||
int *x_origin,
|
||||
int *y_origin);
|
||||
|
@ -1152,7 +1152,7 @@ meta_window_actor_transform_relative_position (MetaScreenCastWindow *screen_cast
|
||||
MetaWindowActorPrivate *priv =
|
||||
meta_window_actor_get_instance_private (window_actor);
|
||||
MetaRectangle bounds;
|
||||
ClutterVertex v1 = { 0.f, }, v2 = { 0.f, };
|
||||
graphene_point3d_t v1 = { 0.f, }, v2 = { 0.f, };
|
||||
|
||||
meta_window_actor_get_frame_bounds (screen_cast_window, &bounds);
|
||||
|
||||
|
@ -101,7 +101,7 @@ notify_cb (GObject *object, GParamSpec *pspec, TestState *state)
|
||||
macro so that the assertion failure will report the right line
|
||||
number */
|
||||
#define assert_coords(state, x_1, y_1, x_2, y_2) G_STMT_START { \
|
||||
ClutterVertex verts[4]; \
|
||||
graphene_point3d_t verts[4]; \
|
||||
clutter_actor_get_abs_allocation_vertices ((state)->rect, verts); \
|
||||
check_coords ((state), (x_1), (y_1), (x_2), (y_2), verts); \
|
||||
g_assert (approx_equal ((x_1), verts[0].x)); \
|
||||
@ -116,7 +116,7 @@ notify_cb (GObject *object, GParamSpec *pspec, TestState *state)
|
||||
g_assert (approx_equal (v->x, xc) && \
|
||||
approx_equal (v->y, yc) && \
|
||||
approx_equal (v->z, zc)); \
|
||||
g_boxed_free (CLUTTER_TYPE_VERTEX, v); } G_STMT_END
|
||||
g_boxed_free (GRAPHENE_TYPE_POINT3D, v); } G_STMT_END
|
||||
|
||||
static inline gboolean
|
||||
approx_equal (int a, int b)
|
||||
@ -130,7 +130,7 @@ check_coords (TestState *state,
|
||||
gint y_1,
|
||||
gint x_2,
|
||||
gint y_2,
|
||||
const ClutterVertex *verts)
|
||||
const graphene_point3d_t *verts)
|
||||
{
|
||||
if (g_test_verbose ())
|
||||
g_print ("checking that (%i,%i,%i,%i) \xe2\x89\x88 (%i,%i,%i,%i): %s\n",
|
||||
@ -426,7 +426,7 @@ test_rotate_center (TestState *state)
|
||||
{
|
||||
ClutterActor *rect = state->rect;
|
||||
gdouble angle_x, angle_y, angle_z;
|
||||
ClutterVertex *center_x, *center_y, *center_z;
|
||||
graphene_point3d_t *center_x, *center_y, *center_z;
|
||||
ClutterGravity z_center_gravity;
|
||||
gfloat stage_width, stage_height;
|
||||
gfloat rect_x, rect_y;
|
||||
|
@ -334,7 +334,7 @@ my_thing_allocate (ClutterActor *self,
|
||||
if (clutter_actor_is_scaled (child) ||
|
||||
clutter_actor_is_rotated (child))
|
||||
{
|
||||
ClutterVertex v1 = { 0, }, v2 = { 0, };
|
||||
graphene_point3d_t v1 = { 0, }, v2 = { 0, };
|
||||
ClutterActorBox transformed_box = { 0, };
|
||||
|
||||
/* origin */
|
||||
|
@ -1646,11 +1646,11 @@ meta_wayland_surface_get_absolute_coordinates (MetaWaylandSurface *surface,
|
||||
{
|
||||
ClutterActor *actor =
|
||||
CLUTTER_ACTOR (meta_wayland_surface_get_actor (surface));
|
||||
ClutterVertex sv = {
|
||||
graphene_point3d_t sv = {
|
||||
.x = sx * surface->scale,
|
||||
.y = sy * surface->scale,
|
||||
};
|
||||
ClutterVertex v = { 0 };
|
||||
graphene_point3d_t v = { 0 };
|
||||
|
||||
clutter_actor_apply_relative_transform_to_point (actor, NULL, &sv, &v);
|
||||
|
||||
|
Reference in New Issue
Block a user