From 7351020a582d70a1495249fba87d342c8a1fb634 Mon Sep 17 00:00:00 2001 From: crupest Date: Wed, 10 Apr 2019 19:42:46 +0800 Subject: Refactor. --- include/cru/platform/graph/painter.hpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 include/cru/platform/graph/painter.hpp (limited to 'include/cru/platform/graph/painter.hpp') diff --git a/include/cru/platform/graph/painter.hpp b/include/cru/platform/graph/painter.hpp new file mode 100644 index 00000000..199ebbad --- /dev/null +++ b/include/cru/platform/graph/painter.hpp @@ -0,0 +1,26 @@ +#pragma once +#include "cru/common/base.hpp" + +#include "cru/common/ui_base.hpp" +#include "../matrix.hpp" + +namespace cru::platform::graph { +struct Brush; +struct Geometry; +struct TextLayout; + +struct Painter : virtual Interface { + virtual Matrix GetTransform() = 0; + virtual void SetTransform(const Matrix& matrix) = 0; + virtual void Clear(const ui::Color& color) = 0; + virtual void StrokeRectangle(const ui::Rect& rectangle, Brush* brush, + float width) = 0; + virtual void FillRectangle(const ui::Rect& rectangle, Brush* brush) = 0; + virtual void StrokeGeometry(Geometry* geometry, Brush* brush, + float width) = 0; + virtual void FillGeometry(Geometry* geometry, Brush* brush) = 0; + virtual void DrawText(const ui::Point& offset, TextLayout* text_layout, Brush* brush) = 0; + virtual void EndDraw() = 0; + virtual bool IsDisposed() = 0; +}; +} // namespace cru::platform -- cgit v1.2.3