mirror of
https://github.com/brl/mutter.git
synced 2024-11-25 01:20:42 -05:00
clutter/stage: Make set_viewport() a static method
Since clutter_stage_set_viewport() is only used inside clutter-stage.c anyway, we can make it a static method. Also we can remove the x and y arguments from it since they're always set to 0 anyway. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1247
This commit is contained in:
parent
7abf0f1e2d
commit
38104755a2
@ -50,11 +50,6 @@ ClutterStageWindow *_clutter_stage_get_window (ClutterStage
|
||||
void _clutter_stage_get_projection_matrix (ClutterStage *stage,
|
||||
CoglMatrix *projection);
|
||||
void _clutter_stage_dirty_projection (ClutterStage *stage);
|
||||
void _clutter_stage_set_viewport (ClutterStage *stage,
|
||||
float x,
|
||||
float y,
|
||||
float width,
|
||||
float height);
|
||||
void _clutter_stage_get_viewport (ClutterStage *stage,
|
||||
float *x,
|
||||
float *y,
|
||||
|
@ -189,6 +189,9 @@ static void capture_view_into (ClutterStage *stage,
|
||||
uint8_t *data,
|
||||
int stride);
|
||||
static void clutter_stage_update_view_perspective (ClutterStage *stage);
|
||||
static void clutter_stage_set_viewport (ClutterStage *stage,
|
||||
float width,
|
||||
float height);
|
||||
|
||||
static void clutter_container_iface_init (ClutterContainerIface *iface);
|
||||
|
||||
@ -718,10 +721,7 @@ clutter_stage_allocate (ClutterActor *self,
|
||||
clutter_actor_get_allocation_box (self, &alloc);
|
||||
clutter_actor_box_get_size (&alloc, &new_width, &new_height);
|
||||
|
||||
_clutter_stage_set_viewport (CLUTTER_STAGE (self),
|
||||
0, 0,
|
||||
new_width,
|
||||
new_height);
|
||||
clutter_stage_set_viewport (CLUTTER_STAGE (self), new_width, new_height);
|
||||
}
|
||||
|
||||
typedef struct _Vector4
|
||||
@ -2239,10 +2239,7 @@ clutter_stage_init (ClutterStage *self)
|
||||
g_signal_connect (self, "notify::min-height",
|
||||
G_CALLBACK (clutter_stage_notify_min_size), NULL);
|
||||
|
||||
_clutter_stage_set_viewport (self,
|
||||
0, 0,
|
||||
geom.width,
|
||||
geom.height);
|
||||
clutter_stage_set_viewport (self, geom.width, geom.height);
|
||||
|
||||
priv->paint_volume_stack =
|
||||
g_array_new (FALSE, FALSE, sizeof (ClutterPaintVolume));
|
||||
@ -2429,8 +2426,6 @@ _clutter_stage_dirty_projection (ClutterStage *stage)
|
||||
/*
|
||||
* clutter_stage_set_viewport:
|
||||
* @stage: A #ClutterStage
|
||||
* @x: The X postition to render the stage at, in window coordinates
|
||||
* @y: The Y position to render the stage at, in window coordinates
|
||||
* @width: The width to render the stage at, in window coordinates
|
||||
* @height: The height to render the stage at, in window coordinates
|
||||
*
|
||||
@ -2463,19 +2458,20 @@ _clutter_stage_dirty_projection (ClutterStage *stage)
|
||||
*
|
||||
* Since: 1.6
|
||||
*/
|
||||
void
|
||||
_clutter_stage_set_viewport (ClutterStage *stage,
|
||||
float x,
|
||||
float y,
|
||||
static void
|
||||
clutter_stage_set_viewport (ClutterStage *stage,
|
||||
float width,
|
||||
float height)
|
||||
{
|
||||
ClutterStagePrivate *priv;
|
||||
float x, y;
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_STAGE (stage));
|
||||
|
||||
priv = stage->priv;
|
||||
|
||||
x = 0.f;
|
||||
y = 0.f;
|
||||
width = roundf (width);
|
||||
height = roundf (height);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user