aboutsummaryrefslogtreecommitdiff
path: root/src/win/graph/direct/brush.cpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2019-06-27 00:18:48 +0800
committercrupest <crupest@outlook.com>2019-06-27 00:18:48 +0800
commitbaa7cf141b8121473edceae16c1a20a6d47bd202 (patch)
tree9349633a9d0bc286fe29f480bd70e4c2ad1f3075 /src/win/graph/direct/brush.cpp
parentf404a3b2eb7bb9865d0c6f938538899996a53d8c (diff)
downloadcru-baa7cf141b8121473edceae16c1a20a6d47bd202.tar.gz
cru-baa7cf141b8121473edceae16c1a20a6d47bd202.tar.bz2
cru-baa7cf141b8121473edceae16c1a20a6d47bd202.zip
......
Diffstat (limited to 'src/win/graph/direct/brush.cpp')
-rw-r--r--src/win/graph/direct/brush.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/win/graph/direct/brush.cpp b/src/win/graph/direct/brush.cpp
new file mode 100644
index 00000000..7ddd14b4
--- /dev/null
+++ b/src/win/graph/direct/brush.cpp
@@ -0,0 +1,19 @@
+#include "cru/win/graph/direct/brush.hpp"
+
+#include "cru/win/graph/direct/convert_util.hpp"
+#include "cru/win/graph/direct/direct_factory.hpp"
+#include "cru/win/graph/direct/exception.hpp"
+
+#include <cassert>
+
+namespace cru::platform::graph::win::direct {
+D2DSolidColorBrush::D2DSolidColorBrush(IDirectFactory* factory) {
+ assert(factory);
+ ThrowIfFailed(factory->GetD2D1DeviceContext()->CreateSolidColorBrush(
+ Convert(color_), &brush_));
+}
+
+void D2DSolidColorBrush::OnSetColor(const Color& color) {
+ brush_->SetColor(Convert(color));
+}
+} // namespace cru::platform::graph::win::direct