mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-10-05 17:49:16 +03:00
LibWeb: Add text shadows support in Skia painter
This commit is contained in:
parent
b27cf1be49
commit
4cdc5d2ce9
Notes:
sideshowbarker
2024-07-17 06:51:10 +09:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/LadybirdBrowser/ladybird/commit/4cdc5d2ce9 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/308
@ -597,8 +597,21 @@ CommandResult DisplayListPlayerSkia::paint_inner_box_shadow(PaintInnerBoxShadow
|
||||
return CommandResult::Continue;
|
||||
}
|
||||
|
||||
CommandResult DisplayListPlayerSkia::paint_text_shadow(PaintTextShadow const&)
|
||||
CommandResult DisplayListPlayerSkia::paint_text_shadow(PaintTextShadow const& command)
|
||||
{
|
||||
auto& canvas = surface().canvas();
|
||||
auto blur_image_filter = SkImageFilters::Blur(command.blur_radius, command.blur_radius, nullptr);
|
||||
SkPaint blur_paint;
|
||||
blur_paint.setImageFilter(blur_image_filter);
|
||||
canvas.saveLayer(SkCanvas::SaveLayerRec(nullptr, &blur_paint, nullptr, 0));
|
||||
draw_glyph_run({
|
||||
.glyph_run = command.glyph_run,
|
||||
.color = command.color,
|
||||
.rect = command.text_rect,
|
||||
.translation = command.draw_location.to_type<float>() + command.text_rect.location().to_type<float>(),
|
||||
.scale = command.glyph_run_scale,
|
||||
});
|
||||
canvas.restore();
|
||||
return CommandResult::Continue;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user