mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 21:17:45 +00:00
LibWeb: Extract CanvasRect class from CRC2D
This one requires drawing to the canvas, so it doesn't make so much sense to move the implementation over.
This commit is contained in:
parent
aa3cb8b425
commit
c0494988ed
4 changed files with 38 additions and 8 deletions
|
@ -18,6 +18,7 @@
|
|||
#include <LibWeb/DOM/ExceptionOr.h>
|
||||
#include <LibWeb/HTML/Canvas/CanvasFillStrokeStyles.h>
|
||||
#include <LibWeb/HTML/Canvas/CanvasPath.h>
|
||||
#include <LibWeb/HTML/Canvas/CanvasRect.h>
|
||||
#include <LibWeb/HTML/Canvas/CanvasState.h>
|
||||
#include <LibWeb/HTML/Canvas/CanvasTransform.h>
|
||||
#include <LibWeb/HTML/CanvasGradient.h>
|
||||
|
@ -36,7 +37,8 @@ class CanvasRenderingContext2D
|
|||
, public CanvasPath
|
||||
, public CanvasState
|
||||
, public CanvasTransform<CanvasRenderingContext2D>
|
||||
, public CanvasFillStrokeStyles<CanvasRenderingContext2D> {
|
||||
, public CanvasFillStrokeStyles<CanvasRenderingContext2D>
|
||||
, public CanvasRect {
|
||||
|
||||
AK_MAKE_NONCOPYABLE(CanvasRenderingContext2D);
|
||||
AK_MAKE_NONMOVABLE(CanvasRenderingContext2D);
|
||||
|
@ -47,9 +49,9 @@ public:
|
|||
static NonnullRefPtr<CanvasRenderingContext2D> create(HTMLCanvasElement& element) { return adopt_ref(*new CanvasRenderingContext2D(element)); }
|
||||
~CanvasRenderingContext2D();
|
||||
|
||||
void fill_rect(float x, float y, float width, float height);
|
||||
void stroke_rect(float x, float y, float width, float height);
|
||||
void clear_rect(float x, float y, float width, float height);
|
||||
virtual void fill_rect(float x, float y, float width, float height) override;
|
||||
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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue