Skip to content

Commit

Permalink
#34: Auto detect CALayer's contentsScale change.
Browse files Browse the repository at this point in the history
  • Loading branch information
kakashidinho committed Oct 17, 2020
1 parent f4b1033 commit 8230df3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/libANGLE/renderer/metal/SurfaceMtl.mm
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,12 @@ void StopFrameCapture()

bool SurfaceMtl::checkIfLayerResized(const gl::Context *context)
{
if (mMetalLayer.get() != mLayer && mMetalLayer.get().contentsScale != mLayer.contentsScale)
{
// Parent layer's content scale has changed, update Metal layer's scale factor.
mMetalLayer.get().contentsScale = mLayer.contentsScale;
}

CGSize currentLayerDrawableSize = mMetalLayer.get().drawableSize;
CGSize expectedDrawableSize = calcExpectedDrawableSize();

Expand Down

0 comments on commit 8230df3

Please sign in to comment.