Follow platform plugin change wrt layer size

Have to set the drawableSize ourselves.

This is not yet fully correct in the sense that does not ensure
what the platform plugin patch tries to enable, namely atomic frames
when it comes to the drawable size. Going to fix that up in separate
patches, maybe it will need some QRhi API changes as well so won't
mix that in here.

Change-Id: I47a3816930bc6a87a2c96d4a6c4c85b2577147dc
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
Laszlo Agocs 2019-09-20 15:58:02 +02:00
parent 35aec918c1
commit b8d8e0dfbb

View File

@ -3524,7 +3524,10 @@ QSize QMetalSwapChain::surfacePixelSize()
if (v) {
CAMetalLayer *layer = (CAMetalLayer *) [v layer];
if (layer) {
CGSize size = [layer drawableSize];
CGSize size = layer.bounds.size;
size.width *= layer.contentsScale;
size.height *= layer.contentsScale;
layer.drawableSize = size;
return QSize(int(size.width), int(size.height));
}
}