2006-08-30 Nikolas Zimmermann <zimmermann@kde.org>
authoreseidel <eseidel@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 Aug 2006 20:24:32 +0000 (20:24 +0000)
committereseidel <eseidel@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 Aug 2006 20:24:32 +0000 (20:24 +0000)
        Reviewed by eseidel.

        Use QColor <-> Color conversion operator, instead of faking it.

        * platform/qt/FontQt.cpp:
        (WebCore::Font::drawGlyphs):
        * platform/qt/GraphicsContextQt.cpp:
        (WebCore::GraphicsContext::fillRect):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@16124 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/platform/qt/FontQt.cpp
WebCore/platform/qt/GraphicsContextQt.cpp

index f16d718c67005839bbd993fe7cd77b15dbb4734d..1976d34d94e11c874441eb254810c03d843bd3c7 100644 (file)
@@ -1,3 +1,14 @@
+2006-08-30  Nikolas Zimmermann  <zimmermann@kde.org>
+
+        Reviewed by eseidel.
+
+        Use QColor <-> Color conversion operator, instead of faking it.
+
+        * platform/qt/FontQt.cpp:
+        (WebCore::Font::drawGlyphs):
+        * platform/qt/GraphicsContextQt.cpp:
+        (WebCore::GraphicsContext::fillRect):
+
 2006-08-30  Rob Buis  <buis@kde.org>
 
         Reviewed by Eric.
index ed9f15a120f456d05cc4a4513cc9957ddc70abd3..3bd43b9df4f1efc6d8806bf02f4859d33d9a4ac8 100644 (file)
@@ -35,7 +35,6 @@
 #include "GraphicsContext.h"
 
 #include <QPainter>
-#include <QDebug>
 
 namespace WebCore {
 
@@ -50,7 +49,7 @@ void Font::drawGlyphs(GraphicsContext* graphicsContext, const FontData* font, co
     QPainter& p = *graphicsContext->platformContext();
 
     Color color = graphicsContext->pen().color();
-    p.setPen(QColor(color.red(), color.green(), color.blue()));
+    p.setPen(QColor(color));
     p.setFont(font->platformData().font());
 
     QChar* buffer = reinterpret_cast<QChar*>(glyphBuffer.glyphs(from));
index 80e615b31e4e2229700617345d0d21df9e65892a..18a8006ff5917eb9fb9420fc05f877520b0974bc 100644 (file)
@@ -32,8 +32,9 @@
 
 #include "config.h"
 
-#include "GraphicsContext.h"
 #include "Path.h"
+#include "Color.h"
+#include "GraphicsContext.h"
 
 #include <QStack>
 #include <QPainter>
@@ -443,7 +444,7 @@ void GraphicsContext::fillRect(const IntRect& rect, const Color& c)
     if (paintingDisabled())
         return;
 
-    m_data->p().fillRect(rect, QColor(c.red(), c.green(), c.blue(), c.alpha()));
+    m_data->p().fillRect(rect, QColor(c));
 }
 
 void GraphicsContext::fillRect(const FloatRect& rect, const Color& c)
@@ -451,7 +452,7 @@ void GraphicsContext::fillRect(const FloatRect& rect, const Color& c)
     if (paintingDisabled())
         return;
 
-    m_data->p().fillRect(rect, QColor(c.red(), c.green(), c.blue(), c.alpha()));
+    m_data->p().fillRect(rect, QColor(c));
 }
 
 void GraphicsContext::addClip(const IntRect& rect)