mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2025-12-27 03:30:12 +01:00
Optimize away calls to cairo_paint_with_alpha() if the alpha value given is <= 0.
Add a new macro CAIRO_ALPHA_IS_ZERO.
This commit is contained in:
parent
89a4e13d73
commit
fdb5e2aa47
3 changed files with 12 additions and 0 deletions
|
|
@ -1,3 +1,10 @@
|
|||
2005-08-21 Billy Biggs <vektor@dumbterm.net>
|
||||
|
||||
* src/cairo.c: (cairo_paint_with_alpha): Optimize away calls to
|
||||
cairo_paint_with_alpha() if the alpha value given is <= 0.
|
||||
|
||||
* src/cairoint.h: Add a new macro CAIRO_ALPHA_IS_ZERO.
|
||||
|
||||
2005-08-21 Billy Biggs <vektor@dumbterm.net>
|
||||
|
||||
Fix for bug #4172:
|
||||
|
|
|
|||
|
|
@ -1302,6 +1302,10 @@ cairo_paint_with_alpha (cairo_t *cr,
|
|||
return;
|
||||
}
|
||||
|
||||
if (CAIRO_ALPHA_IS_ZERO (alpha)) {
|
||||
return;
|
||||
}
|
||||
|
||||
_cairo_color_init_rgba (&color, 1., 1., 1., alpha);
|
||||
_cairo_pattern_init_solid (&pattern.solid, &color);
|
||||
|
||||
|
|
|
|||
|
|
@ -178,6 +178,7 @@ typedef cairo_fixed_16_16_t cairo_fixed_t;
|
|||
#define CAIRO_MINSHORT SHRT_MIN
|
||||
|
||||
#define CAIRO_ALPHA_IS_OPAQUE(alpha) ((alpha) >= ((double)0xff00 / (double)0xffff))
|
||||
#define CAIRO_ALPHA_IS_ZERO(alpha) ((alpha) <= 0.0)
|
||||
|
||||
#include "cairo-hash-private.h"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue