Title: [193779] trunk/Source/WebCore
Revision
193779
Author
za...@apple.com
Date
2015-12-08 13:35:21 -0800 (Tue, 08 Dec 2015)

Log Message

Light cleanup in TextPainter.
https://bugs.webkit.org/show_bug.cgi?id=151994

Reviewed by Darin Adler.

No change in functionality.

* rendering/TextPainter.cpp:
(WebCore::TextPainter::TextPainter):
* rendering/TextPainter.h: Address post review comment.
(WebCore::ShadowApplier::isLastShadowIteration):
(WebCore::ShadowApplier::shadowIsCompletelyCoveredByText):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (193778 => 193779)


--- trunk/Source/WebCore/ChangeLog	2015-12-08 21:07:46 UTC (rev 193778)
+++ trunk/Source/WebCore/ChangeLog	2015-12-08 21:35:21 UTC (rev 193779)
@@ -1,5 +1,20 @@
 2015-12-08  Zalan Bujtas  <za...@apple.com>
 
+        Light cleanup in TextPainter.
+        https://bugs.webkit.org/show_bug.cgi?id=151994
+
+        Reviewed by Darin Adler.
+
+        No change in functionality.
+
+        * rendering/TextPainter.cpp:
+        (WebCore::TextPainter::TextPainter):
+        * rendering/TextPainter.h: Address post review comment.
+        (WebCore::ShadowApplier::isLastShadowIteration):
+        (WebCore::ShadowApplier::shadowIsCompletelyCoveredByText):
+
+2015-12-08  Zalan Bujtas  <za...@apple.com>
+
         Do not insert positioned renderers to multiple gPositionedDescendantsMap.
         https://bugs.webkit.org/show_bug.cgi?id=151878
         rdar://problem/22229889

Modified: trunk/Source/WebCore/rendering/TextPainter.cpp (193778 => 193779)


--- trunk/Source/WebCore/rendering/TextPainter.cpp	2015-12-08 21:07:46 UTC (rev 193778)
+++ trunk/Source/WebCore/rendering/TextPainter.cpp	2015-12-08 21:35:21 UTC (rev 193779)
@@ -31,31 +31,6 @@
 
 namespace WebCore {
 
-TextPainter::TextPainter(GraphicsContext& context, bool paintSelectedTextOnly, bool paintSelectedTextSeparately, const FontCascade& font,
-    int startPositionInTextRun, int endPositionInTextBoxString, int length, const AtomicString& emphasisMark, RenderCombineText* combinedText, TextRun& textRun,
-    FloatRect& boxRect, FloatPoint& textOrigin, int emphasisMarkOffset, const ShadowData* textShadow, const ShadowData* selectionShadow,
-    bool textBoxIsHorizontal, TextPaintStyle& textPaintStyle, TextPaintStyle& selectionPaintStyle)
-        : m_context(context)
-        , m_textPaintStyle(textPaintStyle)
-        , m_selectionPaintStyle(selectionPaintStyle)
-        , m_textShadow(textShadow)
-        , m_selectionShadow(selectionShadow)
-        , m_paintSelectedTextOnly(paintSelectedTextOnly)
-        , m_paintSelectedTextSeparately(paintSelectedTextSeparately)
-        , m_font(font)
-        , m_startPositionInTextRun(startPositionInTextRun)
-        , m_endPositionInTextRun(endPositionInTextBoxString)
-        , m_length(length)
-        , m_emphasisMark(emphasisMark)
-        , m_combinedText(combinedText)
-        , m_textRun(textRun)
-        , m_boxRect(boxRect)
-        , m_textOrigin(textOrigin)
-        , m_emphasisMarkOffset(emphasisMarkOffset)
-        , m_textBoxIsHorizontal(textBoxIsHorizontal)
-{
-}
-
 ShadowApplier::ShadowApplier(GraphicsContext& context, const ShadowData* shadow, const FloatRect& textRect, bool lastShadowIterationShouldDrawText, bool opaque, FontOrientation orientation)
     : m_context(context)
     , m_shadow(shadow)
@@ -104,6 +79,31 @@
         m_context.clearShadow();
 }
 
