summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/sna/gen4_render.c82
-rw-r--r--src/sna/gen5_render.c83
-rw-r--r--src/sna/sna.h2
-rw-r--r--src/sna/sna_transform.c18
4 files changed, 83 insertions, 102 deletions
diff --git a/src/sna/gen4_render.c b/src/sna/gen4_render.c
index dd66a462..553cea87 100644
--- a/src/sna/gen4_render.c
+++ b/src/sna/gen4_render.c
@@ -980,29 +980,24 @@ gen4_emit_composite_primitive(struct sna *sna,
&src_x[2],
&src_y[2]);
} else {
- if (!sna_get_transformed_coordinates_3d(r->src.x + op->src.offset[0],
- r->src.y + op->src.offset[1],
- op->src.transform,
- &src_x[0],
- &src_y[0],
- &src_w[0]))
- return;
-
- if (!sna_get_transformed_coordinates_3d(r->src.x + op->src.offset[0],
- r->src.y + op->src.offset[1] + r->height,
- op->src.transform,
- &src_x[1],
- &src_y[1],
- &src_w[1]))
- return;
-
- if (!sna_get_transformed_coordinates_3d(r->src.x + op->src.offset[0] + r->width,
- r->src.y + op->src.offset[1] + r->height,
- op->src.transform,
- &src_x[2],
- &src_y[2],
- &src_w[2]))
- return;
+ sna_get_transformed_coordinates_3d(r->src.x + op->src.offset[0],
+ r->src.y + op->src.offset[1],
+ op->src.transform,
+ &src_x[0],
+ &src_y[0],
+ &src_w[0]);
+ sna_get_transformed_coordinates_3d(r->src.x + op->src.offset[0],
+ r->src.y + op->src.offset[1] + r->height,
+ op->src.transform,
+ &src_x[1],
+ &src_y[1],
+ &src_w[1]);
+ sna_get_transformed_coordinates_3d(r->src.x + op->src.offset[0] + r->width,
+ r->src.y + op->src.offset[1] + r->height,
+ op->src.transform,
+ &src_x[2],
+ &src_y[2],
+ &src_w[2]);
}
if (op->mask.bo) {
@@ -1025,29 +1020,24 @@ gen4_emit_composite_primitive(struct sna *sna,
&mask_x[2],
&mask_y[2]);
} else {
- if (!sna_get_transformed_coordinates_3d(r->mask.x + op->mask.offset[0],
- r->mask.y + op->mask.offset[1],
- op->mask.transform,
- &mask_x[0],
- &mask_y[0],
- &mask_w[0]))
- return;
-
- if (!sna_get_transformed_coordinates_3d(r->mask.x + op->mask.offset[0],
- r->mask.y + op->mask.offset[1] + r->height,
- op->mask.transform,
- &mask_x[1],
- &mask_y[1],
- &mask_w[1]))
- return;
-
- if (!sna_get_transformed_coordinates_3d(r->mask.x + op->mask.offset[0] + r->width,
- r->mask.y + op->mask.offset[1] + r->height,
- op->mask.transform,
- &mask_x[2],
- &mask_y[2],
- &mask_w[2]))
- return;
+ sna_get_transformed_coordinates_3d(r->mask.x + op->mask.offset[0],
+ r->mask.y + op->mask.offset[1],
+ op->mask.transform,
+ &mask_x[0],
+ &mask_y[0],
+ &mask_w[0]);
+ sna_get_transformed_coordinates_3d(r->mask.x + op->mask.offset[0],
+ r->mask.y + op->mask.offset[1] + r->height,
+ op->mask.transform,
+ &mask_x[1],
+ &mask_y[1],
+ &mask_w[1]);
+ sna_get_transformed_coordinates_3d(r->mask.x + op->mask.offset[0] + r->width,
+ r->mask.y + op->mask.offset[1] + r->height,
+ op->mask.transform,
+ &mask_x[2],
+ &mask_y[2],
+ &mask_w[2]);
}
}
diff --git a/src/sna/gen5_render.c b/src/sna/gen5_render.c
index 9c30041d..8b970f4f 100644
--- a/src/sna/gen5_render.c
+++ b/src/sna/gen5_render.c
@@ -983,29 +983,24 @@ gen5_emit_composite_primitive(struct sna *sna,
&src_x[2],
&src_y[2]);
} else {
- if (!sna_get_transformed_coordinates_3d(r->src.x + op->src.offset[0],
- r->src.y + op->src.offset[1],
- op->src.transform,
- &src_x[0],
- &src_y[0],
- &src_w[0]))
- return;
-
- if (!sna_get_transformed_coordinates_3d(r->src.x + op->src.offset[0],
- r->src.y + op->src.offset[1] + r->height,
- op->src.transform,
- &src_x[1],
- &src_y[1],
- &src_w[1]))
- return;
-
- if (!sna_get_transformed_coordinates_3d(r->src.x + op->src.offset[0] + r->width,
- r->src.y + op->src.offset[1] + r->height,
- op->src.transform,
- &src_x[2],
- &src_y[2],
- &src_w[2]))
- return;
+ sna_get_transformed_coordinates_3d(r->src.x + op->src.offset[0],
+ r->src.y + op->src.offset[1],
+ op->src.transform,
+ &src_x[0],
+ &src_y[0],
+ &src_w[0]);
+ sna_get_transformed_coordinates_3d(r->src.x + op->src.offset[0],
+ r->src.y + op->src.offset[1] + r->height,
+ op->src.transform,
+ &src_x[1],
+ &src_y[1],
+ &src_w[1]);
+ sna_get_transformed_coordinates_3d(r->src.x + op->src.offset[0] + r->width,
+ r->src.y + op->src.offset[1] + r->height,
+ op->src.transform,
+ &src_x[2],
+ &src_y[2],
+ &src_w[2]);
}
if (op->mask.bo) {
@@ -1028,29 +1023,25 @@ gen5_emit_composite_primitive(struct sna *sna,
&mask_x[2],
&mask_y[2]);
} else {
- if (!sna_get_transformed_coordinates_3d(r->mask.x + op->mask.offset[0],
- r->mask.y + op->mask.offset[1],
- op->mask.transform,
- &mask_x[0],
- &mask_y[0],
- &mask_w[0]))
- return;
-
- if (!sna_get_transformed_coordinates_3d(r->mask.x + op->mask.offset[0],
- r->mask.y + op->mask.offset[1] + r->height,
- op->mask.transform,
- &mask_x[1],
- &mask_y[1],
- &mask_w[1]))
- return;
-
- if (!sna_get_transformed_coordinates_3d(r->mask.x + op->mask.offset[0] + r->width,
- r->mask.y + op->mask.offset[1] + r->height,
- op->mask.transform,
- &mask_x[2],
- &mask_y[2],
- &mask_w[2]))
- return;
+ sna_get_transformed_coordinates_3d(r->mask.x + op->mask.offset[0],
+ r->mask.y + op->mask.offset[1],
+ op->mask.transform,
+ &mask_x[0],
+ &mask_y[0],
+ &mask_w[0]);
+
+ sna_get_transformed_coordinates_3d(r->mask.x + op->mask.offset[0],
+ r->mask.y + op->mask.offset[1] + r->height,
+ op->mask.transform,
+ &mask_x[1],
+ &mask_y[1],
+ &mask_w[1]);
+ sna_get_transformed_coordinates_3d(r->mask.x + op->mask.offset[0] + r->width,
+ r->mask.y + op->mask.offset[1] + r->height,
+ op->mask.transform,
+ &mask_x[2],
+ &mask_y[2],
+ &mask_w[2]);
}
}
diff --git a/src/sna/sna.h b/src/sna/sna.h
index d9fd9d1f..df7f42fa 100644
--- a/src/sna/sna.h
+++ b/src/sna/sna.h
@@ -500,7 +500,7 @@ sna_get_transformed_coordinates(int x, int y,
const PictTransform *transform,
float *x_out, float *y_out);
-Bool
+void
sna_get_transformed_coordinates_3d(int x, int y,
const PictTransform *transform,
float *x_out, float *y_out, float *z_out);
diff --git a/src/sna/sna_transform.c b/src/sna/sna_transform.c
index 644d4045..54852b1f 100644
--- a/src/sna/sna_transform.c
+++ b/src/sna/sna_transform.c
@@ -114,7 +114,7 @@ sna_get_transformed_coordinates(int x, int y,
/**
* Returns the un-normalized floating-point coordinates transformed by the given transform.
*/
-Bool
+void
sna_get_transformed_coordinates_3d(int x, int y,
const PictTransform *transform,
float *x_out, float *y_out, float *w_out)
@@ -126,13 +126,13 @@ sna_get_transformed_coordinates_3d(int x, int y,
} else {
int64_t result[3];
- if (!_sna_transform_point(transform, x, y, result))
- return FALSE;
-
- *x_out = result[0] / 65536.;
- *y_out = result[1] / 65536.;
- *w_out = result[2] / 65536.;
+ if (_sna_transform_point(transform, x, y, result)) {
+ *x_out = result[0] / 65536.;
+ *y_out = result[1] / 65536.;
+ *w_out = result[2] / 65536.;
+ } else {
+ *x_out = *y_out = 0;
+ *w_out = 1.;
+ }
}
-
- return TRUE;
}