Bitmap drawing glitches in 4.5 on Mac OS with Retina displays

A user interface toolkit mainly for audio plug-ins (VST, AudioUnit, etc).
Post Reply
ray
Posts: 101
Joined: Fri Sep 02, 2016 9:37 am

Bitmap drawing glitches in 4.5 on Mac OS with Retina displays

Post by ray »

Hi,

I have tried the recently released 4.5 update of VSTGUI. Everything seems to work fine so far except for bitmap drawing on Mac OS when running on a Retina display and the CFrame::setZoom() is set to anything != 1.0 (see image below). The example contains a CAnimKnob and the CFrame zoom is set to a value <1.The black border sometimes appears on the left, sometimes on the top or bottom or on both edges of the bounding box. The control itself is positioned on integral coordinates and has integral and even dimensions when created. The described behaviour can be reproduced in 10.11 and 10.12, but probably also affects older versions of Mac OS.

I was diff'ing lib/platform/mac/cgdrawcontext.cpp against the 4.3 revision and had the impression that it might have to do something with line 621 in CGDrawContext::drawBitmap() where the integralOffset argument for beginCGContext() was changed to true. But alas that didn't help.

It also doesn't make any difference whether the bitmap sits in a layered or non layered view container, except for the erroneousthe border being drawn in white instead of black when layered.

Any ideas?

Thanks!

Image

howardantares
Posts: 130
Joined: Tue Jun 21, 2016 1:46 pm

Re: Bitmap drawing glitches in 4.5 on Mac OS with Retina displays

Post by howardantares »

You say that's using a zoom factor < 1. Don't you want the zoom factor set > 1 for hi-res displays? Setting it < 1 makes things smaller, but you want them larger when in a hi-res display, right? We set ours to 2 for hi-res situations (via a menu item the user can select, if they don't like how small our plug-in appears on their hi-res monitor with the default zoom factor of 1).

ray
Posts: 101
Joined: Fri Sep 02, 2016 9:37 am

Re: Bitmap drawing glitches in 4.5 on Mac OS with Retina displays

Post by ray »

Hi Howard,

thanks for your reply. We handle HighDPI/Retina support by setting the scalefactor to 2.0 in our platformbitmaps, with 2x oversampled graphics of course. The frame zoom factor is used to let users to resize the GUI on the fly in our case.

Post Reply