Bug 1494285 p3. Rename nsDisplayFilter to nsDisplayFilters. r=miko

Differential Revision: https://phabricator.services.mozilla.com/D7008

--HG--
extra : rebase_source : 89a1bd3e34666a09bd9d9d26329f183ebc28a1c3
extra : amend_source : 71c0eacf545383c23533ae05c46561159567d667
extra : histedit_source : a1047949377d690bba5cfcf86b16cb2be0610af0
This commit is contained in:
Jonathan Watt 2018-08-30 13:15:47 +01:00
parent 0133d476ce
commit 5c1dd39583
10 changed files with 54 additions and 50 deletions

View File

@ -922,13 +922,13 @@ Grouper::PaintContainerItem(DIGroup* aGroup, nsDisplayItem* aItem, const IntRect
}
case DisplayItemType::TYPE_FILTER: {
GP("Paint Filter\n");
// We don't currently support doing invalidation inside nsDisplayFilter
// We don't currently support doing invalidation inside nsDisplayFilters
// for now just paint it as a single item
BlobItemData* data = GetBlobItemDataForGroup(aItem, aGroup);
if (data->mLayerManager->GetRoot()) {
data->mLayerManager->BeginTransaction();
static_cast<nsDisplayFilter*>(aItem)->PaintAsLayer(mDisplayListBuilder,
aContext, data->mLayerManager);
static_cast<nsDisplayFilters*>(aItem)->PaintAsLayer(mDisplayListBuilder,
aContext, data->mLayerManager);
if (data->mLayerManager->InTransaction()) {
data->mLayerManager->AbortTransaction();
}
@ -1742,8 +1742,8 @@ PaintItemByDrawTarget(nsDisplayItem* aItem,
{
context->SetMatrix(context->CurrentMatrix().PreTranslate(-aOffset.x, -aOffset.y));
isInvalidated = PaintByLayer(aItem, aDisplayListBuilder, aManager, context, aScale, [&]() {
static_cast<nsDisplayFilter*>(aItem)->PaintAsLayer(aDisplayListBuilder,
context, aManager);
static_cast<nsDisplayFilters*>(aItem)->PaintAsLayer(aDisplayListBuilder,
context, aManager);
});
break;
}
@ -1856,7 +1856,7 @@ WebRenderCommandBuilder::GenerateFallbackData(nsDisplayItem* aItem,
LayerRect paintRect = LayerRect(LayerPoint(0, 0), LayerSize(paintSize));
nsDisplayItemGeometry* geometry = fallbackData->GetGeometry();
// nsDisplayFilter is rendered via BasicLayerManager which means the invalidate
// nsDisplayFilters is rendered via BasicLayerManager which means the invalidate
// region is unknown until we traverse the displaylist contained by it.
if (geometry && !fallbackData->IsInvalid() &&
aItem->GetType() != DisplayItemType::TYPE_FILTER &&

View File

@ -211,7 +211,7 @@ PrintDisplayItemTo(nsDisplayListBuilder* aBuilder, nsDisplayItem* aItem,
if (aItem->GetType() == DisplayItemType::TYPE_FILTER) {
nsCString str;
(static_cast<nsDisplayFilter*>(aItem))->PrintEffects(str);
(static_cast<nsDisplayFilters*>(aItem))->PrintEffects(str);
aStream << str.get();
}
#endif

View File

@ -3201,8 +3201,8 @@ nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder,
/* List now emptied, so add the new list to the top. */
resultList.AppendToTop(
MakeDisplayItem<nsDisplayFilter>(aBuilder, this, &resultList,
handleOpacity));
MakeDisplayItem<nsDisplayFilters>(aBuilder, this, &resultList,
handleOpacity));
}
if (usingMask) {

View File

@ -4450,7 +4450,7 @@ PaintInactiveLayer(nsDisplayListBuilder* aBuilder,
basic->AbortTransaction();
}
} else if (aItem->GetType() == DisplayItemType::TYPE_FILTER) {
static_cast<nsDisplayFilter*>(aItem)->PaintAsLayer(aBuilder, aCtx, basic);
static_cast<nsDisplayFilters*>(aItem)->PaintAsLayer(aBuilder, aCtx, basic);
if (basic->InTransaction()) {
basic->AbortTransaction();
}

View File

@ -10071,18 +10071,18 @@ nsDisplayMasksAndClipPaths::PrintEffects(nsACString& aTo)
}
#endif
nsDisplayFilter::nsDisplayFilter(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame,
nsDisplayList* aList,
bool aHandleOpacity)
nsDisplayFilters::nsDisplayFilters(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame,
nsDisplayList* aList,
bool aHandleOpacity)
: nsDisplayEffectsBase(aBuilder, aFrame, aList, aHandleOpacity)
, mEffectsBounds(aFrame->GetVisualOverflowRectRelativeToSelf())
{
MOZ_COUNT_CTOR(nsDisplayFilter);
MOZ_COUNT_CTOR(nsDisplayFilters);
}
already_AddRefed<Layer>
nsDisplayFilter::BuildLayer(
nsDisplayFilters::BuildLayer(
nsDisplayListBuilder* aBuilder,
LayerManager* aManager,
const ContainerLayerParameters& aContainerParameters)
@ -10121,16 +10121,16 @@ nsDisplayFilter::BuildLayer(
}
LayerState
nsDisplayFilter::GetLayerState(nsDisplayListBuilder* aBuilder,
LayerManager* aManager,
const ContainerLayerParameters& aParameters)
nsDisplayFilters::GetLayerState(nsDisplayListBuilder* aBuilder,
LayerManager* aManager,
const ContainerLayerParameters& aParameters)
{
return LAYER_SVG_EFFECTS;
}
bool
nsDisplayFilter::ComputeVisibility(nsDisplayListBuilder* aBuilder,
nsRegion* aVisibleRegion)
nsDisplayFilters::ComputeVisibility(nsDisplayListBuilder* aBuilder,
nsRegion* aVisibleRegion)
{
nsPoint offset = ToReferenceFrame();
nsRect dirtyRect = nsSVGIntegrationUtils::GetRequiredSourceForInvalidArea(
@ -10147,7 +10147,7 @@ nsDisplayFilter::ComputeVisibility(nsDisplayListBuilder* aBuilder,
}
void
nsDisplayFilter::ComputeInvalidationRegion(
nsDisplayFilters::ComputeInvalidationRegion(
nsDisplayListBuilder* aBuilder,
const nsDisplayItemGeometry* aGeometry,
nsRegion* aInvalidRegion) const
@ -10155,7 +10155,7 @@ nsDisplayFilter::ComputeInvalidationRegion(
nsDisplayEffectsBase::ComputeInvalidationRegion(
aBuilder, aGeometry, aInvalidRegion);
auto* geometry = static_cast<const nsDisplayFilterGeometry*>(aGeometry);
auto* geometry = static_cast<const nsDisplayFiltersGeometry*>(aGeometry);
if (aBuilder->ShouldSyncDecodeImages() &&
geometry->ShouldInvalidateToSyncDecodeImages()) {
@ -10166,9 +10166,9 @@ nsDisplayFilter::ComputeInvalidationRegion(
}
void
nsDisplayFilter::PaintAsLayer(nsDisplayListBuilder* aBuilder,
gfxContext* aCtx,
LayerManager* aManager)
nsDisplayFilters::PaintAsLayer(nsDisplayListBuilder* aBuilder,
gfxContext* aCtx,
LayerManager* aManager)
{
imgDrawingParams imgParams(aBuilder->ShouldSyncDecodeImages()
? imgIContainer::FLAG_SYNC_DECODE
@ -10183,7 +10183,7 @@ nsDisplayFilter::PaintAsLayer(nsDisplayListBuilder* aBuilder,
mHandleOpacity,
imgParams);
nsSVGIntegrationUtils::PaintFilter(params);
nsDisplayFilterGeometry::UpdateDrawResult(this, imgParams.result);
nsDisplayFiltersGeometry::UpdateDrawResult(this, imgParams.result);
}
static float
@ -10194,7 +10194,7 @@ ClampStdDeviation(float aStdDeviation)
}
bool
nsDisplayFilter::CreateWebRenderCommands(
nsDisplayFilters::CreateWebRenderCommands(
mozilla::wr::DisplayListBuilder& aBuilder,
mozilla::wr::IpcResourceUpdateQueue& aResources,
const StackingContextHelper& aSc,
@ -10318,7 +10318,7 @@ nsDisplayFilter::CreateWebRenderCommands(
#ifdef MOZ_DUMP_PAINTING
void
nsDisplayFilter::PrintEffects(nsACString& aTo)
nsDisplayFilters::PrintEffects(nsACString& aTo)
{
nsIFrame* firstFrame =
nsLayoutUtils::FirstContinuationOrIBSplitSibling(mFrame);

View File

@ -907,7 +907,7 @@ public:
/**
* Returns true if we're currently building a display list that's
* under an nsDisplayFilter.
* under an nsDisplayFilters.
*/
bool IsInFilter() const { return mInFilter; }
@ -6840,31 +6840,35 @@ private:
/**
* A display item to paint a stacking context with filter effects set by the
* stacking context root frame's style.
*
* Note that the filters may just be simple CSS filter functions. That is,
* they won't necessarily be references to SVG 'filter' elements.
*/
class nsDisplayFilter : public nsDisplayEffectsBase
class nsDisplayFilters : public nsDisplayEffectsBase
{
public:
nsDisplayFilter(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame,
nsDisplayList* aList,
bool aHandleOpacity);
nsDisplayFilters(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame,
nsDisplayList* aList,
bool aHandleOpacity);
nsDisplayFilter(nsDisplayListBuilder* aBuilder, const nsDisplayFilter& aOther)
nsDisplayFilters(nsDisplayListBuilder* aBuilder,
const nsDisplayFilters& aOther)
: nsDisplayEffectsBase(aBuilder, aOther)
, mEffectsBounds(aOther.mEffectsBounds)
{
}
#ifdef NS_BUILD_REFCNT_LOGGING
~nsDisplayFilter() override { MOZ_COUNT_DTOR(nsDisplayFilter); }
~nsDisplayFilters() override { MOZ_COUNT_DTOR(nsDisplayFilters); }
#endif
NS_DISPLAY_DECL_NAME("Filter", TYPE_FILTER)
nsDisplayWrapList* Clone(nsDisplayListBuilder* aBuilder) const override
{
MOZ_COUNT_CTOR(nsDisplayFilter);
return MakeDisplayItem<nsDisplayFilter>(aBuilder, *this);
MOZ_COUNT_CTOR(nsDisplayFilters);
return MakeDisplayItem<nsDisplayFilters>(aBuilder, *this);
}
bool CanMerge(const nsDisplayItem* aItem) const override
@ -6879,7 +6883,7 @@ public:
{
nsDisplayWrapList::Merge(aItem);
const nsDisplayFilter* other = static_cast<const nsDisplayFilter*>(aItem);
const nsDisplayFilters* other = static_cast<const nsDisplayFilters*>(aItem);
mEffectsBounds.UnionRect(mEffectsBounds,
other->mEffectsBounds +
other->mFrame->GetOffsetTo(mFrame));
@ -6906,7 +6910,7 @@ public:
nsDisplayItemGeometry* AllocateGeometry(
nsDisplayListBuilder* aBuilder) override
{
return new nsDisplayFilterGeometry(this, aBuilder);
return new nsDisplayFiltersGeometry(this, aBuilder);
}
void ComputeInvalidationRegion(nsDisplayListBuilder* aBuilder,

View File

@ -152,8 +152,8 @@ nsDisplayMasksAndClipPathsGeometry::nsDisplayMasksAndClipPathsGeometry(
{
}
nsDisplayFilterGeometry::nsDisplayFilterGeometry(nsDisplayFilter* aItem,
nsDisplayListBuilder* aBuilder)
nsDisplayFiltersGeometry::nsDisplayFiltersGeometry(nsDisplayFilters* aItem,
nsDisplayListBuilder* aBuilder)
: nsDisplaySVGEffectGeometry(aItem, aBuilder)
, nsImageGeometryMixin(aItem, aBuilder)
{

View File

@ -23,7 +23,7 @@ class nsDisplayTableItem;
class nsDisplayThemedBackground;
class nsDisplayEffectsBase;
class nsDisplayMasksAndClipPaths;
class nsDisplayFilter;
class nsDisplayFilters;
namespace mozilla {
namespace gfx {
@ -322,13 +322,13 @@ public:
bool mHandleOpacity;
};
class nsDisplayFilterGeometry
class nsDisplayFiltersGeometry
: public nsDisplaySVGEffectGeometry
, public nsImageGeometryMixin<nsDisplayFilterGeometry>
, public nsImageGeometryMixin<nsDisplayFiltersGeometry>
{
public:
nsDisplayFilterGeometry(nsDisplayFilter* aItem,
nsDisplayListBuilder* aBuilder);
nsDisplayFiltersGeometry(nsDisplayFilters* aItem,
nsDisplayListBuilder* aBuilder);
bool InvalidateForSyncDecodeImages() const override
{

View File

@ -1,7 +1,7 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>Reference for bug 1406183: ImageLayer inside inactive BasicLayerManager for fallback nsDisplayFilter is drawn at the wrong position</title>
<title>Reference for bug 1406183: ImageLayer inside inactive BasicLayerManager for fallback nsDisplayFilters is drawn at the wrong position</title>
<style>

View File

@ -1,7 +1,7 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>Testcase for bug 1406183: ImageLayer inside inactive BasicLayerManager for fallback nsDisplayFilter is drawn at the wrong position</title>
<title>Testcase for bug 1406183: ImageLayer inside inactive BasicLayerManager for fallback nsDisplayFilters is drawn at the wrong position</title>
<style>