summaryrefslogtreecommitdiff
path: root/fragment.c
diff options
context:
space:
mode:
Diffstat (limited to 'fragment.c')
-rw-r--r--fragment.c33
1 files changed, 16 insertions, 17 deletions
diff --git a/fragment.c b/fragment.c
index 1cb3edf..3bbf44c 100644
--- a/fragment.c
+++ b/fragment.c
@@ -23,7 +23,7 @@ typedef enum
STATE_TRAPS,
STATE_GLYPHS,
STATE_IMAGE,
- STATE_COMMAND /* FIXME: should be called composite? */
+ STATE_COMPOSITE
} state_type_t;
typedef struct
@@ -61,7 +61,7 @@ typedef struct
state_t * dest;
pixman_op_t op;
state_t * source;
-} state_command_t;
+} state_composite_t;
union state_t
{
@@ -69,7 +69,7 @@ union state_t
state_traps_t traps;
state_glyphs_t glyphs;
state_image_t image;
- state_command_t command;
+ state_composite_t composite;
};
struct fragment_t
@@ -119,9 +119,9 @@ state_unref (state_t *state)
case STATE_IMAGE:
pixman_image_unref (state->image.image);
break;
- case STATE_COMMAND:
- state_unref (state->command.dest);
- state_unref (state->command.source);
+ case STATE_COMPOSITE:
+ state_unref (state->composite.dest);
+ state_unref (state->composite.source);
break;
}
@@ -138,15 +138,15 @@ state_composite (state_t *dest, pixman_op_t op, state_t *source)
if (!new_state)
return NULL;
- /* FIXME: Always using COMMAND should be correct, but
+ /* FIXME: Always using COMPOSITE should be correct, but
* we can do a lot better with a few simple optimizations
*/
- new_state->common.type = STATE_COMMAND;
+ new_state->common.type = STATE_COMPOSITE;
new_state->common.ref_count = 1;
- new_state->command.dest = state_ref (dest);
- new_state->command.op = op;
- new_state->command.source = state_ref (source);
+ new_state->composite.dest = state_ref (dest);
+ new_state->composite.op = op;
+ new_state->composite.source = state_ref (source);
return new_state;
}
@@ -264,8 +264,7 @@ fragment_intersect (fragment_t *dest, fragment_t *source)
{
fragment_t *new_fragment;
- new_fragment = malloc (sizeof *new_fragment);
- if (!new_fragment)
+ if (!(new_fragment = malloc (sizeof *new_fragment)))
return (fragment_t *)&broken_fragment;
new_fragment->broken = FALSE;
@@ -398,7 +397,7 @@ state_apply (state_t *state, pixman_image_t *image)
0, 0, 0, 0, 0, 0, width, height);
break;
- case STATE_COMMAND:
+ case STATE_COMPOSITE:
/* FIXME: track alpha-only */
temp = pixman_image_create_bits (
PIXMAN_a8r8g8b8, width, height, NULL, -1);
@@ -406,15 +405,15 @@ state_apply (state_t *state, pixman_image_t *image)
if (!temp)
break; /* FIXME: status */
- state_apply (state->command.dest, image);
+ state_apply (state->composite.dest, image);
/* FIXME: check if source can be expressed as
* (s IN m), (s IN glyphs), (s IN traps)
*/
- state_apply (state->command.source, temp);
+ state_apply (state->composite.source, temp);
pixman_image_composite32 (
- state->command.op, temp, NULL, image,
+ state->composite.op, temp, NULL, image,
0, 0, 0, 0, 0, 0, width, height);
pixman_image_unref (temp);