Commit graph

299 commits

Author SHA1 Message Date
Behdad Esfahbod
2a03895663 [pixman] Fix typo in Makefile.am 2007-04-20 00:55:03 -04:00
Behdad Esfahbod
f56582ef06 Put back __inline definition for MSC compilers, in both cairo and pixman
Apparently it's too much to expect people compiling on windows to fill
in sensible values for config.h... /sigh
2007-04-18 17:55:05 -04:00
Behdad Esfahbod
a54b6ed078 [pixman] Rename icint.h to pixmanint.h 2007-04-18 17:54:57 -04:00
Behdad Esfahbod
d3c7942fb2 [pixman] Mark some small functions that are called per-pixel inline
These uses were introduced in the previous commit.
2007-04-12 14:44:32 -04:00
David Reveman
e3b3d22999 [pixman] Fix fbcompose.c that was broken for some composite operations (#5777) 2007-04-12 14:44:32 -04:00
Chris Wilson
52435e99f3 Move pixman_format_t from heap to stack allocations.
pixman_format_t is a simple structure used in short-term allocations and
suitable for on-stack allocation.

Killing the pixman_format_create()/pixman_format_destroy() pairs avoid
around 6% of the allocations during cairo-perf (e.g. 426,158 allocs out
of a total of 7,063,469).
2007-04-12 00:28:03 +01:00
Chris Wilson
54134dd901 Only enable warn-unused-result for recent gcc
The attribute was introduced with gcc-3.4, but the ability to suppress
warnings from misapplied attributes (-Wno-attributes) was only introduced
later. Without the supression, gcc will emit tens of warnings for each
compilation completely drowning the real errors that the programmer
must see.
2007-04-11 14:39:50 -07:00
Chris Wilson
f53c2b418c _pixman_create_source_image() - check for malloc failure
Fix an unchecked malloc by propagating the NULL pointer up to its callers,
which were already checking for failures.
2007-04-11 14:33:53 -07:00
Chris Wilson
61b8e34613 Unexport fbSolidFillmmx and fbCopyAreammx.
By unexporting these function we have exact control over their call sites
and so can convert the initial guards into asserts which transforms the
two functions to return unconditional success and hence conversion to
void.
2007-04-11 13:06:29 -07:00
Chris Wilson
efee208738 Propagate errors up through pixman_composite_trapezoids()
Change the return type to indicate errors detected during
pixman_composite_trapezoids() and add checking for failures during
region ops.
2007-04-11 13:05:31 -07:00
Chris Wilson
bec097b5e2 Propagate region errors from pixman_color_rects().
Region operations within pixman_color_rects can fail, so cleanup and
propagate.
2007-04-11 13:04:53 -07:00
Chris Wilson
909334ee00 FbClipImage* should check for errors during region operations.
Propagate the error from pixman_region_intersect().
2007-04-11 13:03:38 -07:00
Chris Wilson
5b67efcbd8 Propagate region failures during pixman_image_set_clip_region().
Operating on regions can fail so check the status and return an error,
after any necessary cleanup.
2007-04-11 13:02:56 -07:00
Chris Wilson
46eab95698 Add attribute(warn_unused_result)
This adds a compiler check that the function result is used by the caller
and enables it by default for all cairo_private functions and for public
API that returns a cairo_status_t.

It has been discussed that to extend the warnings to all functions, a
new function type could been introduced to cover static functions:
cairo_static. This has not been done at the present time in order to
minimise the churn and focus on the more common errors.

In order to reduce the warning spew generated by gcc for invalid use of
this attribute, -Wno-attributes is added to CFLAGS. This has the
unfortunate side-effect of masking future warnings for all attributes -
be warned!
2007-04-09 15:01:58 +01:00
Behdad Esfahbod
6f93092217 Rename pixman_region_uninit to pixman_region_fini 2007-04-08 22:03:38 -04:00
Behdad Esfahbod
4f8a04b1c9 [pixman-image] Simply initialization given that there is no clip 2007-04-08 21:55:45 -04:00
Mathias Hasselmann
df9ea31df5 [pixman-region] Separate pixman_region_init
Most of the time pixman_region_init is called without any extents, and
followed by a pixman_region_union_rect, used to used to initialize
rectangular regions. pixman_region_union_rect is not that cheap, but
the sequence is called quite often. So it should be worth introducing
a specialized and fast function for this sequence.

This introduces pixman_region_init_rect.  This new function makes
_cairo_region_init_from_rectangle obsolete.

Also removes the extent argument from pixman_region_init as it was
called with NULL most of the time.  A pixman_region_init_with_extents
is added for the general case.
2007-04-08 21:49:46 -04:00
Mathias Hasselmann
9436959a83 Update function map 2007-04-08 21:36:34 -04:00
Mathias Hasselmann
99f4bfada8 Remove abdoned pixman_region_{create,destroy} 2007-04-08 21:36:06 -04:00
Mathias Hasselmann
4532c023e0 Make clientClip region static, remove abdoned CT_PIXMAP code paths 2007-04-08 21:35:58 -04:00
Mathias Hasselmann
65f269f3a4 Avoid pixman_region_create in pixman_composite{,General} 2007-04-08 21:34:10 -04:00
Mathias Hasselmann
82cc451148 Make clip regions of pixman_image_t static 2007-04-08 21:32:52 -04:00
Mathias Hasselmann
0413715337 Avoid pixman_region_create in pixman_color_rects 2007-04-08 21:27:34 -04:00
Mathias Hasselmann
5a6ca4794b Replace pixman_region_create_simple by pixman_region_init 2007-04-08 21:25:25 -04:00
Mathias Hasselmann
ced7b4a4ab Make pixman_region_{init,uninit} public 2007-04-08 20:38:32 -04:00
Mathias Hasselmann
4d9065fceb Move struct pixman_region16 to pixman.h 2007-04-08 20:38:17 -04:00
Chris Wilson
5c24711ee6 Restore gcov functionality
Add -lgcov to the shared library else the test programs fail to link.
Add a couple of lcov convenience targets to generate the coverage reports.
2007-04-04 10:13:13 +01:00
Behdad Esfahbod
a1287e483c [pixman/src/check-config.sh] Test that all source files #include <config.h>
as their first include.
2007-04-03 20:30:30 -04:00
Behdad Esfahbod
174ebc43fe [pixman] Make sure all source files include config.h
as their first include.
2007-04-03 20:02:48 -04:00
Behdad Esfahbod
313a6f7321 [pixman] Cleanup inline mess (#10150)
Simply use "inline" instead of "INLINE" or "__inline__" and let
configure figure out what to use.
2007-04-03 20:02:10 -04:00
Behdad Esfahbod
0263f18f84 [configure.in] Define PIXMAN_CFLAGS, to pass -fno-strict-aliasing to pixman 2007-03-20 08:50:38 -04:00
Gilles Dauphin
d02aa5b23e Don't use unsupported visibily attribute hidden on Solaris
Thanks to Thomas Klausner for passing the report along.
This fixes the following bug report:

	hidden attribute does not work with Solaris ld
	https://bugs.freedesktop.org/show_bug.cgi?id=10227

And as Behdad points out, an even better fix would be to
move checks for supported visibility attribute to configure.
2007-03-16 10:35:23 -07:00
Carl Worth
fe68e8aa32 Fix gradient walker to not reset needlessly
Previously the gradient walker was doing excessive resets, (such
as on every pixel in constant-colored regions or outside the
gradient with CAIRO_EXTEND_NONE). Don't do that.
2007-03-01 14:55:29 -08:00
Carl Worth
9a5dfe1415 Fix implementation of radial gradients for inner radius != 0
The previous implementation fell apart quite badly when neither radius
value was equal to 0.0. I derived the math from scratch, (much thanks to
Vincent Torri <vtorri@univ-evry.fr> for guiding me to a simpler derivation
than I was doing originally), and it's working much better now without
being any slower, (in fact, cairo-perf shows speedup of 1.05x to 1.58x on
my laptop here).

This work also provides groundwork for defining the behavior of radial
gradients where neither circle is wholly contained within the other, (though
we haven't done that definition yet---it will require a new test case and a
very little bit of work on the implementation).

This is a fix for the following bug report:

	Radial Gradients with nonzero inner radius misplace stops
	https://bugs.freedesktop.org/show_bug.cgi?id=7685
2007-03-01 14:53:48 -08:00
Carl Worth
0439f4c4f7 Rename radial gradient inner/outer to c1/c2
The inner/outer names were totally bogus. It is quite
legitimate to have the first circle's radius be larger than
that of the second.
2007-03-01 13:21:54 -08:00
Dan Amelang
01a133167c Update Win32 makefiles
Since the last time these makefiles were last updated some new source
files have been added and one renamed. In addition, a "clean" rule
needed to be added to the pixman makefile. And the "clean" rule in the
main cairo makefile wasn't working properly for me.
2007-02-13 16:53:12 -08:00
Soren Sandmann Pedersen
908469b5fc Apply patch from Marco Gritti and Jordan Crouse to correctly detect
AMD CPU's. Bug 9615.
2007-02-06 16:37:45 -05:00
Soren Sandmann Pedersen
9d3f537423 Remove left-over assert and some alpha checks from
fbCompositeSrc_8888x0565mmx(). Bug 9893.
2007-02-06 16:27:42 -05:00
David Turner
ae4f37e0a3 fixing gradient repeat mode computations
This fixes the regression of linear gradient as demonstrated
by the recently added linear-gradient-reflect test.
2007-02-02 16:42:43 -08:00
Vladimir Vukicevic
691f9d1c0c [mmx] avoid casts between int32 and __m64 types
The MS compiler doesn't like this; _mm_cvtsi32_si64 and _mm_cvtsi64_si32
must be used.
2007-01-25 12:01:50 -08:00
Behdad Esfahbod
3b7751279c [pixman/src/fbmmx.c] Add comment around M64
/* cast to void* in the middle to shut gcc up warning about
 * "dereferencing type-punned pointers".
 */
2007-01-22 14:42:48 -05:00
Behdad Esfahbod
6aa8e80cc7 [pixman/src/fbmmx.c] Hide "dereferencing type-punned pointer" warnings
The warning happens all the place when the code converts from ullong to __m64.
The way the conversion is done is a C idiom: 1) get a pointer to the value, 2)
convert it to the suitable pointer type for the target, 3) dereference it.
That is "*(__m64*)(&m)" in this case.  This is necessarily (as opposed to just
casting to target type) because the two types may not be "compatible" from the
compiler's point of view.  Example of types that are not compatbile is structs
vs anything.

