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

Side by Side Diff: third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp

Issue 1743803002: Rename enums/functions that collide in chromium style in core/style/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@get-names-8
Patch Set: get-names-9: rebase Created 4 years, 9 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/paint/InlineTextBoxPainter.h" 5 #include "core/paint/InlineTextBoxPainter.h"
6 6
7 #include "core/editing/CompositionUnderline.h" 7 #include "core/editing/CompositionUnderline.h"
8 #include "core/editing/Editor.h" 8 #include "core/editing/Editor.h"
9 #include "core/editing/markers/DocumentMarkerController.h" 9 #include "core/editing/markers/DocumentMarkerController.h"
10 #include "core/editing/markers/RenderedDocumentMarker.h" 10 #include "core/editing/markers/RenderedDocumentMarker.h"
(...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after
768 textDecorationThickness = std::max(1.f, styleToUse.computedFontSize() / 10.f); 768 textDecorationThickness = std::max(1.f, styleToUse.computedFontSize() / 10.f);
769 769
770 context.setStrokeThickness(textDecorationThickness); 770 context.setStrokeThickness(textDecorationThickness);
771 771
772 bool antialiasDecoration = shouldSetDecorationAntialias(overline.style, unde rline.style, linethrough.style); 772 bool antialiasDecoration = shouldSetDecorationAntialias(overline.style, unde rline.style, linethrough.style);
773 773
774 // Offset between lines - always non-zero, so lines never cross each other. 774 // Offset between lines - always non-zero, so lines never cross each other.
775 float doubleOffset = textDecorationThickness + 1.f; 775 float doubleOffset = textDecorationThickness + 1.f;
776 776
777 if (deco & TextDecorationUnderline) { 777 if (deco & TextDecorationUnderline) {
778 const int underlineOffset = computeUnderlineOffset(styleToUse.textUnderl inePosition(), styleToUse.fontMetrics(), &m_inlineTextBox, textDecorationThickne ss); 778 const int underlineOffset = computeUnderlineOffset(styleToUse.getTextUnd erlinePosition(), styleToUse.fontMetrics(), &m_inlineTextBox, textDecorationThic kness);
779 paintAppliedDecoration(context, FloatPoint(localOrigin) + FloatPoint(0, underlineOffset), width.toFloat(), doubleOffset, 1, underline, textDecorationThi ckness, antialiasDecoration, isPrinting); 779 paintAppliedDecoration(context, FloatPoint(localOrigin) + FloatPoint(0, underlineOffset), width.toFloat(), doubleOffset, 1, underline, textDecorationThi ckness, antialiasDecoration, isPrinting);
780 } 780 }
781 if (deco & TextDecorationOverline) { 781 if (deco & TextDecorationOverline) {
782 paintAppliedDecoration(context, FloatPoint(localOrigin), width.toFloat() , -doubleOffset, 1, overline, textDecorationThickness, antialiasDecoration, isPr inting); 782 paintAppliedDecoration(context, FloatPoint(localOrigin), width.toFloat() , -doubleOffset, 1, overline, textDecorationThickness, antialiasDecoration, isPr inting);
783 } 783 }
784 if (deco & TextDecorationLineThrough) { 784 if (deco & TextDecorationLineThrough) {
785 const float lineThroughOffset = 2 * baseline / 3; 785 const float lineThroughOffset = 2 * baseline / 3;
786 paintAppliedDecoration(context, FloatPoint(localOrigin) + FloatPoint(0, lineThroughOffset), width.toFloat(), doubleOffset, 0, linethrough, textDecoratio nThickness, antialiasDecoration, isPrinting); 786 paintAppliedDecoration(context, FloatPoint(localOrigin) + FloatPoint(0, lineThroughOffset), width.toFloat(), doubleOffset, 0, linethrough, textDecoratio nThickness, antialiasDecoration, isPrinting);
787 } 787 }
788 } 788 }
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
871 871
872 Color color = LayoutTheme::theme().platformTextSearchHighlightColor(marker-> activeMatch()); 872 Color color = LayoutTheme::theme().platformTextSearchHighlightColor(marker-> activeMatch());
873 GraphicsContext& context = paintInfo.context; 873 GraphicsContext& context = paintInfo.context;
874 GraphicsContextStateSaver stateSaver(context); 874 GraphicsContextStateSaver stateSaver(context);
875 context.clip(FloatRect(boxOrigin.x().toFloat(), (boxOrigin.y() - deltaY).toF loat(), m_inlineTextBox.logicalWidth().toFloat(), selHeight)); 875 context.clip(FloatRect(boxOrigin.x().toFloat(), (boxOrigin.y() - deltaY).toF loat(), m_inlineTextBox.logicalWidth().toFloat(), selHeight));
876 context.drawHighlightForText(font, run, FloatPoint(boxOrigin.x().toFloat(), (boxOrigin.y() - deltaY).toFloat()), selHeight, color, sPos, ePos); 876 context.drawHighlightForText(font, run, FloatPoint(boxOrigin.x().toFloat(), (boxOrigin.y() - deltaY).toFloat()), selHeight, color, sPos, ePos);
877 } 877 }
878 878
879 879
880 } // namespace blink 880 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/BoxPainter.cpp ('k') | third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698