summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSøren Sandmann Pedersen <ssp@redhat.com>2012-10-04 20:46:07 -0400
committerSøren Sandmann Pedersen <ssp@redhat.com>2012-10-04 20:46:07 -0400
commitf6455ef738f0c98d2450cbb7c6c384197297a164 (patch)
tree2204181cf9736c17d8e06dac9e6f4060e005c106
parent3d47e780cd8341316a2e52012f38ab1d45f906ba (diff)
Update some comments
-rw-r--r--fragment.c65
1 files changed, 5 insertions, 60 deletions
diff --git a/fragment.c b/fragment.c
index a8e0f52..ae01e9a 100644
--- a/fragment.c
+++ b/fragment.c
@@ -138,28 +138,9 @@ state_composite (state_t *dest, pixman_op_t op, state_t *source)
if (!new_state)
return NULL;
- /* This function conceptually returns a new object. However,
- * in order to optimize, we will want to to do copy-on-write
- * whenever possible
+ /* FIXME: Always using COMMAND should be correct, but
+ * we can do a lot better with a few simple optimizations
*/
- /* It is always correct to make a copy of dest and source, and
- * use them in a command buffer. That in turn implies that a
- * command buffer holds a ref on all the images involved.
- */
- /* Actually a composite command should most likely be considered
- * to have implicit destination and one source. That's what the callers
- * are going to want:
- *
- * clip_image = create_clip_image()
- * dest_image = create_dest_image()
- * composite (dest_image, DEST_OUT, clip_image);
- * etc.
- */
- /* Hence, for a new state, we should start by SRCing dest onto
- * the new image, and then apply the composite.
- */
-
- /* FIXME: optimize here */
new_state->common.type = STATE_COMMAND;
new_state->common.ref_count = 1;
@@ -384,44 +365,6 @@ state_apply (state_t *state, pixman_image_t *image)
break;
case STATE_COMMAND:
- /* FIXME: hmm this has to be broken because it doesn't ever
- * create a temporary image.
- */
- /* The correct thing here may be to
- * - SRC source onto temp image a
- * - SRC dest onto temp image b
- * - apply a op b
- * - SRC b onto image
- *
- * which simplifies to
- * - SRC source onto temp image
- * - SRC dest into image
- * - apply source to image
- *
- * In the case where source is just a "foo IN bar",
- * we can simpify to "apply (foo, bar, dest)".
- *
- * The correct thing is actually to:
- * - copy dest to a temp image
- * - composite SRC onto temp using command.op
- * - composite temp onto image using argument op.
- *
- * which simplifies a bit if one or both of the ops is SRC
- * if both: simply SRC source onto image
- * if op, but not comamnd.op:
- * SRC dst onto image, then source command.op onto image.
- * if command.op, but not op:
- * apply source to image using command.op
- * These optimizations should probably take place at
- * composite time, not apply time.
- */
- /* What if there is no arg-op (or equivalently defined to be SRC?
- * Then the answer is
- * - apply dest to image
- * - create temp image
- * - apply source to temp
- * - composite temp with command op to image
- */
/* FIXME: track alpha-only */
temp = pixman_image_create_bits (
PIXMAN_a8r8g8b8, width, height, NULL, -1);
@@ -431,7 +374,9 @@ state_apply (state_t *state, pixman_image_t *image)
state_apply (state->command.dest, image);
- /* FIXME: check if source can be expressed as (s IN m) */
+ /* FIXME: check if source can be expressed as
+ * (s IN m), (s IN glyphs), (s IN traps)
+ */
state_apply (state->command.source, temp);
pixman_image_composite32 (