2009-01-15 Dimitri Glazkov <dglazkov@chromium.org>
authordglazkov@chromium.org <dglazkov@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 15 Jan 2009 21:30:17 +0000 (21:30 +0000)
committerdglazkov@chromium.org <dglazkov@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 15 Jan 2009 21:30:17 +0000 (21:30 +0000)
        Reviewed by Darin Adler.

        https://bugs.webkit.org/show_bug.cgi?id=23354
        Fix up graphics/chromium files to account for Uniscribe style scrubbing.

        * platform/graphics/chromium/FontChromiumWin.cpp:
        (WebCore::windowsCanHandleTextDrawing):
        (WebCore::Font::selectionRectForComplexText):
        (WebCore::Font::drawComplexText):
        (WebCore::Font::floatWidthForComplexText):
        (WebCore::Font::offsetForPositionForComplexText):
        * platform/graphics/chromium/GlyphPageTreeNodeChromiumWin.cpp:
        (WebCore::fillNonBMPGlyphs):

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

WebCore/ChangeLog
WebCore/platform/graphics/chromium/FontChromiumWin.cpp
WebCore/platform/graphics/chromium/GlyphPageTreeNodeChromiumWin.cpp

index 4c4a2ae352aac674fb3b0e2ef202af0253f3520f..7e0fe6d5b7e2d939fefda5acdddeb920ab3b0364 100644 (file)
@@ -1,3 +1,19 @@
+2009-01-15  Dimitri Glazkov  <dglazkov@chromium.org>
+
+        Reviewed by Darin Adler.
+
+        https://bugs.webkit.org/show_bug.cgi?id=23354
+        Fix up graphics/chromium files to account for Uniscribe style scrubbing.
+
+        * platform/graphics/chromium/FontChromiumWin.cpp:
+        (WebCore::windowsCanHandleTextDrawing):
+        (WebCore::Font::selectionRectForComplexText):
+        (WebCore::Font::drawComplexText):
+        (WebCore::Font::floatWidthForComplexText):
+        (WebCore::Font::offsetForPositionForComplexText):
+        * platform/graphics/chromium/GlyphPageTreeNodeChromiumWin.cpp:
+        (WebCore::fillNonBMPGlyphs):
+
 2009-01-15  David Levin  <levin@chromium.org>
 
         Reviewed by Darin Adler.
index 1cbe6554961d5be23e522ac702156ac3b605d5ae..3cf18a6e10d1ab1d8792e2ce9b601b3774d98ef4 100644 (file)
@@ -57,8 +57,7 @@ static bool windowsCanHandleTextDrawing(GraphicsContext* context)
     // which look weird. All else being equal, it's better to use Windows' text
     // drawing, so we don't check for zooms.
     const TransformationMatrix& matrix = context->getCTM();
-    if (matrix.b() != 0 ||  // Y skew
-        matrix.c() != 0)    // X skew
+    if (matrix.b() != 0 || matrix.c() != 0)  // Check for skew.
         return false;
 
     // Check for stroke effects.
@@ -263,12 +262,12 @@ FloatRect Font::selectionRectForComplexText(const TextRun& run,
                                             int to) const
 {
     UniscribeHelperTextRun state(run, *this);
-    float left = static_cast<float>(point.x() + state.CharacterToX(from));
-    float right = static_cast<float>(point.x() + state.CharacterToX(to));
+    float left = static_cast<float>(point.x() + state.characterToX(from));
+    float right = static_cast<float>(point.x() + state.characterToX(to));
 
     // If the text is RTL, left will actually be after right.
     if (left < right)
-      return FloatRect(left, static_cast<float>(point.y()),
+        return FloatRect(left, static_cast<float>(point.y()),
                        right - left, static_cast<float>(h));
 
     return FloatRect(right, static_cast<float>(point.y()),
@@ -300,14 +299,14 @@ void Font::drawComplexText(GraphicsContext* graphicsContext,
 
     // Uniscribe counts the coordinates from the upper left, while WebKit uses
     // the baseline, so we have to subtract off the ascent.
-    state.Draw(hdc, static_cast<int>(point.x()), static_cast<int>(point.y() - ascent()), from, to);
+    state.draw(hdc, static_cast<int>(point.x()), static_cast<int>(point.y() - ascent()), from, to);
     context->canvas()->endPlatformPaint();
 }
 
 float Font::floatWidthForComplexText(const TextRun& run) const
 {
     UniscribeHelperTextRun state(run, *this);
-    return static_cast<float>(state.Width());
+    return static_cast<float>(state.width());
 }
 
 int Font::offsetForPositionForComplexText(const TextRun& run, int x,
@@ -316,13 +315,13 @@ int Font::offsetForPositionForComplexText(const TextRun& run, int x,
     // Mac code ignores includePartialGlyphs, and they don't know what it's
     // supposed to do, so we just ignore it as well.
     UniscribeHelperTextRun state(run, *this);
-    int char_index = state.XToCharacter(x);
+    int charIndex = state.xToCharacter(x);
 
     // XToCharacter will return -1 if the position is before the first
     // character (we get called like this sometimes).
-    if (char_index < 0)
-      char_index = 0;
-    return char_index;
+    if (charIndex < 0)
+        charIndex = 0;
+    return charIndex;
 }
 
 } // namespace WebCore
index 123b1c54d81a35f1917be9227d510bdd5f3df2d5..4c5cf7b7f27056decce2053e50da5008faa7f379 100644 (file)
@@ -205,13 +205,13 @@ static bool fillNonBMPGlyphs(unsigned offset,
                                  fontData->m_font.scriptCache(),
                                  fontData->m_font.scriptFontProperties());
     state.setInhibitLigate(true);
-    state.Init();
+    state.init();
 
     for (unsigned i = 0; i < length; i++) {
         // Each character in this input buffer is a surrogate pair, which
         // consists of two UChars. So, the offset for its i-th character is
         // (i * 2).
-        WORD glyph = state.FirstGlyphForCharacter(i * 2);
+        WORD glyph = state.firstGlyphForCharacter(i * 2);
         if (glyph) {
             haveGlyphs = true;
             page->setGlyphDataForIndex(offset + i, glyph, fontData);