aboutsummaryrefslogtreecommitdiff
path: root/include/cru/win/graphics/direct/Painter.hpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2022-02-08 16:53:51 +0800
committercrupest <crupest@outlook.com>2022-02-08 16:53:51 +0800
commit74bb9cd27242b9320f99ff4d2b50c3051576cc14 (patch)
tree744bac5799c593d1d6f81e7b09581bea626f2cde /include/cru/win/graphics/direct/Painter.hpp
parentb90c398de829d1ba5329651d75bae82f5e4085fe (diff)
downloadcru-74bb9cd27242b9320f99ff4d2b50c3051576cc14.tar.gz
cru-74bb9cd27242b9320f99ff4d2b50c3051576cc14.tar.bz2
cru-74bb9cd27242b9320f99ff4d2b50c3051576cc14.zip
...
Diffstat (limited to 'include/cru/win/graphics/direct/Painter.hpp')
-rw-r--r--include/cru/win/graphics/direct/Painter.hpp75
1 files changed, 0 insertions, 75 deletions
diff --git a/include/cru/win/graphics/direct/Painter.hpp b/include/cru/win/graphics/direct/Painter.hpp
deleted file mode 100644
index 57a59357..00000000
--- a/include/cru/win/graphics/direct/Painter.hpp
+++ /dev/null
@@ -1,75 +0,0 @@
-#pragma once
-#include "ComResource.hpp"
-#include "Resource.hpp"
-
-#include "cru/platform/graphics/Painter.hpp"
-
-#include <vector>
-
-namespace cru::platform::graphics::win::direct {
-class CRU_WIN_GRAPHICS_DIRECT_API D2DDeviceContextPainter
- : public DirectResource,
- public virtual IPainter,
- public virtual IComResource<ID2D1DeviceContext1> {
- public:
- explicit D2DDeviceContextPainter(ID2D1DeviceContext1* device_context);
-
- CRU_DELETE_COPY(D2DDeviceContextPainter)
- CRU_DELETE_MOVE(D2DDeviceContextPainter)
-
- ~D2DDeviceContextPainter() override = default;
-
- public:
- ID2D1DeviceContext1* GetComInterface() const override {
- return device_context_;
- }
-
- public:
- Matrix GetTransform() override;
- void SetTransform(const platform::Matrix& matrix) override;
- void ConcatTransform(const Matrix& matrix) override;
-
- void Clear(const Color& color) override;
-
- void DrawLine(const Point& start, const Point& end, IBrush* brush,
- float width) override;
- void StrokeRectangle(const Rect& rectangle, IBrush* brush,
- float width) override;
- void FillRectangle(const Rect& rectangle, IBrush* brush) override;
- void StrokeEllipse(const Rect& outline_rect, IBrush* brush,
- float width) override;
- void FillEllipse(const Rect& outline_rect, IBrush* brush) override;
-
- void StrokeGeometry(IGeometry* geometry, IBrush* brush, float width) override;
- void FillGeometry(IGeometry* geometry, IBrush* brush) override;
-
- void DrawText(const Point& offset, ITextLayout* text_layout,
- IBrush* brush) override;
-
- void DrawImage(const Point& offset, IImage* image) override;
-
- void PushLayer(const Rect& bounds) override;
- void PopLayer() override;
-
- void PushState() override;
- void PopState() override;
-
- void EndDraw() override final;
-
- protected:
- virtual void DoEndDraw() = 0;
-
- private:
- bool IsValid() { return is_drawing_; }
- void CheckValidation();
-
- private:
- ID2D1DeviceContext1* device_context_;
-
- std::vector<Microsoft::WRL::ComPtr<ID2D1Layer>> layers_;
- std::vector<Microsoft::WRL::ComPtr<ID2D1DrawingStateBlock>>
- drawing_state_stack_;
-
- bool is_drawing_ = true;
-};
-} // namespace cru::platform::graphics::win::direct