Changeset 113059 in webkit


Ignore:
Timestamp:
Apr 3, 2012 10:42:45 AM (12 years ago)
Author:
jpu@apple.com
Message:

Rename GraphicsContext::drawLineForTextChecking() to GraphicsContext::drawLineForDocumentMarker()
https://bugs.webkit.org/show_bug.cgi?id=82946

Reviewed by Enrica Casucci.

On OS X, we draw similar underline on dictated text that has alternative text. We rename
this function, so that we can reuse it for dictation underline.

No new tests, since there's no change of functionality.

  • platform/graphics/GraphicsContext.h:
  • platform/graphics/cairo/GraphicsContextCairo.cpp:

(WebCore::GraphicsContext::drawLineForDocumentMarker):

  • platform/graphics/mac/GraphicsContextMac.mm:

(WebCore::GraphicsContext::drawLineForDocumentMarker):

  • platform/graphics/openvg/GraphicsContextOpenVG.cpp:

(WebCore::GraphicsContext::drawLineForDocumentMarker):

  • platform/graphics/qt/GraphicsContextQt.cpp:

(WebCore::GraphicsContext::drawLineForDocumentMarker):

  • platform/graphics/skia/GraphicsContextSkia.cpp:

(WebCore::GraphicsContext::drawLineForDocumentMarker):

  • platform/graphics/win/GraphicsContextCGWin.cpp:

(WebCore::GraphicsContext::drawLineForDocumentMarker):

  • platform/graphics/wince/GraphicsContextWinCE.cpp:

(WebCore::GraphicsContext::drawLineForDocumentMarker):

  • platform/graphics/wx/GraphicsContextWx.cpp:

(WebCore::GraphicsContext::drawLineForDocumentMarker):

  • rendering/InlineTextBox.cpp:

(WebCore::lineStyleForMarkerType):
(WebCore::InlineTextBox::paintSpellingOrGrammarMarker):

