Title: [90919] trunk/Source/WebCore
Revision
90919
Author
[email protected]
Date
2011-07-13 08:43:43 -0700 (Wed, 13 Jul 2011)

Log Message

Fix compile for QRawFont.

https://bugs.webkit.org/show_bug.cgi?id=64453

Patch by Pierre Rossi <[email protected]> on 2011-07-13
Reviewed by Andreas Kling.

* platform/graphics/GraphicsContext.h:
* platform/graphics/qt/FontQt.cpp:
(WebCore::Font::drawGlyphs):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (90918 => 90919)


--- trunk/Source/WebCore/ChangeLog	2011-07-13 14:52:07 UTC (rev 90918)
+++ trunk/Source/WebCore/ChangeLog	2011-07-13 15:43:43 UTC (rev 90919)
@@ -1,3 +1,15 @@
+2011-07-13  Pierre Rossi  <[email protected]>
+
+        Fix compile for QRawFont.
+
+        https://bugs.webkit.org/show_bug.cgi?id=64453
+
+        Reviewed by Andreas Kling.
+
+        * platform/graphics/GraphicsContext.h:
+        * platform/graphics/qt/FontQt.cpp:
+        (WebCore::Font::drawGlyphs):
+
 2011-07-13  John Knottenbelt  <[email protected]>
 
         Reference Geolocation object from GeoNotifier and Geolocation::setIsAllowed.

Modified: trunk/Source/WebCore/platform/graphics/GraphicsContext.h (90918 => 90919)


--- trunk/Source/WebCore/platform/graphics/GraphicsContext.h	2011-07-13 14:52:07 UTC (rev 90918)
+++ trunk/Source/WebCore/platform/graphics/GraphicsContext.h	2011-07-13 15:43:43 UTC (rev 90919)
@@ -53,7 +53,6 @@
 #elif PLATFORM(QT)
 #include <QPainter>
 namespace WebCore {
-class ContextShadow;
 class ShadowBlur;
 }
 typedef QPainter PlatformGraphicsContext;

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


--- trunk/Source/WebCore/platform/graphics/qt/FontQt.cpp	2011-07-13 14:52:07 UTC (rev 90918)
+++ trunk/Source/WebCore/platform/graphics/qt/FontQt.cpp	2011-07-13 15:43:43 UTC (rev 90919)
@@ -42,6 +42,9 @@
 #include <QPainter>
 #include <QPainterPath>
 #include <QPen>
+#if HAVE(QRAWFONT)
+#include <QPointF>
+#endif
 #include <QTextLayout>
 #include <qalgorithms.h>
 #include <qdebug.h>
@@ -333,9 +336,6 @@
     // Stroking text should always take the complex path.
     ASSERT(!shouldStroke);
 
-    // Shadowed text should always take the complex path.
-    ASSERT(context->contextShadow()->type() == ShadowBlur::NoShadow);
-
     if (!shouldFill && !shouldStroke)
         return;
 
@@ -366,30 +366,31 @@
 
     QPainter* painter = context->platformContext();
 
-    ContextShadow* shadow = context->contextShadow();
+    ShadowBlur* shadow = context->shadowBlur();
     switch (shadow->type()) {
-    case ContextShadow::SolidShadow: {
+    case ShadowBlur::SolidShadow: {
         QPen previousPen = painter->pen();
-        painter->setPen(shadow->m_color);
-        painter->translate(shadow->offset());
+        painter->setPen(context->state().shadowColor);
+        const QPointF shadowOffset(context->state().shadowOffset.width(), context->state().shadowOffset.height());
+        painter->translate(shadowOffset);
         painter->drawGlyphRun(point, qtGlyphs);
-        painter->translate(-shadow->offset());
+        painter->translate(-shadowOffset);
         painter->setPen(previousPen);
         break;
     }
-    case ContextShadow::BlurShadow: {
+    case ShadowBlur::BlurShadow: {
         qreal height = rawFont.ascent() + rawFont.descent() + 1;
         QRectF boundingRect(point.x(), point.y() - rawFont.ascent(), width, height);
         GraphicsContext* shadowContext = shadow->beginShadowLayer(context, boundingRect);
         if (shadowContext) {
             QPainter* shadowPainter = shadowContext->platformContext();
-            shadowPainter->setPen(shadow->m_color);
+            shadowPainter->setPen(context->state().shadowColor);
             shadowPainter->drawGlyphRun(point, qtGlyphs);
             shadow->endShadowLayer(context);
         }
         break;
     }
-    case ContextShadow::NoShadow:
+    case ShadowBlur::NoShadow:
         break;
     default:
         ASSERT_NOT_REACHED();
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to