Commit e836835f by Nicolas Capens

Fix OSX retina display support.

Change-Id: I712b089c36e9c696c44a8d99a3d21819798a6142 Reviewed-on: https://swiftshader-review.googlesource.com/4430Reviewed-by: 's avatarNicolas Capens <capn@google.com> Tested-by: 's avatarNicolas Capens <capn@google.com>
parent cd0a4575
......@@ -21,14 +21,14 @@ namespace OSX
if([object isKindOfClass:[NSView class]])
{
NSView *view = reinterpret_cast<NSView*>(object);
width = [view bounds].size.width;
height = [view bounds].size.height;
width = [view convertRectToBacking:[view bounds]].size.width;
height = [view convertRectToBacking:[view bounds]].size.height;
}
else if([object isKindOfClass:[CALayer class]])
{
CALayer *layer = reinterpret_cast<CALayer*>(object);
width = CGRectGetWidth([layer frame]);
height = CGRectGetHeight([layer frame]);
width = [layer bounds].size.width * layer.contentsScale;
height = [layer bounds].size.height * layer.contentsScale;
}
else UNREACHABLE(0);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment