Changeset 113059 in webkit
- Timestamp:
- Apr 3, 2012 10:42:45 AM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r113056 r113059 1 2012-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 1 34 2012-04-03 Jer Noble <jer.noble@apple.com> 2 35 -
trunk/Source/WebCore/platform/graphics/GraphicsContext.h
r112667 r113059 356 356 357 357 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 362 363 }; 363 void drawLineFor TextChecking(const FloatPoint&, float width, TextCheckingLineStyle);364 void drawLineForDocumentMarker(const FloatPoint&, float width, DocumentMarkerLineStyle); 364 365 365 366 bool paintingDisabled() const; -
trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
r106901 r113059 683 683 #endif 684 684 685 void GraphicsContext::drawLineFor TextChecking(const FloatPoint& origin, float width, TextCheckingLineStyle style)685 void GraphicsContext::drawLineForDocumentMarker(const FloatPoint& origin, float width, DocumentMarkerLineStyle style) 686 686 { 687 687 if (paintingDisabled()) … … 692 692 693 693 switch (style) { 694 case TextCheckingSpellingLineStyle:694 case DocumentMarkerSpellingLineStyle: 695 695 cairo_set_source_rgb(cr, 1, 0, 0); 696 696 break; 697 case TextCheckingGrammarLineStyle:697 case DocumentMarkerGrammarLineStyle: 698 698 cairo_set_source_rgb(cr, 0, 1, 0); 699 699 break; -
trunk/Source/WebCore/platform/graphics/mac/GraphicsContextMac.mm
r97517 r113059 100 100 101 101 // WebKit on Mac is a standard platform component, so it must use the standard platform artwork for underline. 102 void GraphicsContext::drawLineFor TextChecking(const FloatPoint& point, float width, TextCheckingLineStyle style)102 void GraphicsContext::drawLineForDocumentMarker(const FloatPoint& point, float width, DocumentMarkerLineStyle style) 103 103 { 104 104 if (paintingDisabled()) … … 112 112 NSColor *patternColor; 113 113 switch (style) { 114 case TextCheckingSpellingLineStyle:114 case DocumentMarkerSpellingLineStyle: 115 115 { 116 116 // Constants for spelling pattern color. … … 121 121 break; 122 122 } 123 case TextCheckingGrammarLineStyle:123 case DocumentMarkerGrammarLineStyle: 124 124 { 125 125 // Constants for grammar pattern color. … … 132 132 #if PLATFORM(MAC) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) 133 133 // To support correction panel. 134 case TextCheckingReplacementLineStyle: 134 case DocumentMarkerAutocorrectionReplacementLineStyle: 135 case DocumentMarkerDictationAlternativesLineStyle: 135 136 { 136 137 // Constants for spelling pattern color. -
trunk/Source/WebCore/platform/graphics/openvg/GraphicsContextOpenVG.cpp
r95901 r113059 247 247 } 248 248 249 void GraphicsContext::drawLineFor TextChecking(const IntPoint& origin, int width, TextCheckingLineStyle style)249 void GraphicsContext::drawLineForDocumentMarker(const IntPoint& origin, int width, DocumentMarkerLineStyle style) 250 250 { 251 251 if (paintingDisabled()) -
trunk/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
r109347 r113059 976 976 977 977 978 void GraphicsContext::drawLineFor TextChecking(const FloatPoint& origin, float width, TextCheckingLineStyle style)978 void GraphicsContext::drawLineForDocumentMarker(const FloatPoint& origin, float width, DocumentMarkerLineStyle style) 979 979 { 980 980 if (paintingDisabled()) … … 985 985 986 986 switch (style) { 987 case TextCheckingSpellingLineStyle:987 case DocumentMarkerSpellingLineStyle: 988 988 painter->setPen(Qt::red); 989 989 break; 990 case TextCheckingGrammarLineStyle:990 case DocumentMarkerGrammarLineStyle: 991 991 painter->setPen(Qt::green); 992 992 break; -
trunk/Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp
r112980 r113059 508 508 } 509 509 510 void GraphicsContext::drawLineFor TextChecking(const FloatPoint& pt, float width, TextCheckingLineStyle style)510 void GraphicsContext::drawLineForDocumentMarker(const FloatPoint& pt, float width, DocumentMarkerLineStyle style) 511 511 { 512 512 if (paintingDisabled()) -
trunk/Source/WebCore/platform/graphics/win/GraphicsContextCGWin.cpp
r94897 r113059 182 182 } 183 183 184 void GraphicsContext::drawLineFor TextChecking(const FloatPoint& point, float width, TextCheckingLineStyle style)184 void GraphicsContext::drawLineForDocumentMarker(const FloatPoint& point, float width, DocumentMarkerLineStyle style) 185 185 { 186 186 if (paintingDisabled()) 187 187 return; 188 188 189 if (style != TextCheckingSpellingLineStyle && style != TextCheckingGrammarLineStyle)189 if (style != DocumentMarkerSpellingLineStyle && style != DocumentMarkerGrammarLineStyle) 190 190 return; 191 191 … … 210 210 CGContextSaveGState(context); 211 211 212 const Color& patternColor = style == TextCheckingGrammarLineStyle ? grammarPatternColor() : spellingPatternColor();212 const Color& patternColor = style == DocumentMarkerGrammarLineStyle ? grammarPatternColor() : spellingPatternColor(); 213 213 setCGStrokeColor(context, patternColor); 214 214 -
trunk/Source/WebCore/platform/graphics/wince/GraphicsContextWinCE.cpp
r95685 r113059 1033 1033 } 1034 1034 1035 void GraphicsContext::drawLineFor TextChecking(const FloatPoint&, float width, TextCheckingLineStyle style)1035 void GraphicsContext::drawLineForDocumentMarker(const FloatPoint&, float width, DocumentMarkerLineStyle style) 1036 1036 { 1037 1037 notImplemented(); -
trunk/Source/WebCore/platform/graphics/wx/GraphicsContextWx.cpp
r95685 r113059 443 443 } 444 444 445 void GraphicsContext::drawLineFor TextChecking(const FloatPoint& origin, float width, TextCheckingLineStyle style)445 void GraphicsContext::drawLineForDocumentMarker(const FloatPoint& origin, float width, DocumentMarkerLineStyle style) 446 446 { 447 447 switch (style) { 448 case TextCheckingSpellingLineStyle:448 case DocumentMarkerSpellingLineStyle: 449 449 m_data->context->SetPen(wxPen(*wxRED, 2, wxLONG_DASH)); 450 450 break; 451 case TextCheckingGrammarLineStyle:451 case DocumentMarkerGrammarLineStyle: 452 452 m_data->context->SetPen(wxPen(*wxGREEN, 2, wxLONG_DASH)); 453 453 break; -
trunk/Source/WebCore/rendering/InlineTextBox.cpp
r112512 r113059 984 984 } 985 985 986 static GraphicsContext:: TextCheckingLineStyle textCheckingLineStyleForMarkerType(DocumentMarker::MarkerType markerType)986 static GraphicsContext::DocumentMarkerLineStyle lineStyleForMarkerType(DocumentMarker::MarkerType markerType) 987 987 { 988 988 switch (markerType) { 989 989 case DocumentMarker::Spelling: 990 return GraphicsContext:: TextCheckingSpellingLineStyle;990 return GraphicsContext::DocumentMarkerSpellingLineStyle; 991 991 case DocumentMarker::Grammar: 992 return GraphicsContext:: TextCheckingGrammarLineStyle;992 return GraphicsContext::DocumentMarkerGrammarLineStyle; 993 993 case DocumentMarker::CorrectionIndicator: 994 return GraphicsContext:: TextCheckingReplacementLineStyle;994 return GraphicsContext::DocumentMarkerAutocorrectionReplacementLineStyle; 995 995 default: 996 996 ASSERT_NOT_REACHED(); 997 return GraphicsContext:: TextCheckingSpellingLineStyle;997 return GraphicsContext::DocumentMarkerSpellingLineStyle; 998 998 } 999 999 } … … 1064 1064 underlineOffset = baseline + 2; 1065 1065 } 1066 pt->drawLineFor TextChecking(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())); 1067 1067 } 1068 1068
Note: See TracChangeset
for help on using the changeset viewer.