OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef TextPainter_h | 5 #ifndef TextPainter_h |
6 #define TextPainter_h | 6 #define TextPainter_h |
7 | 7 |
8 #include "core/rendering/style/RenderStyleConstants.h" | 8 #include "core/rendering/style/RenderStyleConstants.h" |
9 #include "platform/fonts/TextBlob.h" | 9 #include "platform/fonts/TextBlob.h" |
10 #include "platform/geometry/FloatPoint.h" | 10 #include "platform/geometry/FloatPoint.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 | 60 |
61 private: | 61 private: |
62 void updateGraphicsContext(const Style& style, GraphicsContextStateSaver& sa
ver) | 62 void updateGraphicsContext(const Style& style, GraphicsContextStateSaver& sa
ver) |
63 { | 63 { |
64 updateGraphicsContext(m_graphicsContext, style, m_horizontal, saver); | 64 updateGraphicsContext(m_graphicsContext, style, m_horizontal, saver); |
65 } | 65 } |
66 | 66 |
67 enum PaintInternalStep { PaintText, PaintEmphasisMark }; | 67 enum PaintInternalStep { PaintText, PaintEmphasisMark }; |
68 | 68 |
69 template <PaintInternalStep step> | 69 template <PaintInternalStep step> |
70 void paintInternalRun(TextRunPaintInfo&, int from, int to, TextBlobPtr* cach
edTextBlob = 0); | 70 void paintInternalRun(TextRunPaintInfo&, int from, int to); |
71 | 71 |
72 template <PaintInternalStep step> | 72 template <PaintInternalStep step> |
73 void paintInternal(int startOffset, int endOffset, int truncationPoint, Text
BlobPtr* cachedTextBlob = 0); | 73 void paintInternal(int startOffset, int endOffset, int truncationPoint, Text
BlobPtr* cachedTextBlob = 0); |
74 | 74 |
75 void paintEmphasisMarkForCombinedText(); | 75 void paintEmphasisMarkForCombinedText(); |
76 | 76 |
77 GraphicsContext* m_graphicsContext; | 77 GraphicsContext* m_graphicsContext; |
78 const Font& m_font; | 78 const Font& m_font; |
79 const TextRun& m_run; | 79 const TextRun& m_run; |
80 FloatPoint m_textOrigin; | 80 FloatPoint m_textOrigin; |
81 FloatRect m_textBounds; | 81 FloatRect m_textBounds; |
82 bool m_horizontal; | 82 bool m_horizontal; |
83 AtomicString m_emphasisMark; | 83 AtomicString m_emphasisMark; |
84 int m_emphasisMarkOffset; | 84 int m_emphasisMarkOffset; |
85 RenderCombineText* m_combinedText; | 85 RenderCombineText* m_combinedText; |
86 }; | 86 }; |
87 | 87 |
88 } // namespace blink | 88 } // namespace blink |
89 | 89 |
90 #endif // TextPainter_h | 90 #endif // TextPainter_h |
OLD | NEW |