Commit graph

27 commits

Author SHA1 Message Date
Andrea Canciani
eaac0fa87e doc: Manually fix remaining warnings about symmetry
The Python script is unable to fix all of the warnings, because some
point to comments that are not actually documentation.

Fixes the remaining 'documentation comment not closed with **/'
warnings.
2012-03-29 11:03:18 +02:00
Andrea Canciani
c0fc24c889 doc: Make informational comments syntactically different from docs
This avoids confusion with the documentation comments and fixes some
malformed docs reports.
2012-03-29 11:03:18 +02: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
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
Andrea Canciani
87016112c5 Fix surface backend structures
a69335a84e introduced some new members
in the backend structure, but quartz, qt and xlib-xcb were not
updated.
2011-07-26 22:03:31 +02:00
Chris Wilson
83bfd85a13 Implement cairo_backend_t
Allow a backend to completely reimplement the Cairo API as it wants. The
goal is to pass operations to the native backends such as Quartz,
Direct2D, Qt, Skia, OpenVG with no overhead. And to permit complete
logging contexts, and whatever else the imagination holds. Perhaps to
experiment with double-paths?

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-15 11:05:19 +01:00
Andrea Canciani
200e147322 pattern: Use double precision for gradient extreme objects
Using double precision for gradient extreme objects ensures that they
are preserved as specified when constructing the gradient pattern.

Fixes huge-linear, huge-radial.

Fixes part of https://bugs.freedesktop.org/show_bug.cgi?id=32215
2011-01-02 18:33:14 +01:00
Andrea Canciani
a8ae8759f5 path: Always interpret in forward direction
Path are always interpreted in forward direction, so the ability of
interpreting in the opposite direction (which is very unlikely to be
useful at all) can be removed.
2010-12-10 10:58:51 +01:00
Oleg Romashin
6b92d5a0f9 qt: Use native glyph rendering.
Remove the hack of using the xlib surface to do glyph rendering and use
the new interface introduced with Qt4.7, or else fallback to image
rendering with freetype.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
[2 files changed, 35 insertions(+), 140 deletions(-) \o/]
2010-07-16 09:49:42 +01:00
Andrea Canciani
b8a7f8621a Update FSF address
I updated the Free Software Foundation address using the following script.

for i in $(git grep Temple | cut -d: -f1 )
do
  sed -e 's/59 Temple Place[, -]* Suite 330, Boston, MA *02111-1307[, ]* USA/51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA/' -i "$i"
done

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=21356
2010-04-27 11:13:38 +02:00
Chris Wilson
7ab350378e Silence enumeration warnings following addition of RGB16_565 2010-03-30 18:31:34 +01:00
Chris Wilson
e8c819c522 Warnings cleanup for CAIRO_FORMAT_INVALID.
A few more fixes required case statements to handle the addition of
CAIRO_FORMAT_INVALID.
2010-03-01 10:25:01 +00:00
Chris Wilson
3c66c721d1 qt: Fix compile error.
Update after prototype changed for create_similar(), as pointed out by
augzilla.
2010-02-09 08:48:42 +00:00
Chris Wilson
f617d5fc98 Add cairo_device_t
The device is a generic method for accessing the underlying interface
with the native graphics subsystem, typically the X connection or
perhaps the GL context. By exposing a cairo_device_t on a surface and
its various methods we enable finer control over interoperability with
external interactions of the device by applications. The use case in
mind is, for example, a multi-threaded gstreamer which needs to serialise
its own direct access to the device along with Cairo's across many
threads.

Secondly, the cairo_device_t is a unifying API for the mismash of
backend specific methods for controlling creation of surfaces with
explicit devices and a convenient hook for debugging and introspection.

The principal components of the API are the memory management of:

  cairo_device_reference(),
  cairo_device_finish() and
  cairo_device_destroy();

along with a pair of routines for serialising interaction:

  cairo_device_acquire() and
  cairo_device_release()

and a method to flush any outstanding accesses:

  cairo_device_flush().

The device for a particular surface may be retrieved using:

  cairo_surface_get_device().

The device returned is owned by the surface.
2010-01-22 23:01:50 +00:00
Chris Wilson
cfd204824f Constify stroke style and matrices.
As a simple step to ensure that we do not inadvertently modify (or at least
generate compiler warns if we try) user data, mark the incoming style
and matrices as constant.
2010-01-22 23:01:49 +00:00
Chris Wilson
c50c8b90c0 Move _cairo_error() to a standalone header
A pending commit will want to include some utility code from cairo and
so we need to extricate the error handling from the PLT symbol hiding.
2010-01-22 22:30:43 +00:00
Chris Wilson
6950b233e4 qt: Make flush() robust.
Hanno Meyer-Thurow reported in

  http://bugs.freedesktop.org/show_bug.cgi?id=26063
  [PATCH] various fixes to cairo-qt

a few issues related to _cairo_qt_surface_flush() where firefox was
crashing after being built to use cairo-qt.

This is an amalgam of those patches that hopefully address the issue.
2010-01-15 14:27:58 +00:00
Chris Wilson
efdb53425e [qt] Discard impossible status return from path construction
As we never return an error status during the path construction, we can
use the return value for the QPainterPath instead, greatly simplifying the
callers.
2009-08-29 17:07:36 +01:00
Chris Wilson
d1b8e260d4 [qt] Fix compilation
Enabling 'FAST CLIP' appears to trigger an infinite loop so disable.

Enabling 'FAST FILL' has limited effect on performance, so disable whilst
the basic QT surface is improved.
2009-08-10 21:31:10 +01:00
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
Tobias Hunger
01eec61f4f [qt] Remove use of unnecessary QBrush pointer
QBrush is a implicitly shared datastructure. There is on need to layer
"explicit pointer based sharing" atop of it.

Mozilla Bug #498871
2009-07-16 00:16:59 -04:00
Tobias Hunger
222c12cc4e [qt] Remove use of unnecessary QPen pointer
QPen is a implicitly shared class, so there is no need to do explicit sharing
via pointers.

Mozilla Bug #498873
2009-07-16 00:16:59 -04:00
Tobias Hunger
0797b2fcaa [qt] Cleanup some whitespace
Mozilla bug #498843
2009-07-16 00:16:59 -04:00
Tobias Hunger
d782ba04b7 [qt] Add method to flush qpainter
This is required for non-X11 rendering backends.

Mozilla bug #498910
2009-07-16 00:16:58 -04:00
Tobias Hunger
e713857b85 [qt] Move _opstr() inside the #if 0 to avoid warnings
Mozilla bug #498917
2009-07-16 00:16:58 -04:00
Tobias Hunger
4f9551e5e5 [qt] Reduce padding in cairo_qt_surface_t struct
Removes 4 bytes of padding (on a 32bit system) from the datastructure by
reordering the members.

Mozilla bug #498880
2009-07-16 00:16:57 -04:00
Vladimir Vukicevic
22587f57bd Import Qt backend by Mozilla
Written by Vladimir Vukicevic to enable integration with Qt embedded
devices, this backend allows cairo code to target QPainter, and use
it as a source for other cairo backends.

This imports the sources from mozilla-central:
http://mxr.mozilla.org/mozilla-central/find?text=&kind=text&string=cairo-qpainter
renames them from cairo-qpainter to cairo-qt, and integrates the patch
by Oleg Romashin:
https://bugs.freedesktop.org/attachment.cgi?id=18953

And then attempts to restore 'make check' to full functionality.

However:
 - C++ does not play well with the PLT symbol hiding, and leaks into the
   global namespace. 'make check' fails at check-plt.sh

 - Qt embeds a GUI into QApplication which it requires to construct any
   QPainter drawable, i.e. used by the boilerplate to create a cairo-qt
   surface, and this leaks fonts (cairo-ft-fonts no less) causing assertion
   failures that all cairo objects are accounted for upon destruction.

[Updated by Chris Wilson]
Acked-by: Jeff Muizelaar <jeff@infidigm.net>
Acked-by: Carl Worth <cworth@cworth.org>
2009-06-16 11:03:46 +01:00