From 7351020a582d70a1495249fba87d342c8a1fb634 Mon Sep 17 00:00:00 2001 From: crupest Date: Wed, 10 Apr 2019 19:42:46 +0800 Subject: Refactor. --- src/win/graph/win_brush.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/win/graph/win_brush.cpp (limited to 'src/win/graph/win_brush.cpp') diff --git a/src/win/graph/win_brush.cpp b/src/win/graph/win_brush.cpp new file mode 100644 index 00000000..262c3302 --- /dev/null +++ b/src/win/graph/win_brush.cpp @@ -0,0 +1,23 @@ +#include "cru/win/graph/win_brush.hpp" + +#include "cru/win/exception.hpp" +#include "cru/win/graph/d2d_util.hpp" +#include "cru/win/graph/graph_manager.hpp" + +#include + +namespace cru::win::graph { +WinSolidColorBrush::WinSolidColorBrush(GraphManager* graph_manager, + const ui::Color& color) { + assert(graph_manager); + ThrowIfFailed(graph_manager->GetD2D1DeviceContext()->CreateSolidColorBrush( + util::Convert(color), &brush_)); +} + +ui::Color WinSolidColorBrush::GetColor() { + return util::Convert(brush_->GetColor()); +} +void WinSolidColorBrush::SetColor(const ui::Color& color) { + brush_->SetColor(util::Convert(color)); +} +} // namespace cru::win::graph -- cgit v1.2.3