| Index: third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp
|
| diff --git a/third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp b/third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp
|
| index 1c9b4b1a167d2ff6371797ca85b2b5c43db51086..06b2d05366ed8bc7e4b85d5f00a5ce52dd29008c 100644
|
| --- a/third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp
|
| +++ b/third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp
|
| @@ -739,17 +739,32 @@ void GraphicsContext::DrawRect(const IntRect& rect) {
|
| }
|
| }
|
|
|
| -void GraphicsContext::DrawText(const Font& font,
|
| - const TextRunPaintInfo& run_info,
|
| - const FloatPoint& point,
|
| - const PaintFlags& flags) {
|
| +template <typename TextPaintInfo>
|
| +void GraphicsContext::DrawTextInternal(const Font& font,
|
| + const TextPaintInfo& text_info,
|
| + const FloatPoint& point,
|
| + const PaintFlags& flags) {
|
| if (ContextDisabled())
|
| return;
|
|
|
| - if (font.DrawText(canvas_, run_info, point, device_scale_factor_, flags))
|
| + if (font.DrawText(canvas_, text_info, point, device_scale_factor_, flags))
|
| paint_controller_.SetTextPainted();
|
| }
|
|
|
| +void GraphicsContext::DrawText(const Font& font,
|
| + const TextRunPaintInfo& text_info,
|
| + const FloatPoint& point,
|
| + const PaintFlags& flags) {
|
| + DrawTextInternal(font, text_info, point, flags);
|
| +}
|
| +
|
| +void GraphicsContext::DrawText(const Font& font,
|
| + const TextFragmentPaintInfo& text_info,
|
| + const FloatPoint& point,
|
| + const PaintFlags& flags) {
|
| + DrawTextInternal(font, text_info, point, flags);
|
| +}
|
| +
|
| template <typename DrawTextFunc>
|
| void GraphicsContext::DrawTextPasses(const DrawTextFunc& draw_text) {
|
| TextDrawingModeFlags mode_flags = TextDrawingMode();
|
| @@ -769,32 +784,60 @@ void GraphicsContext::DrawTextPasses(const DrawTextFunc& draw_text) {
|
| }
|
| }
|
|
|
| -void GraphicsContext::DrawText(const Font& font,
|
| - const TextRunPaintInfo& run_info,
|
| - const FloatPoint& point) {
|
| +template <typename TextPaintInfo>
|
| +void GraphicsContext::DrawTextInternal(const Font& font,
|
| + const TextPaintInfo& text_info,
|
| + const FloatPoint& point) {
|
| if (ContextDisabled())
|
| return;
|
|
|
| - DrawTextPasses([&font, &run_info, &point, this](const PaintFlags& flags) {
|
| - if (font.DrawText(canvas_, run_info, point, device_scale_factor_, flags))
|
| + DrawTextPasses([&font, &text_info, &point, this](const PaintFlags& flags) {
|
| + if (font.DrawText(canvas_, text_info, point, device_scale_factor_, flags))
|
| paint_controller_.SetTextPainted();
|
| });
|
| }
|
|
|
| -void GraphicsContext::DrawEmphasisMarks(const Font& font,
|
| - const TextRunPaintInfo& run_info,
|
| - const AtomicString& mark,
|
| - const FloatPoint& point) {
|
| +void GraphicsContext::DrawText(const Font& font,
|
| + const TextRunPaintInfo& text_info,
|
| + const FloatPoint& point) {
|
| + DrawTextInternal(font, text_info, point);
|
| +}
|
| +
|
| +void GraphicsContext::DrawText(const Font& font,
|
| + const TextFragmentPaintInfo& text_info,
|
| + const FloatPoint& point) {
|
| + DrawTextInternal(font, text_info, point);
|
| +}
|
| +
|
| +template <typename TextPaintInfo>
|
| +void GraphicsContext::DrawEmphasisMarksInternal(const Font& font,
|
| + const TextPaintInfo& text_info,
|
| + const AtomicString& mark,
|
| + const FloatPoint& point) {
|
| if (ContextDisabled())
|
| return;
|
|
|
| DrawTextPasses(
|
| - [&font, &run_info, &mark, &point, this](const PaintFlags& flags) {
|
| - font.DrawEmphasisMarks(canvas_, run_info, mark, point,
|
| + [&font, &text_info, &mark, &point, this](const PaintFlags& flags) {
|
| + font.DrawEmphasisMarks(canvas_, text_info, mark, point,
|
| device_scale_factor_, flags);
|
| });
|
| }
|
|
|
| +void GraphicsContext::DrawEmphasisMarks(const Font& font,
|
| + const TextRunPaintInfo& text_info,
|
| + const AtomicString& mark,
|
| + const FloatPoint& point) {
|
| + DrawEmphasisMarksInternal(font, text_info, mark, point);
|
| +}
|
| +
|
| +void GraphicsContext::DrawEmphasisMarks(const Font& font,
|
| + const TextFragmentPaintInfo& text_info,
|
| + const AtomicString& mark,
|
| + const FloatPoint& point) {
|
| + DrawEmphasisMarksInternal(font, text_info, mark, point);
|
| +}
|
| +
|
| void GraphicsContext::DrawBidiText(
|
| const Font& font,
|
| const TextRunPaintInfo& run_info,
|
|
|