aboutsummaryrefslogtreecommitdiff
path: root/src/win/gui/Window.cpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-10-30 00:20:52 +0800
committercrupest <crupest@outlook.com>2020-10-30 00:20:52 +0800
commit9c9a9c988b5d03642f931341c97b672d054936c8 (patch)
treeb2f25a52b2572a5b692043ae1a746afa0650ac2c /src/win/gui/Window.cpp
parent6aa2201797a9ed64ce0178215ae941d0c5f09579 (diff)
downloadcru-9c9a9c988b5d03642f931341c97b672d054936c8.tar.gz
cru-9c9a9c988b5d03642f931341c97b672d054936c8.tar.bz2
cru-9c9a9c988b5d03642f931341c97b672d054936c8.zip
...
Diffstat (limited to 'src/win/gui/Window.cpp')
-rw-r--r--src/win/gui/Window.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/win/gui/Window.cpp b/src/win/gui/Window.cpp
index dda8a36a..174b8931 100644
--- a/src/win/gui/Window.cpp
+++ b/src/win/gui/Window.cpp
@@ -4,6 +4,7 @@
#include "cru/common/Logger.hpp"
#include "cru/platform/Check.hpp"
#include "cru/platform/gui/Base.hpp"
+#include "cru/platform/gui/DebugFlags.hpp"
#include "cru/win/graphics/direct/WindowPainter.hpp"
#include "cru/win/gui/Cursor.hpp"
#include "cru/win/gui/Exception.hpp"
@@ -132,7 +133,9 @@ bool WinNativeWindow::ReleaseMouse() {
}
void WinNativeWindow::RequestRepaint() {
- log::TagDebug(log_tag, u"A repaint is requested.");
+ if constexpr (DebugFlags::paint) {
+ log::TagDebug(log_tag, u"A repaint is requested.");
+ }
if (!::InvalidateRect(hwnd_, nullptr, FALSE))
throw Win32Error(::GetLastError(), "Failed to invalidate window.");
if (!::UpdateWindow(hwnd_))
@@ -376,7 +379,9 @@ void WinNativeWindow::OnDestroyInternal() {
void WinNativeWindow::OnPaintInternal() {
paint_event_.Raise(nullptr);
ValidateRect(hwnd_, nullptr);
- log::TagDebug(log_tag, u"A repaint is finished.");
+ if constexpr (DebugFlags::paint) {
+ log::TagDebug(log_tag, u"A repaint is finished.");
+ }
}
void WinNativeWindow::OnResizeInternal(const int new_width,