diff options
Diffstat (limited to 'Source/WebCore/platform/graphics')
-rw-r--r-- | Source/WebCore/platform/graphics/WidthIterator.cpp | 4 | ||||
-rw-r--r-- | Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp | 13 |
2 files changed, 14 insertions, 3 deletions
diff --git a/Source/WebCore/platform/graphics/WidthIterator.cpp b/Source/WebCore/platform/graphics/WidthIterator.cpp index e8b620f8a..48a59a27c 100644 --- a/Source/WebCore/platform/graphics/WidthIterator.cpp +++ b/Source/WebCore/platform/graphics/WidthIterator.cpp @@ -124,9 +124,9 @@ static inline float applyFontTransforms(GlyphBuffer* glyphBuffer, bool ltr, int& #if ENABLE(SVG_FONTS) // We need to handle transforms on SVG fonts internally, since they are rendered internally. if (fontData->isSVGFont()) { - ASSERT(iterator.run().renderingContext()); + // SVG font fallbacks doesn't work properly and will not have a renderingContext. see: textRunNeedsRenderingContext() // SVG font ligatures are handled during glyph selection, only kerning remaining. - if (typesettingFeatures & Kerning) + if (iterator.run().renderingContext() && (typesettingFeatures & Kerning)) iterator.run().renderingContext()->applySVGKerning(fontData, iterator, glyphBuffer, lastGlyphCount); } else #endif diff --git a/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp b/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp index 55c0b6aca..4469fde58 100644 --- a/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp +++ b/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp @@ -38,6 +38,7 @@ #include <wtf/TemporaryChange.h> #if PLATFORM(QT) +#include <QPaintEngine> #include "NativeImageQt.h" #endif @@ -908,7 +909,17 @@ void BitmapTextureGL::updateContents(Image* image, const IntRect& targetRect, co const char* imageData; #if PLATFORM(QT) - QImage qImage = frameImage->toImage(); + QImage qImage; + QPaintEngine* paintEngine = frameImage->paintEngine(); + if (paintEngine && paintEngine->type() == QPaintEngine::Raster) { + // QRasterPixmapData::toImage() will deep-copy the backing QImage if there's an active QPainter on it. + // For performance reasons, we don't want that here, so we temporarily redirect the paint engine. + QPaintDevice* currentPaintDevice = paintEngine->paintDevice(); + paintEngine->setPaintDevice(0); + qImage = frameImage->toImage(); + paintEngine->setPaintDevice(currentPaintDevice); + } else + qImage = frameImage->toImage(); imageData = reinterpret_cast<const char*>(qImage.constBits()); bytesPerLine = qImage.bytesPerLine(); #elif USE(CAIRO) |