mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-22 01:35:35 +00:00
Bug 1280594
- Pause the compositor directly instead of bouncing off the Gecko thread. r=snorp
This commit is contained in:
parent
367f33f78d
commit
35f22f7ca8
@ -64,11 +64,9 @@ public class GLController extends JNIObject {
|
||||
public GLController() {
|
||||
}
|
||||
|
||||
synchronized void serverSurfaceDestroyed() {
|
||||
void serverSurfaceDestroyed() {
|
||||
ThreadUtils.assertOnUiThread();
|
||||
|
||||
mServerSurfaceValid = false;
|
||||
|
||||
// We need to coordinate with Gecko when pausing composition, to ensure
|
||||
// that Gecko never executes a draw event while the compositor is paused.
|
||||
// This is sent synchronously to make sure that we don't attempt to use
|
||||
@ -80,6 +78,10 @@ public class GLController extends JNIObject {
|
||||
if (mCompositorCreated) {
|
||||
pauseCompositor();
|
||||
}
|
||||
|
||||
synchronized (this) {
|
||||
mServerSurfaceValid = false;
|
||||
}
|
||||
}
|
||||
|
||||
void serverSurfaceChanged(int newWidth, int newHeight) {
|
||||
|
@ -908,14 +908,17 @@ public:
|
||||
template<class Functor>
|
||||
static void OnNativeCall(Functor&& aCall)
|
||||
{
|
||||
if (aCall.IsTarget(&GLControllerSupport::CreateCompositor) ||
|
||||
aCall.IsTarget(&GLControllerSupport::PauseCompositor)) {
|
||||
if (aCall.IsTarget(&GLControllerSupport::CreateCompositor)) {
|
||||
|
||||
// These calls are blocking.
|
||||
nsAppShell::SyncRunEvent(WindowEvent<Functor>(
|
||||
mozilla::Move(aCall)), &GLControllerEvent::MakeEvent);
|
||||
return;
|
||||
|
||||
} else if (aCall.IsTarget(&GLControllerSupport::PauseCompositor)) {
|
||||
aCall.SetTarget(&GLControllerSupport::SyncPauseCompositor);
|
||||
(Functor(aCall))();
|
||||
return;
|
||||
} else if (aCall.IsTarget(
|
||||
&GLControllerSupport::SyncResumeResizeCompositor)) {
|
||||
// This call is synchronous. Perform the original call using a copy
|
||||
|
Loading…
Reference in New Issue
Block a user