Bug 518585 - Fix the cairo Qt backend to build. r=pavlov

This commit is contained in:
Tobias Hunger 2009-09-26 17:51:08 +02:00
Родитель 0f44161868
Коммит be6f02b857
9 изменённых файлов: 20 добавлений и 40 удалений

Просмотреть файл

@ -7363,7 +7363,7 @@ if test "$MOZ_TREE_CAIRO"; then
CAIRO_FT_CFLAGS="$FT2_CFLAGS"
fi
if test "$MOZ_WIDGET_TOOLKIT" = "qt"; then
QPAINTER_SURFACE_FEATURE="#define CAIRO_HAS_QPAINTER_SURFACE 1"
QT_SURFACE_FEATURE="#define CAIRO_HAS_QT_SURFACE 1"
fi
if test "$MOZ_WIDGET_TOOLKIT" = "cocoa"; then
QUARTZ_SURFACE_FEATURE="#define CAIRO_HAS_QUARTZ_SURFACE 1"
@ -7452,7 +7452,7 @@ if test "$MOZ_TREE_CAIRO"; then
AC_SUBST(WIN32_FONT_FEATURE)
AC_SUBST(QUARTZ_FONT_FEATURE)
AC_SUBST(PNG_FUNCTIONS_FEATURE)
AC_SUBST(QPAINTER_SURFACE_FEATURE)
AC_SUBST(QT_SURFACE_FEATURE)
if test "$_WIN32_MSVC"; then
MOZ_CAIRO_LIBS='$(DEPTH)/gfx/cairo/cairo/src/mozcairo.lib $(DEPTH)/gfx/cairo/libpixman/src/mozlibpixman.lib'

Просмотреть файл

@ -30,8 +30,6 @@ cairo-version-fixes.patch: fix up cairo-version.c/cairo-version.h for in-place b
win32-ddb-dib.patch: fix for bug 455513; not upstream yet pending feebdack
qpainter-type.patch: add SURFACE_TYPE_QPAINTER to cairo.h
wince-fixes.patch: stubs out win32 functions we use but are not supported on win32. Also implements ExtSelectClipRgn in terms of other functions available on wince.
win32-vertically-offset-glyph.patch: bug 454098; vertical positioning errors when drawing glyph runs including delta-y offsets on screen via GDI

Просмотреть файл

@ -79,7 +79,7 @@
@DIRECTFB_SURFACE_FEATURE@
@QPAINTER_SURFACE_FEATURE@
@QT_SURFACE_FEATURE@
@DDRAW_SURFACE_FEATURE@

Просмотреть файл

@ -842,7 +842,7 @@ struct PatternToBrushConverter {
cairo_surface_pattern_t *spattern = (cairo_surface_pattern_t*) pattern;
cairo_surface_t *surface = spattern->surface;
if (surface->type == CAIRO_SURFACE_TYPE_QPAINTER) {
if (surface->type == CAIRO_SURFACE_TYPE_QT) {
cairo_qpainter_surface_t *qs = (cairo_qpainter_surface_t*) surface;
if (qs->image) {
@ -1148,7 +1148,7 @@ _cairo_qpainter_fast_fill (cairo_qpainter_surface_t *qs,
if (source->type == CAIRO_PATTERN_TYPE_SURFACE) {
cairo_surface_pattern_t *spattern = (cairo_surface_pattern_t*) source;
if (spattern->surface->type == CAIRO_SURFACE_TYPE_QPAINTER) {
if (spattern->surface->type == CAIRO_SURFACE_TYPE_QT) {
cairo_qpainter_surface_t *p = (cairo_qpainter_surface_t*) spattern->surface;
qsSrc_image = p->image;
@ -1504,7 +1504,7 @@ _cairo_qpainter_surface_composite (cairo_operator_t op,
qimg_d.reset(qimg);
}
if (surface->type == CAIRO_SURFACE_TYPE_QPAINTER) {
if (surface->type == CAIRO_SURFACE_TYPE_QT) {
cairo_qpainter_surface_t *qsrc = (cairo_qpainter_surface_t*) surface;
if (qsrc->image)
@ -1557,7 +1557,7 @@ _cairo_qpainter_surface_flush (void *abstract_surface)
**/
static const cairo_surface_backend_t cairo_qpainter_surface_backend = {
CAIRO_SURFACE_TYPE_QPAINTER,
CAIRO_SURFACE_TYPE_QT,
_cairo_qpainter_surface_create_similar,
_cairo_qpainter_surface_finish,
_cairo_qpainter_surface_acquire_source_image,
@ -1776,7 +1776,7 @@ cairo_qpainter_surface_get_qpainter (cairo_surface_t *surface)
{
cairo_qpainter_surface_t *qs = (cairo_qpainter_surface_t*) surface;
if (surface->type != CAIRO_SURFACE_TYPE_QPAINTER)
if (surface->type != CAIRO_SURFACE_TYPE_QT)
return NULL;
return qs->p;
@ -1787,7 +1787,7 @@ cairo_qpainter_surface_get_qimage (cairo_surface_t *surface)
{
cairo_qpainter_surface_t *qs = (cairo_qpainter_surface_t*) surface;
if (surface->type != CAIRO_SURFACE_TYPE_QPAINTER)
if (surface->type != CAIRO_SURFACE_TYPE_QT)
return NULL;
return qs->image;
@ -1798,7 +1798,7 @@ cairo_qpainter_surface_get_image (cairo_surface_t *surface)
{
cairo_qpainter_surface_t *qs = (cairo_qpainter_surface_t*) surface;
if (surface->type != CAIRO_SURFACE_TYPE_QPAINTER)
if (surface->type != CAIRO_SURFACE_TYPE_QT)
return NULL;
return (cairo_surface_t*) qs->image_equiv;

Просмотреть файл

@ -39,7 +39,7 @@
#include <cairo.h>
#if CAIRO_HAS_QPAINTER_SURFACE
#if CAIRO_HAS_QT_SURFACE
class QPainter;
class QImage;
@ -70,10 +70,10 @@ cairo_qpainter_surface_get_qimage (cairo_surface_t *surface);
CAIRO_END_DECLS
#else /* CAIRO_HAS_QPAINTER_SURFACE */
#else /* CAIRO_HAS_QT_SURFACE */
# error Cairo was not compiled with support for the QPainter backend
#endif /* CAIRO_HAS_QPAINTER_SURFACE */
#endif /* CAIRO_HAS_QT_SURFACE */
#endif /* CAIRO_QPAINTER_H_ */

Просмотреть файл

@ -2534,7 +2534,7 @@ _cairo_pattern_is_opaque (const cairo_pattern_t *abstract_pattern);
enum {
CAIRO_PATTERN_ACQUIRE_NONE = 0x0,
CAIRO_PATTERN_ACQUIRE_NO_REFLECT = 0x1,
CAIRO_PATTERN_ACQUIRE_NO_REFLECT = 0x1
};
cairo_private cairo_int_status_t
_cairo_pattern_acquire_surface (const cairo_pattern_t *pattern,

Просмотреть файл

@ -1,21 +0,0 @@
diff --git a/gfx/cairo/cairo/src/cairo.h b/gfx/cairo/cairo/src/cairo.h
--- a/gfx/cairo/cairo/src/cairo.h
+++ b/gfx/cairo/cairo/src/cairo.h
@@ -1875,6 +1875,7 @@
* @CAIRO_SURFACE_TYPE_OS2: The surface is of type os2
* @CAIRO_SURFACE_TYPE_WIN32_PRINTING: The surface is a win32 printing surface
* @CAIRO_SURFACE_TYPE_QUARTZ_IMAGE: The surface is of type quartz_image
+ * @CAIRO_SURFACE_TYPE_QPAINTER: The surface is of type qpainter
*
* #cairo_surface_type_t is used to describe the type of a given
* surface. The surface types are also known as "backends" or "surface
@@ -1913,7 +1914,8 @@
CAIRO_SURFACE_TYPE_SVG,
CAIRO_SURFACE_TYPE_OS2,
CAIRO_SURFACE_TYPE_WIN32_PRINTING,
- CAIRO_SURFACE_TYPE_QUARTZ_IMAGE
+ CAIRO_SURFACE_TYPE_QUARTZ_IMAGE,
+ CAIRO_SURFACE_TYPE_QPAINTER
} cairo_surface_type_t;
cairo_public cairo_surface_type_t

Просмотреть файл

@ -59,7 +59,7 @@
#include "gfxDirectFBSurface.h"
#endif
#ifdef CAIRO_HAS_QPAINTER_SURFACE
#ifdef CAIRO_HAS_QT_SURFACE
#include "gfxQPainterSurface.h"
#endif
@ -180,8 +180,8 @@ gfxASurface::Wrap (cairo_surface_t *csurf)
result = new gfxDirectFBSurface(csurf);
}
#endif
#ifdef CAIRO_HAS_QPAINTER_SURFACE
else if (stype == CAIRO_SURFACE_TYPE_QPAINTER) {
#ifdef CAIRO_HAS_QT_SURFACE
else if (stype == CAIRO_SURFACE_TYPE_QT) {
result = new gfxQPainterSurface(csurf);
}
#endif

Просмотреть файл

@ -363,6 +363,9 @@ gfxQtPlatform::GetFTLibrary()
return gPlatformFTLibrary;
}
void gfxQtPlatform::InitDisplayCaps()
{ }
FontFamily *
gfxQtPlatform::FindFontFamily(const nsAString& aName)
{