Bug 1357320 - Dispatches the discarded compositor animations id list in one async call, r?kats

MozReview-Commit-ID: 8cCNCzxMKpY
This commit is contained in:
peter chang 2017-04-26 10:58:50 +08:00
Родитель 320e68f0dd
Коммит c03a85af76
5 изменённых файлов: 17 добавлений и 13 удалений

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

@ -48,7 +48,7 @@ parent:
sync UpdateImage(ImageKey aImageKey, IntSize aSize,
SurfaceFormat aFormat, ByteBuffer aBytes);
sync DeleteImage(ImageKey aImageKey);
async DeleteCompositorAnimations(uint64_t aId);
async DeleteCompositorAnimations(uint64_t[] aIds);
async AddRawFont(FontKey aFontKey, ByteBuffer aBytes, uint32_t aFontIndex);
async DeleteFont(FontKey aFontKey);
async DPBegin(IntSize aSize);

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

@ -197,7 +197,7 @@ WebRenderBridgeParent::RecvAddImage(const wr::ImageKey& aImageKey,
mozilla::ipc::IPCResult
WebRenderBridgeParent::RecvAddBlobImage(const wr::ImageKey& aImageKey,
const gfx::IntSize& aSize,
const gfx::IntSize& aSize,
const uint32_t& aStride,
const gfx::SurfaceFormat& aFormat,
const ByteBuffer& aBuffer)
@ -270,17 +270,20 @@ WebRenderBridgeParent::RecvDeleteImage(const wr::ImageKey& aImageKey)
}
mozilla::ipc::IPCResult
WebRenderBridgeParent::RecvDeleteCompositorAnimations(const uint64_t& aId)
WebRenderBridgeParent::RecvDeleteCompositorAnimations(InfallibleTArray<uint64_t>&& aIds)
{
if (mDestroyed) {
return IPC_OK();
}
uint64_t id = mWidget ? 0 : mPipelineId.mHandle;
CompositorAnimationStorage* storage =
mCompositorBridge->GetAnimationStorage(id);
uint64_t storageId = mWidget ? 0 : mPipelineId.mHandle;
CompositorAnimationStorage* storage =
mCompositorBridge->GetAnimationStorage(storageId);
MOZ_ASSERT(storage);
storage->ClearById(aId);
for (uint32_t i = 0; i < aIds.Length(); i++) {
storage->ClearById(aIds[i]);
}
return IPC_OK();
}

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

@ -79,7 +79,7 @@ public:
const gfx::SurfaceFormat& aFormat,
const ByteBuffer& aBuffer) override;
mozilla::ipc::IPCResult RecvDeleteImage(const wr::ImageKey& a1) override;
mozilla::ipc::IPCResult RecvDeleteCompositorAnimations(const uint64_t& aId) override;
mozilla::ipc::IPCResult RecvDeleteCompositorAnimations(InfallibleTArray<uint64_t>&& aIds) override;
mozilla::ipc::IPCResult RecvAddRawFont(const wr::FontKey& aFontKey,
const ByteBuffer& aBuffer,
const uint32_t& aFontIndex) override;

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

@ -311,16 +311,17 @@ WebRenderLayerManager::DiscardImages()
void
WebRenderLayerManager::AddCompositorAnimationsIdForDiscard(uint64_t aId)
{
mDiscardedCompositorAnimationsIds.push_back(aId);
mDiscardedCompositorAnimationsIds.AppendElement(aId);
}
void
WebRenderLayerManager::DiscardCompositorAnimations()
{
for (auto id : mDiscardedCompositorAnimationsIds) {
WrBridge()->SendDeleteCompositorAnimations(id);
if (!mDiscardedCompositorAnimationsIds.IsEmpty()) {
WrBridge()->
SendDeleteCompositorAnimations(mDiscardedCompositorAnimationsIds);
mDiscardedCompositorAnimationsIds.Clear();
}
mDiscardedCompositorAnimationsIds.clear();
}
void

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

@ -145,7 +145,7 @@ private:
private:
nsIWidget* MOZ_NON_OWNING_REF mWidget;
std::vector<wr::ImageKey> mImageKeys;
std::vector<uint64_t> mDiscardedCompositorAnimationsIds;
nsTArray<uint64_t> mDiscardedCompositorAnimationsIds;
/* PaintedLayer callbacks; valid at the end of a transaciton,
* while rendering */