Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/notes/bugfix-9992.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Improve export/import snapshot from screen on iOS

The from screen form of export/import snapshot has been changed
to use a different API on iOS7+, which allows a greater variety
of native layers to be captured.
15 changes: 13 additions & 2 deletions engine/src/mbliphonedc.mm
Original file line number Diff line number Diff line change
Expand Up @@ -617,8 +617,19 @@ static void MCScreenDCDoSnapshot(void *p_env)
-[window bounds].size.height * [[window layer] anchorPoint].y);

// Render the layer hierarchy to the current context
[[window layer] renderInContext:t_img_context];

if ([window respondsToSelector: @selector(drawViewHierarchyInRect:afterScreenUpdates:)])
{
// This method is supported in iOS7+ and will capture many
// native view's content.
UIGraphicsPushContext(t_img_context);
[window drawViewHierarchyInRect:[window bounds] afterScreenUpdates:YES];
UIGraphicsPopContext();
}
else
{
[[window layer] renderInContext:t_img_context];
}

// Restore the context
CGContextRestoreGState(t_img_context);
}
Expand Down