Speed up pixman_composite_glyphs()
authorSøren Sandmann Pedersen <ssp@redhat.com>
Mon, 28 May 2012 05:22:26 +0000 (01:22 -0400)
committerSøren Sandmann Pedersen <ssp@redhat.com>
Sat, 2 Jun 2012 12:19:30 +0000 (08:19 -0400)
commita162189dc0fa9978a3b5b6dd24f9bc12995805ed
tree3d5e038c1194016a63b8d1f43f8560c0aac0eb68
parentd9710442b4b2294e1ccd1594c54ca8a4feda2ac5
Speed up pixman_composite_glyphs()

When adding glyphs to the mask, bypass most of the overhead of
pixman_image_composite32() by:

- Only looking up the composite function when the glyph changes either
  format or flags.

- Only using a white source when the glyph format is different from
  the mask format.

- Simply intersecting the glyph rectangle with the destination
  rectangle instead of doing the full _pixman_composite_region32().

Performance results:

[ # ]  backend                         test   min(s) median(s) stddev. count
Before:
[  0]    image            firefox-talos-gfx    6.570    6.577   0.13%    8/10
After:
[  0]    image            firefox-talos-gfx    4.272    4.289   0.28%   10/10

V2: Changes to deal with white sources
pixman/pixman-glyph.c
pixman/pixman-private.h
pixman/pixman.c