diff options
author | crupest <crupest@outlook.com> | 2019-12-12 19:53:17 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2019-12-12 19:53:17 +0800 |
commit | e69911a8b161b81ce3f7b209175766da2b7b3d4b (patch) | |
tree | 76b1f4b6f9f5ad6111578771be783ee456aeb912 /include/cru/platform/graph/painter.hpp | |
parent | 154b5b838edfdcef93cd0a33c013ad7f5f9d7337 (diff) | |
download | cru-e69911a8b161b81ce3f7b209175766da2b7b3d4b.tar.gz cru-e69911a8b161b81ce3f7b209175766da2b7b3d4b.tar.bz2 cru-e69911a8b161b81ce3f7b209175766da2b7b3d4b.zip |
...
Diffstat (limited to 'include/cru/platform/graph/painter.hpp')
-rw-r--r-- | include/cru/platform/graph/painter.hpp | 37 |
1 files changed, 11 insertions, 26 deletions
diff --git a/include/cru/platform/graph/painter.hpp b/include/cru/platform/graph/painter.hpp index 97d4b4cf..3ae9cf1c 100644 --- a/include/cru/platform/graph/painter.hpp +++ b/include/cru/platform/graph/painter.hpp @@ -1,42 +1,27 @@ #pragma once -#include "../graphic_base.hpp" -#include "../matrix.hpp" -#include "../native_resource.hpp" +#include "base.hpp" namespace cru::platform::graph { -class Brush; -class Geometry; -class TextLayout; +struct IBrush; +struct IGeometry; +struct ITextLayout; -class Painter : public NativeResource { - protected: - Painter() = default; - - public: - Painter(const Painter& other) = delete; - Painter& operator=(const Painter& other) = delete; - - Painter(Painter&& other) = delete; - Painter& operator=(Painter&& other) = delete; - - ~Painter() override = default; - - public: +struct IPainter : virtual INativeResource { virtual Matrix GetTransform() = 0; virtual void SetTransform(const Matrix& matrix) = 0; virtual void Clear(const Color& color) = 0; - virtual void StrokeRectangle(const Rect& rectangle, Brush* brush, + virtual void StrokeRectangle(const Rect& rectangle, IBrush* brush, float width) = 0; - virtual void FillRectangle(const Rect& rectangle, Brush* brush) = 0; + virtual void FillRectangle(const Rect& rectangle, IBrush* brush) = 0; - virtual void StrokeGeometry(Geometry* geometry, Brush* brush, + virtual void StrokeGeometry(IGeometry* geometry, IBrush* brush, float width) = 0; - virtual void FillGeometry(Geometry* geometry, Brush* brush) = 0; + virtual void FillGeometry(IGeometry* geometry, IBrush* brush) = 0; - virtual void DrawText(const Point& offset, TextLayout* text_layout, - Brush* brush) = 0; + virtual void DrawText(const Point& offset, ITextLayout* text_layout, + IBrush* brush) = 0; virtual void EndDraw() = 0; }; |