mirror of
https://github.com/brl/mutter.git
synced 2024-11-22 16:10:41 -05:00
stage: Do not use get_allocation_geometry()
It's pointless, and it will be deprecated soon.
This commit is contained in:
parent
699a1876d4
commit
ef1bb42a86
@ -364,10 +364,11 @@ clutter_stage_allocate (ClutterActor *self,
|
||||
ClutterAllocationFlags flags)
|
||||
{
|
||||
ClutterStagePrivate *priv = CLUTTER_STAGE (self)->priv;
|
||||
ClutterGeometry prev_geom, geom;
|
||||
float old_width, old_height;
|
||||
float new_width, new_height;
|
||||
float width, height;
|
||||
cairo_rectangle_int_t window_size;
|
||||
gboolean origin_changed;
|
||||
gint width, height;
|
||||
|
||||
origin_changed = (flags & CLUTTER_ABSOLUTE_ORIGIN_CHANGED)
|
||||
? TRUE
|
||||
@ -377,11 +378,10 @@ clutter_stage_allocate (ClutterActor *self,
|
||||
return;
|
||||
|
||||
/* our old allocation */
|
||||
clutter_actor_get_allocation_geometry (self, &prev_geom);
|
||||
clutter_actor_get_size (self, &old_width, &old_height);
|
||||
|
||||
/* the current allocation */
|
||||
width = clutter_actor_box_get_width (box);
|
||||
height = clutter_actor_box_get_height (box);
|
||||
clutter_actor_box_get_size (box, &width, &height);
|
||||
|
||||
/* the current Stage implementation size */
|
||||
_clutter_stage_window_get_geometry (priv->impl, &window_size);
|
||||
@ -391,7 +391,7 @@ clutter_stage_allocate (ClutterActor *self,
|
||||
* allocation chain - because we cannot forcibly change the size of the
|
||||
* stage window.
|
||||
*/
|
||||
if ((!clutter_feature_available (CLUTTER_FEATURE_STAGE_STATIC)))
|
||||
if (!clutter_feature_available (CLUTTER_FEATURE_STAGE_STATIC))
|
||||
{
|
||||
CLUTTER_NOTE (LAYOUT,
|
||||
"Following allocation to %dx%d (origin %s)",
|
||||
@ -470,14 +470,15 @@ clutter_stage_allocate (ClutterActor *self,
|
||||
window_size.height);
|
||||
|
||||
/* reset the viewport if the allocation effectively changed */
|
||||
clutter_actor_get_allocation_geometry (self, &geom);
|
||||
if (geom.width != prev_geom.width ||
|
||||
geom.height != prev_geom.height)
|
||||
clutter_actor_get_size (self, &new_width, &new_height);
|
||||
|
||||
if (old_width != new_width ||
|
||||
old_height != new_height)
|
||||
{
|
||||
_clutter_stage_set_viewport (CLUTTER_STAGE (self),
|
||||
0, 0,
|
||||
geom.width,
|
||||
geom.height);
|
||||
new_width,
|
||||
new_height);
|
||||
|
||||
/* Note: we don't assume that set_viewport will queue a full redraw
|
||||
* since it may bail-out early if something preemptively set the
|
||||
@ -2836,7 +2837,7 @@ clutter_stage_read_pixels (ClutterStage *stage,
|
||||
gint width,
|
||||
gint height)
|
||||
{
|
||||
ClutterGeometry geom;
|
||||
ClutterActorBox box;
|
||||
guchar *pixels;
|
||||
|
||||
g_return_val_if_fail (CLUTTER_IS_STAGE (stage), NULL);
|
||||
@ -2845,13 +2846,13 @@ clutter_stage_read_pixels (ClutterStage *stage,
|
||||
clutter_stage_ensure_current (stage);
|
||||
clutter_actor_paint (CLUTTER_ACTOR (stage));
|
||||
|
||||
clutter_actor_get_allocation_geometry (CLUTTER_ACTOR (stage), &geom);
|
||||
clutter_actor_get_allocation_box (CLUTTER_ACTOR (stage), &box);
|
||||
|
||||
if (width < 0)
|
||||
width = geom.width;
|
||||
width = box.x2 - box.x1;
|
||||
|
||||
if (height < 0)
|
||||
height = geom.height;
|
||||
height = box.y2 - box.y1;
|
||||
|
||||
pixels = g_malloc (height * width * 4);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user