Bug 151979 - Make paintTextWithShadows a member function (TextPainter).
Summary: Make paintTextWithShadows a member function (TextPainter).
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: zalan
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-07 18:48 PST by zalan
Modified: 2015-12-07 20:34 PST (History)
6 users (show)

See Also:


Attachments
Patch (9.57 KB, patch)
2015-12-07 18:55 PST, zalan
no flags Details | Formatted Diff | Diff
Patch (9.57 KB, patch)
2015-12-07 19:00 PST, zalan
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description zalan 2015-12-07 18:48:35 PST
SSIA.
Comment 1 zalan 2015-12-07 18:55:56 PST
Created attachment 266840 [details]
Patch

Simplified version:

void TextPainter::paintTextWithShadows(const ShadowData* shadow, const FontCascade& font, const TextRun& textRun, const AtomicString& emphasisMark,
    int emphasisMarkOffset, int startOffset, int endOffset, const FloatPoint& textOrigin, bool stroked)
{
    if (!shadow) {
        drawTextOrEmphasisMarks(font, textRun, emphasisMark, emphasisMarkOffset, textOrigin, startOffset, endOffset);
        return;
    }

    Color fillColor = m_context.fillColor();
    bool opaque = !fillColor.hasAlpha();
    bool lastShadowIterationShouldDrawText = !stroked && opaque;
    if (!opaque)
        m_context.setFillColor(Color::black);
    while (shadow) {
        ShadowApplier shadowApplier(m_context, shadow, m_boxRect, lastShadowIterationShouldDrawText, opaque, m_textBoxIsHorizontal ? Horizontal : Vertical);
        if (!shadowApplier.nothingToDraw())
            drawTextOrEmphasisMarks(font, textRun, emphasisMark, emphasisMarkOffset, textOrigin + shadowApplier.extraOffset(), startOffset, endOffset);
        shadow = shadow->next();
    }

    if (!lastShadowIterationShouldDrawText) {
        if (!opaque)
            m_context.setFillColor(fillColor);
        drawTextOrEmphasisMarks(font, textRun, emphasisMark, emphasisMarkOffset, textOrigin, startOffset, endOffset);
    }
}
Comment 2 WebKit Commit Bot 2015-12-07 18:57:30 PST
Attachment 266840 [details] did not pass style-queue:


ERROR: Source/WebCore/rendering/TextPainter.cpp:110:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
ERROR: Source/WebCore/rendering/TextPainter.cpp:197:  Extra space after ( in function call  [whitespace/parens] [4]
Total errors found: 2 in 3 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 zalan 2015-12-07 19:00:36 PST
Created attachment 266841 [details]
Patch
Comment 4 WebKit Commit Bot 2015-12-07 20:34:46 PST
Comment on attachment 266841 [details]
Patch

Clearing flags on attachment: 266841

Committed r193688: <http://trac.webkit.org/changeset/193688>
Comment 5 WebKit Commit Bot 2015-12-07 20:34:50 PST
All reviewed patches have been landed.  Closing bug.