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 #include "core/paint/InlineTextBoxPainter.h" | 5 #include "core/paint/InlineTextBoxPainter.h" |
6 | 6 |
7 #include "core/editing/CompositionUnderline.h" | 7 #include "core/editing/CompositionUnderline.h" |
8 #include "core/editing/Editor.h" | 8 #include "core/editing/Editor.h" |
9 #include "core/editing/markers/DocumentMarkerController.h" | 9 #include "core/editing/markers/DocumentMarkerController.h" |
10 #include "core/frame/LocalFrame.h" | 10 #include "core/frame/LocalFrame.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 gTextBlobCache->remove(&inlineTextBox); | 32 gTextBlobCache->remove(&inlineTextBox); |
33 } | 33 } |
34 | 34 |
35 static TextBlobPtr* addToTextBlobCache(const InlineTextBox& inlineTextBox) | 35 static TextBlobPtr* addToTextBlobCache(const InlineTextBox& inlineTextBox) |
36 { | 36 { |
37 if (!gTextBlobCache) | 37 if (!gTextBlobCache) |
38 gTextBlobCache = new InlineTextBoxBlobCacheMap; | 38 gTextBlobCache = new InlineTextBoxBlobCacheMap; |
39 return &gTextBlobCache->add(&inlineTextBox, nullptr).storedValue->value; | 39 return &gTextBlobCache->add(&inlineTextBox, nullptr).storedValue->value; |
40 } | 40 } |
41 | 41 |
42 static bool paintsMarkerHighlights(const LayoutObject& layoutObject) | 42 bool InlineTextBoxPainter::paintsMarkerHighlights(const LayoutObject& layoutObje
ct) |
43 { | 43 { |
44 return layoutObject.node() && layoutObject.document().markers().hasMarkers(l
ayoutObject.node()); | 44 return layoutObject.node() && layoutObject.document().markers().hasMarkers(l
ayoutObject.node()); |
45 } | 45 } |
46 | 46 |
47 static bool paintsCompositionMarkers(const LayoutObject& layoutObject) | 47 static bool paintsCompositionMarkers(const LayoutObject& layoutObject) |
48 { | 48 { |
49 return layoutObject.node() && layoutObject.document().markers().markersFor(l
ayoutObject.node(), DocumentMarker::Composition).size() > 0; | 49 return layoutObject.node() && layoutObject.document().markers().markersFor(l
ayoutObject.node(), DocumentMarker::Composition).size() > 0; |
50 } | 50 } |
51 | 51 |
52 void InlineTextBoxPainter::paint(const PaintInfo& paintInfo, const LayoutPoint&
paintOffset) | 52 void InlineTextBoxPainter::paint(const PaintInfo& paintInfo, const LayoutPoint&
paintOffset) |
(...skipping 787 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
840 GraphicsContext& context = paintInfo.context; | 840 GraphicsContext& context = paintInfo.context; |
841 GraphicsContextStateSaver stateSaver(context); | 841 GraphicsContextStateSaver stateSaver(context); |
842 | 842 |
843 LayoutRect boxRect(boxOrigin, LayoutSize(m_inlineTextBox.logicalWidth(), m_i
nlineTextBox.logicalHeight())); | 843 LayoutRect boxRect(boxOrigin, LayoutSize(m_inlineTextBox.logicalWidth(), m_i
nlineTextBox.logicalHeight())); |
844 context.clip(FloatRect(boxRect)); | 844 context.clip(FloatRect(boxRect)); |
845 context.drawHighlightForText(font, run, FloatPoint(boxOrigin), boxRect.heigh
t(), color, sPos, ePos); | 845 context.drawHighlightForText(font, run, FloatPoint(boxOrigin), boxRect.heigh
t(), color, sPos, ePos); |
846 } | 846 } |
847 | 847 |
848 | 848 |
849 } // namespace blink | 849 } // namespace blink |
OLD | NEW |