| 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 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 | 450 |
| 451 void InlineTextBoxPainter::removeFromTextBlobCache( | 451 void InlineTextBoxPainter::removeFromTextBlobCache( |
| 452 const InlineTextBox& inlineTextBox) { | 452 const InlineTextBox& inlineTextBox) { |
| 453 if (gTextBlobCache) | 453 if (gTextBlobCache) |
| 454 gTextBlobCache->remove(&inlineTextBox); | 454 gTextBlobCache->remove(&inlineTextBox); |
| 455 } | 455 } |
| 456 | 456 |
| 457 static TextBlobPtr* addToTextBlobCache(const InlineTextBox& inlineTextBox) { | 457 static TextBlobPtr* addToTextBlobCache(const InlineTextBox& inlineTextBox) { |
| 458 if (!gTextBlobCache) | 458 if (!gTextBlobCache) |
| 459 gTextBlobCache = new InlineTextBoxBlobCacheMap; | 459 gTextBlobCache = new InlineTextBoxBlobCacheMap; |
| 460 return &gTextBlobCache->add(&inlineTextBox, nullptr).storedValue->value; | 460 return &gTextBlobCache->insert(&inlineTextBox, nullptr).storedValue->value; |
| 461 } | 461 } |
| 462 | 462 |
| 463 LayoutObject& InlineTextBoxPainter::inlineLayoutObject() const { | 463 LayoutObject& InlineTextBoxPainter::inlineLayoutObject() const { |
| 464 return *LineLayoutAPIShim::layoutObjectFrom( | 464 return *LineLayoutAPIShim::layoutObjectFrom( |
| 465 m_inlineTextBox.getLineLayoutItem()); | 465 m_inlineTextBox.getLineLayoutItem()); |
| 466 } | 466 } |
| 467 | 467 |
| 468 bool InlineTextBoxPainter::paintsMarkerHighlights( | 468 bool InlineTextBoxPainter::paintsMarkerHighlights( |
| 469 const LayoutObject& layoutObject) { | 469 const LayoutObject& layoutObject) { |
| 470 return layoutObject.node() && | 470 return layoutObject.node() && |
| (...skipping 919 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1390 | 1390 |
| 1391 LayoutRect boxRect(boxOrigin, LayoutSize(m_inlineTextBox.logicalWidth(), | 1391 LayoutRect boxRect(boxOrigin, LayoutSize(m_inlineTextBox.logicalWidth(), |
| 1392 m_inlineTextBox.logicalHeight())); | 1392 m_inlineTextBox.logicalHeight())); |
| 1393 context.clip(FloatRect(boxRect)); | 1393 context.clip(FloatRect(boxRect)); |
| 1394 context.drawHighlightForText(font, run, FloatPoint(boxOrigin), | 1394 context.drawHighlightForText(font, run, FloatPoint(boxOrigin), |
| 1395 boxRect.height().toInt(), color, | 1395 boxRect.height().toInt(), color, |
| 1396 paintOffsets.first, paintOffsets.second); | 1396 paintOffsets.first, paintOffsets.second); |
| 1397 } | 1397 } |
| 1398 | 1398 |
| 1399 } // namespace blink | 1399 } // namespace blink |
| OLD | NEW |