diff options
author | crupest <crupest@outlook.com> | 2019-06-27 17:02:58 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2019-06-27 17:02:58 +0800 |
commit | b53527fbe50a953ad0e3225cc812eb76b8a1f82d (patch) | |
tree | eb81cd14d0a165c47f841ad94835f8987109de7e /include/cru/platform/graph | |
parent | 8c5b05bcfce96495b4ffc4209ab8feda12597729 (diff) | |
download | cru-b53527fbe50a953ad0e3225cc812eb76b8a1f82d.tar.gz cru-b53527fbe50a953ad0e3225cc812eb76b8a1f82d.tar.bz2 cru-b53527fbe50a953ad0e3225cc812eb76b8a1f82d.zip |
...
Diffstat (limited to 'include/cru/platform/graph')
-rw-r--r-- | include/cru/platform/graph/graph_factory.hpp | 3 | ||||
-rw-r--r-- | include/cru/platform/graph/util/painter_util.hpp | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/include/cru/platform/graph/graph_factory.hpp b/include/cru/platform/graph/graph_factory.hpp index 69afc7b3..0b1034cc 100644 --- a/include/cru/platform/graph/graph_factory.hpp +++ b/include/cru/platform/graph/graph_factory.hpp @@ -55,5 +55,8 @@ class GraphFactory : public NativeResource { virtual TextLayout* CreateTextLayout(std::shared_ptr<Font> font, std::wstring text) = 0; + + virtual bool IsAutoDelete() const = 0; + virtual void SetAutoDelete(bool value) = 0; }; } // namespace cru::platform::graph diff --git a/include/cru/platform/graph/util/painter_util.hpp b/include/cru/platform/graph/util/painter_util.hpp index 71e125c3..7a655a34 100644 --- a/include/cru/platform/graph/util/painter_util.hpp +++ b/include/cru/platform/graph/util/painter_util.hpp @@ -6,9 +6,9 @@ namespace cru::platform::graph::util { template <typename Fn> -inline void WithTransform(IPainter* painter, const Matrix& matrix, +inline void WithTransform(Painter* painter, const Matrix& matrix, const Fn& action) { - static_assert(std::is_invocable_v<decltype(action), IPainter*>, + static_assert(std::is_invocable_v<decltype(action), Painter*>, "Action must can be be invoked with painter."); const auto old = painter->GetTransform(); painter->SetTransform(old * matrix); |