Location:
trunk/Source/WebCore
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r113056 r113059  
     12012-04-03  Jia Pu  <jpu@apple.com>
     2
     3        Rename GraphicsContext::drawLineForTextChecking() to GraphicsContext::drawLineForDocumentMarker()
     4        https://bugs.webkit.org/show_bug.cgi?id=82946
     5
     6        Reviewed by Enrica Casucci.
     7
     8        On OS X, we draw similar underline on dictated text that has alternative text. We rename
     9        this function, so that we can reuse it for dictation underline.
     10
     11        No new tests, since there's no change of functionality.
     12
     13        * platform/graphics/GraphicsContext.h:
     14        * platform/graphics/cairo/GraphicsContextCairo.cpp:
     15        (WebCore::GraphicsContext::drawLineForDocumentMarker):
     16        * platform/graphics/mac/GraphicsContextMac.mm:
     17        (WebCore::GraphicsContext::drawLineForDocumentMarker):
     18        * platform/graphics/openvg/GraphicsContextOpenVG.cpp:
     19        (WebCore::GraphicsContext::drawLineForDocumentMarker):
     20        * platform/graphics/qt/GraphicsContextQt.cpp:
     21        (WebCore::GraphicsContext::drawLineForDocumentMarker):
     22        * platform/graphics/skia/GraphicsContextSkia.cpp:
     23        (WebCore::GraphicsContext::drawLineForDocumentMarker):
     24        * platform/graphics/win/GraphicsContextCGWin.cpp:
     25        (WebCore::GraphicsContext::drawLineForDocumentMarker):
     26        * platform/graphics/wince/GraphicsContextWinCE.cpp:
     27        (WebCore::GraphicsContext::drawLineForDocumentMarker):
     28        * platform/graphics/wx/GraphicsContextWx.cpp:
     29        (WebCore::GraphicsContext::drawLineForDocumentMarker):
     30        * rendering/InlineTextBox.cpp:
     31        (WebCore::lineStyleForMarkerType):
     32        (WebCore::InlineTextBox::paintSpellingOrGrammarMarker):
     33
    1342012-04-03  Jer Noble  <jer.noble@apple.com>
    235
  • trunk/Source/WebCore/platform/graphics/GraphicsContext.h

    r112667 r113059  
    356356
    357357        void drawLineForText(const FloatPoint&, float width, bool printing);
    358         enum TextCheckingLineStyle {
    359             TextCheckingSpellingLineStyle,
    360             TextCheckingGrammarLineStyle,
    361             TextCheckingReplacementLineStyle
     358        enum DocumentMarkerLineStyle {
     359            DocumentMarkerSpellingLineStyle,
     360            DocumentMarkerGrammarLineStyle,
     361            DocumentMarkerAutocorrectionReplacementLineStyle,
     362            DocumentMarkerDictationAlternativesLineStyle
    362363        };
    363         void drawLineForTextChecking(const FloatPoint&, float width, TextCheckingLineStyle);
     364        void drawLineForDocumentMarker(const FloatPoint&, float width, DocumentMarkerLineStyle);
    364365
    365366        bool paintingDisabled() const;
  • trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp

    r106901 r113059  
    683683#endif
    684684
    685 void GraphicsContext::drawLineForTextChecking(const FloatPoint& origin, float width, TextCheckingLineStyle style)
     685void GraphicsContext::drawLineForDocumentMarker(const FloatPoint& origin, float width, DocumentMarkerLineStyle style)
    686686{
    687687    if (paintingDisabled())
     
    692692
    693693    switch (style) {
    694     case TextCheckingSpellingLineStyle:
     694    case DocumentMarkerSpellingLineStyle:
    695695        cairo_set_source_rgb(cr, 1, 0, 0);
    696696        break;
    697     case TextCheckingGrammarLineStyle:
     697    case DocumentMarkerGrammarLineStyle:
    698698        cairo_set_source_rgb(cr, 0, 1, 0);
    699699        break;
  • trunk/Source/WebCore/platform/graphics/mac/GraphicsContextMac.mm

    r97517 r113059  
    100100
    101101// WebKit on Mac is a standard platform component, so it must use the standard platform artwork for underline.
    102 void GraphicsContext::drawLineForTextChecking(const FloatPoint& point, float width, TextCheckingLineStyle style)
     102void GraphicsContext::drawLineForDocumentMarker(const FloatPoint& point, float width, DocumentMarkerLineStyle style)
    103103{
    104104    if (paintingDisabled())
     
    112112    NSColor *patternColor;
    113113    switch (style) {
    114         case TextCheckingSpellingLineStyle:
     114        case DocumentMarkerSpellingLineStyle:
    115115        {
    116116            // Constants for spelling pattern color.
     
    121121            break;
    122122        }
    123         case TextCheckingGrammarLineStyle:
     123        case DocumentMarkerGrammarLineStyle:
    124124        {
    125125            // Constants for grammar pattern color.
     
    132132#if PLATFORM(MAC) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
    133133        // To support correction panel.
    134         case TextCheckingReplacementLineStyle:
     134        case DocumentMarkerAutocorrectionReplacementLineStyle:
     135        case DocumentMarkerDictationAlternativesLineStyle:
    135136        {
    136137            // Constants for spelling pattern color.
  • trunk/Source/WebCore/platform/graphics/openvg/GraphicsContextOpenVG.cpp

    r95901 r113059  
    247247}
    248248
    249 void GraphicsContext::drawLineForTextChecking(const IntPoint& origin, int width, TextCheckingLineStyle style)
     249void GraphicsContext::drawLineForDocumentMarker(const IntPoint& origin, int width, DocumentMarkerLineStyle style)
    250250{
    251251    if (paintingDisabled())
  • trunk/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp

    r109347 r113059  
    976976
    977977
    978 void GraphicsContext::drawLineForTextChecking(const FloatPoint& origin, float width, TextCheckingLineStyle style)
     978void GraphicsContext::drawLineForDocumentMarker(const FloatPoint& origin, float width, DocumentMarkerLineStyle style)
    979979{
    980980    if (paintingDisabled())
     
    985985
    986986    switch (style) {
    987     case TextCheckingSpellingLineStyle:
     987    case DocumentMarkerSpellingLineStyle:
    988988        painter->setPen(Qt::red);
    989989        break;
    990     case TextCheckingGrammarLineStyle:
     990    case DocumentMarkerGrammarLineStyle:
    991991        painter->setPen(Qt::green);
    992992        break;
  • trunk/Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp

    r112980 r113059  
    508508}
    509509
    510 void GraphicsContext::drawLineForTextChecking(const FloatPoint& pt, float width, TextCheckingLineStyle style)
     510void GraphicsContext::drawLineForDocumentMarker(const FloatPoint& pt, float width, DocumentMarkerLineStyle style)
    511511{
    512512    if (paintingDisabled())
  • trunk/Source/WebCore/platform/graphics/win/GraphicsContextCGWin.cpp

    r94897 r113059  
    182182}
    183183
    184 void GraphicsContext::drawLineForTextChecking(const FloatPoint& point, float width, TextCheckingLineStyle style)
     184void GraphicsContext::drawLineForDocumentMarker(const FloatPoint& point, float width, DocumentMarkerLineStyle style)
    185185{
    186186    if (paintingDisabled())
    187187        return;
    188188
    189     if (style != TextCheckingSpellingLineStyle && style != TextCheckingGrammarLineStyle)
     189    if (style != DocumentMarkerSpellingLineStyle && style != DocumentMarkerGrammarLineStyle)
    190190        return;
    191191
     
    210210    CGContextSaveGState(context);
    211211
    212     const Color& patternColor = style == TextCheckingGrammarLineStyle ? grammarPatternColor() : spellingPatternColor();
     212    const Color& patternColor = style == DocumentMarkerGrammarLineStyle ? grammarPatternColor() : spellingPatternColor();
    213213    setCGStrokeColor(context, patternColor);
    214214
  • trunk/Source/WebCore/platform/graphics/wince/GraphicsContextWinCE.cpp

    r95685 r113059  
    10331033}
    10341034
    1035 void GraphicsContext::drawLineForTextChecking(const FloatPoint&, float width, TextCheckingLineStyle style)
     1035void GraphicsContext::drawLineForDocumentMarker(const FloatPoint&, float width, DocumentMarkerLineStyle style)
    10361036{
    10371037    notImplemented();
  • trunk/Source/WebCore/platform/graphics/wx/GraphicsContextWx.cpp

    r95685 r113059  
    443443}
    444444
    445 void GraphicsContext::drawLineForTextChecking(const FloatPoint& origin, float width, TextCheckingLineStyle style)
     445void GraphicsContext::drawLineForDocumentMarker(const FloatPoint& origin, float width, DocumentMarkerLineStyle style)
    446446{
    447447    switch (style) {
    448     case TextCheckingSpellingLineStyle:
     448    case DocumentMarkerSpellingLineStyle:
    449449        m_data->context->SetPen(wxPen(*wxRED, 2, wxLONG_DASH));
    450450        break;
    451     case TextCheckingGrammarLineStyle:
     451    case DocumentMarkerGrammarLineStyle:
    452452        m_data->context->SetPen(wxPen(*wxGREEN, 2, wxLONG_DASH));
    453453        break;
  • trunk/Source/WebCore/rendering/InlineTextBox.cpp

    r112512 r113059  
    984984}
    985985
    986 static GraphicsContext::TextCheckingLineStyle textCheckingLineStyleForMarkerType(DocumentMarker::MarkerType markerType)
     986static GraphicsContext::DocumentMarkerLineStyle lineStyleForMarkerType(DocumentMarker::MarkerType markerType)
    987987{
    988988    switch (markerType) {
    989989    case DocumentMarker::Spelling:
    990         return GraphicsContext::TextCheckingSpellingLineStyle;
     990        return GraphicsContext::DocumentMarkerSpellingLineStyle;
    991991    case DocumentMarker::Grammar:
    992         return GraphicsContext::TextCheckingGrammarLineStyle;
     992        return GraphicsContext::DocumentMarkerGrammarLineStyle;
    993993    case DocumentMarker::CorrectionIndicator:
    994         return GraphicsContext::TextCheckingReplacementLineStyle;
     994        return GraphicsContext::DocumentMarkerAutocorrectionReplacementLineStyle;
    995995    default:
    996996        ASSERT_NOT_REACHED();
    997         return GraphicsContext::TextCheckingSpellingLineStyle;
     997        return GraphicsContext::DocumentMarkerSpellingLineStyle;
    998998    }
    999999}
     
    10641064        underlineOffset = baseline + 2;
    10651065    }
    1066     pt->drawLineForTextChecking(FloatPoint(boxOrigin.x() + start, boxOrigin.y() + underlineOffset), width, textCheckingLineStyleForMarkerType(marker->type()));
     1066    pt->drawLineForDocumentMarker(FloatPoint(boxOrigin.x() + start, boxOrigin.y() + underlineOffset), width, lineStyleForMarkerType(marker->type()));
    10671067}
    10681068
Note: See TracChangeset for help on using the changeset viewer.