Skip to content
Permalink
Browse files
Move decoration context setup calls to InlineTextBox::paintDecoration.
https://bugs.webkit.org/show_bug.cgi?id=152622

Reviewed by Simon Fraser.

No change in functionality.

* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paint):
(WebCore::InlineTextBox::paintDecoration):
* rendering/InlineTextBox.h:

Canonical link: https://commits.webkit.org/170705@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@194467 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
alanbujtas committed Dec 31, 2015
1 parent c0d64f4 commit ed48d3b563a38c2525354df69bf2282f7cc4daec
Showing with 29 additions and 12 deletions.
  1. +14 −0 Source/WebCore/ChangeLog
  2. +11 −11 Source/WebCore/rendering/InlineTextBox.cpp
  3. +4 −1 Source/WebCore/rendering/InlineTextBox.h
@@ -1,3 +1,17 @@
2015-12-31 Zalan Bujtas <zalan@apple.com>

Move decoration context setup calls to InlineTextBox::paintDecoration.
https://bugs.webkit.org/show_bug.cgi?id=152622

Reviewed by Simon Fraser.

No change in functionality.

* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paint):
(WebCore::InlineTextBox::paintDecoration):
* rendering/InlineTextBox.h:

2015-12-31 Simon Fraser <simon.fraser@apple.com>

More scrollOffset/scrollPosition disambiguation, in RenderLayer
@@ -560,14 +560,8 @@ void InlineTextBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset,

// Paint decorations
TextDecoration textDecorations = lineStyle.textDecorationsInEffect();
if (textDecorations != TextDecorationNone && paintInfo.phase != PaintPhaseSelection) {
updateGraphicsContext(context, textPaintStyle);
if (combinedText)
context.concatCTM(rotation(boxRect, Clockwise));
paintDecoration(context, font, textRun, textOrigin, boxOrigin, textDecorations, textShadow);
if (combinedText)
context.concatCTM(rotation(boxRect, Counterclockwise));
}
if (textDecorations != TextDecorationNone && paintInfo.phase != PaintPhaseSelection)
paintDecoration(context, font, combinedText, textRun, textOrigin, boxRect, textDecorations, textPaintStyle, textShadow);

if (paintInfo.phase == PaintPhaseForeground) {
paintDocumentMarkers(context, boxOrigin, lineStyle, font, false);
@@ -699,13 +693,16 @@ void InlineTextBox::paintCompositionBackground(GraphicsContext& context, const F
context.fillRect(snapRectToDevicePixelsWithWritingDirection(selectionRect, renderer().document().deviceScaleFactor(), textRun.ltr()), compositionColor);
}

void InlineTextBox::paintDecoration(GraphicsContext& context, const FontCascade& font, const TextRun& textRun, const FloatPoint& textOrigin, const FloatPoint& boxOrigin,
TextDecoration decoration, const ShadowData* shadow)
void InlineTextBox::paintDecoration(GraphicsContext& context, const FontCascade& font, RenderCombineText* combinedText, const TextRun& textRun, const FloatPoint& textOrigin,
const FloatRect& boxRect, TextDecoration decoration, TextPaintStyle textPaintStyle, const ShadowData* shadow)
{
if (m_truncation == cFullTruncation)
return;

FloatPoint localOrigin = boxOrigin;
FloatPoint localOrigin = boxRect.location();
updateGraphicsContext(context, textPaintStyle);
if (combinedText)
context.concatCTM(rotation(boxRect, Clockwise));

float width = m_logicalWidth;
if (m_truncation != cNoTruncation) {
@@ -724,6 +721,9 @@ void InlineTextBox::paintDecoration(GraphicsContext& context, const FontCascade&
decorationPainter.addTextShadow(shadow);

decorationPainter.paintTextDecoration(textRun, textOrigin, localOrigin);

if (combinedText)
context.concatCTM(rotation(boxRect, Counterclockwise));
}

static GraphicsContext::DocumentMarkerLineStyle lineStyleForMarkerType(DocumentMarker::MarkerType markerType)
@@ -30,8 +30,10 @@
namespace WebCore {

struct CompositionUnderline;
class RenderCombineText;
class RenderedDocumentMarker;
class TextPainter;
struct TextPaintStyle;

const unsigned short cNoTruncation = USHRT_MAX;
const unsigned short cFullTruncation = USHRT_MAX - 1;
@@ -159,7 +161,8 @@ class InlineTextBox : public InlineBox {
void paintCompositionUnderline(GraphicsContext&, const FloatPoint& boxOrigin, const CompositionUnderline&);

private:
void paintDecoration(GraphicsContext&, const FontCascade&, const TextRun&, const FloatPoint& textOrigin, const FloatPoint& boxOrigin, TextDecoration, const ShadowData*);
void paintDecoration(GraphicsContext&, const FontCascade&, RenderCombineText*, const TextRun&, const FloatPoint& textOrigin, const FloatRect& boxRect,
TextDecoration, TextPaintStyle, const ShadowData*);
void paintSelection(GraphicsContext&, const FloatPoint& boxOrigin, const RenderStyle&, const FontCascade&, Color textColor);
void paintDocumentMarker(GraphicsContext&, const FloatPoint& boxOrigin, RenderedDocumentMarker&, const RenderStyle&, const FontCascade&, bool grammar);
void paintTextMatchMarker(GraphicsContext&, const FloatPoint& boxOrigin, RenderedDocumentMarker&, const RenderStyle&, const FontCascade&);

0 comments on commit ed48d3b

Please sign in to comment.