mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 05:07:34 +00:00
LibWeb: Extract CanvasDrawImage class from CRC2D
This commit is contained in:
parent
7cf42ede68
commit
270c60c5e8
7 changed files with 105 additions and 47 deletions
|
@ -16,6 +16,7 @@
|
|||
#include <LibGfx/Path.h>
|
||||
#include <LibWeb/Bindings/Wrappable.h>
|
||||
#include <LibWeb/DOM/ExceptionOr.h>
|
||||
#include <LibWeb/HTML/Canvas/CanvasDrawImage.h>
|
||||
#include <LibWeb/HTML/Canvas/CanvasDrawPath.h>
|
||||
#include <LibWeb/HTML/Canvas/CanvasFillStrokeStyles.h>
|
||||
#include <LibWeb/HTML/Canvas/CanvasPath.h>
|
||||
|
@ -42,7 +43,8 @@ class CanvasRenderingContext2D
|
|||
, public CanvasFillStrokeStyles<CanvasRenderingContext2D>
|
||||
, public CanvasRect
|
||||
, public CanvasDrawPath
|
||||
, public CanvasText {
|
||||
, public CanvasText
|
||||
, public CanvasDrawImage {
|
||||
|
||||
AK_MAKE_NONCOPYABLE(CanvasRenderingContext2D);
|
||||
AK_MAKE_NONMOVABLE(CanvasRenderingContext2D);
|
||||
|
@ -57,9 +59,7 @@ public:
|
|||
virtual void stroke_rect(float x, float y, float width, float height) override;
|
||||
virtual void clear_rect(float x, float y, float width, float height) override;
|
||||
|
||||
DOM::ExceptionOr<void> draw_image(CanvasImageSource const&, float destination_x, float destination_y);
|
||||
DOM::ExceptionOr<void> draw_image(CanvasImageSource const&, float destination_x, float destination_y, float destination_width, float destination_height);
|
||||
DOM::ExceptionOr<void> draw_image(CanvasImageSource const&, float source_x, float source_y, float source_width, float source_height, float destination_x, float destination_y, float destination_width, float destination_height);
|
||||
virtual DOM::ExceptionOr<void> draw_image_internal(CanvasImageSource const&, float source_x, float source_y, float source_width, float source_height, float destination_x, float destination_y, float destination_width, float destination_height) override;
|
||||
|
||||
void set_line_width(float line_width) { drawing_state().line_width = line_width; }
|
||||
float line_width() const { return drawing_state().line_width; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue