mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 19:59:17 +00:00
LibWeb/Canvas: Support globalCompositionOperation
Canvas now supports compositing and various blending modes via the `globalCompositeOperation` attribute.
This commit is contained in:
parent
19ab213b16
commit
8575bddfe6
Notes:
github-actions[bot]
2025-02-05 11:28:07 +00:00
Author: https://github.com/skyz1
Commit: 8575bddfe6
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3267
Reviewed-by: https://github.com/AtkinsSJ ✅
Reviewed-by: https://github.com/konradekk
16 changed files with 283 additions and 32 deletions
|
@ -18,6 +18,9 @@ public:
|
|||
virtual float global_alpha() const = 0;
|
||||
virtual void set_global_alpha(float) = 0;
|
||||
|
||||
virtual String global_composite_operation() const = 0;
|
||||
virtual void set_global_composite_operation(String) = 0;
|
||||
|
||||
protected:
|
||||
CanvasCompositing() = default;
|
||||
};
|
||||
|
|
|
@ -2,5 +2,5 @@
|
|||
interface mixin CanvasCompositing {
|
||||
// compositing
|
||||
attribute unrestricted double globalAlpha; // (default 1.0)
|
||||
[FIXME] attribute DOMString globalCompositeOperation; // (default "source-over")
|
||||
attribute DOMString globalCompositeOperation; // (default "source-over")
|
||||
};
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#include <AK/Vector.h>
|
||||
#include <LibGfx/AffineTransform.h>
|
||||
#include <LibGfx/Color.h>
|
||||
#include <LibGfx/CompositingAndBlendingOperator.h>
|
||||
#include <LibGfx/Filter.h>
|
||||
#include <LibGfx/Font/Font.h>
|
||||
#include <LibGfx/PaintStyle.h>
|
||||
|
@ -96,6 +97,7 @@ public:
|
|||
bool image_smoothing_enabled { true };
|
||||
Bindings::ImageSmoothingQuality image_smoothing_quality { Bindings::ImageSmoothingQuality::Low };
|
||||
float global_alpha = { 1 };
|
||||
Gfx::CompositingAndBlendingOperator current_compositing_and_blending_operator = Gfx::CompositingAndBlendingOperator::SourceOver;
|
||||
RefPtr<CSS::CSSStyleValue> font_style_value { nullptr };
|
||||
RefPtr<Gfx::Font const> current_font { nullptr };
|
||||
Bindings::CanvasTextAlign text_align { Bindings::CanvasTextAlign::Start };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue