зеркало из https://github.com/mozilla/pjs.git
Branch merge.
This commit is contained in:
Коммит
aa4f8c4621
|
@ -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,
|
||||
|
|
Загрузка…
Ссылка в новой задаче