From 56213a64fe9e4270fd7886675b1e8224b2d88794 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Sat, 7 Aug 2010 14:37:26 +0800 Subject: draw: Add new util function draw_pt_trim_count. draw_pt_trim_count is renamed from trim in draw_pt.c. --- src/gallium/auxiliary/draw/draw_pt_util.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/gallium/auxiliary/draw/draw_pt_util.c') diff --git a/src/gallium/auxiliary/draw/draw_pt_util.c b/src/gallium/auxiliary/draw/draw_pt_util.c index 182a597cca2..513bbbed216 100644 --- a/src/gallium/auxiliary/draw/draw_pt_util.c +++ b/src/gallium/auxiliary/draw/draw_pt_util.c @@ -92,3 +92,10 @@ void draw_pt_split_prim(unsigned prim, unsigned *first, unsigned *incr) break; } } + +unsigned draw_pt_trim_count(unsigned count, unsigned first, unsigned incr) +{ + if (count < first) + return 0; + return count - (count - first) % incr; +} -- cgit v1.2.3