Bug 870211 - Add new IPC messages to LayersTransaction for doing incremental updates to textures. r=Bas
This commit is contained in:
@@ -37,6 +37,8 @@ class CompositableForwarder : public ISurfaceAllocator
|
|||||||
friend class AutoOpenSurface;
|
friend class AutoOpenSurface;
|
||||||
friend class TextureClientShmem;
|
friend class TextureClientShmem;
|
||||||
public:
|
public:
|
||||||
|
typedef gfxASurface::gfxContentType gfxContentType;
|
||||||
|
|
||||||
CompositableForwarder()
|
CompositableForwarder()
|
||||||
: mMaxTextureSize(0)
|
: mMaxTextureSize(0)
|
||||||
, mCompositorBackend(layers::LAYERS_NONE)
|
, mCompositorBackend(layers::LAYERS_NONE)
|
||||||
@@ -70,6 +72,14 @@ public:
|
|||||||
const SurfaceDescriptor* aFrontDescriptorOnWhite = nullptr,
|
const SurfaceDescriptor* aFrontDescriptorOnWhite = nullptr,
|
||||||
const SurfaceDescriptor* aBackDescriptorOnWhite = nullptr) = 0;
|
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),
|
* Tell the compositor that a Compositable is killing its buffer(s),
|
||||||
* that is TextureClient/Hosts.
|
* that is TextureClient/Hosts.
|
||||||
@@ -102,6 +112,23 @@ public:
|
|||||||
const ThebesBufferData& aThebesBufferData,
|
const ThebesBufferData& aThebesBufferData,
|
||||||
const nsIntRegion& aUpdatedRegion) = 0;
|
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
|
* Communicate the picture rect of a YUV image in aLayer to the compositor
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -38,6 +38,19 @@ CompositableParentManager::ReceiveCompositableUpdate(const CompositableOperation
|
|||||||
|
|
||||||
break;
|
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: {
|
case CompositableOperation::TOpDestroyThebesBuffer: {
|
||||||
MOZ_LAYERS_LOG(("[ParentSide] Created double buffer"));
|
MOZ_LAYERS_LOG(("[ParentSide] Created double buffer"));
|
||||||
const OpDestroyThebesBuffer& op = aEdit.get_OpDestroyThebesBuffer();
|
const OpDestroyThebesBuffer& op = aEdit.get_OpDestroyThebesBuffer();
|
||||||
@@ -128,6 +141,24 @@ CompositableParentManager::ReceiveCompositableUpdate(const CompositableOperation
|
|||||||
RenderTraceInvalidateEnd(thebes, "FF00FF");
|
RenderTraceInvalidateEnd(thebes, "FF00FF");
|
||||||
break;
|
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: {
|
case CompositableOperation::TOpUpdatePictureRect: {
|
||||||
const OpUpdatePictureRect& op = aEdit.get_OpUpdatePictureRect();
|
const OpUpdatePictureRect& op = aEdit.get_OpUpdatePictureRect();
|
||||||
CompositableHost* compositable
|
CompositableHost* compositable
|
||||||
|
|||||||
@@ -247,6 +247,15 @@ public:
|
|||||||
virtual void UpdateTextureNoSwap(CompositableClient* aCompositable,
|
virtual void UpdateTextureNoSwap(CompositableClient* aCompositable,
|
||||||
TextureIdentifier aTextureId,
|
TextureIdentifier aTextureId,
|
||||||
SurfaceDescriptor* aDescriptor) MOZ_OVERRIDE;
|
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
|
* Communicate the picture rect of a YUV image in aLayer to the compositor
|
||||||
@@ -263,6 +272,12 @@ public:
|
|||||||
const SurfaceDescriptor* aDescriptorOnWhite = nullptr) MOZ_OVERRIDE {
|
const SurfaceDescriptor* aDescriptorOnWhite = nullptr) MOZ_OVERRIDE {
|
||||||
NS_RUNTIMEABORT("should not be called");
|
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,
|
virtual void CreatedDoubleBuffer(CompositableClient* aCompositable,
|
||||||
const SurfaceDescriptor& aFrontDescriptor,
|
const SurfaceDescriptor& aFrontDescriptor,
|
||||||
const SurfaceDescriptor& aBackDescriptor,
|
const SurfaceDescriptor& aBackDescriptor,
|
||||||
|
|||||||
@@ -251,6 +251,12 @@ struct OpCreatedTexture {
|
|||||||
TextureInfo textureInfo;
|
TextureInfo textureInfo;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct OpCreatedIncrementalTexture {
|
||||||
|
PCompositable compositable;
|
||||||
|
TextureInfo textureInfo;
|
||||||
|
nsIntRect bufferRect;
|
||||||
|
};
|
||||||
|
|
||||||
struct OpDestroyThebesBuffer {
|
struct OpDestroyThebesBuffer {
|
||||||
PCompositable compositable;
|
PCompositable compositable;
|
||||||
};
|
};
|
||||||
@@ -267,6 +273,15 @@ struct OpPaintTextureRegion {
|
|||||||
nsIntRegion updatedRegion;
|
nsIntRegion updatedRegion;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct OpPaintTextureIncremental {
|
||||||
|
PCompositable compositable;
|
||||||
|
uint32_t textureId;
|
||||||
|
SurfaceDescriptor image;
|
||||||
|
nsIntRegion updatedRegion;
|
||||||
|
nsIntRect bufferRect;
|
||||||
|
nsIntPoint bufferRotation;
|
||||||
|
};
|
||||||
|
|
||||||
struct OpUpdatePictureRect {
|
struct OpUpdatePictureRect {
|
||||||
PCompositable compositable;
|
PCompositable compositable;
|
||||||
nsIntRect picture;
|
nsIntRect picture;
|
||||||
@@ -276,10 +291,12 @@ union CompositableOperation {
|
|||||||
OpUpdatePictureRect;
|
OpUpdatePictureRect;
|
||||||
|
|
||||||
OpCreatedTexture;
|
OpCreatedTexture;
|
||||||
|
OpCreatedIncrementalTexture;
|
||||||
OpDestroyThebesBuffer;
|
OpDestroyThebesBuffer;
|
||||||
|
|
||||||
OpPaintTexture;
|
OpPaintTexture;
|
||||||
OpPaintTextureRegion;
|
OpPaintTextureRegion;
|
||||||
|
OpPaintTextureIncremental;
|
||||||
|
|
||||||
OpPaintTiledLayerBuffer;
|
OpPaintTiledLayerBuffer;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -348,6 +348,25 @@ ShadowLayerForwarder::UpdateTextureRegion(CompositableClient* aCompositable,
|
|||||||
aUpdatedRegion));
|
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
|
void
|
||||||
ShadowLayerForwarder::UpdatePictureRect(CompositableClient* aCompositable,
|
ShadowLayerForwarder::UpdatePictureRect(CompositableClient* aCompositable,
|
||||||
const nsIntRect& aRect)
|
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
|
void
|
||||||
ShadowLayerForwarder::CreatedDoubleBuffer(CompositableClient* aCompositable,
|
ShadowLayerForwarder::CreatedDoubleBuffer(CompositableClient* aCompositable,
|
||||||
const SurfaceDescriptor& aFrontDescriptor,
|
const SurfaceDescriptor& aFrontDescriptor,
|
||||||
|
|||||||
@@ -138,8 +138,6 @@ class ShadowLayerForwarder : public CompositableForwarder
|
|||||||
friend class TextureClientShmem;
|
friend class TextureClientShmem;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
typedef gfxASurface::gfxContentType gfxContentType;
|
|
||||||
|
|
||||||
virtual ~ShadowLayerForwarder();
|
virtual ~ShadowLayerForwarder();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -152,6 +150,9 @@ public:
|
|||||||
const SurfaceDescriptor& aDescriptor,
|
const SurfaceDescriptor& aDescriptor,
|
||||||
const TextureInfo& aTextureInfo,
|
const TextureInfo& aTextureInfo,
|
||||||
const SurfaceDescriptor* aDescriptorOnWhite = nullptr) MOZ_OVERRIDE;
|
const SurfaceDescriptor* aDescriptorOnWhite = nullptr) MOZ_OVERRIDE;
|
||||||
|
virtual void CreatedIncrementalBuffer(CompositableClient* aCompositable,
|
||||||
|
const TextureInfo& aTextureInfo,
|
||||||
|
const nsIntRect& aBufferRect) MOZ_OVERRIDE;
|
||||||
virtual void CreatedDoubleBuffer(CompositableClient* aCompositable,
|
virtual void CreatedDoubleBuffer(CompositableClient* aCompositable,
|
||||||
const SurfaceDescriptor& aFrontDescriptor,
|
const SurfaceDescriptor& aFrontDescriptor,
|
||||||
const SurfaceDescriptor& aBackDescriptor,
|
const SurfaceDescriptor& aBackDescriptor,
|
||||||
@@ -288,6 +289,13 @@ public:
|
|||||||
const ThebesBufferData& aThebesBufferData,
|
const ThebesBufferData& aThebesBufferData,
|
||||||
const nsIntRegion& aUpdatedRegion) MOZ_OVERRIDE;
|
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
|
* Communicate the picture rect of an image to the compositor
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user