Commit graph

18 commits

Author SHA1 Message Date
Karl Tomlinson
108b1c7825 clip: consider gstate target extents in _cairo_gstate_copy_clip_rectangle_list
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=29125

To be consistent with _cairo_gstate_clip_extents, the context's clip
should be intersected with the target surface extents (instead of only
using them when there is no clip).

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-07-17 11:32:02 +01:00
Karl Tomlinson
b79ea8a6ca clip: consider all_clipped in _cairo_clip_get_extents
If the gstate clip in _cairo_gstate_int_clip_extents() has all_clipped
set (and path NULL), then it returns the gstate target extents instead of
an empty rectangle.  If the target is infinite, then it says the clip is
unbounded.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=29124
Tested-by test/get-clip

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-07-17 11:30:51 +01:00
Karl Tomlinson
6a51159013 test: return CAIRO_TEST_FAILURE from get-clip preamble on failure
https://bugs.freedesktop.org/show_bug.cgi?id=29120
2010-07-17 11:30:35 +01:00
Karl Tomlinson
33ac203587 test: use the surface size expected in get-clip phase "No clip set"
https://bugs.freedesktop.org/show_bug.cgi?id=29121
2010-07-17 11:22:28 +01:00
Chris Wilson
5d8f366581 [test] clip representation is no longer surface dependent
So we can test the api just once in the preamble and not per-target.
2009-07-23 16:36:02 +01:00
Chris Wilson
c3f2db4f73 [drm] Add an accelerated image surface.
Use the DRM interface to h/w accelerate composition on image surfaces.
The purpose of the backend is simply to explore what such a hardware
interface might look like and what benefits we might expect.  The
use case that might justify writing such custom backends are embedded
devices running a drm compositor like wayland - which would, for example,
allow one to write applications that seamlessly integrated accelerated,
dynamic, high quality 2D graphics using Cairo with advanced interaction
(e.g. smooth animations in the UI) driven by a clutter framework...

In this first step we introduce the fundamental wrapping of GEM for intel
and radeon chipsets, and, for comparison, gallium. No acceleration, all
we do is use buffer objects (that is use the kernel memory manager) to
allocate images and simply use the fallback mechanism. This provides a
suitable base to start writing chip specific drivers.
2009-07-23 16:18:42 +01:00
Chris Wilson
1ae5942a3a Merge commit 'anholt/gl'
Conflicts:
	boilerplate/Makefile.sources
	boilerplate/cairo-boilerplate.c
	build/configure.ac.features
	src/cairo.h
	util/cairo-script/Makefile.am
2009-07-21 22:28:44 +01:00
Chris Wilson
52fa8760ae Add OpenVG backend.
Based on the work by Øyvind Kolås and Pierre Tardy -- many thanks to
Pierre for pushing this backend for inclusion as well as testing and
reviewing my initial patch. And many more thanks to pippin for writing the
backend in the first place!

Hacked and chopped by myself into a suitable basis for a backend. Quite a
few issues remain open, but would seem to be ready for testing on suitable
hardware.
2009-07-17 11:50:02 +01:00
Chris Wilson
6003ab77e1 Export meta-surface
The meta-surface is a vital tool to record a trace of drawing commands
in-memory. As such it is used throughout cairo.

The value of such a surface is immediately obvious and should be
applicable for many applications. The first such case is by
cairo-test-trace which wants to record the entire graph of drawing commands
that affect a surface in the event of a failure.
2009-07-03 18:26:50 +01:00
M Joonas Pihlaja
e380beae53 [sdl] Remove new backend.
The SDL backend makes invalid assumptions about SDL_Surface locking
semantics and doesn't deal correctly with the unpremultiplied pixel
format supported by SDL.  Removed as per discussion on the mailing list.

http://lists.cairographics.org/archives/cairo/2009-February/016595.html
2009-02-16 14:01:43 +02:00
Chris Wilson
e90073f7dd [test] Build test suite into single binary.
Avoid calling libtool to link every single test case, by building just one
binary from all the sources.

This binary is then given the task of choosing tests to run (based on user
selection and individual test requirement), forking each test into its own
process and accumulating the results.
2008-10-31 12:30:11 +00:00
Chris Wilson
336eddfdbb [test/get-clip] Check the status on the secondary context.
As we solely use a secondary context, we must manually report NO_MEMORY
errors whilst running under memfault.
2008-10-18 09:55:06 +01:00
Chris Wilson
436c0c8be2 [test] Preparatory work for running under memfault.
In order to run under memfault, the framework is first extended to handle
running concurrent tests - i.e. multi-threading. (Not that this is a
requirement for memfault, instead it shares a common goal of storing
per-test data).  To that end all the global data is moved into a per-test
context and the targets are adjusted to avoid overlap on shared, global
resources (such as output files and frame buffers). In order to preserve
the simplicity of the standard draw routines, the context is not passed
explicitly as a parameter to the routines, but is instead attached to the
cairo_t via the user_data.

For the masochist, to enable the tests to be run across multiple threads
simply set the environment variable CAIRO_TEST_NUM_THREADS to the desired
number.

In the long run, we can hope the need for memfault (runtime testing of
error paths) will be mitigated by static analysis. A promising candidate
for this task would appear to be http://hal.cs.berkeley.edu/cil/.
2008-08-13 21:54:59 +01:00
Chris Wilson
3bf06c3366 [test/*] Create new surfaces using the group target.
cairo_get_target() returns the original surface passed to
cairo_create(), and not the current destination as required when
testing drawing to the same surface using multiple contexts.

For completeness we also use the group target when creating similar
surfaces within the tests (to check that similar surfaces of similar
surfaces also work).
2007-12-20 21:21:32 +00:00
Vladimir Vukicevic
4c201723ce [quartz] Rename nquartz to quartz 2007-02-20 12:15:35 -08:00
Robert O'Callahan
4e1c2b1ad8 Rename cairo_copy_clip_rectangles to cairo_copy_clip_rectangle_list 2007-01-17 15:07:31 -08:00
Carl Worth
28a9f1dd14 Fix get-clip test for surfaces not implementing set_clip_region 2006-11-14 15:13:58 -08:00
Robert O'Callahan
191e108b93 Add clip getters API + tests
Add new public API methods:

void cairo_clip_extents (cairo_t *cr,                                               double *x1, double *y1,
    double *x2, double *y2);
cairo_rectangle_list_t *cairo_copy_clip_rectangles (cairo_t *);
void cairo_rectangle_list_destroy (cairo_rectangle_list_t *);

Also add 'get-clip' and 'get-path-extents' tests.
2006-09-25 23:22:45 -07:00