Commit graph

24 commits

Author SHA1 Message Date
Chris Wilson
bed2701e1c Remove clip handling from generic surface layer.
Handling clip as part of the surface state, as opposed to being part of
the operation state, is cumbersome and a hindrance to providing true proxy
surface support. For example, the clip must be copied from the surface
onto the fallback image, but this was forgotten causing undue hassle in
each backend. Another example is the contortion the meta surface
endures to ensure the clip is correctly recorded. By contrast passing the
clip along with the operation is quite simple and enables us to write
generic handlers for providing surface wrappers. (And in the future, we
should be able to write more esoteric wrappers, e.g. automatic 2x FSAA,
trivially.)

In brief, instead of the surface automatically applying the clip before
calling the backend, the backend can call into a generic helper to apply
clipping. For raster surfaces, clip regions are handled automatically as
part of the composite interface. For vector surfaces, a clip helper is
introduced to replay and callback into an intersect_clip_path() function
as necessary.

Whilst this is not primarily a performance related change (the change
should just move the computation of the clip from the moment it is applied
by the user to the moment it is required by the backend), it is important
to track any potential regression:

ppc:
Speedups
========
image-rgba         evolution-20090607-0    1026085.22 0.18% -> 672972.07 0.77%:  1.52x speedup
▌
image-rgba         evolution-20090618-0    680579.98 0.12% -> 573237.66  0.16%:  1.19x speedup
▎
image-rgba      swfdec-fill-rate-4xaa-0    460296.92 0.36% -> 407464.63  0.42%:  1.13x speedup
▏
image-rgba      swfdec-fill-rate-2xaa-0    128431.95 0.47% -> 115051.86  0.42%:  1.12x speedup
▏
Slowdowns
=========
image-rgba     firefox-periodic-table-0    56837.61 0.78% -> 66055.17    3.20%:  1.09x slowdown
▏
2009-07-23 15:32:14 +01:00
M Joonas Pihlaja
4a9b274eeb [cairo-spans] Add a check/create_span_renderer backend methods.
A surface will have the chance to use span rendering at cairo_fill()
time by creating a renderer for a specific combination of
pattern/dst/op before the path is scan converted.  The protocol is to
first call check_span_renderer() to see if the surface wants to render
with spans and then later call create_span_renderer() to create the
renderer for real once the extents of the path are known.

No backends have an implementation yet.
2008-12-06 14:04:36 +02:00
Behdad Esfahbod
3f5051fab1 Fix now-detected doc formatting issues 2008-06-01 19:14:13 -04:00
Behdad Esfahbod
f0633f4449 [doc] Make sure all function names in docs are followed by () 2008-01-28 21:49:57 -05:00
Vladimir Vukicevic
5c7d2d14d7 [fix] Avoid int overflow when allocating large buffers
This patch introduces three macros: _cairo_malloc_ab,
_cairo_malloc_abc, _cairo_malloc_ab_plus_c and replaces various calls
to malloc(a*b), malloc(a*b*c), and malloc(a*b+c) with them.  The macros
return NULL if int overflow would occur during the allocation.  See
CODING_STYLE for more information.
2007-06-29 09:46:08 -07:00
Behdad Esfahbod
97b50e99bf [BeOS] Remove old-style mutex initialization cruft 2007-04-22 16:05:25 -04:00
Behdad Esfahbod
8fbf50d31d [src] Make sure all source files #include "cairoint.h" as their first include
This is necessary to avoid many portability problems as cairoint.h includes
config.h.  Without a test, we will regress again, hence add it.

The inclusion idiom for cairo now is:

	#include "cairoint.h"

	#include "cairo-something.h"
	#include "cairo-anotherthing-private.h"

	#include <some-library.h>
	#include <other-library/other-file.h>

Moreover, some standard headers files are included from cairoint.h and need
not be included again.
2007-04-03 20:28:11 -04:00
Behdad Esfahbod
a487d09421 Rename all mutex variables to start with an underscore
since they are not static in some of the implementations (win32, ...)
2007-03-05 15:59:43 -05:00
Behdad Esfahbod
c8b84a4735 [beos] Update mutex initializers
This should be the last one.  We are going to move to a central
mutex initialization scheme right after 1.4.0 is out.
2007-03-05 15:46:19 -05:00
Christian Biesinger
05a259d493 [beos] Fix build error
Rename cairo_rectangle_fixed_t to cairo_rectangle_int16_t
as needed per commit 746f66c3fc.
2006-10-26 21:47:16 +02:00
Christian Biesinger
0b63baba6e Make BeOS compile again
..by passing the cairo_content_t to _cairo_surface_init
2006-05-25 17:29:01 +02:00
Robert O'Callahan
7bcf957b4e Rename cairo_rectangle_t to cairo_rectangle_fixed_t.
This is in preparation for a later function addition for extracting
clip rectangles from a cairo_t, (which will add a public
cairo_rectangle_t).
2006-05-04 03:43:34 -07:00
Christian Biesinger
6a430478f5 Add an assert for the unsupported image surface formats 2006-03-27 15:46:02 +02:00
Christian Biesinger
8fbd0d448d Implement create_similar for BeOS 2006-03-27 02:57:59 +02:00
Christian Biesinger
ef04471b1b More consistent naming for the BeOS surface functions 2006-03-18 18:08:20 +01:00
Christian Biesinger
d985a9d669 Fixing BeOS surface part II 2006-03-01 00:40:35 +01:00
Christian Biesinger
566bb18dfe Updating BeOS surface per the get_type changes 2006-03-01 00:06:43 +01:00
Christian Biesinger
0fc25c9853 Don't call _cairo_error when returning an error
Only return it when returning a nil surface.
2006-02-18 21:45:58 +01:00
Christian Biesinger
f036c28fa3 Implement composite for the beos backend. Don't map CAIRO_OPERATOR_ADD to B_OP_ADD for now, something's broken there. 2005-12-26 19:08:53 +00:00
Christian Biesinger
4fe93bcf92 Don't require that the caller locks the view; do it in cairo code.
Remove the now-unneeded locking
2005-12-26 16:44:41 +00:00
Christian Biesinger
606d23b287 Use correct color when OPERATOR_SOURCE is used on a surface without alpha information. 2005-12-19 17:16:28 +00:00
Christian Biesinger
70c45dd502 Some final changes to the beos backend before checkin were wrong, fixing. 2005-12-19 11:01:42 +00:00
Christian Biesinger
9af7220b68 Use gtk-doc syntax rather than doxygen syntax for internal functions (to avoid warnings from gtk-doc when it processes this file) 2005-12-19 10:17:22 +00:00
Christian Biesinger
6142bc5348 Mention new --enable-svg option
Add notes for the new BeOS backend
Add disabled by default BeOS backend
Add BeOS files
New
New
BEOS_SURFACE_FEATURE
BeOS mutex functions
Ignore files generates by the BeOS tests
Add cairo-test-beos.*
New.
Test BeOS backend.
2005-12-18 17:20:06 +00:00