Commit graph

264 commits

Author SHA1 Message Date
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
Christian Biesinger
38dcddd79e fix comment: pixman_private needs to be before the type of a variable
Makes the documentation match the code.
Compare also commit 34d11aa3c4
2006-10-10 12:38:33 -07:00
Alfred Peng
34d11aa3c4 Use pixman_private consistently as prefix not suffix 2006-09-29 17:17:27 -07:00
Alfred Peng
c1495742f7 Add Sun Pro C definition of pixman_private 2006-09-29 17:16:47 -07:00
Vladimir Vukicevic
a56b962428 Add win32 output files to gitignore 2006-09-19 12:19:21 -07:00
Carl Worth
82b710ebc2 Add missing pixman_private to _FbOnes when a function.
This was thanks to a report from crucible (run #2113) since it tested
with older versions of gcc (3.3.6) than most of the cairo developers
use, (so we had been getting the _FbOnes macro not the function).
2006-09-19 10:13:36 -07:00
Vladimir Vukicevic
00d5a2ed48 [win32] Makefile.win32: use correct (/MD) runtime library flag everywhere
There was a bad mix of LIBCMT (the static runtime lib) and MSVCRT (the dynamic
one) before, because LIBCMT is the default.  This specifies /MD everywhere.
2006-09-09 23:29:17 -07:00
Vladimir Vukicevic
0e59041321 [win32] win32-specific Makefiles for building with MSVC
This patch adds a bunch of makefiles for building cairo with Visual C++.
gnu make is still required, and make must be run from a command prompt
that has the Visual C++ paths set up, as well as has the cygwin environment
in the path.  Run 'make -f Makefile.win32'.
2006-09-09 17:08:18 -07:00
Nicholas Miell
d598cd8d61 Fix the AMD64 final link by removing SLIM from pixman
In order for SLIM's PLT indirection avoidance to work, everything in
the library that makes internal function calls needs to see the
relevant slim_hidden_proto() macro in addition to the function's
prototype. However, external headers used by clients of the shared
library should not use the SLIM macros at all.

Pixman is a rather odd case -- it's mostly independent from cairo, so
it has it's own public interface, but it's built as a part of cairo
instead of its own shared library. This means that cairo would need to
see all of pixman's slim_hidden_proto() macros in order to function
and it doesn't currently, which results in a link failure on AMD64
systems and on i386 systems (I think, I haven't actually verified
this) it produces a shared object that isn't actally sharable.

I have no idea why exactly the link failure only showed up as a result
of commit e06246b9b1. I think it has
something to do with the pixman functions no longer having PLT entries
at all, but the exact interaction isn't clear to me.

However, all of these pixman functions aren't part of the cairo ABI
(which is why they were marked pixman_private in the first place),
which means that the SLIMification of pixman is largely pointless --
they aren't externally visible, so they don't need PLT entries at
all. Furthermore, while pixman may eventually be shared among cairo
and X, I'm told that this sharing will be source-level only, which
means it won't ever be an actual shared library and thus won't ever
need SLIM at all.

So, I just removed all use of SLIM in pixman (leaving behind
slim_internal.h for the future edification of anyone who cares).This
fixes the AMD64 link failure and passes the check-plt & check-def
parts of make check.

Signed-off-by: Nicholas Miell <nmiell@gmail.com>
2006-09-07 12:48:28 -07:00
Nicholas Miell
203d70a562 Make the SLIM macros robust in the face of macro-renamed symbols
This doesn't actually fix the AMD64 link failure, but it does make the
foo/EXT_foo/INT_foo symbol names generated by the slim_hidden_proto()
and slim_hidden_def() macros consistent in the face of the meddling of
pixman-remap.h.

Signed-off-by: Nicholas Miell <nmiell@gmail.com>
2006-09-07 12:48:23 -07:00
Carl Worth
e06246b9b1 pixman: Add pixman_private decorations to hide pixman symbols from public interface 2006-09-05 17:21:48 -07:00
Vladimir Vukicevic
72e25648c4 pixman: Use pSourceClip rather than pCompositeClip when fetching
This fixes the source-clip-scale test failures for most backends.
2006-08-17 13:35:16 -07:00
Pavel Roskin
b29cc61fac [pixman] Don't cast pointers to integers
This causes warnings on 64-bit platforms that may indicate very serious
problems.  Fortunately, not in this case.
2006-08-13 04:44:20 -04:00
Kjartan Maraas
22eee1db00 [warnings] Fixes for sparse. This fixes a lot of instances of 0 vs NULL 2006-08-11 11:18:24 -04:00
Alfred Peng
db06681b48 Fix leaks in failure paths in pixman gradient creation 2006-08-08 10:58:42 -07:00
Behdad Esfahbod
77fd0efa9a Fix few remaining compiler warnings, revealed by -O3 2006-08-08 02:58:50 -04:00
Carl Worth
959b85e98c Merge branch 'warnings-cleanup' into cairo
Conflicts:

	src/cairo-font-subset.c
2006-08-07 15:06:47 -07:00
Carl Worth
43b579d757 Add -Wswitch-enum compiler flag and fix all trivial warnings 2006-08-07 14:30:06 -07:00
Behdad Esfahbod
d1f9bef30e Add -Wunsafe-loop-optimizations compiler flag and fix all warnings 2006-08-07 14:24:32 -07:00
Carl Worth
9ae66174e7 Fix bug 7294 by adding pixman BGR formats and internal cairo BGR formats.
This approach to fixing the bug is valid since there is code in pixman
for rendering to BGR images, (which is why cairo 1.0 worked with BGR X
servers for example). But, since we don't want to advertise additional
image formats we implement this through a new cairo_internal_format_t.

This is rather fragile since we don't want to leak any internal formats
nor do we ever want an internal format to be used somewhere a real
format is expected, (and trigger a CAIRO_FORMAT_VALID assertion failure).
More comments than code are added here to help compensate for the
fragility and to give some guidance in fixing this mess in a better way
in the future.
2006-08-07 11:19:19 -07:00
Carl Worth
eb9caf0833 Add -Wsign-compare compiler flag and fix all warnings 2006-07-28 22:50:06 -07:00
Behdad Esfahbod
84b37568e1 Add -Wold-style-definition compiler falg and fix all warnings. 2006-07-28 15:23:22 -07:00
Carl Worth
7285499700 Squelch some bogus compiler warnings about possibly uninitialized values. 2006-06-29 05:07:51 +02:00
Torsten Schoenfeld
e747bbd350 Fix build after recent pixman.h change.
The recent pixman.h change to use configure-generated defines
accidentally broke the build.  Pulling in config.h fixes it.
2006-06-25 15:25:23 +02:00
Carl Worth
e32138aa93 Prefer using configure-generated variable for finding stdint.h or similar.
We were doing something more complicated originally, and that was because
pixman.h was an installed public header file at one time. But that hasn't
been the case for quite a long time.
2006-06-25 14:42:27 +02:00
Carl Worth
c6164d0d2a New API: Add support for new CAIRO_FORMAT_RGB16_565 2006-06-16 08:46:34 -07:00
Behdad Esfahbod
a8b736c160 Use enum time instead of int (shuts intel compiler up.) 2006-06-16 00:08:44 -04:00
Bertram Felgenhauer
b104a79502 Patch to fix pixman samping location bug (#2488). 2006-06-13 20:10:59 -04:00
Carl Worth
0ee64b8468 Bug 4196: undef MIN an MAX before defining to avoid duplicate definition 2006-06-13 16:50:43 -07:00
Zakharov Mikhail
32c0e85d45 pixman: fix compilation on HP-UX 11.11 2006-06-07 09:42:48 -07:00
Carl Worth
ef10a0403a Remove initial, final, and duplicate blank lines.
This patch was produced by running git-stripspace on all *.[ch] files
within cairo. Note that this script would have also created all the changes
from the previous commits to remove trailing whitespace.
2006-06-06 15:50:33 -07:00
Carl Worth
5278de0997 Remove all remaining trailing whitespace.
This patch was produced with the following (GNU) sed script:

	sed -i -r -e 's/[ \t]+$//'

run on all *.[ch] files within cairo.

Note that the above script would have also created all the changes
from the previous commits to remove trailing whitespace.
2006-06-06 15:41:31 -07:00
Carl Worth
00592e0757 Remove trailing whitespace from lines with a single brace.
This patch was produced with the following (GNU) sed script:

	sed -i -r -e '/^[ \t]*[{}][ \t]*/ s/[ \t]+$//'

run on all *.[ch] files within cairo.
2006-06-06 15:38:58 -07:00
Carl Worth
4670366ede Remove trailing whitespace from lines that look like comments.
This patch was produced with the following (GNU) sed script:

	sed -i -r -e '/^[ \t]*\/?\*/ s/[ \t]+$//'

run on all *.[ch] files within cairo, (though I manually excluded
src/cairo-atsui-font.c which has a code line that appears as a comment
to this script).
2006-06-06 15:35:48 -07:00
Carl Worth
80b8deb1e4 Remove extraneous whitespace from "blank" lines.
This patch was produced with the following (GNU) sed script:

	sed -i -r -e 's/^[ \t]+$//'

run on all *.[ch] files within cairo.
2006-06-06 15:25:49 -07:00
Carl Worth
621ebc4726 pixman: Remove unused code to quiet compiler warnings 2006-05-15 10:16:06 -07:00