mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 870211 - Add new IPC messages to LayersTransaction for doing incremental updates to textures. r=Bas
This commit is contained in:
parent
a1675f0918
commit
43219a3a35
@ -37,6 +37,8 @@ class CompositableForwarder : public ISurfaceAllocator
|
||||
friend class AutoOpenSurface;
|
||||
friend class TextureClientShmem;
|
||||
public:
|
||||
typedef gfxASurface::gfxContentType gfxContentType;
|
||||
|
||||
CompositableForwarder()
|
||||
: mMaxTextureSize(0)
|
||||
, mCompositorBackend(layers::LAYERS_NONE)
|
||||
@ -70,6 +72,14 @@ public:
|
||||
const SurfaceDescriptor* aFrontDescriptorOnWhite = nullptr,
|
||||
const SurfaceDescriptor* aBackDescriptorOnWhite = nullptr) = 0;
|
||||
|
||||
/**
|
||||
* Notify the CompositableHost that it should create host-side-only
|
||||
* texture(s), that we will update incrementally using UpdateTextureIncremental.
|
||||
*/
|
||||
virtual void CreatedIncrementalBuffer(CompositableClient* aCompositable,
|
||||
const TextureInfo& aTextureInfo,
|
||||
const nsIntRect& aBufferRect) = 0;
|
||||
|
||||
/**
|
||||
* Tell the compositor that a Compositable is killing its buffer(s),
|
||||
* that is TextureClient/Hosts.
|
||||
@ -102,6 +112,23 @@ public:
|
||||
const ThebesBufferData& aThebesBufferData,
|
||||
const nsIntRegion& aUpdatedRegion) = 0;
|
||||
|
||||
/**
|
||||
* Notify the compositor to update aTextureId using aDescriptor, and take
|
||||
* ownership of aDescriptor.
|
||||
*
|
||||
* aDescriptor only contains the pixels for aUpdatedRegion, and is relative
|
||||
* to aUpdatedRegion.TopLeft().
|
||||
*
|
||||
* aBufferRect/aBufferRotation define the new valid region contained
|
||||
* within the texture after the update has been applied.
|
||||
*/
|
||||
virtual void UpdateTextureIncremental(CompositableClient* aCompositable,
|
||||
TextureIdentifier aTextureId,
|
||||
SurfaceDescriptor& aDescriptor,
|
||||
const nsIntRegion& aUpdatedRegion,
|
||||
const nsIntRect& aBufferRect,
|
||||
const nsIntPoint& aBufferRotation) = 0;
|
||||
|
||||
/**
|
||||
* Communicate the picture rect of a YUV image in aLayer to the compositor
|
||||
*/
|
||||
|
@ -38,6 +38,19 @@ CompositableParentManager::ReceiveCompositableUpdate(const CompositableOperation
|
||||
|
||||
break;
|
||||
}
|
||||
case CompositableOperation::TOpCreatedIncrementalTexture: {
|
||||
MOZ_LAYERS_LOG(("[ParentSide] Created texture"));
|
||||
const OpCreatedIncrementalTexture& op = aEdit.get_OpCreatedIncrementalTexture();
|
||||
|
||||
CompositableParent* compositableParent =
|
||||
static_cast<CompositableParent*>(op.compositableParent());
|
||||
CompositableHost* compositable = compositableParent->GetCompositableHost();
|
||||
|
||||
compositable->EnsureTextureHost(compositableParent->GetCompositableManager(),
|
||||
op.textureInfo(),
|
||||
op.bufferRect());
|
||||
break;
|
||||
}
|
||||
case CompositableOperation::TOpDestroyThebesBuffer: {
|
||||
MOZ_LAYERS_LOG(("[ParentSide] Created double buffer"));
|
||||
const OpDestroyThebesBuffer& op = aEdit.get_OpDestroyThebesBuffer();
|
||||
@ -128,6 +141,24 @@ CompositableParentManager::ReceiveCompositableUpdate(const CompositableOperation
|
||||
RenderTraceInvalidateEnd(thebes, "FF00FF");
|
||||
break;
|
||||
}
|
||||
case CompositableOperation::TOpPaintTextureIncremental: {
|
||||
MOZ_LAYERS_LOG(("[ParentSide] Paint ThebesLayer"));
|
||||
|
||||
const OpPaintTextureIncremental& op = aEdit.get_OpPaintTextureIncremental();
|
||||
|
||||
CompositableParent* compositableParent = static_cast<CompositableParent*>(op.compositableParent());
|
||||
CompositableHost* compositable =
|
||||
compositableParent->GetCompositableHost();
|
||||
|
||||
SurfaceDescriptor desc = op.image();
|
||||
|
||||
compositable->UpdateIncremental(op.textureId(),
|
||||
desc,
|
||||
op.updatedRegion(),
|
||||
op.bufferRect(),
|
||||
op.bufferRotation());
|
||||
break;
|
||||
}
|
||||
case CompositableOperation::TOpUpdatePictureRect: {
|
||||
const OpUpdatePictureRect& op = aEdit.get_OpUpdatePictureRect();
|
||||
CompositableHost* compositable
|
||||
|
@ -247,6 +247,15 @@ public:
|
||||
virtual void UpdateTextureNoSwap(CompositableClient* aCompositable,
|
||||
TextureIdentifier aTextureId,
|
||||
SurfaceDescriptor* aDescriptor) MOZ_OVERRIDE;
|
||||
virtual void UpdateTextureIncremental(CompositableClient* aCompositable,
|
||||
TextureIdentifier aTextureId,
|
||||
SurfaceDescriptor& aDescriptor,
|
||||
const nsIntRegion& aUpdatedRegion,
|
||||
const nsIntRect& aBufferRect,
|
||||
const nsIntPoint& aBufferRotation) MOZ_OVERRIDE
|
||||
{
|
||||
NS_RUNTIMEABORT("should not be called");
|
||||
}
|
||||
|
||||
/**
|
||||
* Communicate the picture rect of a YUV image in aLayer to the compositor
|
||||
@ -263,6 +272,12 @@ public:
|
||||
const SurfaceDescriptor* aDescriptorOnWhite = nullptr) MOZ_OVERRIDE {
|
||||
NS_RUNTIMEABORT("should not be called");
|
||||
}
|
||||
virtual void CreatedIncrementalBuffer(CompositableClient* aCompositable,
|
||||
const TextureInfo& aTextureInfo,
|
||||
const nsIntRect& aBufferRect) MOZ_OVERRIDE
|
||||
{
|
||||
NS_RUNTIMEABORT("should not be called");
|
||||
}
|
||||
virtual void CreatedDoubleBuffer(CompositableClient* aCompositable,
|
||||
const SurfaceDescriptor& aFrontDescriptor,
|
||||
const SurfaceDescriptor& aBackDescriptor,
|
||||
|
@ -251,6 +251,12 @@ struct OpCreatedTexture {
|
||||
TextureInfo textureInfo;
|
||||
};
|
||||
|
||||
struct OpCreatedIncrementalTexture {
|
||||
PCompositable compositable;
|
||||
TextureInfo textureInfo;
|
||||
nsIntRect bufferRect;
|
||||
};
|
||||
|
||||
struct OpDestroyThebesBuffer {
|
||||
PCompositable compositable;
|
||||
};
|
||||
@ -267,6 +273,15 @@ struct OpPaintTextureRegion {
|
||||
nsIntRegion updatedRegion;
|
||||
};
|
||||
|
||||
struct OpPaintTextureIncremental {
|
||||
PCompositable compositable;
|
||||
uint32_t textureId;
|
||||
SurfaceDescriptor image;
|
||||
nsIntRegion updatedRegion;
|
||||
nsIntRect bufferRect;
|
||||
nsIntPoint bufferRotation;
|
||||
};
|
||||
|
||||
struct OpUpdatePictureRect {
|
||||
PCompositable compositable;
|
||||
nsIntRect picture;
|
||||
@ -276,10 +291,12 @@ union CompositableOperation {
|
||||
OpUpdatePictureRect;
|
||||
|
||||
OpCreatedTexture;
|
||||
OpCreatedIncrementalTexture;
|
||||
OpDestroyThebesBuffer;
|
||||
|
||||
OpPaintTexture;
|
||||
OpPaintTextureRegion;
|
||||
OpPaintTextureIncremental;
|
||||
|
||||
OpPaintTiledLayerBuffer;
|
||||
};
|
||||
|
@ -348,6 +348,25 @@ ShadowLayerForwarder::UpdateTextureRegion(CompositableClient* aCompositable,
|
||||
aUpdatedRegion));
|
||||
}
|
||||
|
||||
void
|
||||
ShadowLayerForwarder::UpdateTextureIncremental(CompositableClient* aCompositable,
|
||||
TextureIdentifier aTextureId,
|
||||
SurfaceDescriptor& aDescriptor,
|
||||
const nsIntRegion& aUpdatedRegion,
|
||||
const nsIntRect& aBufferRect,
|
||||
const nsIntPoint& aBufferRotation)
|
||||
{
|
||||
MOZ_ASSERT(aCompositable);
|
||||
MOZ_ASSERT(aCompositable->GetIPDLActor());
|
||||
mTxn->AddPaint(OpPaintTextureIncremental(nullptr, aCompositable->GetIPDLActor(),
|
||||
aTextureId,
|
||||
aDescriptor,
|
||||
aUpdatedRegion,
|
||||
aBufferRect,
|
||||
aBufferRotation));
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ShadowLayerForwarder::UpdatePictureRect(CompositableClient* aCompositable,
|
||||
const nsIntRect& aRect)
|
||||
@ -706,6 +725,15 @@ ShadowLayerForwarder::CreatedSingleBuffer(CompositableClient* aCompositable,
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ShadowLayerForwarder::CreatedIncrementalBuffer(CompositableClient* aCompositable,
|
||||
const TextureInfo& aTextureInfo,
|
||||
const nsIntRect& aBufferRect)
|
||||
{
|
||||
mTxn->AddPaint(OpCreatedIncrementalTexture(nullptr, aCompositable->GetIPDLActor(),
|
||||
aTextureInfo, aBufferRect));
|
||||
}
|
||||
|
||||
void
|
||||
ShadowLayerForwarder::CreatedDoubleBuffer(CompositableClient* aCompositable,
|
||||
const SurfaceDescriptor& aFrontDescriptor,
|
||||
|
@ -138,8 +138,6 @@ class ShadowLayerForwarder : public CompositableForwarder
|
||||
friend class TextureClientShmem;
|
||||
|
||||
public:
|
||||
typedef gfxASurface::gfxContentType gfxContentType;
|
||||
|
||||
virtual ~ShadowLayerForwarder();
|
||||
|
||||
/**
|
||||
@ -152,6 +150,9 @@ public:
|
||||
const SurfaceDescriptor& aDescriptor,
|
||||
const TextureInfo& aTextureInfo,
|
||||
const SurfaceDescriptor* aDescriptorOnWhite = nullptr) MOZ_OVERRIDE;
|
||||
virtual void CreatedIncrementalBuffer(CompositableClient* aCompositable,
|
||||
const TextureInfo& aTextureInfo,
|
||||
const nsIntRect& aBufferRect) MOZ_OVERRIDE;
|
||||
virtual void CreatedDoubleBuffer(CompositableClient* aCompositable,
|
||||
const SurfaceDescriptor& aFrontDescriptor,
|
||||
const SurfaceDescriptor& aBackDescriptor,
|
||||
@ -288,6 +289,13 @@ public:
|
||||
const ThebesBufferData& aThebesBufferData,
|
||||
const nsIntRegion& aUpdatedRegion) MOZ_OVERRIDE;
|
||||
|
||||
virtual void UpdateTextureIncremental(CompositableClient* aCompositable,
|
||||
TextureIdentifier aTextureId,
|
||||
SurfaceDescriptor& aDescriptor,
|
||||
const nsIntRegion& aUpdatedRegion,
|
||||
const nsIntRect& aBufferRect,
|
||||
const nsIntPoint& aBufferRotation) MOZ_OVERRIDE;
|
||||
|
||||
/**
|
||||
* Communicate the picture rect of an image to the compositor
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user