Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions clutter/clutter/clutter-enums.h
Original file line number Diff line number Diff line change
Expand Up @@ -1329,8 +1329,6 @@ typedef enum
* painting the stages
* @CLUTTER_REPAINT_FLAGS_POST_PAINT: Run the repaint function after
* painting the stages
* @CLUTTER_REPAINT_FLAGS_QUEUE_REDRAW_ON_ADD: Ensure that a new frame
* is queued after adding the repaint function
*
* Flags to pass to clutter_threads_add_repaint_func_full().
*
Expand All @@ -1340,7 +1338,6 @@ typedef enum
{
CLUTTER_REPAINT_FLAGS_PRE_PAINT = 1 << 0,
CLUTTER_REPAINT_FLAGS_POST_PAINT = 1 << 1,
CLUTTER_REPAINT_FLAGS_QUEUE_REDRAW_ON_ADD = 1 << 2
} ClutterRepaintFlags;

/**
Expand Down
10 changes: 1 addition & 9 deletions clutter/clutter/clutter-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2407,8 +2407,7 @@ clutter_threads_add_repaint_func_full (ClutterRepaintFlags flags,

repaint_func->id = context->last_repaint_id++;

/* mask out QUEUE_REDRAW_ON_ADD, since we're going to consume it */
repaint_func->flags = flags & ~CLUTTER_REPAINT_FLAGS_QUEUE_REDRAW_ON_ADD;
repaint_func->flags = flags;
repaint_func->func = func;
repaint_func->data = data;
repaint_func->notify = notify;
Expand All @@ -2418,13 +2417,6 @@ clutter_threads_add_repaint_func_full (ClutterRepaintFlags flags,

_clutter_context_unlock ();

if ((flags & CLUTTER_REPAINT_FLAGS_QUEUE_REDRAW_ON_ADD) != 0)
{
ClutterMasterClock *master_clock = _clutter_master_clock_get_default ();

_clutter_master_clock_ensure_next_iteration (master_clock);
}

return repaint_func->id;
}

Expand Down
49 changes: 35 additions & 14 deletions clutter/clutter/clutter-pan-action.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ enum

static guint pan_signals[LAST_SIGNAL] = { 0, };

G_DEFINE_TYPE_WITH_PRIVATE (ClutterPanAction, clutter_pan_action, CLUTTER_TYPE_GESTURE_ACTION)
G_DEFINE_TYPE_WITH_PRIVATE (ClutterPanAction, clutter_pan_action,
CLUTTER_TYPE_GESTURE_ACTION)

