mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 18:20:43 +09:00
LibWeb: Implement CRC2D.imageSmoothingEnabled
We now select between nearest neighbor and bilinear filtering when scaling images in CRC2D.drawImage(). This patch also adds CRC2D.imageSmoothingQuality but it's ignored for now as we don't have a bunch of different quality levels to map it to. Work towards #17993 (Ruffle Flash Player)
This commit is contained in:
parent
e4b71495f5
commit
e77552519e
Notes:
sideshowbarker
2024-07-17 04:09:56 +09:00
Author: https://github.com/awesomekling
Commit: e77552519e
Pull-request: https://github.com/SerenityOS/serenity/pull/18088
Reviewed-by: https://github.com/Lubrsi ✅
7 changed files with 75 additions and 2 deletions
|
@ -20,6 +20,7 @@
|
|||
#include <LibWeb/HTML/Canvas/CanvasDrawPath.h>
|
||||
#include <LibWeb/HTML/Canvas/CanvasFillStrokeStyles.h>
|
||||
#include <LibWeb/HTML/Canvas/CanvasImageData.h>
|
||||
#include <LibWeb/HTML/Canvas/CanvasImageSmoothing.h>
|
||||
#include <LibWeb/HTML/Canvas/CanvasPath.h>
|
||||
#include <LibWeb/HTML/Canvas/CanvasPathDrawingStyles.h>
|
||||
#include <LibWeb/HTML/Canvas/CanvasRect.h>
|
||||
|
@ -48,6 +49,7 @@ class CanvasRenderingContext2D
|
|||
, public CanvasText
|
||||
, public CanvasDrawImage
|
||||
, public CanvasImageData
|
||||
, public CanvasImageSmoothing
|
||||
, public CanvasPathDrawingStyles<CanvasRenderingContext2D> {
|
||||
|
||||
WEB_PLATFORM_OBJECT(CanvasRenderingContext2D, Bindings::PlatformObject);
|
||||
|
@ -84,6 +86,11 @@ public:
|
|||
|
||||
virtual void clip() override;
|
||||
|
||||
virtual bool image_smoothing_enabled() const override;
|
||||
virtual void set_image_smoothing_enabled(bool) override;
|
||||
virtual Bindings::ImageSmoothingQuality image_smoothing_quality() const override;
|
||||
virtual void set_image_smoothing_quality(Bindings::ImageSmoothingQuality) override;
|
||||
|
||||
private:
|
||||
explicit CanvasRenderingContext2D(JS::Realm&, HTMLCanvasElement&);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue