Restore support for using faster dotted pens in wxMSW

Changes of d245dc9e1f (Fix drawing of dotted lines with wxDC in wxMSW,
2020-03-27) improved the appearance of dotted and dashed lines in wxMSW
but at the expense of significant (up to a factor of 300) slowdown.

Allow the applications for which the drawing performance is important to
explicitly request the old behaviour, with uglier, but faster, pens by
choosing to use low quality pens.

Update the graphics benchmark to allow specifying the pen quality and
verify that the performance when using it is the same as before 3.1.4.

See https://github.com/wxWidgets/wxWidgets/pull/2218

See #7097.

Closes #18875.
This commit is contained in:
Vadim Zeitlin
2021-02-07 01:27:00 +01:00
parent a5afa85c0a
commit b53f7ac904
6 changed files with 208 additions and 10 deletions

View File

@@ -43,12 +43,14 @@ public:
void SetDashes(int nb_dashes, const wxDash *dash) wxOVERRIDE;
void SetJoin(wxPenJoin join) wxOVERRIDE;
void SetCap(wxPenCap cap) wxOVERRIDE;
void SetQuality(wxPenQuality quality) wxOVERRIDE;
wxColour GetColour() const wxOVERRIDE;
int GetWidth() const wxOVERRIDE;
wxPenStyle GetStyle() const wxOVERRIDE;
wxPenJoin GetJoin() const wxOVERRIDE;
wxPenCap GetCap() const wxOVERRIDE;
wxPenQuality GetQuality() const wxOVERRIDE;
int GetDashes(wxDash** ptr) const wxOVERRIDE;
wxDash* GetDash() const;
int GetDashCount() const;