mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-01 15:18:06 +00:00
LibWeb: Store LibGfx objects in RefPtr to const for draw commands
This commit is contained in:
parent
5d2f4ce5e6
commit
4d828378d8
3 changed files with 8 additions and 8 deletions
|
@ -39,7 +39,7 @@ namespace Web::Painting {
|
||||||
class DisplayList;
|
class DisplayList;
|
||||||
|
|
||||||
struct DrawGlyphRun {
|
struct DrawGlyphRun {
|
||||||
NonnullRefPtr<Gfx::GlyphRun> glyph_run;
|
NonnullRefPtr<Gfx::GlyphRun const> glyph_run;
|
||||||
double scale { 1 };
|
double scale { 1 };
|
||||||
Gfx::IntRect rect;
|
Gfx::IntRect rect;
|
||||||
Gfx::FloatPoint translation;
|
Gfx::FloatPoint translation;
|
||||||
|
@ -61,7 +61,7 @@ struct FillRect {
|
||||||
|
|
||||||
struct DrawPaintingSurface {
|
struct DrawPaintingSurface {
|
||||||
Gfx::IntRect dst_rect;
|
Gfx::IntRect dst_rect;
|
||||||
NonnullRefPtr<Gfx::PaintingSurface> surface;
|
NonnullRefPtr<Gfx::PaintingSurface const> surface;
|
||||||
Gfx::IntRect src_rect;
|
Gfx::IntRect src_rect;
|
||||||
Gfx::ScalingMode scaling_mode;
|
Gfx::ScalingMode scaling_mode;
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ struct DrawPaintingSurface {
|
||||||
struct DrawScaledImmutableBitmap {
|
struct DrawScaledImmutableBitmap {
|
||||||
Gfx::IntRect dst_rect;
|
Gfx::IntRect dst_rect;
|
||||||
Gfx::IntRect clip_rect;
|
Gfx::IntRect clip_rect;
|
||||||
NonnullRefPtr<Gfx::ImmutableBitmap> bitmap;
|
NonnullRefPtr<Gfx::ImmutableBitmap const> bitmap;
|
||||||
Gfx::ScalingMode scaling_mode;
|
Gfx::ScalingMode scaling_mode;
|
||||||
|
|
||||||
[[nodiscard]] Gfx::IntRect bounding_rect() const { return clip_rect; }
|
[[nodiscard]] Gfx::IntRect bounding_rect() const { return clip_rect; }
|
||||||
|
@ -91,7 +91,7 @@ struct DrawRepeatedImmutableBitmap {
|
||||||
|
|
||||||
Gfx::IntRect dst_rect;
|
Gfx::IntRect dst_rect;
|
||||||
Gfx::IntRect clip_rect;
|
Gfx::IntRect clip_rect;
|
||||||
NonnullRefPtr<Gfx::ImmutableBitmap> bitmap;
|
NonnullRefPtr<Gfx::ImmutableBitmap const> bitmap;
|
||||||
Gfx::ScalingMode scaling_mode;
|
Gfx::ScalingMode scaling_mode;
|
||||||
Repeat repeat;
|
Repeat repeat;
|
||||||
|
|
||||||
|
@ -170,7 +170,7 @@ struct PaintInnerBoxShadow {
|
||||||
};
|
};
|
||||||
|
|
||||||
struct PaintTextShadow {
|
struct PaintTextShadow {
|
||||||
NonnullRefPtr<Gfx::GlyphRun> glyph_run;
|
NonnullRefPtr<Gfx::GlyphRun const> glyph_run;
|
||||||
double glyph_run_scale { 1 };
|
double glyph_run_scale { 1 };
|
||||||
Gfx::IntRect shadow_bounding_rect;
|
Gfx::IntRect shadow_bounding_rect;
|
||||||
Gfx::IntRect text_rect;
|
Gfx::IntRect text_rect;
|
||||||
|
@ -438,7 +438,7 @@ struct ApplyTransform {
|
||||||
|
|
||||||
struct ApplyMaskBitmap {
|
struct ApplyMaskBitmap {
|
||||||
Gfx::IntPoint origin;
|
Gfx::IntPoint origin;
|
||||||
NonnullRefPtr<Gfx::ImmutableBitmap> bitmap;
|
NonnullRefPtr<Gfx::ImmutableBitmap const> bitmap;
|
||||||
Gfx::Bitmap::MaskKind kind;
|
Gfx::Bitmap::MaskKind kind;
|
||||||
|
|
||||||
void translate_by(Gfx::IntPoint const& offset)
|
void translate_by(Gfx::IntPoint const& offset)
|
||||||
|
|
|
@ -206,7 +206,7 @@ void DisplayListRecorder::draw_scaled_immutable_bitmap(Gfx::IntRect const& dst_r
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void DisplayListRecorder::draw_repeated_immutable_bitmap(Gfx::IntRect dst_rect, Gfx::IntRect clip_rect, NonnullRefPtr<Gfx::ImmutableBitmap> bitmap, Gfx::ScalingMode scaling_mode, DrawRepeatedImmutableBitmap::Repeat repeat)
|
void DisplayListRecorder::draw_repeated_immutable_bitmap(Gfx::IntRect dst_rect, Gfx::IntRect clip_rect, NonnullRefPtr<Gfx::ImmutableBitmap const> bitmap, Gfx::ScalingMode scaling_mode, DrawRepeatedImmutableBitmap::Repeat repeat)
|
||||||
{
|
{
|
||||||
append(DrawRepeatedImmutableBitmap {
|
append(DrawRepeatedImmutableBitmap {
|
||||||
.dst_rect = dst_rect,
|
.dst_rect = dst_rect,
|
||||||
|
|
|
@ -97,7 +97,7 @@ public:
|
||||||
void draw_painting_surface(Gfx::IntRect const& dst_rect, NonnullRefPtr<Gfx::PaintingSurface>, Gfx::IntRect const& src_rect, Gfx::ScalingMode scaling_mode = Gfx::ScalingMode::NearestNeighbor);
|
void draw_painting_surface(Gfx::IntRect const& dst_rect, NonnullRefPtr<Gfx::PaintingSurface>, Gfx::IntRect const& src_rect, Gfx::ScalingMode scaling_mode = Gfx::ScalingMode::NearestNeighbor);
|
||||||
void draw_scaled_immutable_bitmap(Gfx::IntRect const& dst_rect, Gfx::IntRect const& clip_rect, Gfx::ImmutableBitmap const& bitmap, Gfx::ScalingMode scaling_mode = Gfx::ScalingMode::NearestNeighbor);
|
void draw_scaled_immutable_bitmap(Gfx::IntRect const& dst_rect, Gfx::IntRect const& clip_rect, Gfx::ImmutableBitmap const& bitmap, Gfx::ScalingMode scaling_mode = Gfx::ScalingMode::NearestNeighbor);
|
||||||
|
|
||||||
void draw_repeated_immutable_bitmap(Gfx::IntRect dst_rect, Gfx::IntRect clip_rect, NonnullRefPtr<Gfx::ImmutableBitmap> bitmap, Gfx::ScalingMode scaling_mode, DrawRepeatedImmutableBitmap::Repeat);
|
void draw_repeated_immutable_bitmap(Gfx::IntRect dst_rect, Gfx::IntRect clip_rect, NonnullRefPtr<Gfx::ImmutableBitmap const> bitmap, Gfx::ScalingMode scaling_mode, DrawRepeatedImmutableBitmap::Repeat);
|
||||||
|
|
||||||
void draw_line(Gfx::IntPoint from, Gfx::IntPoint to, Color color, int thickness = 1, Gfx::LineStyle style = Gfx::LineStyle::Solid, Color alternate_color = Color::Transparent);
|
void draw_line(Gfx::IntPoint from, Gfx::IntPoint to, Color color, int thickness = 1, Gfx::LineStyle style = Gfx::LineStyle::Solid, Color alternate_color = Color::Transparent);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue