mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-19 08:15:31 +00:00
Bug 873944 - Add FlushRendering API to the compositor interface. r=nrc
This commit is contained in:
parent
af797088b0
commit
6c5bb2cc06
@ -466,6 +466,15 @@ public:
|
||||
*/
|
||||
virtual void SetIsFirstPaint() {}
|
||||
|
||||
/**
|
||||
* Make sure that the previous transaction has been entirely
|
||||
* completed.
|
||||
*
|
||||
* Note: This may sychronously wait on a remote compositor
|
||||
* to complete rendering.
|
||||
*/
|
||||
virtual void FlushRendering() { }
|
||||
|
||||
// We always declare the following logging symbols, because it's
|
||||
// extremely tricky to conditionally declare them. However, for
|
||||
// ifndef MOZ_LAYERS_HAVE_LOG builds, they only have trivial
|
||||
|
@ -260,6 +260,16 @@ ClientLayerManager::MakeSnapshotIfRequired()
|
||||
mShadowTarget = nullptr;
|
||||
}
|
||||
|
||||
void
|
||||
ClientLayerManager::FlushRendering()
|
||||
{
|
||||
if (mWidget) {
|
||||
if (CompositorChild* remoteRenderer = mWidget->GetRemoteRenderer()) {
|
||||
remoteRenderer->SendFlushRendering();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ClientLayerManager::ForwardTransaction()
|
||||
{
|
||||
|
@ -53,6 +53,8 @@ public:
|
||||
virtual already_AddRefed<ColorLayer> CreateColorLayer();
|
||||
virtual already_AddRefed<RefLayer> CreateRefLayer();
|
||||
|
||||
virtual void FlushRendering() MOZ_OVERRIDE;
|
||||
|
||||
ShadowableLayer* Hold(Layer* aLayer);
|
||||
|
||||
bool HasShadowManager() const { return ShadowLayerForwarder::HasShadowManager(); }
|
||||
|
@ -249,6 +249,18 @@ CompositorParent::RecvMakeSnapshot(const SurfaceDescriptor& aInSnapshot,
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
CompositorParent::RecvFlushRendering()
|
||||
{
|
||||
// If we're waiting to do a composite, then cancel it
|
||||
// and do it immediately instead.
|
||||
if (mCurrentCompositeTask) {
|
||||
mCurrentCompositeTask->Cancel();
|
||||
ComposeToTarget(nullptr);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
CompositorParent::ActorDestroy(ActorDestroyReason why)
|
||||
{
|
||||
@ -743,6 +755,7 @@ public:
|
||||
virtual bool RecvMakeSnapshot(const SurfaceDescriptor& aInSnapshot,
|
||||
SurfaceDescriptor* aOutSnapshot)
|
||||
{ return true; }
|
||||
virtual bool RecvFlushRendering() MOZ_OVERRIDE { return true; }
|
||||
|
||||
virtual PLayerTransactionParent*
|
||||
AllocPLayerTransaction(const LayersBackend& aBackendType,
|
||||
|
@ -55,6 +55,7 @@ public:
|
||||
virtual bool RecvResume() MOZ_OVERRIDE;
|
||||
virtual bool RecvMakeSnapshot(const SurfaceDescriptor& aInSnapshot,
|
||||
SurfaceDescriptor* aOutSnapshot);
|
||||
virtual bool RecvFlushRendering() MOZ_OVERRIDE;
|
||||
|
||||
virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE;
|
||||
|
||||
|
@ -53,6 +53,10 @@ parent:
|
||||
sync MakeSnapshot(SurfaceDescriptor inSnapshot)
|
||||
returns (SurfaceDescriptor outSnapshot);
|
||||
|
||||
// Make sure any pending composites are started immediately and
|
||||
// block until they are completed.
|
||||
sync FlushRendering();
|
||||
|
||||
sync PLayerTransaction(LayersBackend layersBackendHint, uint64_t id)
|
||||
returns (TextureFactoryIdentifier textureFactoryIdentifier);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user