The "dereferencing type-punned pointer will break strict-aliasing rules" from
gcc exactly means: "some code may be assuming that pointers with different
types do not compare equal (or otherwise share the same target object).  If
you case a pointer to a different type and dereference it, it may happen
here."  However, in our usecase, it's clear that the compiler cannot make any
false assumptions.  So we just go ahead and hide it by using a middle cast to
"void *".  Since the compiler does not many any aliasing assumptions about
generic pointers, it will not warn either. (Though the problems if any, will
still occure.  So this is not an ideal solution to this problem and should be
used very carefully, to no hide useful warnings for when things go loose on
some weird architecture.)

Another solution would have been to use gcc's "may_alias" function attribute,
but trying to define a may_alias version of __m64 hit a bug in gcc.  That is,
try replacing "__m64" with "m64" and define:

  typedef __m64 m64 __attribute__((may_alias));

and see it fail to compile.  This seems to be because of the special vector
type that __m64 has.
2007-01-21 15:06:02 -05:00
Dan Williams
5c2136ea7c Implement pixman fbCompositeSrc_8888x0565mmx
MMX-accelerate for fbCompositeSrc_8888x0565.  Upstream X bug for the
same issue:

http://bugs.freedesktop.org/show_bug.cgi?id=9682
2007-01-17 12:48:51 -08:00
Pavel Roskin
a2ec383ff1 Clean up _fbOnes()
The implementation of _FbOnes in iccolor.c would not work on 64-bit
longs correctly.  Fortunately, it's only used on integers, so make it
explicit in the declaration.

