Module: wine Branch: stable Commit: af5d66649eea2feb4a840481b8b5eaa689a5cbf0 URL: https://gitlab.winehq.org/wine/wine/-/commit/af5d66649eea2feb4a840481b8b5eaa...
Author: Zhiyi Zhang zzhang@codeweavers.com Date: Thu Apr 6 16:14:28 2023 +0800
light.msstyles: Use border fill background for progress parts.
These parts only contain simple images that can be achieved with border fill backgrounds as well. So visually, this change is a no-op. The reason for using image file backgrounds is that I tend to use the same background type as the theme files for Windows. However, drawing border fill background is much more efficient.
Pro Evolution Soccer 2008 demo is buggy and generates ~570,000 WM_PAINT messages for the progress control. On Windows, it's ~1,140,000 WM_PAINT messages. DrawThemeBackground() on Wine is 10x more expensive than that of Windows and I found little room for optimization. 60% of the time in DrawThemeBackground() is spend for CreateCompatibleDC() and other 30% for actually drawing. So I decided to change light.msstyles instead.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54728 (cherry picked from commit 2960cf2e0616216fb8d01e11d7ca7475bfe26d97)
---
dlls/light.msstyles/Makefile.in | 4 -- .../blue_progress_chunk_horizontal.bmp | Bin 2358 -> 0 bytes .../blue_progress_chunk_horizontal.svg | 13 ------ .../blue_progress_chunk_vertical.bmp | Bin 2490 -> 0 bytes .../blue_progress_chunk_vertical.svg | 13 ------ .../blue_progress_track_horizontal.bmp | Bin 2698 -> 0 bytes .../blue_progress_track_horizontal.svg | 13 ------ .../blue_progress_track_vertical.bmp | Bin 886 -> 0 bytes .../blue_progress_track_vertical.svg | 13 ------ dlls/light.msstyles/light.rc | 46 ++++----------------- 10 files changed, 8 insertions(+), 94 deletions(-)
diff --git a/dlls/light.msstyles/Makefile.in b/dlls/light.msstyles/Makefile.in index 8c31d5b9b08..dc8837f9364 100644 --- a/dlls/light.msstyles/Makefile.in +++ b/dlls/light.msstyles/Makefile.in @@ -204,10 +204,6 @@ SVG_SRCS = \ blue_navigation_menu_button_32px.svg \ blue_navigation_menu_button_39px.svg \ blue_navigation_menu_button_52px.svg \ - blue_progress_chunk_horizontal.svg \ - blue_progress_chunk_vertical.svg \ - blue_progress_track_horizontal.svg \ - blue_progress_track_vertical.svg \ blue_radiobutton_13px.svg \ blue_radiobutton_16px.svg \ blue_radiobutton_19px.svg \ diff --git a/dlls/light.msstyles/blue_progress_chunk_horizontal.bmp b/dlls/light.msstyles/blue_progress_chunk_horizontal.bmp deleted file mode 100644 index 60debfe4049..00000000000 Binary files a/dlls/light.msstyles/blue_progress_chunk_horizontal.bmp and /dev/null differ diff --git a/dlls/light.msstyles/blue_progress_chunk_horizontal.svg b/dlls/light.msstyles/blue_progress_chunk_horizontal.svg deleted file mode 100644 index 629b667f585..00000000000 --- a/dlls/light.msstyles/blue_progress_chunk_horizontal.svg +++ /dev/null @@ -1,13 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<svg id="bitmap:49-24" width="49" height="15" version="1.1" viewBox="0 0 12.965 3.9688" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> - <metadata> - rdf:RDF - <cc:Work rdf:about=""> - dc:formatimage/svg+xml</dc:format> - <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage%22/%3E - dc:title/ - </cc:Work> - </rdf:RDF> - </metadata> - <rect width="12.965" height="3.9688" fill="#3096fa" style="paint-order:normal"/> -</svg> diff --git a/dlls/light.msstyles/blue_progress_chunk_vertical.bmp b/dlls/light.msstyles/blue_progress_chunk_vertical.bmp deleted file mode 100644 index f9816b09dcf..00000000000 Binary files a/dlls/light.msstyles/blue_progress_chunk_vertical.bmp and /dev/null differ diff --git a/dlls/light.msstyles/blue_progress_chunk_vertical.svg b/dlls/light.msstyles/blue_progress_chunk_vertical.svg deleted file mode 100644 index 4f43374dce5..00000000000 --- a/dlls/light.msstyles/blue_progress_chunk_vertical.svg +++ /dev/null @@ -1,13 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<svg id="bitmap:15-24" width="15" height="49" version="1.1" viewBox="0 0 3.9687 12.965" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> - <metadata> - rdf:RDF - <cc:Work rdf:about=""> - dc:formatimage/svg+xml</dc:format> - <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage%22/%3E - dc:title/ - </cc:Work> - </rdf:RDF> - </metadata> - <rect transform="rotate(90)" y="-3.9688" width="12.965" height="3.9688" fill="#3096fa" style="paint-order:normal"/> -</svg> diff --git a/dlls/light.msstyles/blue_progress_track_horizontal.bmp b/dlls/light.msstyles/blue_progress_track_horizontal.bmp deleted file mode 100644 index 43d5eaa441a..00000000000 Binary files a/dlls/light.msstyles/blue_progress_track_horizontal.bmp and /dev/null differ diff --git a/dlls/light.msstyles/blue_progress_track_horizontal.svg b/dlls/light.msstyles/blue_progress_track_horizontal.svg deleted file mode 100644 index af25bbbcd51..00000000000 --- a/dlls/light.msstyles/blue_progress_track_horizontal.svg +++ /dev/null @@ -1,13 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<svg id="bitmap:53-24" width="53" height="16" version="1.1" viewBox="0 0 14.023 4.2333" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> - <metadata> - rdf:RDF - <cc:Work rdf:about=""> - dc:formatimage/svg+xml</dc:format> - <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage%22/%3E - dc:title/ - </cc:Work> - </rdf:RDF> - </metadata> - <rect x=".13229" y=".13229" width="13.758" height="3.9688" fill="#fff" stroke="#aeaeae" stroke-width=".26458"/> -</svg> diff --git a/dlls/light.msstyles/blue_progress_track_vertical.bmp b/dlls/light.msstyles/blue_progress_track_vertical.bmp deleted file mode 100644 index 5dddee9c32e..00000000000 Binary files a/dlls/light.msstyles/blue_progress_track_vertical.bmp and /dev/null differ diff --git a/dlls/light.msstyles/blue_progress_track_vertical.svg b/dlls/light.msstyles/blue_progress_track_vertical.svg deleted file mode 100644 index 2f0f638bd8a..00000000000 --- a/dlls/light.msstyles/blue_progress_track_vertical.svg +++ /dev/null @@ -1,13 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<svg id="bitmap:14-24" width="14" height="17" version="1.1" viewBox="0 0 3.7042 4.4979" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> - <metadata> - rdf:RDF - <cc:Work rdf:about=""> - dc:formatimage/svg+xml</dc:format> - <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage%22/%3E - dc:title/ - </cc:Work> - </rdf:RDF> - </metadata> - <rect x=".13229" y=".13229" width="3.4396" height="4.2333" fill="#fff" stroke="#aeaeae" stroke-width=".26458"/> -</svg> diff --git a/dlls/light.msstyles/light.rc b/dlls/light.msstyles/light.rc index be8b1dfda57..ec832e83ea0 100644 --- a/dlls/light.msstyles/light.rc +++ b/dlls/light.msstyles/light.rc @@ -1204,29 +1204,19 @@ BLUE_INI TEXTFILE "BorderColor = 174 174 174\r\n"
"[Progress.Bar]\r\n" -"BgType = ImageFile\r\n" -"ImageFile = blue_progress_track_horizontal.bmp\r\n" "MinSize = 10, 10\r\n" -"SizingMargins = 1, 1, 1, 1\r\n" -"SizingType = Stretch\r\n" +"FillColor = 255 255 255\r\n"
"[Progress.BarVert]\r\n" -"BgType = ImageFile\r\n" -"ImageFile = blue_progress_track_vertical.bmp\r\n" -"SizingMargins = 1, 1, 1, 1\r\n" -"SizingType = Stretch\r\n" +"FillColor = 255 255 255\r\n"
"[Progress.Chunk]\r\n" -"BgType = ImageFile\r\n" -"ImageFile = blue_progress_chunk_horizontal.bmp\r\n" -"SizingMargins = 1, 1, 1, 1\r\n" -"SizingType = Stretch\r\n" +"BorderSize = 0\r\n" +"FillColor = 48 150 250\r\n"
"[Progress.ChunkVert]\r\n" -"BgType = ImageFile\r\n" -"ImageFile = blue_progress_chunk_vertical.bmp\r\n" -"SizingMargins = 1, 1, 1, 1\r\n" -"SizingType = Stretch\r\n" +"BorderSize = 0\r\n" +"FillColor = 48 150 250\r\n"
"[Progress.Fill]\r\n" "FillColor = 48 150 250\r\n" @@ -1265,17 +1255,10 @@ BLUE_INI TEXTFILE "BgType = None\r\n"
"[Progress.TransparentBar]\r\n" -"BgType = ImageFile\r\n" -"ImageFile = blue_progress_track_horizontal.bmp\r\n" -"MinSize = 10, 10\r\n" -"SizingMargins = 1, 1, 1, 1\r\n" -"SizingType = Stretch\r\n" +"FillColor = 255 255 255\r\n"
"[Progress.TransparentBarVert]\r\n" -"BgType = ImageFile\r\n" -"ImageFile = blue_progress_track_vertical.bmp\r\n" -"SizingMargins = 1, 1, 1, 1\r\n" -"SizingType = Stretch\r\n" +"FillColor = 255 255 255\r\n"
"\r\n; Rebar\r\n" "[Rebar]\r\n" @@ -3519,19 +3502,6 @@ BLUE_NAVIGATION_MENU_BUTTON_39PX_BMP BITMAP "blue_navigation_menu_button_39px.bm /* @makedep: blue_navigation_menu_button_52px.bmp */ BLUE_NAVIGATION_MENU_BUTTON_52PX_BMP BITMAP "blue_navigation_menu_button_52px.bmp"
-/* Progress */ -/* @makedep: blue_progress_chunk_horizontal.bmp */ -BLUE_PROGRESS_CHUNK_HORIZONTAL_BMP BITMAP "blue_progress_chunk_horizontal.bmp" - -/* @makedep: blue_progress_chunk_vertical.bmp */ -BLUE_PROGRESS_CHUNK_VERTICAL_BMP BITMAP "blue_progress_chunk_vertical.bmp" - -/* @makedep: blue_progress_track_horizontal.bmp */ -BLUE_PROGRESS_TRACK_HORIZONTAL_BMP BITMAP "blue_progress_track_horizontal.bmp" - -/* @makedep: blue_progress_track_vertical.bmp */ -BLUE_PROGRESS_TRACK_VERTICAL_BMP BITMAP "blue_progress_track_vertical.bmp" - /* Rebar */ /* @makedep: blue_rebar_background.bmp */ BLUE_REBAR_BACKGROUND_BMP BITMAP "blue_rebar_background.bmp"