mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-11 10:41:30 +00:00
LibWeb: Reduce DrawGlyphRun struct from 56 to 48 bytes
This commit is contained in:
parent
ddc3017464
commit
d1c7c0ba19
Notes:
github-actions[bot]
2024-11-11 16:07:23 +00:00
Author: https://github.com/shlyakpavel
Commit: d1c7c0ba19
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2280
3 changed files with 6 additions and 6 deletions
|
@ -39,10 +39,10 @@ class DisplayList;
|
||||||
|
|
||||||
struct DrawGlyphRun {
|
struct DrawGlyphRun {
|
||||||
NonnullRefPtr<Gfx::GlyphRun> glyph_run;
|
NonnullRefPtr<Gfx::GlyphRun> glyph_run;
|
||||||
Color color;
|
double scale { 1 };
|
||||||
Gfx::IntRect rect;
|
Gfx::IntRect rect;
|
||||||
Gfx::FloatPoint translation;
|
Gfx::FloatPoint translation;
|
||||||
double scale { 1 };
|
Color color;
|
||||||
Gfx::Orientation orientation { Gfx::Orientation::Horizontal };
|
Gfx::Orientation orientation { Gfx::Orientation::Horizontal };
|
||||||
|
|
||||||
[[nodiscard]] Gfx::IntRect bounding_rect() const { return rect; }
|
[[nodiscard]] Gfx::IntRect bounding_rect() const { return rect; }
|
||||||
|
|
|
@ -704,10 +704,10 @@ void DisplayListPlayerSkia::paint_text_shadow(PaintTextShadow const& command)
|
||||||
canvas.saveLayer(SkCanvas::SaveLayerRec(nullptr, &blur_paint, nullptr, 0));
|
canvas.saveLayer(SkCanvas::SaveLayerRec(nullptr, &blur_paint, nullptr, 0));
|
||||||
draw_glyph_run({
|
draw_glyph_run({
|
||||||
.glyph_run = command.glyph_run,
|
.glyph_run = command.glyph_run,
|
||||||
.color = command.color,
|
.scale = command.glyph_run_scale,
|
||||||
.rect = command.text_rect,
|
.rect = command.text_rect,
|
||||||
.translation = command.draw_location.to_type<float>() + command.text_rect.location().to_type<float>(),
|
.translation = command.draw_location.to_type<float>() + command.text_rect.location().to_type<float>(),
|
||||||
.scale = command.glyph_run_scale,
|
.color = command.color,
|
||||||
});
|
});
|
||||||
canvas.restore();
|
canvas.restore();
|
||||||
}
|
}
|
||||||
|
|
|
@ -243,10 +243,10 @@ void DisplayListRecorder::draw_text_run(Gfx::IntPoint baseline_start, Gfx::Glyph
|
||||||
return;
|
return;
|
||||||
append(DrawGlyphRun {
|
append(DrawGlyphRun {
|
||||||
.glyph_run = glyph_run,
|
.glyph_run = glyph_run,
|
||||||
.color = color,
|
.scale = scale,
|
||||||
.rect = rect,
|
.rect = rect,
|
||||||
.translation = baseline_start.to_type<float>(),
|
.translation = baseline_start.to_type<float>(),
|
||||||
.scale = scale,
|
.color = color,
|
||||||
.orientation = orientation,
|
.orientation = orientation,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue