Bug 1132072 - Handle RequestNotifyLayerTreeReady when RenderFrameParent not ready (r=dvander)

This commit is contained in:
Bill McCloskey 2015-03-10 15:21:02 -07:00
parent 7319a01bdc
commit 71d65e32e7
2 changed files with 16 additions and 4 deletions

View File

@ -276,6 +276,7 @@ TabParent::TabParent(nsIContentParent* aManager,
, mInitedByParent(false)
, mTabId(aTabId)
, mCreatingWindow(false)
, mNeedLayerTreeReadyNotification(false)
{
MOZ_ASSERT(aManager);
}
@ -2315,6 +2316,12 @@ TabParent::RecvGetRenderFrameInfo(PRenderFrameParent* aRenderFrame,
RenderFrameParent* renderFrame = static_cast<RenderFrameParent*>(aRenderFrame);
renderFrame->GetTextureFactoryIdentifier(aTextureFactoryIdentifier);
*aLayersId = renderFrame->GetLayersId();
if (mNeedLayerTreeReadyNotification) {
RequestNotifyLayerTreeReady();
mNeedLayerTreeReadyNotification = false;
}
return true;
}
@ -2617,11 +2624,11 @@ TabParent::RequestNotifyLayerTreeReady()
{
RenderFrameParent* frame = GetRenderFrame();
if (!frame) {
return false;
mNeedLayerTreeReadyNotification = true;
} else {
CompositorParent::RequestNotifyLayerTreeReady(frame->GetLayersId(),
new LayerTreeUpdateObserver());
}
CompositorParent::RequestNotifyLayerTreeReady(frame->GetLayersId(),
new LayerTreeUpdateObserver());
return true;
}

View File

@ -512,6 +512,11 @@ private:
// CreateWindow response. Then TabChild loads them immediately.
nsTArray<FrameScriptInfo> mDelayedFrameScripts;
// If the user called RequestNotifyLayerTreeReady and the RenderFrameParent
// wasn't ready yet, we set this flag and call RequestNotifyLayerTreeReady
// again once the RenderFrameParent arrives.
bool mNeedLayerTreeReadyNotification;
private:
// This is used when APZ needs to find the TabParent associated with a layer
// to dispatch events.