2005-10-10 David Reveman <davidr@novell.com>

Some major performance improvements to the general composite code used for gradients and transformed images. Like fetching of mask scanline before source scanline so that only the necessary pixels from source needs to be computed in case of gradients or transformed images as source. This patch also include some gradient specific fixes and performance improvement.
This commit is contained in:
Carl Worth 2006-01-04 16:39:23 +00:00
parent 305a83721f
commit 19441311e4
4 changed files with 747 additions and 430 deletions

View file

@ -1,6 +1,26 @@
2006-01-04 Carl Worth <cworth@cworth.org>
Originally: 2005-10-10 David Reveman <davidr@novell.com>
* Originally: 2005-10-10 David Reveman <davidr@novell.com>
* src/fbcompose.c: (SourcePictureClassify), (fbFetchSolid),
(fbFetch), (fbFetchSourcePict), (fbFetchTransformed),
(fbFetchExternalAlpha), (fbCompositeRect):
* src/icimage.c: (_pixman_init_gradient),
(_pixman_create_source_image),
(pixman_image_create_linear_gradient),
(pixman_image_create_radial_gradient):
* src/icimage.h:
Some major performance improvements to the general composite code
used for gradients and transformed images. Like fetching of mask
scanline before source scanline so that only the necessary pixels
from source needs to be computed in case of gradients or
transformed images as source. This patch also include some
gradient specific fixes and performance improvement.
2006-01-04 Carl Worth <cworth@cworth.org>
* Originally: 2005-10-10 David Reveman <davidr@novell.com>
* src/pixman.h: Add entries for gradient support.

File diff suppressed because it is too large Load diff

View file

@ -240,6 +240,7 @@ _pixman_init_gradient (pixman_gradient_image_t *gradient,
dpos = stops[i].x;
}
gradient->class = SourcePictClassUnknown;
gradient->stopRange = 0xffff;
gradient->colorTable = NULL;
gradient->colorTableSize = 0;
@ -253,8 +254,9 @@ _pixman_create_source_image (void)
pixman_image_t *image;
image = (pixman_image_t *) malloc (sizeof (pixman_image_t));
image->pDrawable = 0;
image->pixels = 0;
image->pDrawable = 0;
image->pixels = 0;
image->format_code = PICT_a8r8g8b8;
pixman_image_init (image);
@ -276,9 +278,6 @@ pixman_image_create_linear_gradient (const pixman_linear_gradient_t *gradient,
if (!image)
return 0;
if (gradient->p1.x == gradient->p2.x && gradient->p1.y == gradient->p2.y)
return 0;
linear = malloc (sizeof (pixman_linear_gradient_image_t) +
sizeof (pixman_gradient_stop_t) * n_stops);
if (!linear)
@ -314,7 +313,7 @@ pixman_image_create_radial_gradient (const pixman_radial_gradient_t *gradient,
{
pixman_radial_gradient_image_t *radial;
pixman_image_t *image;
double dx, dy, x;
double x;
if (n_stops < 2)
return 0;
@ -323,12 +322,6 @@ pixman_image_create_radial_gradient (const pixman_radial_gradient_t *gradient,
if (!image)
return 0;
dx = (double) (gradient->inner.x - gradient->outer.x);
dy = (double) (gradient->inner.y - gradient->outer.y);
if (sqrt (dx * dx + dy * dy) + (double) (gradient->inner.radius) >
(double) (gradient->outer.radius))
return 0;
radial = malloc (sizeof (pixman_radial_gradient_image_t) +
sizeof (pixman_gradient_stop_t) * n_stops);
if (!radial)

View file

@ -61,13 +61,19 @@ typedef struct pixman_format {
#define SourcePictTypeRadial 2
#define SourcePictTypeConical 3
#define SourcePictClassUnknown 0
#define SourcePictClassHorizontal 1
#define SourcePictClassVertical 2
typedef struct _pixman_solid_fill_image {
unsigned int type;
unsigned int class;
uint32_t color;
} pixman_solid_fill_image_t;
typedef struct _pixman_gradient_image {
unsigned int type;
unsigned int class;
pixman_gradient_stop_t *stops;
int nstops;
int stopRange;
@ -77,6 +83,7 @@ typedef struct _pixman_gradient_image {
typedef struct _pixman_linear_gradient_image {
unsigned int type;
unsigned int class;
pixman_gradient_stop_t *stops;
int nstops;
int stopRange;
@ -88,6 +95,7 @@ typedef struct _pixman_linear_gradient_image {
typedef struct _pixman_radial_gradient_image {
unsigned int type;
unsigned int class;
pixman_gradient_stop_t *stops;
int nstops;
int stopRange;
@ -104,6 +112,7 @@ typedef struct _pixman_radial_gradient_image {
typedef struct _pixman_conical_gradient_image {
unsigned int type;
unsigned int class;
pixman_gradient_stop_t *stops;
int nstops;
int stopRange;