diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2019-09-20 15:58:02 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2019-09-23 15:10:13 +0200 |
commit | b8d8e0dfbbf721604eaa340b3bc47e5a574228fb (patch) | |
tree | bb7c17f797792d134b7a81a746a5cc29586d598a /src/gui/rhi | |
parent | 35aec918c15d50893dd4e403e400f37e6a2d7c6f (diff) |
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>
Diffstat (limited to 'src/gui/rhi')
-rw-r--r-- | src/gui/rhi/qrhimetal.mm | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gui/rhi/qrhimetal.mm b/src/gui/rhi/qrhimetal.mm index 0b1ab72c2c..bfd6944cdb 100644 --- a/src/gui/rhi/qrhimetal.mm +++ b/src/gui/rhi/qrhimetal.mm @@ -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)); } } |