Bug 854421 - Part 3: Add a way to detect PLayerTransaction objects that exist only for testing and won't composite. r=nical

This commit is contained in:
Matt Woodrow 2014-05-29 09:42:16 +12:00
parent b440e6a8f7
commit 5dda13aee0
2 changed files with 13 additions and 3 deletions

View File

@ -39,6 +39,9 @@ public:
bool IPCOpen() const { return mIPCOpen; }
void SetHasNoCompositor() { mHasNoCompositor = true; }
bool HasNoCompositor() { return mHasNoCompositor; }
void SetForwarder(ShadowLayerForwarder* aForwarder)
{
mForwarder = aForwarder;
@ -46,9 +49,10 @@ public:
protected:
LayerTransactionChild()
: mIPCOpen(false)
: mForwarder(nullptr)
, mIPCOpen(false)
, mDestroyed(false)
, mForwarder(nullptr)
, mHasNoCompositor(false)
{}
~LayerTransactionChild() { }
@ -80,9 +84,10 @@ protected:
friend class CompositorChild;
friend class layout::RenderFrameChild;
ShadowLayerForwarder* mForwarder;
bool mIPCOpen;
bool mDestroyed;
ShadowLayerForwarder* mForwarder;
bool mHasNoCompositor;
};
} // namespace layers

View File

@ -37,6 +37,11 @@ RenderFrameChild::AllocPLayerTransactionChild()
{
LayerTransactionChild* c = new LayerTransactionChild();
c->AddIPDLReference();
// We only create PLayerTransaction objects through PRenderFrame when we don't
// have a PCompositor. This means that the child process content will never
// get drawn to the screen, but some tests rely on it pretending to function
// for now.
c->SetHasNoCompositor();
return c;
}