aboutsummaryrefslogtreecommitdiff
path: root/include/cru/platform/graphics/NullPainter.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/cru/platform/graphics/NullPainter.h')
-rw-r--r--include/cru/platform/graphics/NullPainter.h84
1 files changed, 84 insertions, 0 deletions
diff --git a/include/cru/platform/graphics/NullPainter.h b/include/cru/platform/graphics/NullPainter.h
new file mode 100644
index 00000000..2c6e6cb1
--- /dev/null
+++ b/include/cru/platform/graphics/NullPainter.h
@@ -0,0 +1,84 @@
+#pragma once
+#include "Painter.h"
+#include "cru/common/Base.h"
+
+namespace cru::platform::graphics {
+class CRU_PLATFORM_GRAPHICS_API NullPainter : public Object,
+ public virtual IPainter {
+ public:
+ NullPainter() = default;
+
+ CRU_DELETE_COPY(NullPainter)
+ CRU_DELETE_MOVE(NullPainter)
+
+ ~NullPainter() override = default;
+
+ public:
+ String GetPlatformId() const override { return u"NULL"; }
+
+ String GetDebugString() override { return u"NullPainter"; }
+
+ Matrix GetTransform() override { return Matrix(); }
+ void SetTransform(const Matrix& matrix) override { CRU_UNUSED(matrix) }
+
+ void ConcatTransform(const Matrix& matrix) override { CRU_UNUSED(matrix) }
+
+ void Clear(const Color& color) override { CRU_UNUSED(color) }
+
+ void DrawLine(const Point& start, const Point& end, IBrush* brush,
+ float width) override {
+ CRU_UNUSED(start) CRU_UNUSED(end) CRU_UNUSED(brush) CRU_UNUSED(width)
+ }
+ void StrokeRectangle(const Rect& rectangle, IBrush* brush,
+ float width) override {
+ CRU_UNUSED(rectangle) CRU_UNUSED(brush) CRU_UNUSED(width)
+ }
+ void FillRectangle(const Rect& rectangle, IBrush* brush) override {
+ CRU_UNUSED(rectangle)
+ CRU_UNUSED(brush)
+ }
+ void StrokeEllipse(const Rect& outline_rect, IBrush* brush,
+ float width) override {
+ CRU_UNUSED(outline_rect)
+ CRU_UNUSED(brush)
+ CRU_UNUSED(width)
+ }
+ void FillEllipse(const Rect& outline_rect, IBrush* brush) override {
+ CRU_UNUSED(outline_rect)
+ CRU_UNUSED(brush)
+ }
+
+ void StrokeGeometry(IGeometry* geometry, IBrush* brush,
+ float width) override {
+ CRU_UNUSED(geometry)
+ CRU_UNUSED(brush)
+ CRU_UNUSED(width)
+ }
+ void FillGeometry(IGeometry* geometry, IBrush* brush) override {
+ CRU_UNUSED(geometry)
+ CRU_UNUSED(brush)
+ }
+
+ void DrawText(const Point& offset, ITextLayout* text_layout,
+ IBrush* brush) override {
+ CRU_UNUSED(offset)
+ CRU_UNUSED(text_layout)
+ CRU_UNUSED(brush)
+ }
+
+ void DrawImage(const Point& offset, IImage* image) override {
+ CRU_UNUSED(offset)
+ CRU_UNUSED(image)
+ }
+
+ void PushLayer(const Rect& bounds) override { CRU_UNUSED(bounds) }
+
+ void PopLayer() override {}
+
+ void PushState() override {}
+
+ void PopState() override {}
+
+ void EndDraw() override {}
+};
+} // namespace cru::platform::graphics