
This modification introduces a new layer to the painting process. The stacking context traversal no longer immediately calls the Gfx::Painter methods. Instead, it writes serialized painting commands into newly introduced RecordingPainter. Created list of commands is executed later to produce resulting bitmap. Producing painting command list will make it easier to add new optimizations: - It's simpler to check if the painting result is not visible in the viewport at the command level rather than during stacking context traversal. - Run painting in a separate thread. The painting thread can process serialized painting commands, while the main thread can work on the next paintable tree and safely invalidate the previous one. - As we consider GPU-accelerated painting support, it would be easier to back each painting command rather than constructing an alternative for the entire Gfx::Painter API.
27 lines
606 B
C++
27 lines
606 B
C++
/*
|
|
* Copyright (c) 2023, Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LibWeb/Painting/BordersData.h>
|
|
#include <LibWeb/Painting/ShadowData.h>
|
|
|
|
namespace Web::Painting {
|
|
|
|
struct PaintOuterBoxShadowParams {
|
|
RecordingPainter& painter;
|
|
CSSPixelRect content_rect;
|
|
BorderRadiiData border_radii;
|
|
ShadowData box_shadow_data;
|
|
CornerRadii corner_radii;
|
|
DevicePixels offset_x;
|
|
DevicePixels offset_y;
|
|
DevicePixels blur_radius;
|
|
DevicePixels spread_distance;
|
|
DevicePixelRect device_content_rect;
|
|
};
|
|
|
|
}
|