Commit graph

10138 commits

Author SHA1 Message Date
Andrea Canciani
dfb8b131f5 win32: Fix Makefile.win32 build
The Makefile.win32 build system assumes that the files are in the same
directory level. If this is not the case, the compiler fails when it
tries to write the object files to a non-existing directory.

This can be fixed simply by making sure that the destination directory
always exists.

Fixes:

fatal error C1083: Cannot open compiler generated file:
'release/win32/cairo-win32-debug.obj': No such file or directory
2012-02-15 19:11:39 +01:00
Chris Wilson
ae3319890e win32: Rebase on the new compositor infrastructure
Try and undo all the damage that has acrued over the years by plugging
into the compositor pipeline.

References: https://bugs.freedesktop.org/show_bug.cgi?id=42739
References: https://bugs.freedesktop.org/show_bug.cgi?id=42821
References: https://bugs.freedesktop.org/show_bug.cgi?id=33081
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-15 14:37:11 +00:00
Chris Wilson
92c0b37d04 win32: Move to separate directoy
I suspect I may split the win32 code into a few more files, so move it
to its own directory to reduce the clutter.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-15 14:21:01 +00:00
Chris Wilson
8bea52bb0b Add preliminary damage tracking
This is initially based around the requirements for handling internal
fallbacks to the image compositor and reducing the number of pixels
required to be transferred.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-15 14:21:00 +00:00
Nis Martensen
c7d8ec72e6 doc: fix typo
The pattern creation function call in the example code has one _mesh too
much. This hopefully fixes the mesh mismatch mess :)

Signed-off-by: Nis Martensen <nis.martensen@web.de>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-02-14 21:04:25 +01:00
Oleg Romashin
4f81940749 qt: Fix compilation, also minor fix for building against Qt5
Update to latest surface backend structure, removed obsolete functions
and fixed functions API in order to be compatible with backend definition.

Fixed compilation with Qt5
2012-02-12 09:57:00 +00:00
Nis Martensen
76df401263 doc: Fix pattern name mismatch
In the example code, the mesh pattern variable was named "mesh" and
"pattern". Just use "pattern".

Signed-off-by: Andrea Canciani <ranma42@gmail.com>
2012-02-12 09:07:48 +01:00
Andrea Canciani
469994ac19 observer: Silence gcc warning
GCC complains that:

cairo-surface-observer.c:289:26: warning: ignoring return value of
'cairo_device_acquire', declared with attribute warn_unused_result
[-Wunused-result]

Explain why it's safe to ignore it in a comment.
2012-02-11 15:10:22 +01:00
Andrea Canciani
f2567e95a1 observer: Return status when printing the observed data
Making cairo_surface_observer_print() and
cairo_device_observer_print() return the status of the observer or of
the stream makes it possible to correctly track what kind of error
happens if the print is not successful.

This makes the functions more consistent with existing API with a
similar signature like cairo_surface_write_to_png_stream().
2012-02-11 15:10:22 +01:00
Uli Schlachter
f7eaf37f04 Wrapper: Don't translate clips extents' origin
If a bounded recording surface doesn't have its extents .x and .y at the
surface's origin, this code was translating all clips to make up for that.
However, the clip already is in device space.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41583

Signed-off-by: Uli Schlachter <psychon@znc.in>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-10 18:00:01 +01:00
Uli Schlachter
2f4645db84 xlib-xcb: Make this compile again
There was a typo in commit 2061cd81f2.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-02-10 17:52:45 +01:00
Chris Wilson
154e6b052b quartz: Add missing source hook
Regression from 2061cd81f2.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45866
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-10 09:21:32 +00:00
Chris Wilson
8960a5d0d0 analysis: replace open-coded _cairo_box_add_box()
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-10 00:03:51 +00:00
Henry (Yu) Song
e809cea6d0 gl: initialize temporary surface with size same as subsurface
Rather than the operation extents which may be larger. It would be
beneficial to trim to the intersection instead and tweak the pattern
matrices - however this is the fallback path and so hopefully less
frequently trod!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-09 23:38:37 +00:00
Chris Wilson
38bf7a6526 gl: Transfer ownership of trapezoid mask to operand
Signed-off-by: Henry (Yu) Song <hsong@sisa.samsung.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-09 23:26:14 +00:00
Chris Wilson
2886df60b0 polygon-intersection: The edge direction is immaterial
When checking for continuations on the right-hand edge, the actual
direction of the edge is immaterial as it is sorted into ascending
y-order and the direction is fixed up when emitting into the output
polygon.

Fixes assertion introduced with 658fa75a5c.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-09 22:44:47 +00:00
Chris Wilson
bb86e332da traps: composite_boxes() is not a mask constructor
Since it doesn't combine the clip in a single pass, don't claim to.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-09 22:11:24 +00:00
Chris Wilson
3443ad903d spans: Pass unbounded operations to the spans compositors
Only bail if we need to combine clipping with the spans (either for a
bounded or unbounded operation).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-09 22:08:41 +00:00
Chris Wilson
3023ff86d5 clip: Apply the partial boxes for clip_combine_with_surface
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-09 22:08:08 +00:00
Chris Wilson
fb3a193959 clip: Check whether an extents only clip contains the box
If we steal the boxes, we leave behind an extents-only clip, i.e. only
without a path or boxes, in which case do not return FALSE for the
is-contained check on a rectangle.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-09 22:06:18 +00:00
Chris Wilson
bbdb17fc18 tor: Restore the 256x15 sampling of the original rasteriser
A quick hack escaped into the wild, as this was superseded by the
separate tor22 rasteriser.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-09 19:45:24 +00:00
Chris Wilson
658fa75a5c polygon: Extend intersection edges to cover entire range
By simply swapping the continuation edges, we end up with a set of edges
that are defined over a shorter range than their extents. Whilst this is
numerically stable at our normal precision we start to encounter issues
when using a coarser grid during rasterisation as the derivative of the
edge becomes unstable.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44722
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-09 19:44:44 +00:00
Chris Wilson
a349a312dc directfb: Discard long broken code and return to basics
Rewrite the directfb backend as nothing more than a simpler image
compositor onto a shadowfb that is flushed back to the dfb surface as
required. Future refinements would be to add damage tracking, and to mix
the useful directfb operations (such as solid fills and alpha blends).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-09 16:20:26 +00:00
Chris Wilson
f4309795e9 test: Referesh traps (xlib) reference images for font updates
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-09 13:41:55 +00:00
Chris Wilson
2061cd81f2 Replace the ad-hoc surface unwrappers with a function pointer
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-09 13:01:17 +00:00
Chris Wilson
7c34997a3b gl: Just flush the context upon operand destroy
Replace the assertion that the context is flushed when we destroy the
operation and jfdi. Easiest way to resolve it rather than untangle just
why we end up there with an unflushed context.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-09 11:30:34 +00:00
Martin Robinson
8c3b86787a gl: Fix gl-source-surface test
When painting a GL surface pattern from one context to a
a surface of another context, be careful to manage the
multiple contexts so that they do not stomp on each other.

[ickle: Preserve fast path for GL subsurfaces]
2012-02-04 21:07:05 +00:00
Adrian Johnson
b52296a435 ps: fix extend-pad-border test failure 2012-02-04 16:25:09 +10:30
Adrian Johnson
477bcd89d7 ps: ensure shading domain is [ 0 1 ]
Printing to a printer with an Adobe PostScript 3 interpreter fails
with rangecheck when the shading domain is not [ 0 1 ]. Workaround
this by using a type 3 function to map from [ 0 1] to the required
domain.
2012-02-02 23:02:48 +10:30
Adrian Johnson
a004fe8529 ps: add missing 'Q' to end of page 2012-02-02 20:50:04 +10:30
Chris Wilson
c6c02f5194 xlib: Only reduce a readback of an uninitialised source for pixmaps
For a foreign drawable, we have to assume to that is dirty upon creation
or otherwise we fail to read back the correct pixel data when copying to
an image.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-02 02:08:19 +00:00
Chris Wilson
24445f9468 xlib: Set IncludeInferiors when acquiring the source image
If we need to fallback and perform a copy first to a pixmap for a
partially unviewable Window, we need to copy its inferiors as well.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-02 01:46:56 +00:00
Chris Wilson
b454db4b13 xlib: Set IncludeInferiors when using CopyArea
cairo-xlib semantics state that we copy the contents of a Window's
children when we use a Window as a source in a cairo operation. This
requires that we set the IncludeInferiors SubwindowMode on the GC.
However, we can only set one SubwindowMode for an operation and our
semantics are that drawing performed by cairo onto a Window are clipped
by its children (the ClipByChildren SubwindowMode). Therefore if we have
to copy between two Window, we can not use CopyArea. Furthermore, we
cannot tell if an external Drawable is a Window or a Pixmap, therefore
we treat all foriegn Drawables as Window.

