Commit 4fcdbb63 authored by Koji Ishii's avatar Koji Ishii Committed by Commit Bot

Rename `text_bounds` to `text_frame_rect`

Pointed out in crrev.com/c/2315897 that this member name is
confusing, whether it is a frame rect used in layout, or ink
overflow.

Renamed to clarify it is a frame rect.

Bug: 1108580
Change-Id: I3cc1b32930c60068ac6a63514f6216c07b4b8129
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2315462Reviewed-by: default avatarXianzhu Wang <wangxianzhu@chromium.org>
Commit-Queue: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#791457}
parent 07b94e9b
......@@ -28,9 +28,13 @@ class CORE_EXPORT NGTextPainter : public TextPainterBase {
const NGTextFragmentPaintInfo& fragment_paint_info,
const IntRect& visual_rect,
const PhysicalOffset& text_origin,
const PhysicalRect& text_bounds,
const PhysicalRect& text_frame_rect,
bool horizontal)
: TextPainterBase(context, font, text_origin, text_bounds, horizontal),
: TextPainterBase(context,
font,
text_origin,
text_frame_rect,
horizontal),
fragment_paint_info_(fragment_paint_info),
visual_rect_(visual_rect) {}
~NGTextPainter() = default;
......
......@@ -36,7 +36,7 @@ void TextPainter::Paint(unsigned start_offset,
if (combined_text_) {
graphics_context_.Save();
combined_text_->TransformToInlineCoordinates(graphics_context_,
text_bounds_);
text_frame_rect_);
PaintInternal<kPaintText>(start_offset, end_offset, length, node_id);
graphics_context_.Restore();
} else {
......@@ -124,15 +124,15 @@ void TextPainter::PaintEmphasisMarkForCombinedText() {
DCHECK(combined_text_);
TextRun placeholder_text_run(&kIdeographicFullStopCharacter, 1);
FloatPoint emphasis_mark_text_origin(
text_bounds_.X().ToFloat(), text_bounds_.Y().ToFloat() +
font_data->GetFontMetrics().Ascent() +
emphasis_mark_offset_);
text_frame_rect_.X().ToFloat(), text_frame_rect_.Y().ToFloat() +
font_data->GetFontMetrics().Ascent() +
emphasis_mark_offset_);
TextRunPaintInfo text_run_paint_info(placeholder_text_run);
graphics_context_.ConcatCTM(Rotation(text_bounds_, kClockwise));
graphics_context_.ConcatCTM(Rotation(text_frame_rect_, kClockwise));
graphics_context_.DrawEmphasisMarks(combined_text_->OriginalFont(),
text_run_paint_info, emphasis_mark_,
emphasis_mark_text_origin);
graphics_context_.ConcatCTM(Rotation(text_bounds_, kCounterclockwise));
graphics_context_.ConcatCTM(Rotation(text_frame_rect_, kCounterclockwise));
}
} // namespace blink
......@@ -24,9 +24,13 @@ class CORE_EXPORT TextPainter : public TextPainterBase {
const Font& font,
const TextRun& run,
const PhysicalOffset& text_origin,
const PhysicalRect& text_bounds,
const PhysicalRect& text_frame_rect,
bool horizontal)
: TextPainterBase(context, font, text_origin, text_bounds, horizontal),
: TextPainterBase(context,
font,
text_origin,
text_frame_rect,
horizontal),
run_(run),
combined_text_(nullptr) {}
~TextPainter() = default;
......
......@@ -119,12 +119,12 @@ float DoubleOffsetFromThickness(float thickness_pixels) {
TextPainterBase::TextPainterBase(GraphicsContext& context,
const Font& font,
const PhysicalOffset& text_origin,
const PhysicalRect& text_bounds,
const PhysicalRect& text_frame_rect,
bool horizontal)
: graphics_context_(context),
font_(font),
text_origin_(text_origin),
text_bounds_(text_bounds),
text_frame_rect_(text_frame_rect),
horizontal_(horizontal),
has_combined_text_(false),
emphasis_mark_offset_(0),
......@@ -291,7 +291,7 @@ void TextPainterBase::PaintDecorationsExceptLineThrough(
UpdateGraphicsContext(context, text_style, horizontal_, state_saver);
if (has_combined_text_)
context.ConcatCTM(Rotation(text_bounds_, kClockwise));
context.ConcatCTM(Rotation(text_frame_rect_, kClockwise));
// text-underline-position may flip underline and overline.
ResolvedUnderlinePosition underline_position =
......@@ -355,7 +355,7 @@ void TextPainterBase::PaintDecorationsExceptLineThrough(
// Restore rotation as needed.
if (has_combined_text_)
context.ConcatCTM(Rotation(text_bounds_, kCounterclockwise));
context.ConcatCTM(Rotation(text_frame_rect_, kCounterclockwise));
}
void TextPainterBase::PaintDecorationsOnlyLineThrough(
......@@ -368,7 +368,7 @@ void TextPainterBase::PaintDecorationsOnlyLineThrough(
UpdateGraphicsContext(context, text_style, horizontal_, state_saver);
if (has_combined_text_)
context.ConcatCTM(Rotation(text_bounds_, kClockwise));
context.ConcatCTM(Rotation(text_frame_rect_, kClockwise));
DCHECK_EQ(decorations.size(),
decoration_info.applied_decorations_thickness.size());
......@@ -404,7 +404,7 @@ void TextPainterBase::PaintDecorationsOnlyLineThrough(
// Restore rotation as needed.
if (has_combined_text_)
context.ConcatCTM(Rotation(text_bounds_, kCounterclockwise));
context.ConcatCTM(Rotation(text_frame_rect_, kCounterclockwise));
}
void TextPainterBase::ComputeDecorationInfo(
......
......@@ -36,7 +36,7 @@ class CORE_EXPORT TextPainterBase {
TextPainterBase(GraphicsContext&,
const Font&,
const PhysicalOffset& text_origin,
const PhysicalRect& text_bounds,
const PhysicalRect& text_frame_rect,
bool horizontal);
~TextPainterBase();
......@@ -115,7 +115,7 @@ class CORE_EXPORT TextPainterBase {
GraphicsContext& graphics_context_;
const Font& font_;
PhysicalOffset text_origin_;
PhysicalRect text_bounds_;
PhysicalRect text_frame_rect_;
bool horizontal_;
bool has_combined_text_;
AtomicString emphasis_mark_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment