Bug 863223 - Make canvas updates asynchronous once again r=nrc

This commit is contained in:
James Willcox 2013-05-01 19:24:27 -04:00
Родитель f9b344108a
Коммит ff9fc3204f
7 изменённых файлов: 61 добавлений и 0 удалений

Просмотреть файл

@ -67,6 +67,13 @@ CanvasClient2D::Update(gfx::IntSize aSize, ClientCanvasLayer* aLayer)
mTextureClient->Unlock();
}
void
CanvasClient2D::Updated()
{
mForwarder->UpdateTextureNoSwap(this, 1, mTextureClient->GetDescriptor());
}
CanvasClientWebGL::CanvasClientWebGL(CompositableForwarder* aFwd,
TextureFlags aFlags)
: CanvasClient(aFwd, aFlags)

Просмотреть файл

@ -65,6 +65,8 @@ public:
}
virtual void Update(gfx::IntSize aSize, ClientCanvasLayer* aLayer);
virtual void Updated() MOZ_OVERRIDE;
};
// Used for GL canvases where we don't need to do any readback, i.e., with a

Просмотреть файл

@ -84,6 +84,13 @@ public:
TextureIdentifier aTextureId,
SurfaceDescriptor* aDescriptor) = 0;
/**
* Same as UpdateTexture, but performs an asynchronous layer transaction (if possible)
*/
virtual void UpdateTextureNoSwap(CompositableClient* aCompositable,
TextureIdentifier aTextureId,
SurfaceDescriptor* aDescriptor) = 0;
/**
* Communicate to the compositor that aRegion in the texture identified by
* aCompositable and aIdentifier has been updated to aThebesBuffer.

Просмотреть файл

@ -94,6 +94,23 @@ ImageBridgeChild::UpdateTexture(CompositableClient* aCompositable,
}
}
void
ImageBridgeChild::UpdateTextureNoSwap(CompositableClient* aCompositable,
TextureIdentifier aTextureId,
SurfaceDescriptor* aDescriptor)
{
if (aDescriptor->type() != SurfaceDescriptor::T__None &&
aDescriptor->type() != SurfaceDescriptor::Tnull_t) {
MOZ_ASSERT(aCompositable);
MOZ_ASSERT(aCompositable->GetIPDLActor());
mTxn->AddNoSwapEdit(OpPaintTexture(nullptr, aCompositable->GetIPDLActor(), 1,
SurfaceDescriptor(*aDescriptor)));
*aDescriptor = SurfaceDescriptor();
} else {
NS_WARNING("Trying to send a null SurfaceDescriptor.");
}
}
void
ImageBridgeChild::UpdatePictureRect(CompositableClient* aCompositable,
const nsIntRect& aRect)

Просмотреть файл

@ -244,6 +244,10 @@ public:
TextureIdentifier aTextureId,
SurfaceDescriptor* aDescriptor) MOZ_OVERRIDE;
virtual void UpdateTextureNoSwap(CompositableClient* aCompositable,
TextureIdentifier aTextureId,
SurfaceDescriptor* aDescriptor) MOZ_OVERRIDE;
/**
* Communicate the picture rect of a YUV image in aLayer to the compositor
*/

Просмотреть файл

@ -316,6 +316,23 @@ ShadowLayerForwarder::UpdateTexture(CompositableClient* aCompositable,
}
}
void
ShadowLayerForwarder::UpdateTextureNoSwap(CompositableClient* aCompositable,
TextureIdentifier aTextureId,
SurfaceDescriptor* aDescriptor)
{
if (aDescriptor->type() != SurfaceDescriptor::T__None &&
aDescriptor->type() != SurfaceDescriptor::Tnull_t) {
MOZ_ASSERT(aCompositable);
MOZ_ASSERT(aCompositable->GetIPDLActor());
mTxn->AddNoSwapPaint(OpPaintTexture(nullptr, aCompositable->GetIPDLActor(), 1,
SurfaceDescriptor(*aDescriptor)));
*aDescriptor = SurfaceDescriptor();
} else {
NS_WARNING("Trying to send a null SurfaceDescriptor.");
}
}
void
ShadowLayerForwarder::UpdateTextureRegion(CompositableClient* aCompositable,
const ThebesBufferData& aThebesBufferData,

Просмотреть файл

@ -273,6 +273,13 @@ public:
TextureIdentifier aTextureId,
SurfaceDescriptor* aDescriptor) MOZ_OVERRIDE;
/**
* Same as above, but performs an asynchronous layer transaction
*/
virtual void UpdateTextureNoSwap(CompositableClient* aCompositable,
TextureIdentifier aTextureId,
SurfaceDescriptor* aDescriptor) MOZ_OVERRIDE;
/**
* Communicate to the compositor that aRegion in the texture identified by aLayer
* and aIdentifier has been updated to aThebesBuffer.