aboutsummaryrefslogtreecommitdiff
path: root/include/cru/platform/graph/painter.hpp
blob: 97d4b4cf773fcb2df410da9993d3598057b72825 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#pragma once
#include "../graphic_base.hpp"
#include "../matrix.hpp"
#include "../native_resource.hpp"

namespace cru::platform::graph {
class Brush;
class Geometry;
class TextLayout;

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:
  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,
                               float width) = 0;
  virtual void FillRectangle(const 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 Point& offset, TextLayout* text_layout,
                        Brush* brush) = 0;

  virtual void EndDraw() = 0;
};
}  // namespace cru::platform::graph