// Copyright 2021 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_PAINT_TEXT_DECORATION_PAINTER_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_PAINT_TEXT_DECORATION_PAINTER_H_ #include <optional> #include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/paint/highlight_painter.h" #include "third_party/blink/renderer/core/paint/text_decoration_info.h" namespace blink { class ComputedStyle; class FragmentItem; class GraphicsContextStateSaver; class InlinePaintContext; class TextPainter; struct LineRelativeRect; struct PaintInfo; struct TextPaintStyle; // TextFragmentPainter helper that paints text-decoration. // // We expose a friendlier interface over TextPainter’s decoration // primitives that’s harder to misuse. Callers of Begin must then call // PaintExceptLineThrough and PaintOnlyLineThrough, in exactly that order // (though other painting code may happen in between). // // We clip the canvas to ensure that decorations change exactly at the edge of // any ::selection background, but paint all decorations along the full logical // width of |decoration_rect|. This yields better results for wavy lines, since // they stay perfectly continuous and in phase into any highlighted parts. class CORE_EXPORT TextDecorationPainter { … }; } // namespace blink #endif // THIRD_PARTY_BLINK_RENDERER_CORE_PAINT_TEXT_DECORATION_PAINTER_H_