Bug 1386188 - Support filter for layers-free mode. r=kats

MozReview-Commit-ID: LuPnaSjhjgk

--HG--
extra : rebase_source : 2cf28919048683cdb446c5456a933651d2689fa1
This commit is contained in:
Ethan Lin 2017-08-03 17:41:41 +08:00
Родитель 2f3e874c80
Коммит c80dac96f4
2 изменённых файлов: 43 добавлений и 0 удалений

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

@ -9132,6 +9132,43 @@ nsDisplayFilter::PaintAsLayer(nsDisplayListBuilder* aBuilder,
nsDisplayFilterGeometry::UpdateDrawResult(this, imgParams.result); nsDisplayFilterGeometry::UpdateDrawResult(this, imgParams.result);
} }
bool
nsDisplayFilter::CreateWebRenderCommands(mozilla::wr::DisplayListBuilder& aBuilder,
const StackingContextHelper& aSc,
nsTArray<WebRenderParentCommand>& aParentCommands,
mozilla::layers::WebRenderLayerManager* aManager,
nsDisplayListBuilder* aDisplayListBuilder)
{
if (aManager->IsLayersFreeTransaction()) {
ContainerLayerParameters parameter;
if (GetLayerState(aDisplayListBuilder, aManager, parameter) != LAYER_ACTIVE) {
// TODO: should have a fallback path to paint the child list
return false;
}
}
nsTArray<mozilla::wr::WrFilterOp> wrFilters;
const nsTArray<nsStyleFilter>& filters = mFrame->StyleEffects()->mFilters;
nsTArray<layers::CSSFilter> cssFilters = nsTArray<layers::CSSFilter>(filters.Length());
for (const nsStyleFilter& filter : filters) {
wrFilters.AppendElement(wr::ToWrFilterOp(ToCSSFilter(filter)));
}
StackingContextHelper sc(aSc,
aBuilder,
aDisplayListBuilder,
this,
&mList,
nullptr,
0,
nullptr,
nullptr,
wrFilters);
nsDisplaySVGEffects::CreateWebRenderCommands(aBuilder, sc, aParentCommands, aManager, aDisplayListBuilder);
return true;
}
#ifdef MOZ_DUMP_PAINTING #ifdef MOZ_DUMP_PAINTING
void void
nsDisplayFilter::PrintEffects(nsACString& aTo) nsDisplayFilter::PrintEffects(nsACString& aTo)

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

@ -4586,6 +4586,12 @@ public:
void PaintAsLayer(nsDisplayListBuilder* aBuilder, void PaintAsLayer(nsDisplayListBuilder* aBuilder,
gfxContext* aCtx, gfxContext* aCtx,
LayerManager* aManager); LayerManager* aManager);
virtual bool CreateWebRenderCommands(mozilla::wr::DisplayListBuilder& aBuilder,
const StackingContextHelper& aSc,
nsTArray<WebRenderParentCommand>& aParentCommands,
mozilla::layers::WebRenderLayerManager* aManager,
nsDisplayListBuilder* aDisplayListBuilder) override;
}; };
/* A display item that applies a transformation to all of its descendant /* A display item that applies a transformation to all of its descendant