+TextPainter::TextPainter(GraphicsContext& context, bool paintSelectedTextOnly, bool paintSelectedTextSeparately, const FontCascade& font, int startPositionInTextRun,
+    int endPositionInTextBoxString, int length, const AtomicString& emphasisMark, RenderCombineText* combinedText, TextRun& textRun, FloatRect& boxRect,
+    FloatPoint& textOrigin, int emphasisMarkOffset, const ShadowData* textShadow, const ShadowData* selectionShadow, bool textBoxIsHorizontal,
+    TextPaintStyle& textPaintStyle, TextPaintStyle& selectionPaintStyle)
+    : m_context(context)
+    , m_textPaintStyle(textPaintStyle)
+    , m_selectionPaintStyle(selectionPaintStyle)
+    , m_textShadow(textShadow)
+    , m_selectionShadow(selectionShadow)
+    , m_paintSelectedTextOnly(paintSelectedTextOnly)
+    , m_paintSelectedTextSeparately(paintSelectedTextSeparately)
+    , m_font(font)
+    , m_startPositionInTextRun(startPositionInTextRun)
+    , m_endPositionInTextRun(endPositionInTextBoxString)
+    , m_length(length)
+    , m_emphasisMark(emphasisMark)
+    , m_combinedText(combinedText)
+    , m_textRun(textRun)
+    , m_boxRect(boxRect)
+    , m_textOrigin(textOrigin)
+    , m_emphasisMarkOffset(emphasisMarkOffset)
+    , m_textBoxIsHorizontal(textBoxIsHorizontal)
+{
+}
+
 void TextPainter::drawTextOrEmphasisMarks(const FontCascade& font, const TextRun& textRun, const AtomicString& emphasisMark,
     int emphasisMarkOffset, const FloatPoint& textOrigin, int startOffset, int endOffset)
 {

Modified: trunk/Source/WebCore/rendering/TextPainter.h (193778 => 193779)


--- trunk/Source/WebCore/rendering/TextPainter.h	2015-12-08 21:07:46 UTC (rev 193778)
+++ trunk/Source/WebCore/rendering/TextPainter.h	2015-12-08 21:35:21 UTC (rev 193779)
@@ -50,8 +50,9 @@
     bool textBoxIsHorizontal, TextPaintStyle& nonSelectionPaintStyle, TextPaintStyle& selectionPaintStyle);
     
     void paintText();
-
+#if ENABLE(CSS3_TEXT_DECORATION_SKIP_INK)
     DashArray dashesForIntersectionsWithRect(const FloatRect& lineExtents);
+#endif
 
 private:
     void drawTextOrEmphasisMarks(const FontCascade&, const TextRun&, const AtomicString& emphasisMark, int emphasisMarkOffset,
@@ -61,7 +62,6 @@
     void paintTextWithStyle(const TextPaintStyle&, int startOffset, int endOffset, const ShadowData*);
     void paintEmphasisMarksIfNeeded(int startOffset, int endOffset, const TextPaintStyle&, const ShadowData*);
 
-private:
     GraphicsContext& m_context;
     TextPaintStyle& m_textPaintStyle;
     TextPaintStyle& m_selectionPaintStyle;
@@ -91,16 +91,9 @@
     ~ShadowApplier();
 
 private:
-    bool isLastShadowIteration()
-    {
-        return m_shadow && !m_shadow->next();
-    }
+    bool isLastShadowIteration();
+    bool shadowIsCompletelyCoveredByText(bool textIsOpaque);
 
-    bool shadowIsCompletelyCoveredByText(bool textIsOpaque)
-    {
-        return textIsOpaque && m_shadow && m_shadow->location() == IntPoint() && !m_shadow->radius();
-    }
-
     FloatSize m_extraOffset;
     GraphicsContext& m_context;
     const ShadowData* m_shadow;
@@ -110,6 +103,16 @@
     bool m_didSaveContext : 1;
 };
 
+inline bool ShadowApplier::isLastShadowIteration()
+{
+    return m_shadow && !m_shadow->next();
+}
+
+inline bool ShadowApplier::shadowIsCompletelyCoveredByText(bool textIsOpaque)
+{
+    return textIsOpaque && m_shadow && m_shadow->location() == IntPoint() && !m_shadow->radius();
+}
+
 } // namespace WebCore
 
 #endif // TextPainter_h
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to