mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-02 06:09:08 +00:00
LibWeb: Add internals
call to dump display list
It's useful to have tests that dump display list items, so we can more easily see how changes to the display list recording process affect the output. Even the small sample test added in this commit shows that we currently record an unnecessary AddClipRect item for empty paint phases. For now, the dump doesn't include every single property of an item, but we can shape it to include more useful information as we iterate on it.
This commit is contained in:
parent
6be559f639
commit
8ae7417445
Notes:
github-actions[bot]
2025-07-13 17:16:19 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: 8ae7417445
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5390
Reviewed-by: https://github.com/gmta ✅
11 changed files with 332 additions and 10 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2024, Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
|
||||
* Copyright (c) 2024-2025, Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -41,4 +41,194 @@ void PaintInnerBoxShadow::translate_by(Gfx::IntPoint const& offset)
|
|||
box_shadow_params.device_content_rect.translate_by(offset);
|
||||
}
|
||||
|
||||
void DrawGlyphRun::dump(StringBuilder& builder) const
|
||||
{
|
||||
builder.appendff("DrawGlyphRun rect={} translation={} color={} scale={}", rect, translation, color, scale);
|
||||
}
|
||||
|
||||
void FillRect::dump(StringBuilder& builder) const
|
||||
{
|
||||
builder.appendff("FillRect rect={} color={}", rect, color);
|
||||
}
|
||||
|
||||
void DrawPaintingSurface::dump(StringBuilder& builder) const
|
||||
{
|
||||
builder.appendff("DrawPaintingSurface dst_rect={} src_rect={}", dst_rect, src_rect);
|
||||
}
|
||||
|
||||
void DrawScaledImmutableBitmap::dump(StringBuilder& builder) const
|
||||
{
|
||||
builder.appendff("DrawScaledImmutableBitmap dst_rect={} clip_rect={}", dst_rect, clip_rect);
|
||||
}
|
||||
|
||||
void DrawRepeatedImmutableBitmap::dump(StringBuilder& builder) const
|
||||
{
|
||||
builder.appendff("DrawRepeatedImmutableBitmap dst_rect={} clip_rect={}", dst_rect, clip_rect);
|
||||
}
|
||||
|
||||
void Save::dump(StringBuilder& builder) const
|
||||
{
|
||||
builder.appendff("Save");
|
||||
}
|
||||
|
||||
void SaveLayer::dump(StringBuilder& builder) const
|
||||
{
|
||||
builder.appendff("SaveLayer");
|
||||
}
|
||||
|
||||
void Restore::dump(StringBuilder& builder) const
|
||||
{
|
||||
builder.appendff("Restore");
|
||||
}
|
||||
|
||||
void Translate::dump(StringBuilder& builder) const
|
||||
{
|
||||
builder.appendff("Translate delta={}", delta);
|
||||
}
|
||||
|
||||
void AddClipRect::dump(StringBuilder& builder) const
|
||||
{
|
||||
builder.appendff("AddClipRect rect={}", rect);
|
||||
}
|
||||
|
||||
void PushStackingContext::dump(StringBuilder& builder) const
|
||||
{
|
||||
builder.appendff("PushStackingContext");
|
||||
}
|
||||
|
||||
void PopStackingContext::dump(StringBuilder& builder) const
|
||||
{
|
||||
builder.appendff("PopStackingContext");
|
||||
}
|
||||
|
||||
void PaintLinearGradient::dump(StringBuilder& builder) const
|
||||
{
|
||||
builder.appendff("PaintLinearGradient rect={}", gradient_rect);
|
||||
}
|
||||
|
||||
void PaintRadialGradient::dump(StringBuilder& builder) const
|
||||
{
|
||||
builder.appendff("PaintRadialGradient rect={} center={} size={}", rect, center, size);
|
||||
}
|
||||
|
||||
void PaintConicGradient::dump(StringBuilder& builder) const
|
||||
{
|
||||
builder.appendff("PaintConicGradient rect={} position={} angle={}", rect, position, conic_gradient_data.start_angle);
|
||||
}
|
||||
|
||||
void PaintOuterBoxShadow::dump(StringBuilder& builder) const
|
||||
{
|
||||
builder.appendff("PaintOuterBoxShadow content_rect={} offset=({},{}) blur_radius={} spread_distance={} color={}", box_shadow_params.device_content_rect, box_shadow_params.offset_x, box_shadow_params.offset_y, box_shadow_params.blur_radius, box_shadow_params.spread_distance, box_shadow_params.color);
|
||||
}
|
||||
|
||||
void PaintInnerBoxShadow::dump(StringBuilder& builder) const
|
||||
{
|
||||
builder.appendff("PaintInnerBoxShadow content_rect={} offset=({},{}) blur_radius={} spread_distance={} color={}", box_shadow_params.device_content_rect, box_shadow_params.offset_x, box_shadow_params.offset_y, box_shadow_params.blur_radius, box_shadow_params.spread_distance, box_shadow_params.color);
|
||||
}
|
||||
|
||||
void PaintTextShadow::dump(StringBuilder& builder) const
|
||||
{
|
||||
builder.appendff("PaintTextShadow shadow_rect={} text_rect={} draw_location={} blur_radius={} color={} scale={}", shadow_bounding_rect, text_rect, draw_location, blur_radius, color, glyph_run_scale);
|
||||
}
|
||||
|
||||
void FillRectWithRoundedCorners::dump(StringBuilder& builder) const
|
||||
{
|
||||
builder.appendff("FillRectWithRoundedCorners rect={} color={}", rect, color);
|
||||
}
|
||||
|
||||
void FillPathUsingColor::dump(StringBuilder& builder) const
|
||||
{
|
||||
builder.appendff("FillPathUsingColor");
|
||||
}
|
||||
|
||||
void FillPathUsingPaintStyle::dump(StringBuilder& builder) const
|
||||
{
|
||||
builder.appendff("FillPathUsingPaintStyle");
|
||||
}
|
||||
|
||||
void StrokePathUsingColor::dump(StringBuilder& builder) const
|
||||
{
|
||||
builder.appendff("StrokePathUsingColor");
|
||||
}
|
||||
|
||||
void StrokePathUsingPaintStyle::dump(StringBuilder& builder) const
|
||||
{
|
||||
builder.appendff("StrokePathUsingPaintStyle");
|
||||
}
|
||||
|
||||
void DrawEllipse::dump(StringBuilder& builder) const
|
||||
{
|
||||
builder.appendff("DrawEllipse rect={} color={} thickness={}", rect, color, thickness);
|
||||
}
|
||||
|
||||
void FillEllipse::dump(StringBuilder& builder) const
|
||||
{
|
||||
builder.appendff("FillEllipse rect={} color={}", rect, color);
|
||||
}
|
||||
|
||||
void DrawLine::dump(StringBuilder& builder) const
|
||||
{
|
||||
builder.appendff("DrawLine from={} to={} color={} thickness={}", from, to, color, thickness);
|
||||
}
|
||||
|
||||
void ApplyBackdropFilter::dump(StringBuilder& builder) const
|
||||
{
|
||||
builder.appendff("ApplyBackdropFilter backdrop_region={}", backdrop_region);
|
||||
}
|
||||
|
||||
void DrawRect::dump(StringBuilder& builder) const
|
||||
{
|
||||
builder.appendff("DrawRect rect={} color={} rough={}", rect, color, rough);
|
||||
}
|
||||
|
||||
void DrawTriangleWave::dump(StringBuilder& builder) const
|
||||
{
|
||||
builder.appendff("DrawTriangleWave p1={} p2={} color={} amplitude={} thickness={}", p1, p2, color, amplitude, thickness);
|
||||
}
|
||||
|
||||
void AddRoundedRectClip::dump(StringBuilder& builder) const
|
||||
{
|
||||
builder.appendff("AddRoundedRectClip rect={}", border_rect);
|
||||
}
|
||||
|
||||
void AddMask::dump(StringBuilder& builder) const
|
||||
{
|
||||
builder.appendff("AddMask rect={} has_display_list={}", rect, display_list != nullptr);
|
||||
}
|
||||
|
||||
void PaintNestedDisplayList::dump(StringBuilder& builder) const
|
||||
{
|
||||
builder.appendff("PaintNestedDisplayList rect={}", rect);
|
||||
}
|
||||
|
||||
void PaintScrollBar::dump(StringBuilder& builder) const
|
||||
{
|
||||
builder.appendff("PaintScrollBar");
|
||||
}
|
||||
|
||||
void ApplyOpacity::dump(StringBuilder& builder) const
|
||||
{
|
||||
builder.appendff("ApplyOpacity opacity={}", opacity);
|
||||
}
|
||||
|
||||
void ApplyCompositeAndBlendingOperator::dump(StringBuilder& builder) const
|
||||
{
|
||||
builder.appendff("ApplyCompositeAndBlendingOperator");
|
||||
}
|
||||
|
||||
void ApplyFilter::dump(StringBuilder& builder) const
|
||||
{
|
||||
builder.appendff("ApplyFilter");
|
||||
}
|
||||
|
||||
void ApplyTransform::dump(StringBuilder& builder) const
|
||||
{
|
||||
builder.appendff("ApplyTransform");
|
||||
}
|
||||
|
||||
void ApplyMaskBitmap::dump(StringBuilder& builder) const
|
||||
{
|
||||
builder.appendff("ApplyMaskBitmap");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue