зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1499828 Part 3 - Redraw the overlay when required, r=mccr8.
--HG-- extra : rebase_source : dc275641c80c674a9384acc8f101abbf8178be74
This commit is contained in:
Родитель
9701e7e569
Коммит
8cefe66b8d
|
@ -153,9 +153,6 @@ UpdateGraphicsInUIProcess(const PaintMessage* aMsg)
|
||||||
InitGraphicsSandbox();
|
InitGraphicsSandbox();
|
||||||
}
|
}
|
||||||
|
|
||||||
AutoSafeJSContext cx;
|
|
||||||
JSAutoRealm ar(cx, *gGraphicsSandbox);
|
|
||||||
|
|
||||||
size_t width = gLastPaintWidth;
|
size_t width = gLastPaintWidth;
|
||||||
size_t height = gLastPaintHeight;
|
size_t height = gLastPaintHeight;
|
||||||
size_t stride = layers::ImageDataSerializer::ComputeRGBStride(gSurfaceFormat, width);
|
size_t stride = layers::ImageDataSerializer::ComputeRGBStride(gSurfaceFormat, width);
|
||||||
|
@ -184,6 +181,9 @@ UpdateGraphicsInUIProcess(const PaintMessage* aMsg)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AutoSafeJSContext cx;
|
||||||
|
JSAutoRealm ar(cx, *gGraphicsSandbox);
|
||||||
|
|
||||||
JSObject* bufferObject =
|
JSObject* bufferObject =
|
||||||
JS_NewArrayBufferWithExternalContents(cx, width * height * 4, memory);
|
JS_NewArrayBufferWithExternalContents(cx, width * height * 4, memory);
|
||||||
MOZ_RELEASE_ASSERT(bufferObject);
|
MOZ_RELEASE_ASSERT(bufferObject);
|
||||||
|
@ -196,11 +196,28 @@ UpdateGraphicsInUIProcess(const PaintMessage* aMsg)
|
||||||
|
|
||||||
// Call into the graphics module to update the canvas it manages.
|
// Call into the graphics module to update the canvas it manages.
|
||||||
RootedValue rval(cx);
|
RootedValue rval(cx);
|
||||||
if (!JS_CallFunctionName(cx, *gGraphicsSandbox, "Update", args, &rval)) {
|
if (!JS_CallFunctionName(cx, *gGraphicsSandbox, "UpdateCanvas", args, &rval)) {
|
||||||
MOZ_CRASH("UpdateGraphicsInUIProcess");
|
MOZ_CRASH("UpdateGraphicsInUIProcess");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
UpdateGraphicsOverlay()
|
||||||
|
{
|
||||||
|
if (!gLastPaintWidth || !gLastPaintHeight) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
AutoSafeJSContext cx;
|
||||||
|
JSAutoRealm ar(cx, *gGraphicsSandbox);
|
||||||
|
|
||||||
|
RootedValue rval(cx);
|
||||||
|
if (!JS_CallFunctionName(cx, *gGraphicsSandbox, "UpdateOverlay",
|
||||||
|
JS::HandleValueArray::empty(), &rval)) {
|
||||||
|
MOZ_CRASH("UpdateGraphicsOverlay");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
MaybeTriggerExplicitPaint()
|
MaybeTriggerExplicitPaint()
|
||||||
{
|
{
|
||||||
|
|
|
@ -611,6 +611,12 @@ SwitchActiveChild(ChildProcessInfo* aChild, bool aRecoverPosition = true)
|
||||||
oldActiveChild->RecoverToCheckpoint(oldActiveChild->MostRecentSavedCheckpoint());
|
oldActiveChild->RecoverToCheckpoint(oldActiveChild->MostRecentSavedCheckpoint());
|
||||||
oldActiveChild->SetRole(MakeUnique<ChildRoleStandby>());
|
oldActiveChild->SetRole(MakeUnique<ChildRoleStandby>());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The graphics overlay is affected when we switch between recording and
|
||||||
|
// replaying children.
|
||||||
|
if (aChild->IsRecording() != oldActiveChild->IsRecording()) {
|
||||||
|
UpdateGraphicsOverlay();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -1181,6 +1187,10 @@ RecvHitCheckpoint(const HitCheckpointMessage& aMsg)
|
||||||
UpdateCheckpointTimes(aMsg);
|
UpdateCheckpointTimes(aMsg);
|
||||||
MaybeUpdateGraphicsAtCheckpoint(aMsg.mCheckpointId);
|
MaybeUpdateGraphicsAtCheckpoint(aMsg.mCheckpointId);
|
||||||
|
|
||||||
|
if (!gActiveChild->IsRecording()) {
|
||||||
|
UpdateGraphicsOverlay();
|
||||||
|
}
|
||||||
|
|
||||||
// Resume either forwards or backwards. Break the resume off into a separate
|
// Resume either forwards or backwards. Break the resume off into a separate
|
||||||
// runnable, to avoid starving any code already on the stack and waiting for
|
// runnable, to avoid starving any code already on the stack and waiting for
|
||||||
// the process to pause. Immediately resume if the main thread is blocked.
|
// the process to pause. Immediately resume if the main thread is blocked.
|
||||||
|
|
|
@ -94,6 +94,9 @@ void SendGraphicsMemoryToChild();
|
||||||
// an unhandled recording divergence.
|
// an unhandled recording divergence.
|
||||||
void UpdateGraphicsInUIProcess(const PaintMessage* aMsg);
|
void UpdateGraphicsInUIProcess(const PaintMessage* aMsg);
|
||||||
|
|
||||||
|
// Update the overlay shown over the tab's graphics.
|
||||||
|
void UpdateGraphicsOverlay();
|
||||||
|
|
||||||
// If necessary, update graphics after the active child sends a paint message
|
// If necessary, update graphics after the active child sends a paint message
|
||||||
// or reaches a checkpoint.
|
// or reaches a checkpoint.
|
||||||
void MaybeUpdateGraphicsAtPaint(const PaintMessage& aMsg);
|
void MaybeUpdateGraphicsAtPaint(const PaintMessage& aMsg);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче