diff options
author | crupest <crupest@outlook.com> | 2019-04-10 19:42:46 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2019-04-10 19:42:46 +0800 |
commit | 7351020a582d70a1495249fba87d342c8a1fb634 (patch) | |
tree | e80f225041dc3816b3dce21c7e15aadbb211602e /src/win/graph/win_brush.cpp | |
parent | a94a806f69586e08a30fff0cdb3e52b0ce7acfa5 (diff) | |
download | cru-7351020a582d70a1495249fba87d342c8a1fb634.tar.gz cru-7351020a582d70a1495249fba87d342c8a1fb634.tar.bz2 cru-7351020a582d70a1495249fba87d342c8a1fb634.zip |
Refactor.
Diffstat (limited to 'src/win/graph/win_brush.cpp')
-rw-r--r-- | src/win/graph/win_brush.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
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 <cassert> + +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 |