static void
emit_pan (ClutterPanAction *self,
Expand All @@ -156,14 +157,18 @@ emit_pan (ClutterPanAction *self,
gfloat scroll_threshold = G_PI_4/2;
gfloat drag_angle;

clutter_gesture_action_get_motion_delta (CLUTTER_GESTURE_ACTION (self), 0, &delta_x, &delta_y);
clutter_gesture_action_get_motion_delta (CLUTTER_GESTURE_ACTION (self),
0,
&delta_x,
&delta_y);

if (delta_x != 0.0f)
drag_angle = atanf (delta_y / delta_x);
else
drag_angle = G_PI_2;

if ((drag_angle > -scroll_threshold) && (drag_angle < scroll_threshold))
if ((drag_angle > -scroll_threshold) &&
(drag_angle < scroll_threshold))
priv->pin_state = SCROLL_PINNED_HORIZONTAL;
else if ((drag_angle > (G_PI_2 - scroll_threshold)) ||
(drag_angle < -(G_PI_2 - scroll_threshold)))
Expand Down Expand Up @@ -282,7 +287,10 @@ gesture_end (ClutterGestureAction *gesture,
gfloat tau;
gint duration;

clutter_gesture_action_get_release_coords (CLUTTER_GESTURE_ACTION (self), 0, &priv->release_x, &priv->release_y);
clutter_gesture_action_get_release_coords (CLUTTER_GESTURE_ACTION (self),
0,
&priv->release_x,
&priv->release_y);

if (!priv->should_interpolate)
{
Expand All @@ -293,7 +301,9 @@ gesture_end (ClutterGestureAction *gesture,
priv->state = PAN_STATE_INTERPOLATING;

clutter_gesture_action_get_motion_delta (gesture, 0, &delta_x, &delta_y);
velocity = clutter_gesture_action_get_velocity (gesture, 0, &velocity_x, &velocity_y);
velocity = clutter_gesture_action_get_velocity (gesture, 0,
&velocity_x,
&velocity_y);

/* Exponential timing constant v(t) = v(0) * exp(-t/tau)
* tau = 1000ms / (frame_per_second * - ln(decay_per_frame))
Expand All @@ -304,17 +314,22 @@ gesture_end (ClutterGestureAction *gesture,
/* See where the decreasing velocity reaches $min_velocity px/ms
* v(t) = v(0) * exp(-t/tau) = min_velocity
* t = - tau * ln( min_velocity / |v(0)|) */
duration = - tau * logf (min_velocity / (ABS (velocity) * priv->acceleration_factor));
duration = - tau * logf (min_velocity / (ABS (velocity) *
priv->acceleration_factor));

/* Target point: x(t) = v(0) * tau * [1 - exp(-t/tau)] */
priv->target_x = velocity_x * priv->acceleration_factor * tau * (1 - exp ((float)-duration / tau));
priv->target_y = velocity_y * priv->acceleration_factor * tau * (1 - exp ((float)-duration / tau));
priv->target_x = (velocity_x * priv->acceleration_factor * tau *
(1 - exp ((float)-duration / tau)));
priv->target_y = (velocity_y * priv->acceleration_factor * tau *
(1 - exp ((float)-duration / tau)));

if (ABS (velocity) * priv->acceleration_factor > min_velocity && duration > FLOAT_EPSILON)
if (ABS (velocity) * priv->acceleration_factor > min_velocity &&
duration > FLOAT_EPSILON)
{
priv->interpolated_x = priv->interpolated_y = 0.0f;
priv->deceleration_timeline = clutter_timeline_new (duration);
clutter_timeline_set_progress_mode (priv->deceleration_timeline, CLUTTER_EASE_OUT_EXPO);
clutter_timeline_set_progress_mode (priv->deceleration_timeline,
CLUTTER_EASE_OUT_EXPO);

g_signal_connect (priv->deceleration_timeline, "new_frame",
G_CALLBACK (on_deceleration_new_frame), self);
Expand Down Expand Up @@ -367,7 +382,8 @@ clutter_pan_action_set_property (GObject *gobject,
break;

case PROP_ACCELERATION_FACTOR :
clutter_pan_action_set_acceleration_factor (self, g_value_get_double (value));
clutter_pan_action_set_acceleration_factor (self,
g_value_get_double (value));
break;

default:
Expand Down Expand Up @@ -411,9 +427,11 @@ static void
clutter_pan_action_constructed (GObject *gobject)
{
ClutterGestureAction *gesture;
ClutterGestureTriggerEdge edge;

gesture = CLUTTER_GESTURE_ACTION (gobject);
clutter_gesture_action_set_threshold_trigger_edge (gesture, CLUTTER_GESTURE_TRIGGER_EDGE_AFTER);
edge = CLUTTER_GESTURE_TRIGGER_EDGE_AFTER;
clutter_gesture_action_set_threshold_trigger_edge (gesture, edge);
}

static void
Expand Down Expand Up @@ -442,7 +460,8 @@ clutter_pan_action_set_actor (ClutterActorMeta *meta,
g_clear_object (&priv->deceleration_timeline);
}

CLUTTER_ACTOR_META_CLASS (clutter_pan_action_parent_class)->set_actor (meta, actor);
CLUTTER_ACTOR_META_CLASS (clutter_pan_action_parent_class)->set_actor (meta,
actor);
}


Expand Down Expand Up @@ -880,7 +899,9 @@ clutter_pan_action_get_constrained_motion_delta (ClutterPanAction *self,

priv = self->priv;

distance = clutter_pan_action_get_motion_delta (self, point, &delta_x, &delta_y);
distance = clutter_pan_action_get_motion_delta (self, point,
&delta_x,
&delta_y);

switch (priv->pan_axis)
{
Expand Down
2 changes: 1 addition & 1 deletion clutter/clutter/clutter-script-parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -1750,7 +1750,7 @@ clutter_script_construct_parameters (ClutterScript *script,
continue;
}

if (!(pspec->flags & G_PARAM_CONSTRUCT_ONLY))
if (!(pspec->flags & (G_PARAM_CONSTRUCT | G_PARAM_CONSTRUCT_ONLY)))
{
unparsed = g_list_prepend (unparsed, pinfo);
continue;
Expand Down
32 changes: 1 addition & 31 deletions clutter/clutter/clutter-stage.c
Original file line number Diff line number Diff line change
Expand Up @@ -1115,6 +1115,7 @@ clutter_stage_hide (ClutterActor *self)
ClutterStagePrivate *priv = CLUTTER_STAGE (self)->priv;

g_assert (priv->impl != NULL);
_clutter_stage_clear_pick_stack (CLUTTER_STAGE (self));
_clutter_stage_window_hide (priv->impl);

CLUTTER_ACTOR_CLASS (clutter_stage_parent_class)->hide (self);
Expand Down Expand Up @@ -3492,37 +3493,6 @@ _clutter_stage_maybe_setup_viewport (ClutterStage *stage,

#undef _DEG_TO_RAD

/**
* clutter_stage_ensure_redraw:
* @stage: a #ClutterStage
*
* Ensures that @stage is redrawn
*
* This function should not be called by applications: it is
* used when embedding a #ClutterStage into a toolkit with
* another windowing system, like GTK+.
*
* Since: 1.0
*/
void
clutter_stage_ensure_redraw (ClutterStage *stage)
{
ClutterMasterClock *master_clock;
ClutterStagePrivate *priv;

g_return_if_fail (CLUTTER_IS_STAGE (stage));

priv = stage->priv;

if (!_clutter_stage_needs_update (stage))
clutter_stage_schedule_update (stage);

priv->redraw_pending = TRUE;

master_clock = _clutter_master_clock_get_default ();
_clutter_master_clock_start_running (master_clock);
}

/**
* clutter_stage_is_redraw_queued: (skip)
*/
Expand Down
2 changes: 0 additions & 2 deletions clutter/clutter/clutter-stage.h
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,6 @@ guchar * clutter_stage_read_pixels (ClutterStage

CLUTTER_EXPORT
void clutter_stage_ensure_viewport (ClutterStage *stage);
CLUTTER_EXPORT
void clutter_stage_ensure_redraw (ClutterStage *stage);

CLUTTER_EXPORT
gboolean clutter_stage_is_redraw_queued (ClutterStage *stage);
Expand Down
Loading
Loading