зеркало из https://github.com/mozilla/gecko-dev.git
Composite only when needed.
This commit is contained in:
Родитель
d6112ed67c
Коммит
1665830318
|
@ -59,7 +59,7 @@ CompositorChild::CompositorChild(Thread *aCompositorThread, LayerManager *aLayer
|
|||
|
||||
CompositorChild::~CompositorChild()
|
||||
{
|
||||
printf("del\n");
|
||||
printf("del compositor child\n");
|
||||
MOZ_COUNT_DTOR(CompositorChild);
|
||||
}
|
||||
|
||||
|
@ -76,7 +76,7 @@ CompositorChild::CreateCompositor(LayerManager *aLayerManager)
|
|||
if (compositorThread->Start()) {
|
||||
MessageLoop *parentMessageLoop = MessageLoop::current();
|
||||
MessageLoop *childMessageLoop = compositorThread->message_loop();
|
||||
CompositorParent *compositorParent = new CompositorParent();
|
||||
CompositorParent* compositorParent = new CompositorParent();
|
||||
CompositorChild *compositorChild = new CompositorChild(compositorThread, aLayerManager);
|
||||
mozilla::ipc::AsyncChannel *parentChannel =
|
||||
compositorParent->GetIPCChannel();
|
||||
|
@ -87,6 +87,7 @@ CompositorChild::CreateCompositor(LayerManager *aLayerManager)
|
|||
|
||||
compositorChild->Open(parentChannel, childMessageLoop, childSide);
|
||||
compositorChild->CallInit();
|
||||
compositorChild->mCompositorParent = compositorParent;
|
||||
|
||||
return compositorChild;
|
||||
}
|
||||
|
|
|
@ -42,7 +42,6 @@
|
|||
|
||||
#include "mozilla/layers/PCompositorChild.h"
|
||||
|
||||
|
||||
namespace base {
|
||||
class Thread;
|
||||
}
|
||||
|
@ -53,6 +52,7 @@ namespace mozilla {
|
|||
namespace layers {
|
||||
|
||||
class LayerManager;
|
||||
class CompositorParent;
|
||||
|
||||
class CompositorChild : public PCompositorChild
|
||||
{
|
||||
|
@ -75,6 +75,7 @@ protected:
|
|||
private:
|
||||
Thread *mCompositorThread;
|
||||
LayerManager *mLayerManager;
|
||||
nsRefPtr<CompositorParent> mCompositorParent;
|
||||
|
||||
DISALLOW_EVIL_CONSTRUCTORS(CompositorChild);
|
||||
};
|
||||
|
|
|
@ -77,16 +77,22 @@ CompositorParent::AnswerStop()
|
|||
}
|
||||
|
||||
void
|
||||
CompositorParent::Composite()
|
||||
CompositorParent::RequestComposition()
|
||||
{
|
||||
CancelableTask *composeTask = NewRunnableMethod(this, &CompositorParent::Composite);
|
||||
MessageLoop::current()->PostDelayedTask(FROM_HERE, composeTask, 10);
|
||||
MessageLoop::current()->PostTask(FROM_HERE, composeTask);
|
||||
}
|
||||
|
||||
if (!mLayerManager)
|
||||
void
|
||||
CompositorParent::Composite()
|
||||
{
|
||||
if (!mLayerManager) {
|
||||
CancelableTask *composeTask = NewRunnableMethod(this, &CompositorParent::Composite);
|
||||
MessageLoop::current()->PostDelayedTask(FROM_HERE, composeTask, 10);
|
||||
return;
|
||||
}
|
||||
|
||||
mLayerManager->EndEmptyTransaction();
|
||||
|
||||
}
|
||||
|
||||
PLayersParent*
|
||||
|
|
|
@ -60,6 +60,8 @@ public:
|
|||
bool AnswerInit();
|
||||
bool AnswerStop();
|
||||
|
||||
void RequestComposition();
|
||||
|
||||
virtual mozilla::layout::RenderFrameParent* GetRenderFrameParent() { return NULL; }
|
||||
virtual CompositorParent* GetCompositorParent() { return this; }
|
||||
|
||||
|
|
|
@ -47,6 +47,7 @@
|
|||
#include "mozilla/unused.h"
|
||||
|
||||
#include "mozilla/layout/RenderFrameParent.h"
|
||||
#include "CompositorParent.h"
|
||||
|
||||
#include "gfxSharedImageSurface.h"
|
||||
|
||||
|
@ -395,6 +396,9 @@ ShadowLayersParent::RecvUpdate(const InfallibleTArray<Edit>& cset,
|
|||
Frame()->ShadowLayersUpdated();
|
||||
}
|
||||
|
||||
if (mHost->GetCompositorParent()) {
|
||||
mHost->GetCompositorParent()->RequestComposition();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче