This commit is contained in:
Vladimir Vukicevic 2008-05-01 09:23:23 -07:00
Родитель 75d1be2f68 23ffd8bb5c
Коммит aa4f8c4621
3 изменённых файлов: 22 добавлений и 29 удалений

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

@ -1162,9 +1162,31 @@ _cairo_qpainter_surface_fill (void *abstract_surface,
//qs->p->setRenderHint (QPainter::Antialiasing, antialias == CAIRO_ANTIALIAS_NONE ? false : true);
qs->p->setRenderHint (QPainter::SmoothPixmapTransform, source->filter != CAIRO_FILTER_FAST);
if (source->type == CAIRO_PATTERN_TYPE_SURFACE &&
source->extend == CAIRO_EXTEND_NONE &&
((cairo_surface_pattern_t*)source)->surface->type == CAIRO_SURFACE_TYPE_QPAINTER)
{
cairo_qpainter_surface_t *qsSrc = (cairo_qpainter_surface_t*) ((cairo_surface_pattern_t*)source)->surface;
QMatrix savedMatrix = qs->p->worldMatrix();
cairo_matrix_t m = source->matrix;
cairo_matrix_invert (&m);
qs->p->setWorldMatrix (_qmatrix_from_cairo_matrix (m), true);
if (qsSrc->image) {
qs->p->drawImage (0, 0, *qsSrc->image);
} else if (qsSrc->pixmap) {
qs->p->drawPixmap (0, 0, *qsSrc->pixmap);
}
qs->p->setWorldMatrix (savedMatrix, false);
} else {
PatternToBrushConverter brush(source);
qs->p->fillPath (qpath, brush);
}
if (qs->supports_porter_duff)
qs->p->setCompositionMode (QPainter::CompositionMode_SourceOver);

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

@ -60,9 +60,6 @@ public:
already_AddRefed<gfxASurface> CreateOffscreenSurface(const gfxIntSize& size,
gfxASurface::gfxImageFormat imageFormat);
already_AddRefed<gfxASurface> OptimizeImage(gfxImageSurface *aSurface,
gfxASurface::gfxImageFormat format);
nsresult GetFontList(const nsACString& aLangGroup,
const nsACString& aGenericFamily,
nsStringArray& aListOfFonts);

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

@ -63,10 +63,6 @@
#include <ft2build.h>
#include FT_FREETYPE_H
#ifndef Q_WS_X11
#define OPTIMIZE_TO_QPIXMAP
#endif
PRInt32 gfxQtPlatform::sDPI = -1;
gfxFontconfigUtils *gfxQtPlatform::sFontconfigUtils = nsnull;
static cairo_user_data_key_t cairo_qt_pixmap_key;
@ -134,28 +130,6 @@ gfxQtPlatform::CreateOffscreenSurface(const gfxIntSize& size,
return newSurface.forget();
}
already_AddRefed<gfxASurface>
gfxQtPlatform::OptimizeImage(gfxImageSurface *aSurface,
gfxASurface::gfxImageFormat format)
{
#ifdef OPTIMIZE_TO_QPIXMAP
const gfxIntSize& surfaceSize = aSurface->GetSize();
nsRefPtr<gfxASurface> optSurface = CreateOffscreenSurface(surfaceSize, format);
if (!optSurface || optSurface->CairoStatus() != 0)
return nsnull;
gfxContext tmpCtx(optSurface);
tmpCtx.SetOperator(gfxContext::OPERATOR_SOURCE);
tmpCtx.SetSource(aSurface);
tmpCtx.Paint();
return optSurface.forget();
#else
return nsnull;
#endif
}
nsresult
gfxQtPlatform::GetFontList(const nsACString& aLangGroup,
const nsACString& aGenericFamily,