diff options
author | crupest <crupest@outlook.com> | 2019-12-16 00:09:52 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2019-12-16 00:09:52 +0800 |
commit | 6ad6638adf64d958cdae44ce1df6a8a3787fed84 (patch) | |
tree | 030af9ca6e19bebc6250a8d278e46af7065fcd2f /src/win/native/window_d2d_painter.cpp | |
parent | 221c62de313ad811ca2b3ae8ba43996c96c347bc (diff) | |
download | cru-6ad6638adf64d958cdae44ce1df6a8a3787fed84.tar.gz cru-6ad6638adf64d958cdae44ce1df6a8a3787fed84.tar.bz2 cru-6ad6638adf64d958cdae44ce1df6a8a3787fed84.zip |
...
Diffstat (limited to 'src/win/native/window_d2d_painter.cpp')
-rw-r--r-- | src/win/native/window_d2d_painter.cpp | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/src/win/native/window_d2d_painter.cpp b/src/win/native/window_d2d_painter.cpp index ab74a964..023559f4 100644 --- a/src/win/native/window_d2d_painter.cpp +++ b/src/win/native/window_d2d_painter.cpp @@ -9,25 +9,16 @@ namespace cru::platform::native::win { using namespace cru::platform::graph::win::direct; -WindowD2DPainter::WindowD2DPainter(WinNativeWindow* window) - : D2DPainter(window->GetWindowRenderTarget() - ->GetDirectFactory() - ->GetD2D1DeviceContext()), - window_(window) { - window->GetWindowRenderTarget()->SetAsTarget(); - window->GetWindowRenderTarget() - ->GetDirectFactory() - ->GetD2D1DeviceContext() - ->BeginDraw(); +WindowD2DPainter::WindowD2DPainter(WindowRenderTarget* render_target) + : D2DPainter(render_target->GetD2D1DeviceContext()), + render_target_(render_target) { + render_target_->GetD2D1DeviceContext()->BeginDraw(); } WindowD2DPainter::~WindowD2DPainter() { EndDraw(); } void WindowD2DPainter::DoEndDraw() { - ThrowIfFailed(window_->GetWindowRenderTarget() - ->GetDirectFactory() - ->GetD2D1DeviceContext() - ->EndDraw()); - window_->GetWindowRenderTarget()->Present(); + ThrowIfFailed(render_target_->GetD2D1DeviceContext()->EndDraw()); + render_target_->Present(); } } // namespace cru::platform::native::win |