Skip to content

Commit

Permalink
window-actor: Fix squished window textures (#453)
Browse files Browse the repository at this point in the history
* window-actor: Fix squished window textures

* clutter: Move ClutterActorPrivate to clutter-muffin.h

This will be needed to override queue_relayout on MetaWindowActor without hurting performance.

* Propagate relayouts to the window group on size/position change

* Don't relayout twice
  • Loading branch information
jaszhix authored and clefebvre committed Apr 2, 2019
1 parent 6069fd7 commit f752fb5
Show file tree
Hide file tree
Showing 3 changed files with 240 additions and 217 deletions.
210 changes: 1 addition & 209 deletions clutter/clutter/clutter-actor.c
Expand Up @@ -616,40 +616,7 @@
#define CLUTTER_DISABLE_DEPRECATION_WARNINGS
#define CLUTTER_ENABLE_EXPERIMENTAL_API

#include "clutter-actor-private.h"

#include "clutter-action.h"
#include "clutter-actor-meta-private.h"
#include "clutter-animatable.h"
#include "clutter-color-static.h"
#include "clutter-color.h"
#include "clutter-constraint-private.h"
#include "clutter-container.h"
#include "clutter-content-private.h"
#include "clutter-debug.h"
#include "clutter-easing.h"
#include "clutter-effect-private.h"
#include "clutter-enum-types.h"
#include "clutter-fixed-layout.h"
#include "clutter-flatten-effect.h"
#include "clutter-interval.h"
#include "clutter-main.h"
#include "clutter-marshal.h"
#include "clutter-paint-nodes.h"
#include "clutter-paint-node-private.h"
#include "clutter-paint-volume-private.h"
#include "clutter-private.h"
#include "clutter-property-transition.h"
#include "clutter-scriptable.h"
#include "clutter-script-private.h"
#include "clutter-stage-private.h"
#include "clutter-timeline.h"
#include "clutter-transition.h"
#include "clutter-units.h"

#include "deprecated/clutter-actor.h"
#include "deprecated/clutter-behaviour.h"
#include "deprecated/clutter-container.h"
#include "clutter-muffin.h"

/* Internal enum used to control mapped state update. This is a hint
* which indicates when to do something other than just enforce
Expand All @@ -668,181 +635,6 @@ typedef enum {
*/
} MapStateChange;

/* 3 entries should be a good compromise, few layout managers
* will ask for 3 different preferred size in each allocation cycle */
#define N_CACHED_SIZE_REQUESTS 3

struct _ClutterActorPrivate
{
/* request mode */
ClutterRequestMode request_mode;

/* our cached size requests for different width / height */
SizeRequest width_requests[N_CACHED_SIZE_REQUESTS];
SizeRequest height_requests[N_CACHED_SIZE_REQUESTS];

/* An age of 0 means the entry is not set */
guint cached_height_age;
guint cached_width_age;

/* the bounding box of the actor, relative to the parent's
* allocation
*/
ClutterActorBox allocation;
ClutterAllocationFlags allocation_flags;

/* clip, in actor coordinates */
ClutterRect clip;

/* the cached transformation matrix; see apply_transform() */
CoglMatrix transform;

guint8 opacity;
gint opacity_override;

ClutterOffscreenRedirect offscreen_redirect;

/* This is an internal effect used to implement the
offscreen-redirect property */
ClutterEffect *flatten_effect;

/* scene graph */
ClutterActor *parent;
ClutterActor *prev_sibling;
ClutterActor *next_sibling;
ClutterActor *first_child;
ClutterActor *last_child;

gint n_children;

/* tracks whenever the children of an actor are changed; the
* age is incremented by 1 whenever an actor is added or
* removed. the age is not incremented when the first or the
* last child pointers are changed, or when grandchildren of
* an actor are changed.
*/
gint age;

gchar *name; /* a non-unique name, used for debugging */

gint32 pick_id; /* per-stage unique id, used for picking */

/* a back-pointer to the Pango context that we can use
* to create pre-configured PangoLayout
*/
PangoContext *pango_context;

/* the text direction configured for this child - either by
* application code, or by the actor's parent
*/
ClutterTextDirection text_direction;

/* a counter used to toggle the CLUTTER_INTERNAL_CHILD flag */
gint internal_child;

/* meta classes */
ClutterMetaGroup *actions;
ClutterMetaGroup *constraints;
ClutterMetaGroup *effects;

/* delegate object used to allocate the children of this actor */
ClutterLayoutManager *layout_manager;

/* delegate object used to paint the contents of this actor */
ClutterContent *content;

ClutterActorBox content_box;
ClutterContentGravity content_gravity;
ClutterScalingFilter min_filter;
ClutterScalingFilter mag_filter;
ClutterContentRepeat content_repeat;

/* used when painting, to update the paint volume */
ClutterEffect *current_effect;

/* This is used to store an effect which needs to be redrawn. A
redraw can be queued to start from a particular effect. This is
used by parametrised effects that can cache an image of the
actor. If a parameter of the effect changes then it only needs to
redraw the cached image, not the actual actor. The pointer is
only valid if is_dirty == TRUE. If the pointer is NULL then the
whole actor is dirty. */
ClutterEffect *effect_to_redraw;

/* This is used when painting effects to implement the
clutter_actor_continue_paint() function. It points to the node in
the list of effects that is next in the chain */
const GList *next_effect_to_paint;

ClutterPaintVolume paint_volume;

/* NB: This volume isn't relative to this actor, it is in eye
* coordinates so that it can remain valid after the actor changes.
*/
ClutterPaintVolume last_paint_volume;

ClutterStageQueueRedrawEntry *queue_redraw_entry;

ClutterColor bg_color;

#ifdef CLUTTER_ENABLE_DEBUG
/* a string used for debugging messages */
gchar *debug_name;
#endif

/* a set of clones of the actor */
GHashTable *clones;

/* whether the actor is inside a cloned branch; this
* value is propagated to all the actor's children
*/
gulong in_cloned_branch;

GListModel *child_model;
ClutterActorCreateChildFunc create_child_func;
gpointer create_child_data;
GDestroyNotify create_child_notify;

/* bitfields: KEEP AT THE END */

/* fixed position and sizes */
guint position_set : 1;
guint min_width_set : 1;
guint min_height_set : 1;
guint natural_width_set : 1;
guint natural_height_set : 1;
/* cached request is invalid (implies allocation is too) */
guint needs_width_request : 1;
/* cached request is invalid (implies allocation is too) */
guint needs_height_request : 1;
/* cached allocation is invalid (request has changed, probably) */
guint needs_allocation : 1;
guint show_on_set_parent : 1;
guint has_clip : 1;
guint clip_to_allocation : 1;
guint enable_model_view_transform : 1;
guint enable_paint_unmapped : 1;
guint has_pointer : 1;
guint propagated_one_redraw : 1;
guint paint_volume_valid : 1;
guint last_paint_volume_valid : 1;
guint in_clone_paint : 1;
guint transform_valid : 1;
/* This is TRUE if anything has queued a redraw since we were last
painted. In this case effect_to_redraw will point to an effect
the redraw was queued from or it will be NULL if the redraw was
queued without an effect. */
guint is_dirty : 1;
guint bg_color_set : 1;
guint content_box_valid : 1;
guint x_expand_set : 1;
guint y_expand_set : 1;
guint needs_compute_expand : 1;
guint needs_x_expand : 1;
guint needs_y_expand : 1;
guint needs_paint_volume_update : 1;
};

enum
{
PROP_0,
Expand Down

0 comments on commit f752fb5

Please sign in to comment.