Light cleanup in TextPainter.
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 Dec 2015 21:35:21 +0000 (21:35 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 Dec 2015 21:35:21 +0000 (21:35 +0000)
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):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@193779 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/rendering/TextPainter.cpp
Source/WebCore/rendering/TextPainter.h

index 920ec17cc28ad558a0ed53e075922fff964c813a..91592cdc85d0fcc8e24643298944271824af9d67 100644 (file)
@@ -1,3 +1,18 @@
+2015-12-08  Zalan Bujtas  <zalan@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  <zalan@apple.com>
 
         Do not insert positioned renderers to multiple gPositionedDescendantsMap.
index 5d49fff0c1eb2b2cb969627525856e5c41e3b065..6829f7648b56863610c335d35bc4ef0100911ac4 100644 (file)
 
 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 @@ ShadowApplier::~ShadowApplier()
         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)
 {
index 3ad69a49fec804c618595e1ead469622d4e05bc0..db4e9fc46f1ebb0e81f070663687e3d796c8e21c 100644 (file)
@@ -50,8 +50,9 @@ public:
     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 @@ private:
     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,15 +91,8 @@ public:
     ~ShadowApplier();
 
 private:
-    bool isLastShadowIteration()
-    {
-        return m_shadow && !m_shadow->next();
-    }
-
-    bool shadowIsCompletelyCoveredByText(bool textIsOpaque)
-    {
-        return textIsOpaque && m_shadow && m_shadow->location() == IntPoint() && !m_shadow->radius();
-    }
+    bool isLastShadowIteration();
+    bool shadowIsCompletelyCoveredByText(bool textIsOpaque);
 
     FloatSize m_extraOffset;
     GraphicsContext& m_context;
@@ -110,6 +103,16 @@ private:
     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