Title: [121503] trunk/Source/WebCore
Revision
121503
Author
[email protected]
Date
2012-06-28 18:45:34 -0700 (Thu, 28 Jun 2012)

Log Message

[Qt] Remove unnecessary AffineTransform calls
https://bugs.webkit.org/show_bug.cgi?id=90178

Patch by Bruno de Oliveira Abinader <[email protected]> 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):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (121502 => 121503)


--- trunk/Source/WebCore/ChangeLog	2012-06-29 01:45:20 UTC (rev 121502)
+++ trunk/Source/WebCore/ChangeLog	2012-06-29 01:45:34 UTC (rev 121503)
@@ -1,3 +1,29 @@
+2012-06-28  Bruno de Oliveira Abinader  <[email protected]>
+
+        [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  <[email protected]>
 
         [Qt] When uploading an opaque image to a texture for TextureMapper, unnecessary alpha operations take place

Modified: trunk/Source/WebCore/platform/graphics/Pattern.h (121502 => 121503)


--- trunk/Source/WebCore/platform/graphics/Pattern.h	2012-06-29 01:45:20 UTC (rev 121502)
+++ trunk/Source/WebCore/platform/graphics/Pattern.h	2012-06-29 01:45:34 UTC (rev 121503)
@@ -78,6 +78,9 @@
     // 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

Modified: trunk/Source/WebCore/platform/graphics/qt/FontQt.cpp (121502 => 121503)


--- trunk/Source/WebCore/platform/graphics/qt/FontQt.cpp	2012-06-29 01:45:20 UTC (rev 121502)
+++ trunk/Source/WebCore/platform/graphics/qt/FontQt.cpp	2012-06-29 01:45:34 UTC (rev 121503)
@@ -81,8 +81,7 @@
     }
 
     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 @@
     }
 
     if (ctx->strokePattern()) {
-        AffineTransform affine;
-        QBrush brush(ctx->strokePattern()->createPlatformPattern(affine));
+        QBrush brush(ctx->strokePattern()->createPlatformPattern());
         return QPen(brush, ctx->strokeThickness());
     }
 

Modified: trunk/Source/WebCore/platform/graphics/qt/FontQt4.cpp (121502 => 121503)


--- trunk/Source/WebCore/platform/graphics/qt/FontQt4.cpp	2012-06-29 01:45:20 UTC (rev 121502)
+++ trunk/Source/WebCore/platform/graphics/qt/FontQt4.cpp	2012-06-29 01:45:34 UTC (rev 121503)
@@ -83,8 +83,7 @@
     }
 
     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 @@
     }
 
     if (ctx->strokePattern()) {
-        AffineTransform affine;
-        QBrush brush(ctx->strokePattern()->createPlatformPattern(affine));
+        QBrush brush(ctx->strokePattern()->createPlatformPattern());
         return QPen(brush, ctx->strokeThickness());
     }
 

Modified: trunk/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp (121502 => 121503)


--- trunk/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp	2012-06-29 01:45:20 UTC (rev 121502)
+++ trunk/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp	2012-06-29 01:45:34 UTC (rev 121503)
@@ -507,8 +507,7 @@
             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 @@
         }
     }
     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 @@
     }
 
     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 @@
 {
     ASSERT(pattern);
 
-    AffineTransform affine;
-    const QBrush brush = pattern->createPlatformPattern(affine);
+    const QBrush brush = pattern->createPlatformPattern();
     if (brush.style() != Qt::TexturePattern)
         return;
 

Modified: trunk/Source/WebCore/platform/graphics/qt/PatternQt.cpp (121502 => 121503)


--- trunk/Source/WebCore/platform/graphics/qt/PatternQt.cpp	2012-06-29 01:45:20 UTC (rev 121502)
+++ trunk/Source/WebCore/platform/graphics/qt/PatternQt.cpp	2012-06-29 01:45:34 UTC (rev 121503)
@@ -31,7 +31,7 @@
 
 namespace WebCore {
 
-QBrush Pattern::createPlatformPattern(const AffineTransform&) const
+QBrush Pattern::createPlatformPattern() const
 {
     QPixmap* pixmap = tileImage()->nativeImageForCurrentFrame();
     if (!pixmap)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to