2024-06-10 14:22:04 +03:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2024, Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2024-09-19 22:34:53 +02:00
|
|
|
#include <LibGfx/SkiaBackendContext.h>
|
2025-07-10 19:24:30 +02:00
|
|
|
#include <LibWeb/Painting/Command.h>
|
|
|
|
|
#include <LibWeb/Painting/DisplayList.h>
|
2024-06-23 18:40:10 +02:00
|
|
|
#include <LibWeb/Painting/DisplayListRecorder.h>
|
2024-06-10 14:22:04 +03:00
|
|
|
|
2024-09-19 22:34:53 +02:00
|
|
|
class GrDirectContext;
|
2024-07-03 19:23:27 +02:00
|
|
|
|
2024-06-10 14:22:04 +03:00
|
|
|
namespace Web::Painting {
|
|
|
|
|
|
2025-01-29 10:24:57 +01:00
|
|
|
class DisplayListPlayerSkia final : public DisplayListPlayer {
|
2024-06-10 14:22:04 +03:00
|
|
|
public:
|
2025-01-29 10:24:57 +01:00
|
|
|
DisplayListPlayerSkia(RefPtr<Gfx::SkiaBackendContext>);
|
|
|
|
|
DisplayListPlayerSkia();
|
2025-07-09 04:12:39 +02:00
|
|
|
~DisplayListPlayerSkia();
|
2024-07-24 16:48:32 +03:00
|
|
|
|
|
|
|
|
private:
|
2025-01-29 10:24:57 +01:00
|
|
|
void flush() override;
|
2024-07-24 13:55:15 +03:00
|
|
|
void draw_glyph_run(DrawGlyphRun const&) override;
|
|
|
|
|
void fill_rect(FillRect const&) override;
|
2024-09-25 15:44:58 +02:00
|
|
|
void draw_painting_surface(DrawPaintingSurface const&) override;
|
2024-07-24 13:55:15 +03:00
|
|
|
void draw_scaled_immutable_bitmap(DrawScaledImmutableBitmap const&) override;
|
|
|
|
|
void draw_repeated_immutable_bitmap(DrawRepeatedImmutableBitmap const&) override;
|
|
|
|
|
void add_clip_rect(AddClipRect const&) override;
|
|
|
|
|
void save(Save const&) override;
|
2025-03-29 23:12:11 +01:00
|
|
|
void save_layer(SaveLayer const&) override;
|
2024-07-24 13:55:15 +03:00
|
|
|
void restore(Restore const&) override;
|
2024-10-11 15:01:16 +02:00
|
|
|
void translate(Translate const&) override;
|
2024-07-24 13:55:15 +03:00
|
|
|
void push_stacking_context(PushStackingContext const&) override;
|
|
|
|
|
void pop_stacking_context(PopStackingContext const&) override;
|
|
|
|
|
void paint_linear_gradient(PaintLinearGradient const&) override;
|
|
|
|
|
void paint_outer_box_shadow(PaintOuterBoxShadow const&) override;
|
|
|
|
|
void paint_inner_box_shadow(PaintInnerBoxShadow const&) override;
|
|
|
|
|
void paint_text_shadow(PaintTextShadow const&) override;
|
|
|
|
|
void fill_rect_with_rounded_corners(FillRectWithRoundedCorners const&) override;
|
|
|
|
|
void fill_path_using_color(FillPathUsingColor const&) override;
|
|
|
|
|
void fill_path_using_paint_style(FillPathUsingPaintStyle const&) override;
|
|
|
|
|
void stroke_path_using_color(StrokePathUsingColor const&) override;
|
|
|
|
|
void stroke_path_using_paint_style(StrokePathUsingPaintStyle const&) override;
|
|
|
|
|
void draw_ellipse(DrawEllipse const&) override;
|
|
|
|
|
void fill_ellipse(FillEllipse const&) override;
|
|
|
|
|
void draw_line(DrawLine const&) override;
|
|
|
|
|
void apply_backdrop_filter(ApplyBackdropFilter const&) override;
|
|
|
|
|
void draw_rect(DrawRect const&) override;
|
|
|
|
|
void paint_radial_gradient(PaintRadialGradient const&) override;
|
|
|
|
|
void paint_conic_gradient(PaintConicGradient const&) override;
|
|
|
|
|
void draw_triangle_wave(DrawTriangleWave const&) override;
|
2024-07-29 14:13:34 +03:00
|
|
|
void add_rounded_rect_clip(AddRoundedRectClip const&) override;
|
2024-08-06 15:26:47 +03:00
|
|
|
void add_mask(AddMask const&) override;
|
2024-08-17 18:56:56 +02:00
|
|
|
void paint_scrollbar(PaintScrollBar const&) override;
|
2024-08-08 14:17:54 +03:00
|
|
|
void paint_nested_display_list(PaintNestedDisplayList const&) override;
|
2024-10-09 02:57:57 +02:00
|
|
|
void apply_opacity(ApplyOpacity const&) override;
|
2025-01-22 09:50:49 +01:00
|
|
|
void apply_composite_and_blending_operator(ApplyCompositeAndBlendingOperator const&) override;
|
2025-05-11 12:44:54 +02:00
|
|
|
void apply_filters(ApplyFilter const&) override;
|
2024-10-09 02:57:57 +02:00
|
|
|
void apply_transform(ApplyTransform const&) override;
|
|
|
|
|
void apply_mask_bitmap(ApplyMaskBitmap const&) override;
|
2024-06-10 14:22:04 +03:00
|
|
|
|
|
|
|
|
bool would_be_fully_clipped_by_painter(Gfx::IntRect) const override;
|
|
|
|
|
|
2025-01-29 10:24:57 +01:00
|
|
|
RefPtr<Gfx::SkiaBackendContext> m_context;
|
2025-07-09 04:12:39 +02:00
|
|
|
|
|
|
|
|
struct CachedRuntimeEffects;
|
|
|
|
|
OwnPtr<CachedRuntimeEffects> m_cached_runtime_effects;
|
|
|
|
|
CachedRuntimeEffects& cached_runtime_effects();
|
2024-06-10 14:22:04 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|