Closed Bug 561265 Opened 15 years ago Closed 2 years ago

Use GetThemeBitmap for drawing native widgets with D2D

Categories

(Core :: Graphics, defect)

x86
Windows 7
defect

Tracking

()

RESOLVED INVALID

People

(Reporter: jrmuizel, Unassigned)

References

Details

We can do more efficient drawing if use GetThemeBitmap to build a cache of all of the theme bitmaps and draw them directly with D2D instead of using GDI. Further if we sprite them we can also take advantage of direct2d's ability to draw multiple parts in a single draw call. The documentation on how to use GetThemeBitmap etc. is pretty sparse but Wine has an implementation of the theme dll which should give a pretty good idea of how this should work.
Drawing theme elements this way would also limit our need for native clipping on GDI.
I think we can use GetThemeMargins and GetThemePartSize to figure out how to draw the theme bitmaps. i.e. to draw a button get the margins and then stretch out the bitmap using a 3x3 grid defined by the margins sort of like "border-image".
This might help with bug 713532, but I don't know how this would work with animated themes.
Blocks: 1277206
FWIW, Edge does not seem to be using this API anymore. I wonder if we'd be better off just implementing the windows style theme by hand. (This is what Chrome does)
Component: Widget: Win32 → Graphics
Severity: normal → S3

Not relevant anymore

Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.