summaryrefslogtreecommitdiff
path: root/alf/alfgroupbox.cpp
diff options
context:
space:
mode:
authorJonas Kümmerlin <jonas@kuemmerlin.eu>2020-05-06 18:04:07 +0200
committerJonas Kümmerlin <jonas@kuemmerlin.eu>2020-05-06 18:04:07 +0200
commitc77d5b3fbfb455b7db990872be6f4b4490a6ac37 (patch)
treec94e9f850f9f61c54b27d8c5e4060864bfe58a5f /alf/alfgroupbox.cpp
parent9940644e71cec3eb4905eece652ab5bbfc510f49 (diff)
notebook: add tricks for faster rendering
Win10 in particular sucks at stretching a completely white bitmap
Diffstat (limited to 'alf/alfgroupbox.cpp')
-rw-r--r--alf/alfgroupbox.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/alf/alfgroupbox.cpp b/alf/alfgroupbox.cpp
index 9786323..5c459dc 100644
--- a/alf/alfgroupbox.cpp
+++ b/alf/alfgroupbox.cpp
@@ -62,6 +62,15 @@ ALF_GroupBox_PaintFrameUxtheme(ALFGroupBoxPriv *priv, HWND hwnd, HDC dc, RECT *r
RECT rc;
GetClientRect(hwnd, &rc);
+ // Skip drawing the border if that is not requested, since stretching that bitmap might be expensive.
+ // Will happen when a transparent child calls DrawThemeParentBackground.
+ RECT rcTop = { 0, 0, rc.right-rc.left, priv->layout.containerMargins.top };
+ RECT rcLeft = { 0, 0, priv->layout.containerMargins.left, rc.bottom-rc.top };
+ RECT rcRight = { rc.right-rc.left-priv->layout.containerMargins.right, 0, rc.right-rc.left, rc.bottom-rc.top };
+ RECT rcBottom = { 0, rc.bottom-rc.top-priv->layout.containerMargins.bottom, rc.right-rc.left, rc.bottom-rc.top };
+ if (!RectVisible(dc, &rcTop) && !RectVisible(dc, &rcLeft) && !RectVisible(dc, &rcRight) && !RectVisible(dc, &rcBottom))
+ return;
+
rc.top += priv->calculatedLabelSize.cy / 2;
HRGN oldClipR = CreateRectRgn(0, 0, 0, 0);