[Qt] Remove unnecessary AffineTransform calls
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 29 Jun 2012 01:45:34 +0000 (01:45 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 29 Jun 2012 01:45:34 +0000 (01:45 +0000)
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

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/Pattern.h
Source/WebCore/platform/graphics/qt/FontQt.cpp
Source/WebCore/platform/graphics/qt/FontQt4.cpp
Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
Source/WebCore/platform/graphics/qt/PatternQt.cpp

index c8b6916..7dd7f52 100644 (file)
@@ -1,3 +1,29 @@
+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
index 5a3c879..3d53005 100644 (file)
@@ -78,6 +78,9 @@ public:
     // 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
index b55f0b7..ef99022 100644 (file)
@@ -81,8 +81,7 @@ static QPen fillPenForContext(GraphicsContext* ctx)
     }
 
     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);
@@ -97,8 +96,7 @@ static QPen strokePenForContext(GraphicsContext* ctx)
     }
 
     if (ctx->strokePattern()) {
-        AffineTransform affine;
-        QBrush brush(ctx->strokePattern()->createPlatformPattern(affine));
+        QBrush brush(ctx->strokePattern()->createPlatformPattern());
         return QPen(brush, ctx->strokeThickness());
     }
 
index b021f9c..232b8ff 100644 (file)
@@ -83,8 +83,7 @@ static QPen fillPenForContext(GraphicsContext* ctx)
     }
 
     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()));
@@ -99,8 +98,7 @@ static QPen strokePenForContext(GraphicsContext* ctx)
     }
 
     if (ctx->strokePattern()) {
-        AffineTransform affine;
-        QBrush brush(ctx->strokePattern()->createPlatformPattern(affine));
+        QBrush brush(ctx->strokePattern()->createPlatformPattern());
         return QPen(brush, ctx->strokeThickness());
     }
 
index 400e3d1..465890e 100644 (file)
@@ -507,8 +507,7 @@ void GraphicsContext::fillPath(const Path& path)
             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());
@@ -528,8 +527,7 @@ void GraphicsContext::fillPath(const Path& path)
         }
     }
     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());
@@ -590,8 +588,7 @@ void GraphicsContext::strokePath(const Path& path)
     }
 
     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());
@@ -605,8 +602,7 @@ static inline void drawRepeatPattern(QPainter* p, PassRefPtr<Pattern> pattern, c
 {
     ASSERT(pattern);
 
-    AffineTransform affine;
-    const QBrush brush = pattern->createPlatformPattern(affine);
+    const QBrush brush = pattern->createPlatformPattern();
     if (brush.style() != Qt::TexturePattern)
         return;
 
index af7b128..7aae625 100644 (file)
@@ -31,7 +31,7 @@
 
 namespace WebCore {
 
-QBrush Pattern::createPlatformPattern(const AffineTransform&) const
+QBrush Pattern::createPlatformPattern() const
 {
     QPixmap* pixmap = tileImage()->nativeImageForCurrentFrame();
     if (!pixmap)