summaryrefslogtreecommitdiff
path: root/src/sna/sna_trapezoids.h
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-09-24 08:05:01 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2014-09-24 08:10:07 +0100
commit911a0ad8d0520554dc55883997dd59dc3f5f9139 (patch)
treee0fccb6f241e8fee566e3f9aefd880a7cde235d1 /src/sna/sna_trapezoids.h
parentdbe6d105a60ff28419b549d439bbb29f50b28f08 (diff)
sna/trapezoids: Flesh out alternate rasterisers for tristrips
And undo the accidental commit of commit 4e00cbe35d1a409a02ee27d991213d9a0807e500 Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Mon Sep 22 08:54:57 2014 +0100 traps Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_trapezoids.h')
-rw-r--r--src/sna/sna_trapezoids.h32
1 files changed, 29 insertions, 3 deletions
diff --git a/src/sna/sna_trapezoids.h b/src/sna/sna_trapezoids.h
index 5acf5317..e8f7f3f4 100644
--- a/src/sna/sna_trapezoids.h
+++ b/src/sna/sna_trapezoids.h
@@ -227,10 +227,37 @@ triangles_mask_converter(CARD8 op, PicturePtr src, PicturePtr dst,
int count, xTriangle *tri);
bool
+mono_tristrip_span_converter(struct sna *sna,
+ CARD8 op, PicturePtr src, PicturePtr dst,
+ INT16 src_x, INT16 src_y,
+ int count, xPointFixed *points);
+bool
+imprecise_tristrip_span_converter(struct sna *sna,
+ CARD8 op, PicturePtr src, PicturePtr dst,
+ PictFormatPtr maskFormat, INT16 src_x, INT16 src_y,
+ int count, xPointFixed *points);
+bool
+precise_tristrip_span_converter(struct sna *sna,
+ CARD8 op, PicturePtr src, PicturePtr dst,
+ PictFormatPtr maskFormat, INT16 src_x, INT16 src_y,
+ int count, xPointFixed *points);
+
+static inline bool
tristrip_span_converter(struct sna *sna,
CARD8 op, PicturePtr src, PicturePtr dst,
PictFormatPtr maskFormat, INT16 src_x, INT16 src_y,
- int count, xPointFixed *points);
+ int count, xPointFixed *points)
+{
+ if (NO_SCAN_CONVERTER)
+ return false;
+
+ if (is_mono(dst, maskFormat))
+ return mono_tristrip_span_converter(sna, op, src, dst, src_x, src_y, count, points);
+ else if (is_precise(dst, maskFormat))
+ return precise_tristrip_span_converter(sna, op, src, dst, maskFormat, src_x, src_y, count, points);
+ else
+ return imprecise_tristrip_span_converter(sna, op, src, dst, maskFormat, src_x, src_y, count, points);
+}
inline static void trapezoid_origin(const xLineFixed *l, int16_t *x, int16_t *y)
{
@@ -332,8 +359,7 @@ xTriangleValid(const xTriangle *t)
static inline int pixman_fixed_to_fast(pixman_fixed_t v)
{
- //return (v + ((1<<(16-FAST_SAMPLES_shift-1))-1)) >> (16 - FAST_SAMPLES_shift);
- return (v + ((1<<(16-FAST_SAMPLES_shift-1)))) >> (16 - FAST_SAMPLES_shift);
+ return (v + ((1<<(16-FAST_SAMPLES_shift-1))-1)) >> (16 - FAST_SAMPLES_shift);
}
bool trapezoids_bounds(int n, const xTrapezoid *t, BoxPtr box);