Failure here means falling back to a render path, where we can
independently control the subwindow mode on the source and destination,
or to a GetImage/PutImage if the xserver does not support render.

Reported-by: Benjamin Otte <otte@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-02 01:14:16 +00:00
Adrian Johnson
d95172858b ps: avoid using ps patterns to paint/fill gradients
Patterns are slower and use more memory to print. For painting and
filling we can use the shading operator to draw gradients.
2012-02-01 22:31:07 +10:30
Adrian Johnson
46ca65895f ps: support RASTER_SOURCE patterns 2012-01-31 23:53:45 +10:30
Adrian Johnson
0f40cdea1b api: add cairo_surface_supports_mime_type
to allow querying if a surface supports a particular mime type.
2012-01-19 19:09:10 +10:30
Chris Wilson
a7c9c75ffa xlib: Improve choice of bits-per-pixel for depth
The only reliable method would be to query the xserver for the
matching bpp for a particular depth. In the absence of such information,
simply chose the next higher power-of-two(depth).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-17 12:40:11 +00:00
Andrea Canciani
a2f419b546 rectangle: Implement _cairo_rectangle_contains_rectangle()
And reuse it.
2012-01-15 18:25:57 +01:00
Andrea Canciani
2808bf5b95 pattern: Infinite color-only sources are always opaque
No matter what the sampling extents are, infinite color-only sources
are opaque.
2012-01-15 18:25:52 +01:00
Andrea Canciani
11493eea9b raster-source: Do not return value in void function
Both MSVC and Sun Studio Compiler complain about void values being
returned.

Fixes:
cairo-raster-source-pattern.c(93) : warning C4098:
'_cairo_raster_source_pattern_release' : 'void' function returning a
value
2012-01-15 16:49:08 +01:00
Andrea Canciani
c1c9424a3d quartz: Do not export private functions
Private functions must be marked cairo_private to avoid exporting
them.
2012-01-15 16:23:14 +01:00
Andrea Canciani
7058e8c181 quartz: Make glyph antialiasing consistent with quartz-font
CAIRO_ANTIALIAS_{FAST,GOOD,BEST} were introduced and used in
cairo-quartz-font.c by commit 70cd3b473d.

Fixes the warnings:

cairo-quartz-surface.c: In function '_cairo_quartz_cg_glyphs':
cairo-quartz-surface.c:1976: warning: enumeration value 'CAIRO_ANTIALIAS_FAST' not handled in switch
cairo-quartz-surface.c:1976: warning: enumeration value 'CAIRO_ANTIALIAS_GOOD' not handled in switch
cairo-quartz-surface.c:1976: warning: enumeration value 'CAIRO_ANTIALIAS_BEST' not handled in switch
2012-01-15 16:23:14 +01:00
Andrea Canciani
29145f4e48 quartz: Fix building with QUARTZ_DEBUG
Multiple code refactorings broke the debugging code.
2012-01-15 16:23:14 +01:00
Andrea Canciani
2bb441fd11 test: Add stride-12-image
Add a test to check that all the backends can handle images with a
stride that is not width * 4.
2012-01-15 14:29:25 +01:00
Adrian Johnson
88d589aa47 ps: handle different x/y fallback resolution in Fallback Image comment 2012-01-15 21:29:15 +10:30
Adrian Johnson
284cba1f37 test: add push/pop group to fallback test 2012-01-15 21:18:43 +10:30
Uli Schlachter
9a199fd403 xcb: Use int instead of uint16_t for rowstride
Fixes negative-stride-image

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-01-12 20:31:16 +01:00
Andrea Canciani
45d9659665 test: Add negative-stride-image
Add a test to check that all the backends can handle images with
negative stride.
2012-01-12 11:53:16 +01:00
Chris Wilson
738be215da xlib: Fix typo in 5045155de6, lack of closing ';'
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-11 12:45:41 +00:00
Chris Wilson
dc80e8328c subsurface: Add guards for creating similar surface
If the target backend doesn't provide the entry points, just return NULL
(unsupported).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-11 12:43:44 +00:00