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

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

Issue 881133003: Revert of text-combine should scale rather than fall back to none when wide (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 10 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 "config.h" 5 #include "config.h"
6 #include "core/paint/InlineTextBoxPainter.h" 6 #include "core/paint/InlineTextBoxPainter.h"
7 7
8 #include "core/dom/DocumentMarkerController.h" 8 #include "core/dom/DocumentMarkerController.h"
9 #include "core/dom/RenderedDocumentMarker.h" 9 #include "core/dom/RenderedDocumentMarker.h"
10 #include "core/editing/CompositionUnderline.h" 10 #include "core/editing/CompositionUnderline.h"
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 100
101 GraphicsContext* context = paintInfo.context; 101 GraphicsContext* context = paintInfo.context;
102 RenderStyle* styleToUse = m_inlineTextBox.renderer().style(m_inlineTextBox.i sFirstLineStyle()); 102 RenderStyle* styleToUse = m_inlineTextBox.renderer().style(m_inlineTextBox.i sFirstLineStyle());
103 103
104 adjustedPaintOffset.move(0, styleToUse->isHorizontalWritingMode() ? LayoutUn it() : -m_inlineTextBox.logicalHeight().toLayoutUnit()); 104 adjustedPaintOffset.move(0, styleToUse->isHorizontalWritingMode() ? LayoutUn it() : -m_inlineTextBox.logicalHeight().toLayoutUnit());
105 105
106 FloatPoint boxOrigin = m_inlineTextBox.locationIncludingFlipping(); 106 FloatPoint boxOrigin = m_inlineTextBox.locationIncludingFlipping();
107 boxOrigin.move(adjustedPaintOffset.x().toFloat(), adjustedPaintOffset.y().to Float()); 107 boxOrigin.move(adjustedPaintOffset.x().toFloat(), adjustedPaintOffset.y().to Float());
108 FloatRect boxRect(boxOrigin, FloatSize(m_inlineTextBox.logicalWidth(), m_inl ineTextBox.logicalHeight())); 108 FloatRect boxRect(boxOrigin, FloatSize(m_inlineTextBox.logicalWidth(), m_inl ineTextBox.logicalHeight()));
109 109
110 bool shouldRotate = false; 110 RenderCombineText* combinedText = styleToUse->hasTextCombine() && m_inlineTe xtBox.renderer().isCombineText() && toRenderCombineText(m_inlineTextBox.renderer ()).isCombined() ? &toRenderCombineText(m_inlineTextBox.renderer()) : 0;
111 RenderCombineText* combinedText = nullptr; 111
112 if (!m_inlineTextBox.isHorizontal()) { 112 bool shouldRotate = !m_inlineTextBox.isHorizontal() && !combinedText;
113 if (styleToUse->hasTextCombine() && m_inlineTextBox.renderer().isCombine Text()) { 113 if (shouldRotate)
114 combinedText = &toRenderCombineText(m_inlineTextBox.renderer()); 114 context->concatCTM(TextPainter::rotation(boxRect, TextPainter::Clockwise ));
115 if (!combinedText->isCombined())
116 combinedText = nullptr;
117 }
118 if (combinedText) {
119 combinedText->updateFont();
120 } else {
121 shouldRotate = true;
122 context->concatCTM(TextPainter::rotation(boxRect, TextPainter::Clock wise));
123 }
124 }
125 115
126 // Determine whether or not we have composition underlines to draw. 116 // Determine whether or not we have composition underlines to draw.
127 bool containsComposition = m_inlineTextBox.renderer().node() && m_inlineText Box.renderer().frame()->inputMethodController().compositionNode() == m_inlineTex tBox.renderer().node(); 117 bool containsComposition = m_inlineTextBox.renderer().node() && m_inlineText Box.renderer().frame()->inputMethodController().compositionNode() == m_inlineTex tBox.renderer().node();
128 bool useCustomUnderlines = containsComposition && m_inlineTextBox.renderer() .frame()->inputMethodController().compositionUsesCustomUnderlines(); 118 bool useCustomUnderlines = containsComposition && m_inlineTextBox.renderer() .frame()->inputMethodController().compositionUsesCustomUnderlines();
129 119
130 // Determine text colors. 120 // Determine text colors.
131 TextPainter::Style textStyle = TextPainter::textPaintingStyle(m_inlineTextBo x.renderer(), styleToUse, paintInfo.forceBlackText(), isPrinting); 121 TextPainter::Style textStyle = TextPainter::textPaintingStyle(m_inlineTextBo x.renderer(), styleToUse, paintInfo.forceBlackText(), isPrinting);
132 TextPainter::Style selectionStyle = TextPainter::selectionPaintingStyle(m_in lineTextBox.renderer(), haveSelection, paintInfo.forceBlackText(), isPrinting, t extStyle); 122 TextPainter::Style selectionStyle = TextPainter::selectionPaintingStyle(m_in lineTextBox.renderer(), haveSelection, paintInfo.forceBlackText(), isPrinting, t extStyle);
133 bool paintSelectedTextOnly = (paintInfo.phase == PaintPhaseSelection); 123 bool paintSelectedTextOnly = (paintInfo.phase == PaintPhaseSelection);
134 bool paintSelectedTextSeparately = !paintSelectedTextOnly && textStyle != se lectionStyle; 124 bool paintSelectedTextSeparately = !paintSelectedTextOnly && textStyle != se lectionStyle;
(...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after
806 RenderTheme::theme().platformActiveTextSearchHighlightColor() : 796 RenderTheme::theme().platformActiveTextSearchHighlightColor() :
807 RenderTheme::theme().platformInactiveTextSearchHighlightColor(); 797 RenderTheme::theme().platformInactiveTextSearchHighlightColor();
808 GraphicsContextStateSaver stateSaver(*pt); 798 GraphicsContextStateSaver stateSaver(*pt);
809 pt->clip(FloatRect(boxOrigin.x(), boxOrigin.y() - deltaY, m_inlineTextBo x.logicalWidth(), selHeight)); 799 pt->clip(FloatRect(boxOrigin.x(), boxOrigin.y() - deltaY, m_inlineTextBo x.logicalWidth(), selHeight));
810 pt->drawHighlightForText(font, run, FloatPoint(boxOrigin.x(), boxOrigin. y() - deltaY), selHeight, color, sPos, ePos); 800 pt->drawHighlightForText(font, run, FloatPoint(boxOrigin.x(), boxOrigin. y() - deltaY), selHeight, color, sPos, ePos);
811 } 801 }
812 } 802 }
813 803
814 804
815 } // namespace blink 805 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/virtual/antialiasedtext/fast/text/font-variant-width-expected.txt ('k') | Source/core/paint/TextPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698