Bug 1359993 - Reduce invalidation of video r=nical

This commit is contained in:
sotaro
2017-06-05 20:55:14 +09:00
parent d1f6bffff0
commit 551d6c6ee1
5 changed files with 23 additions and 2 deletions

View File

@@ -1813,6 +1813,8 @@ public:
// matches the frame metrics array length.
virtual void ClearCachedResources() {}
virtual bool SupportsAsyncUpdate() { return false; }
private:
void ScrollMetadataChanged();
public:

View File

@@ -59,6 +59,14 @@ protected:
DestroyBackBuffer();
}
virtual bool SupportsAsyncUpdate() override
{
if (GetImageClientType() == CompositableType::IMAGE_BRIDGE) {
return true;
}
return false;
}
virtual void HandleMemoryPressure() override
{
if (mImageClient) {

View File

@@ -90,6 +90,16 @@ WebRenderImageLayer::ClearCachedResources()
}
}
bool
WebRenderImageLayer::SupportsAsyncUpdate()
{
if (GetImageClientType() == CompositableType::IMAGE_BRIDGE &&
mPipelineId.isSome()) {
return true;
}
return false;
}
void
WebRenderImageLayer::RenderLayer(wr::DisplayListBuilder& aBuilder,
const StackingContextHelper& aSc)

View File

@@ -24,6 +24,8 @@ public:
virtual void ClearCachedResources() override;
virtual bool SupportsAsyncUpdate() override;
protected:
virtual ~WebRenderImageLayer();

View File

@@ -6681,8 +6681,7 @@ nsIFrame::InvalidateLayer(uint32_t aDisplayItemKey,
// If the layer is being updated asynchronously, and it's being forwarded
// to a compositor, then we don't need to invalidate.
if ((aFlags & UPDATE_IS_ASYNC) && layer &&
layer->Manager()->GetBackendType() == LayersBackend::LAYERS_CLIENT) {
if ((aFlags & UPDATE_IS_ASYNC) && layer && layer->SupportsAsyncUpdate()) {
return layer;
}