diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2011-04-08 13:49:11 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2011-04-08 13:49:11 +0200 |
commit | 94e774a8bd2891f36885ae710efd42caebd855ed (patch) | |
tree | 883147e1bf5dc8feba5d142b8ffcde8e7e0676f6 /draw | |
parent | a1b5f023ccebd339e9a74ef7f3bcc94c0c74d3e0 (diff) | |
download | mupdf-94e774a8bd2891f36885ae710efd42caebd855ed.tar.xz |
Remove inline keyword where it is not strictly necessary for performance.
Also put the function on the same line for inline functions, so
they stick out and are easy to find with grep.
Diffstat (limited to 'draw')
-rw-r--r-- | draw/draw_blend.c | 32 | ||||
-rw-r--r-- | draw/draw_edge.c | 30 | ||||
-rw-r--r-- | draw/draw_mesh.c | 12 |
3 files changed, 28 insertions, 46 deletions
diff --git a/draw/draw_blend.c b/draw/draw_blend.c index 5b4d8e83..2d68758a 100644 --- a/draw/draw_blend.c +++ b/draw/draw_blend.c @@ -27,14 +27,12 @@ const char *fz_blendmode_names[] = /* Separable blend modes */ -static inline int -fz_screen_byte(int b, int s) +static inline int fz_screen_byte(int b, int s) { return b + s - fz_mul255(b, s); } -static inline int -fz_hard_light_byte(int b, int s) +static inline int fz_hard_light_byte(int b, int s) { int s2 = s << 1; if (s <= 127) @@ -43,26 +41,22 @@ fz_hard_light_byte(int b, int s) return fz_screen_byte(b, s2 - 255); } -static inline int -fz_overlay_byte(int b, int s) +static inline int fz_overlay_byte(int b, int s) { return fz_hard_light_byte(s, b); /* note swapped order */ } -static inline int -fz_darken_byte(int b, int s) +static inline int fz_darken_byte(int b, int s) { return MIN(b, s); } -static inline int -fz_lighten_byte(int b, int s) +static inline int fz_lighten_byte(int b, int s) { return MAX(b, s); } -static inline int -fz_color_dodge_byte(int b, int s) +static inline int fz_color_dodge_byte(int b, int s) { s = 255 - s; if (b == 0) @@ -73,8 +67,7 @@ fz_color_dodge_byte(int b, int s) return (0x1fe * b + s) / (s << 1); } -static inline int -fz_color_burn_byte(int b, int s) +static inline int fz_color_burn_byte(int b, int s) { b = 255 - b; if (b == 0) @@ -85,8 +78,7 @@ fz_color_burn_byte(int b, int s) return 0xff - (0x1fe * b + s) / (s << 1); } -static inline int -fz_soft_light_byte(int b, int s) +static inline int fz_soft_light_byte(int b, int s) { /* review this */ if (s < 128) { @@ -102,21 +94,19 @@ fz_soft_light_byte(int b, int s) } } -static inline int -fz_difference_byte(int b, int s) +static inline int fz_difference_byte(int b, int s) { return ABS(b - s); } -static inline int -fz_exclusion_byte(int b, int s) +static inline int fz_exclusion_byte(int b, int s) { return b + s - (fz_mul255(b, s)<<1); } /* Non-separable blend modes */ -static inline void +static void fz_luminosity_rgb(int *rd, int *gd, int *bd, int rb, int gb, int bb, int rs, int gs, int bs) { int delta, scale; diff --git a/draw/draw_edge.c b/draw/draw_edge.c index 2ef70d6b..ec56d189 100644 --- a/draw/draw_edge.c +++ b/draw/draw_edge.c @@ -396,7 +396,7 @@ fz_free_ael(fz_ael *ael) fz_free(ael); } -static inline void +static void sort_ael(fz_edge **a, int n) { int h, i, k; @@ -480,8 +480,7 @@ advance_ael(fz_ael *ael) * Anti-aliased scan conversion. */ -static inline void -add_span_aa(int *list, int x0, int x1, int xofs) +static inline void add_span_aa(int *list, int x0, int x1, int xofs) { int x0pix, x0sub; int x1pix, x1sub; @@ -513,8 +512,7 @@ add_span_aa(int *list, int x0, int x1, int xofs) } } -static inline void -non_zero_winding_aa(fz_ael *ael, int *list, int xofs) +static inline void non_zero_winding_aa(fz_ael *ael, int *list, int xofs) { int winding = 0; int x = 0; @@ -529,8 +527,7 @@ non_zero_winding_aa(fz_ael *ael, int *list, int xofs) } } -static inline void -even_odd_aa(fz_ael *ael, int *list, int xofs) +static inline void even_odd_aa(fz_ael *ael, int *list, int xofs) { int even = 0; int x = 0; @@ -545,8 +542,7 @@ even_odd_aa(fz_ael *ael, int *list, int xofs) } } -static inline void -undelta_aa(unsigned char * restrict out, int * restrict in, int n) +static inline void undelta_aa(unsigned char * restrict out, int * restrict in, int n) { int d = 0; while (n--) @@ -556,8 +552,8 @@ undelta_aa(unsigned char * restrict out, int * restrict in, int n) } } -static inline void -blit_aa(fz_pixmap *dst, int x, int y, unsigned char *mp, int w, unsigned char *color) +static inline void blit_aa(fz_pixmap *dst, int x, int y, + unsigned char *mp, int w, unsigned char *color) { unsigned char *dp; dp = dst->samples + ( (y - dst->y) * dst->w + (x - dst->x) ) * dst->n; @@ -644,8 +640,8 @@ fz_scan_convert_aa(fz_gel *gel, fz_ael *ael, int eofill, fz_bbox clip, * Sharp (not anti-aliased) scan conversion */ -static inline void -blit_sharp(int x0, int x1, int y, fz_bbox clip, fz_pixmap *dst, unsigned char *color) +static inline void blit_sharp(int x0, int x1, int y, + fz_bbox clip, fz_pixmap *dst, unsigned char *color) { unsigned char *dp; x0 = CLAMP(x0, dst->x, dst->x + dst->w); @@ -660,8 +656,8 @@ blit_sharp(int x0, int x1, int y, fz_bbox clip, fz_pixmap *dst, unsigned char *c } } -static inline void -non_zero_winding_sharp(fz_ael *ael, int y, fz_bbox clip, fz_pixmap *dst, unsigned char *color) +static inline void non_zero_winding_sharp(fz_ael *ael, int y, + fz_bbox clip, fz_pixmap *dst, unsigned char *color) { int winding = 0; int x = 0; @@ -676,8 +672,8 @@ non_zero_winding_sharp(fz_ael *ael, int y, fz_bbox clip, fz_pixmap *dst, unsigne } } -static inline void -even_odd_sharp(fz_ael *ael, int y, fz_bbox clip, fz_pixmap *dst, unsigned char *color) +static inline void even_odd_sharp(fz_ael *ael, int y, + fz_bbox clip, fz_pixmap *dst, unsigned char *color) { int even = 0; int x = 0; diff --git a/draw/draw_mesh.c b/draw/draw_mesh.c index eeebf0a1..4254cb64 100644 --- a/draw/draw_mesh.c +++ b/draw/draw_mesh.c @@ -121,8 +121,7 @@ static int clip_poly(float src[MAXV][MAXN], * gouraud shaded polygon scan conversion */ -static inline void -paint_scan(fz_pixmap *pix, int y, int x1, int x2, int *v1, int *v2, int n) +static void paint_scan(fz_pixmap *pix, int y, int x1, int x2, int *v1, int *v2, int n) { unsigned char *p = pix->samples + ((y - pix->y) * pix->w + (x1 - pix->x)) * pix->n; int v[FZ_MAX_COLORS]; @@ -156,8 +155,7 @@ paint_scan(fz_pixmap *pix, int y, int x1, int x2, int *v1, int *v2, int n) } } -static inline int -find_next(int gel[MAXV][MAXN], int len, int a, int *s, int *e, int d) +static int find_next(int gel[MAXV][MAXN], int len, int a, int *s, int *e, int d) { int b; @@ -186,8 +184,7 @@ find_next(int gel[MAXV][MAXN], int len, int a, int *s, int *e, int d) } } -static inline void -load_edge(int gel[MAXV][MAXN], int s, int e, int *ael, int *del, int n) +static void load_edge(int gel[MAXV][MAXN], int s, int e, int *ael, int *del, int n) { int swp, k, dy; @@ -207,8 +204,7 @@ load_edge(int gel[MAXV][MAXN], int s, int e, int *ael, int *del, int n) } } -static inline void -step_edge(int *ael, int *del, int n) +static inline void step_edge(int *ael, int *del, int n) { int k; ael[0] += del[0]; |