aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Third2021-05-23 12:35:21 +0100
committerAlan Third2021-05-31 17:09:41 +0100
commit6bf76258161ca724a87fab2066c1c862ee61cf88 (patch)
tree9f9233f5d81341cf03f2392229b3338b3ed9b91e
parent3882834aa39040b8f340bad9deaede8a0d58e03b (diff)
downloademacs-6bf76258161ca724a87fab2066c1c862ee61cf88.tar.gz
emacs-6bf76258161ca724a87fab2066c1c862ee61cf88.zip
Make the NS buffer copy happen before we need it
* src/nsterm.m ([EmacsView viewWillDraw]): Move releaseContext to updateLayer. ([EmacsView updateLayer]): Send a request for getContext, which will copy the buffer and create the context if it doesn't already exist, to the NS run loop.
-rw-r--r--src/nsterm.m6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/nsterm.m b/src/nsterm.m
index 6b6ad0c016c..f6168243a49 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -8482,8 +8482,6 @@ not_in_argv (NSString *arg)
8482 unblock_input (); 8482 unblock_input ();
8483 waiting_for_input = owfi; 8483 waiting_for_input = owfi;
8484 } 8484 }
8485
8486 [surface releaseContext];
8487} 8485}
8488 8486
8489 8487
@@ -8515,7 +8513,11 @@ not_in_argv (NSString *arg)
8515 There's a private method, -[CALayer setContentsChanged], that we 8513 There's a private method, -[CALayer setContentsChanged], that we
8516 could use to force it, but we shouldn't often get the same 8514 could use to force it, but we shouldn't often get the same
8517 surface twice in a row. */ 8515 surface twice in a row. */
8516 [surface releaseContext];
8518 [[self layer] setContents:(id)[surface getSurface]]; 8517 [[self layer] setContents:(id)[surface getSurface]];
8518 [surface performSelectorOnMainThread:@selector (getContext)
8519 withObject:nil
8520 waitUntilDone:NO];
8519} 8521}
8520#endif 8522#endif
8521 8523