Changeset 176147 in webkit


Ignore:
Timestamp:
Nov 14, 2014 4:26:56 PM (9 years ago)
Author:
Alan Bujtas
Message:

Remove computeTextPaintStyle's RenderText dependency.
https://bugs.webkit.org/show_bug.cgi?id=138754

Reviewed by Simon Fraser.

So that we can compute text paint style across renderers in simple line layout.

No change in functionality.

  • rendering/InlineTextBox.cpp:

(WebCore::InlineTextBox::paint):

  • rendering/SimpleLineLayoutFunctions.cpp:

(WebCore::SimpleLineLayout::paintFlow):

  • rendering/TextPaintStyle.cpp:

(WebCore::computeTextPaintStyle):

  • rendering/TextPaintStyle.h:
Location:
trunk/Source/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r176146 r176147  
     12014-11-14  Zalan Bujtas  <zalan@apple.com>
     2
     3        Remove computeTextPaintStyle's RenderText dependency.
     4        https://bugs.webkit.org/show_bug.cgi?id=138754
     5
     6        Reviewed by Simon Fraser.
     7
     8        So that we can compute text paint style across renderers in simple line layout.
     9
     10        No change in functionality.
     11
     12        * rendering/InlineTextBox.cpp:
     13        (WebCore::InlineTextBox::paint):
     14        * rendering/SimpleLineLayoutFunctions.cpp:
     15        (WebCore::SimpleLineLayout::paintFlow):
     16        * rendering/TextPaintStyle.cpp:
     17        (WebCore::computeTextPaintStyle):
     18        * rendering/TextPaintStyle.h:
     19
    1202014-11-14  Myles C. Maxfield  <mmaxfield@apple.com>
    221
  • trunk/Source/WebCore/rendering/InlineTextBox.cpp

    r174876 r176147  
    531531
    532532    // Determine the text colors and selection colors.
    533     TextPaintStyle textPaintStyle = computeTextPaintStyle(renderer(), lineStyle, paintInfo);
     533    TextPaintStyle textPaintStyle = computeTextPaintStyle(renderer().frame(), lineStyle, paintInfo);
    534534
    535535    bool paintSelectedTextOnly;
  • trunk/Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp

    r174504 r176147  
    6868        return;
    6969
    70     RenderText& textRenderer = downcast<RenderText>(*flow.firstChild());
    71     ASSERT(!textRenderer.firstTextBox());
    72 
    7370    bool debugBordersEnabled = flow.frame().settings().simpleLineLayoutDebugBordersEnabled();
    7471
    7572    GraphicsContext& context = *paintInfo.context;
    76 
    7773    const Font& font = style.font();
    78     TextPaintStyle textPaintStyle = computeTextPaintStyle(textRenderer, style, paintInfo);
     74    TextPaintStyle textPaintStyle = computeTextPaintStyle(flow.frame(), style, paintInfo);
    7975    GraphicsContextStateSaver stateSaver(context, textPaintStyle.strokeWidth > 0);
    8076
  • trunk/Source/WebCore/rendering/TextPaintStyle.cpp

    r174283 r176147  
    7575}
    7676
    77 TextPaintStyle computeTextPaintStyle(const RenderText& renderer, const RenderStyle& lineStyle, const PaintInfo& paintInfo)
     77TextPaintStyle computeTextPaintStyle(const Frame& frame, const RenderStyle& lineStyle, const PaintInfo& paintInfo)
    7878{
    7979    TextPaintStyle paintStyle(lineStyle.colorSpace());
     
    9292
    9393    if (lineStyle.insideDefaultButton()) {
    94         Page* page = renderer.frame().page();
     94        Page* page = frame.page();
    9595        if (page && page->focusController().isActive()) {
    96             paintStyle.fillColor = renderer.theme().systemColor(CSSValueActivebuttontext);
     96            paintStyle.fillColor = page->theme().systemColor(CSSValueActivebuttontext);
    9797            return paintStyle;
    9898        }
     
    102102
    103103    bool forceBackgroundToWhite = false;
    104     if (renderer.document().printing()) {
     104    if (frame.document() && frame.document()->printing()) {
    105105        if (lineStyle.printColorAdjust() == PrintColorAdjustEconomy)
    106106            forceBackgroundToWhite = true;
    107         if (renderer.frame().settings().shouldPrintBackgrounds())
     107        if (frame.settings().shouldPrintBackgrounds())
    108108            forceBackgroundToWhite = false;
    109109    }
  • trunk/Source/WebCore/rendering/TextPaintStyle.h

    r158803 r176147  
    3232namespace WebCore {
    3333
     34class Frame;
    3435class GraphicsContext;
    3536class RenderText;
     
    5253};
    5354
    54 TextPaintStyle computeTextPaintStyle(const RenderText&, const RenderStyle&, const PaintInfo&);
     55TextPaintStyle computeTextPaintStyle(const Frame&, const RenderStyle&, const PaintInfo&);
    5556TextPaintStyle computeTextSelectionPaintStyle(const TextPaintStyle&, const RenderText&, const RenderStyle&, const PaintInfo&, bool& paintSelectedTextOnly, bool& paintSelectedTextSeparately, const ShadowData*& selectionShadow);
    5657
Note: See TracChangeset for help on using the changeset viewer.