2013-02-18 17:55:26 -05:00
|
|
|
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
|
|
|
/*
|
|
|
|
* Utilities for use with Clutter
|
|
|
|
*
|
|
|
|
* Copyright 2010 Red Hat, Inc.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License as
|
|
|
|
* published by the Free Software Foundation; either version 2 of the
|
|
|
|
* License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2014-01-11 20:42:06 -05:00
|
|
|
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
2013-02-18 17:55:26 -05:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __META_CLUTTER_UTILS_H__
|
|
|
|
#define __META_CLUTTER_UTILS_H__
|
|
|
|
|
2018-07-10 04:36:24 -04:00
|
|
|
#include "clutter/clutter.h"
|
|
|
|
|
2021-06-01 11:50:07 -04:00
|
|
|
typedef struct {
|
|
|
|
int x_origin, y_origin;
|
|
|
|
float x_scale, y_scale;
|
|
|
|
} MetaTransforms;
|
|
|
|
|
2019-02-20 08:18:48 -05:00
|
|
|
gboolean meta_actor_vertices_are_untransformed (graphene_point3d_t *verts,
|
|
|
|
float widthf,
|
|
|
|
float heightf,
|
2021-06-01 11:50:07 -04:00
|
|
|
MetaTransforms *out_transforms);
|
2013-02-18 17:55:26 -05:00
|
|
|
|
2018-12-19 05:55:43 -05:00
|
|
|
gboolean meta_actor_painting_untransformed (CoglFramebuffer *fb,
|
|
|
|
int paint_width,
|
|
|
|
int paint_height,
|
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-13 14:31:23 -04:00
|
|
|
int sample_widthf,
|
|
|
|
int sample_heightf,
|
2021-06-01 11:50:07 -04:00
|
|
|
MetaTransforms *out_transforms);
|
2014-08-27 12:44:26 -04:00
|
|
|
|
2013-02-18 17:55:26 -05:00
|
|
|
#endif /* __META_CLUTTER_UTILS_H__ */
|