Opened 2 years ago

Closed 2 years ago

Last modified 5 months ago

#14134 closed enhancement (fixed)

[MSW] Implement wxGDIPlusContext::SetInterpolationQuality()

Reported by: ericj Owned by:
Priority: normal Milestone:
Component: wxMSW Version: stable-latest
Keywords: wxGraphicsContext GDI+ SetInterpolationQuality Cc:
Blocked By: Blocking:
Patch: yes

Description

The following small patch implements wxGraphicsContext::SetInterpolationQuality() for GDI+

Attachments (1)

msw_graphics.patch download (1.8 KB) - added by ericj 2 years ago.

Download all attachments as: .zip

Change History (10)

Changed 2 years ago by ericj

comment:1 Changed 2 years ago by VZ

  • Resolution set to fixed
  • Status changed from new to closed

(In [70990]) Implement wxGraphicsContext::SetInterpolationQuality() for wxMSW.

Provide implementation of the previously stubbed out method.

Closes #14134.

comment:2 Changed 2 years ago by ericj

Implement wxGraphicsContext::SetInterpolationQuality() (Eric Jarvi).

Don't want to be nitpicking, but it's "Eric Jensen" :)

comment:3 Changed 2 years ago by vadz

Oops, really sorry, I took it from SF user page but I should have confirmed with you, will fix in a moment.

comment:4 Changed 2 years ago by VZ

(In [70994]) Correct Eric Jensen name in the change log.

See #14134.

comment:5 follow-up: Changed 2 years ago by catalin

I wonder if it is ok to cache the new value before being applied. See m_interpolation = interpolation;.
I see that for the current wxInterpolationQuality enum values the default tag is never hit but wouldn't it still be better to move the assignment after the switch?

For easier reading it could probably do without interpolationMode variable. Sorry if I'm missing something obvious though.

comment:6 in reply to: ↑ 5 Changed 2 years ago by ericj

Replying to catalin:

I wonder if it is ok to cache the new value before being applied. See m_interpolation = interpolation;.
I see that for the current wxInterpolationQuality enum values the default tag is never hit but wouldn't it still be better to move the assignment after the switch?

Probably yes. I just copied the method SetAntialiasMode and adjusted it for the interpolation setting.

For easier reading it could probably do without interpolationMode variable. Sorry if I'm missing something obvious though.

I think this variable is needed though. The input parameter is the wxWidgets type wxAntialiasMode which needs to be converted to the underlying MSW type InterpolationMode.

comment:7 Changed 2 years ago by VZ

(In [71009]) Minor fix to wxGraphicsContext::SetInterpolationQuality() in wxMSW.

Only update the internal variable if we really succeeded in changing the
interpolation mode.

See #14134.

comment:8 Changed 5 months ago by VZ

In 76304:

Document unexpected default wxGraphicsContext interpolation quality.

In 3.0, keep wxINTERPOLATION_GOOD as the default value instead of
wxINTERPOLATION_DEFAULT for compatibility, but at least mention this and warn
about the changes in 3.1.

See #14134.

comment:9 Changed 5 months ago by VZ

In 76305:

Don't set wxINTERPOLATION_GOOD quality by default in wxGDIPlusContext.

This is inconsistent with wxOSX and also doesn't play well with the existence
of wxINTERPOLATION_DEFAULT which is different from wxINTERPOLATION_GOOD.

See #14134.

Note: See TracTickets for help on using tickets.