[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

andreas.kling at nokia.com andreas.kling at nokia.com
Wed Dec 22 12:25:31 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 892352c8011a50a40d2c2690db482a6d549b15c7
Author: andreas.kling at nokia.com <andreas.kling at nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Aug 23 11:44:41 2010 +0000

    2010-08-23  Andreas Kling  <andreas.kling at nokia.com>
    
            Reviewed by Kenneth Rohde Christiansen.
    
            [Qt] -webkit-text-stroke is broken due to Qt::TextBypassShaping
            https://bugs.webkit.org/show_bug.cgi?id=44403
    
            Don't bypass the Harfbuzz shaping if we're drawing text with a stroke.
            For canvas, always use complex text shaping since stroke and fill are decoupled.
    
            * html/canvas/CanvasRenderingContext2D.cpp:
            (WebCore::CanvasRenderingContext2D::measureText):
            (WebCore::CanvasRenderingContext2D::drawTextInternal):
            * platform/graphics/qt/FontQt.cpp:
            (WebCore::drawTextCommon):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65801 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index d3c9216..2ddefc6 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,19 @@
+2010-08-23  Andreas Kling  <andreas.kling at nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] -webkit-text-stroke is broken due to Qt::TextBypassShaping
+        https://bugs.webkit.org/show_bug.cgi?id=44403
+
+        Don't bypass the Harfbuzz shaping if we're drawing text with a stroke.
+        For canvas, always use complex text shaping since stroke and fill are decoupled.
+
+        * html/canvas/CanvasRenderingContext2D.cpp:
+        (WebCore::CanvasRenderingContext2D::measureText):
+        (WebCore::CanvasRenderingContext2D::drawTextInternal):
+        * platform/graphics/qt/FontQt.cpp:
+        (WebCore::drawTextCommon):
+
 2010-08-23  Mikhail Naganov  <mnaganov at chromium.org>
 
         Reviewed by Pavel Feldman.
diff --git a/WebCore/html/canvas/CanvasRenderingContext2D.cpp b/WebCore/html/canvas/CanvasRenderingContext2D.cpp
index 58ec1d0..485a22b 100644
--- a/WebCore/html/canvas/CanvasRenderingContext2D.cpp
+++ b/WebCore/html/canvas/CanvasRenderingContext2D.cpp
@@ -1727,7 +1727,19 @@ void CanvasRenderingContext2D::strokeText(const String& text, float x, float y,
 PassRefPtr<TextMetrics> CanvasRenderingContext2D::measureText(const String& text)
 {
     RefPtr<TextMetrics> metrics = TextMetrics::create();
+
+#if PLATFORM(QT)
+    // We always use complex text shaping since it can't be turned off for QPainterPath::addText().
+    Font::CodePath oldCodePath = Font::codePath();
+    Font::setCodePath(Font::Complex);
+#endif
+
     metrics->setWidth(accessFont().width(TextRun(text.characters(), text.length())));
+
+#if PLATFORM(QT)
+    Font::setCodePath(oldCodePath);
+#endif
+
     return metrics;
 }
 
@@ -1838,7 +1850,18 @@ void CanvasRenderingContext2D::drawTextInternal(const String& text, float x, flo
 #endif
 
     c->setTextDrawingMode(fill ? cTextFill : cTextStroke);
+
+#if PLATFORM(QT)
+    // We always use complex text shaping since it can't be turned off for QPainterPath::addText().
+    Font::CodePath oldCodePath = Font::codePath();
+    Font::setCodePath(Font::Complex);
+#endif
+
     c->drawBidiText(font, textRun, location);
+
+#if PLATFORM(QT)
+    Font::setCodePath(oldCodePath);
+#endif
 }
 
 const Font& CanvasRenderingContext2D::accessFont()
diff --git a/WebCore/platform/graphics/qt/FontQt.cpp b/WebCore/platform/graphics/qt/FontQt.cpp
index 59320cb..8edd356 100644
--- a/WebCore/platform/graphics/qt/FontQt.cpp
+++ b/WebCore/platform/graphics/qt/FontQt.cpp
@@ -169,7 +169,7 @@ static void drawTextCommon(GraphicsContext* ctx, const TextRun& run, const Float
     int flags = run.rtl() ? Qt::TextForceRightToLeft : Qt::TextForceLeftToRight;
 #if QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)
     // See QWebPagePrivate::QWebPagePrivate() where the default path is set to Complex for Qt 4.6 and earlier.
-    if (!isComplexText)
+    if (!isComplexText && !(ctx->textDrawingMode() & cTextStroke))
         flags |= Qt::TextBypassShaping;
 #endif
     if (hasShadow) {

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list