https://bugs.webkit.org/show_bug.cgi?id=90178
Patch by Bruno de Oliveira Abinader <bruno.abinader@basyskom.com> on 2012-06-28
Reviewed by Noam Rosenthal.
Qt currently ignores the const AffineTransform& parameter on
Pattern::createPlatformPattern, so removing it from all its Qt calls and
changing the function signature if platform is Qt.
* platform/graphics/Pattern.h:
(Pattern):
* platform/graphics/qt/FontQt.cpp:
(WebCore::fillPenForContext):
(WebCore::strokePenForContext):
* platform/graphics/qt/FontQt4.cpp:
(WebCore::fillPenForContext):
(WebCore::strokePenForContext):
* platform/graphics/qt/GraphicsContextQt.cpp:
(WebCore::GraphicsContext::fillPath):
(WebCore::GraphicsContext::strokePath):
(WebCore::drawRepeatPattern):
* platform/graphics/qt/PatternQt.cpp:
(WebCore::Pattern::createPlatformPattern):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@121503
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-06-28 Bruno de Oliveira Abinader <bruno.abinader@basyskom.com>
+
+ [Qt] Remove unnecessary AffineTransform calls
+ https://bugs.webkit.org/show_bug.cgi?id=90178
+
+ Reviewed by Noam Rosenthal.
+
+ Qt currently ignores the const AffineTransform& parameter on
+ Pattern::createPlatformPattern, so removing it from all its Qt calls and
+ changing the function signature if platform is Qt.
+
+ * platform/graphics/Pattern.h:
+ (Pattern):
+ * platform/graphics/qt/FontQt.cpp:
+ (WebCore::fillPenForContext):
+ (WebCore::strokePenForContext):
+ * platform/graphics/qt/FontQt4.cpp:
+ (WebCore::fillPenForContext):
+ (WebCore::strokePenForContext):
+ * platform/graphics/qt/GraphicsContextQt.cpp:
+ (WebCore::GraphicsContext::fillPath):
+ (WebCore::GraphicsContext::strokePath):
+ (WebCore::drawRepeatPattern):
+ * platform/graphics/qt/PatternQt.cpp:
+ (WebCore::Pattern::createPlatformPattern):
+
2012-06-28 No'am Rosenthal <noam.rosenthal@nokia.com>
[Qt] When uploading an opaque image to a texture for TextureMapper, unnecessary alpha operations take place
// Pattern space is an abstract space that maps to the default user space by the transformation 'userSpaceTransformation'
#if USE(SKIA)
PlatformPatternPtr platformPattern(const AffineTransform& userSpaceTransformation);
+#elif PLATFORM(QT)
+ // Qt ignores user space transformation and uses pattern's instead
+ PlatformPatternPtr createPlatformPattern() const;
#else
PlatformPatternPtr createPlatformPattern(const AffineTransform& userSpaceTransformation) const;
#endif
}
if (ctx->fillPattern()) {
- AffineTransform affine;
- return QPen(QBrush(ctx->fillPattern()->createPlatformPattern(affine)), 0);
+ return QPen(QBrush(ctx->fillPattern()->createPlatformPattern()), 0);
}
return QPen(QColor(ctx->fillColor()), 0);
}
if (ctx->strokePattern()) {
- AffineTransform affine;
- QBrush brush(ctx->strokePattern()->createPlatformPattern(affine));
+ QBrush brush(ctx->strokePattern()->createPlatformPattern());
return QPen(brush, ctx->strokeThickness());
}
}
if (ctx->fillPattern()) {
- AffineTransform affine;
- return QPen(QBrush(ctx->fillPattern()->createPlatformPattern(affine)), 0);
+ return QPen(QBrush(ctx->fillPattern()->createPlatformPattern()), 0);
}
return QPen(QColor(ctx->fillColor()));
}
if (ctx->strokePattern()) {
- AffineTransform affine;
- QBrush brush(ctx->strokePattern()->createPlatformPattern(affine));
+ QBrush brush(ctx->strokePattern()->createPlatformPattern());
return QPen(brush, ctx->strokeThickness());
}
if (shadowContext) {
QPainter* shadowPainter = shadowContext->platformContext();
if (m_state.fillPattern) {
- AffineTransform affine;
- shadowPainter->fillPath(platformPath, QBrush(m_state.fillPattern->createPlatformPattern(affine)));
+ shadowPainter->fillPath(platformPath, QBrush(m_state.fillPattern->createPlatformPattern()));
} else if (m_state.fillGradient) {
QBrush brush(*m_state.fillGradient->platformGradient());
brush.setTransform(m_state.fillGradient->gradientSpaceTransform());
}
}
if (m_state.fillPattern) {
- AffineTransform affine;
- p->fillPath(platformPath, QBrush(m_state.fillPattern->createPlatformPattern(affine)));
+ p->fillPath(platformPath, QBrush(m_state.fillPattern->createPlatformPattern()));
} else if (m_state.fillGradient) {
QBrush brush(*m_state.fillGradient->platformGradient());
brush.setTransform(m_state.fillGradient->gradientSpaceTransform());
}
if (m_state.strokePattern) {
- AffineTransform affine;
- QBrush brush = m_state.strokePattern->createPlatformPattern(affine);
+ QBrush brush = m_state.strokePattern->createPlatformPattern();
fillPathStroke(p, pathStroker, platformPath, brush);
} else if (m_state.strokeGradient) {
QBrush brush(*m_state.strokeGradient->platformGradient());
{
ASSERT(pattern);
- AffineTransform affine;
- const QBrush brush = pattern->createPlatformPattern(affine);
+ const QBrush brush = pattern->createPlatformPattern();
if (brush.style() != Qt::TexturePattern)
return;
namespace WebCore {
-QBrush Pattern::createPlatformPattern(const AffineTransform&) const
+QBrush Pattern::createPlatformPattern() const
{
QPixmap* pixmap = tileImage()->nativeImageForCurrentFrame();
if (!pixmap)