Use an inline function for the gcc builtin implementation to make sure
that it's never used with arguments of incorrect size.

There is no __INT_MIN__ in gcc 4.1.1, but it's not an issue now because
the argument is 32-bit.

Signed-off-by: Pavel Roskin <proski@gnu.org>
2007-01-16 16:38:36 -08:00
Soeren Sandmann
cf1d95e714 Add SRC and IN implementations to avoid CompositeGeneral in some cases hit by PDF rendering
The patch implements a few more operations with special cases MMX
code. On my laptop, applying the patch to cairo speeds up the
benchmark (rendering page 14 of a PDF file[*]) from 20.9 seconds
to 14.9 seconds, which is an improvement of 28.6%.

[*] http://people.redhat.com/jakub/prelink.pdf

This also benefits the recently added unaligned_clip perf case:

image-rgb  unaligned_clip-100 0.11 -> 0.06: 1.65x speedup
▋
image-rgba unaligned_clip-100 0.11 -> 0.06: 1.64x speedup
▋
2007-01-09 15:37:26 -08:00
Alp Toker
caa3c2e1e7 Fix various code/comment typos 2007-01-07 01:35:15 -05:00
David Turner
e9bef30d2b Optimize gradient computations
We update the test suite reference images where needed, (pdiff
avoided a few, but most still needed updating). We take advantage
of the need for new reference images to shrink some of the giant
tests to speed them up a bit.

This optimization provides a 2x improvement in linear gradient
generation performance (numbers from an x86 laptop):

image-rgb    paint_linear_rgba_source-512 26.13 -> 11.13: 2.35x speedup
█▍
image-rgb    paint_linear_rgba_source-256  6.47 ->  2.76: 2.34x speedup
█▍
image-rgba      paint_linear_rgb_over-256  6.51 ->  2.86: 2.28x speedup
█▎
image-rgb      paint_linear_rgba_over-512 28.62 -> 13.70: 2.09x speedup
█▏
image-rgba       fill_linear_rgb_over-256  3.24 ->  1.94: 1.66x speedup
▋
image-rgb     stroke_linear_rgba_over-256  5.68 ->  4.10: 1.39x speedup
▍
2006-12-14 09:27:45 -08:00
Carl Worth
af9cce6aa2 Fix 'make distcheck' after recent file removals 2006-12-14 09:18:26 -08:00
Behdad Esfahbod
6122c30930 [pixman] Remove unused slim_internal.h 2006-12-08 15:38:34 -05:00
Vladimir Vukicevic
3e002a474b [win32] Update pixman MMX code to work with MSVC
Patch from Tor Lillqvist.
2006-11-07 13:12:07 -08:00