Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Side by Side Diff: Source/core/rendering/InlineTextBox.cpp

Issue 564973002: Move a bunch more painting code out of RenderBoxModelObject and into BoxPainter. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Merged, made more things static. Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * (C) 1999 Lars Knoll (knoll@kde.org) 2 * (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 2000 Dirk Mueller (mueller@kde.org) 3 * (C) 2000 Dirk Mueller (mueller@kde.org)
4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 14 matching lines...) Expand all
25 25
26 #include "core/dom/Document.h" 26 #include "core/dom/Document.h"
27 #include "core/dom/DocumentMarkerController.h" 27 #include "core/dom/DocumentMarkerController.h"
28 #include "core/dom/RenderedDocumentMarker.h" 28 #include "core/dom/RenderedDocumentMarker.h"
29 #include "core/dom/Text.h" 29 #include "core/dom/Text.h"
30 #include "core/editing/CompositionUnderline.h" 30 #include "core/editing/CompositionUnderline.h"
31 #include "core/editing/CompositionUnderlineRangeFilter.h" 31 #include "core/editing/CompositionUnderlineRangeFilter.h"
32 #include "core/editing/Editor.h" 32 #include "core/editing/Editor.h"
33 #include "core/editing/InputMethodController.h" 33 #include "core/editing/InputMethodController.h"
34 #include "core/frame/LocalFrame.h" 34 #include "core/frame/LocalFrame.h"
35 #include "core/frame/Settings.h"
35 #include "core/page/Page.h" 36 #include "core/page/Page.h"
36 #include "core/frame/Settings.h" 37 #include "core/paint/BoxPainter.h"
37 #include "core/rendering/AbstractInlineTextBox.h" 38 #include "core/rendering/AbstractInlineTextBox.h"
38 #include "core/rendering/EllipsisBox.h" 39 #include "core/rendering/EllipsisBox.h"
39 #include "core/rendering/HitTestResult.h" 40 #include "core/rendering/HitTestResult.h"
40 #include "core/rendering/PaintInfo.h" 41 #include "core/rendering/PaintInfo.h"
41 #include "core/rendering/RenderBR.h" 42 #include "core/rendering/RenderBR.h"
42 #include "core/rendering/RenderBlock.h" 43 #include "core/rendering/RenderBlock.h"
43 #include "core/rendering/RenderCombineText.h" 44 #include "core/rendering/RenderCombineText.h"
44 #include "core/rendering/RenderRubyRun.h" 45 #include "core/rendering/RenderRubyRun.h"
45 #include "core/rendering/RenderRubyText.h" 46 #include "core/rendering/RenderRubyText.h"
46 #include "core/rendering/RenderTheme.h" 47 #include "core/rendering/RenderTheme.h"
(...skipping 914 matching lines...) Expand 10 before | Expand all | Expand 10 after
961 962
962 // Update Underline thickness, in case we have Faulty Font Metrics calculati ng underline thickness by old method. 963 // Update Underline thickness, in case we have Faulty Font Metrics calculati ng underline thickness by old method.
963 float textDecorationThickness = styleToUse->fontMetrics().underlineThickness (); 964 float textDecorationThickness = styleToUse->fontMetrics().underlineThickness ();
964 int fontHeightInt = (int)(styleToUse->fontMetrics().floatHeight() + 0.5); 965 int fontHeightInt = (int)(styleToUse->fontMetrics().floatHeight() + 0.5);
965 if ((textDecorationThickness == 0.f) || (textDecorationThickness >= (fontHei ghtInt >> 1))) 966 if ((textDecorationThickness == 0.f) || (textDecorationThickness >= (fontHei ghtInt >> 1)))
966 textDecorationThickness = std::max(1.f, styleToUse->computedFontSize() / 10.f); 967 textDecorationThickness = std::max(1.f, styleToUse->computedFontSize() / 10.f);
967 968
968 context->setStrokeThickness(textDecorationThickness); 969 context->setStrokeThickness(textDecorationThickness);
969 970
970 bool antialiasDecoration = shouldSetDecorationAntialias(overline.style, unde rline.style, linethrough.style) 971 bool antialiasDecoration = shouldSetDecorationAntialias(overline.style, unde rline.style, linethrough.style)
971 && RenderBoxModelObject::shouldAntialiasLines(context); 972 && BoxPainter::shouldAntialiasLines(context);
972 973
973 // Offset between lines - always non-zero, so lines never cross each other. 974 // Offset between lines - always non-zero, so lines never cross each other.
974 float doubleOffset = textDecorationThickness + 1.f; 975 float doubleOffset = textDecorationThickness + 1.f;
975 976
976 if (deco & TextDecorationUnderline) { 977 if (deco & TextDecorationUnderline) {
977 const int underlineOffset = computeUnderlineOffset(styleToUse->textUnder linePosition(), styleToUse->fontMetrics(), this, textDecorationThickness); 978 const int underlineOffset = computeUnderlineOffset(styleToUse->textUnder linePosition(), styleToUse->fontMetrics(), this, textDecorationThickness);
978 paintAppliedDecoration(context, localOrigin + FloatPoint(0, underlineOff set), width, doubleOffset, 1, underline, textDecorationThickness, antialiasDecor ation, isPrinting); 979 paintAppliedDecoration(context, localOrigin + FloatPoint(0, underlineOff set), width, doubleOffset, 1, underline, textDecorationThickness, antialiasDecor ation, isPrinting);
979 } 980 }
980 if (deco & TextDecorationOverline) { 981 if (deco & TextDecorationOverline) {
981 paintAppliedDecoration(context, localOrigin, width, -doubleOffset, 1, ov erline, textDecorationThickness, antialiasDecoration, isPrinting); 982 paintAppliedDecoration(context, localOrigin, width, -doubleOffset, 1, ov erline, textDecorationThickness, antialiasDecoration, isPrinting);
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after
1369 printedCharacters = fprintf(stderr, "\t%s %p", obj.renderName(), &obj); 1370 printedCharacters = fprintf(stderr, "\t%s %p", obj.renderName(), &obj);
1370 const int rendererCharacterOffset = 24; 1371 const int rendererCharacterOffset = 24;
1371 for (; printedCharacters < rendererCharacterOffset; printedCharacters++) 1372 for (; printedCharacters < rendererCharacterOffset; printedCharacters++)
1372 fputc(' ', stderr); 1373 fputc(' ', stderr);
1373 fprintf(stderr, "(%d,%d) \"%s\"\n", start(), start() + len(), value.utf8().d ata()); 1374 fprintf(stderr, "(%d,%d) \"%s\"\n", start(), start() + len(), value.utf8().d ata());
1374 } 1375 }
1375 1376
1376 #endif 1377 #endif
1377 1378
1378 } // namespace blink 1379 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698