зеркало из https://github.com/mozilla/gecko-dev.git
Bug 948265 - Remove kPrimitiveIndexSourceAlpha since nsSVGFilterInstance creates ToAlpha filter nodes now. r=mstange
This commit is contained in:
Родитель
97bde6246e
Коммит
6fa2b606f3
|
@ -986,7 +986,6 @@ ElementForIndex(int32_t aIndex,
|
|||
{
|
||||
switch (aIndex) {
|
||||
case FilterPrimitiveDescription::kPrimitiveIndexSourceGraphic:
|
||||
case FilterPrimitiveDescription::kPrimitiveIndexSourceAlpha:
|
||||
return aSourceGraphicElement;
|
||||
case FilterPrimitiveDescription::kPrimitiveIndexFillPaint:
|
||||
return aFillPaintElement;
|
||||
|
@ -1103,10 +1102,6 @@ FilterNodeGraphFromDescription(DrawTarget* aDT,
|
|||
if (surf) {
|
||||
IntPoint offset = surfaceRect.TopLeft();
|
||||
sourceFilterNode = FilterWrappers::ForSurface(aDT, surf, offset);
|
||||
|
||||
if (inputIndex == FilterPrimitiveDescription::kPrimitiveIndexSourceAlpha) {
|
||||
sourceFilterNode = FilterWrappers::ToAlpha(aDT, sourceFilterNode);
|
||||
}
|
||||
}
|
||||
|
||||
inputFilter = new FilterCachedColorModels(aDT, sourceFilterNode,
|
||||
|
|
|
@ -284,9 +284,8 @@ class FilterPrimitiveDescription MOZ_FINAL {
|
|||
public:
|
||||
enum {
|
||||
kPrimitiveIndexSourceGraphic = -1,
|
||||
kPrimitiveIndexSourceAlpha = -2,
|
||||
kPrimitiveIndexFillPaint = -3,
|
||||
kPrimitiveIndexStrokePaint = -4
|
||||
kPrimitiveIndexFillPaint = -2,
|
||||
kPrimitiveIndexStrokePaint = -3
|
||||
};
|
||||
|
||||
FilterPrimitiveDescription();
|
||||
|
|
|
@ -292,33 +292,31 @@ GetLastResultIndex(const nsTArray<FilterPrimitiveDescription>& aPrimitiveDescrs)
|
|||
int32_t
|
||||
nsSVGFilterInstance::GetOrCreateSourceAlphaIndex(nsTArray<FilterPrimitiveDescription>& aPrimitiveDescrs)
|
||||
{
|
||||
// If the SourceAlpha index has already been determined or created for this
|
||||
// SVG filter, just return it.
|
||||
// If the SourceAlpha index has already been created for this SVG filter,
|
||||
// return it.
|
||||
if (mSourceAlphaAvailable)
|
||||
return mSourceAlphaIndex;
|
||||
|
||||
// If this is the first filter in the chain, we can just use the
|
||||
// kPrimitiveIndexSourceAlpha keyword to refer to the SourceAlpha of the
|
||||
// original image.
|
||||
if (mSourceGraphicIndex < 0) {
|
||||
mSourceAlphaIndex = FilterPrimitiveDescription::kPrimitiveIndexSourceAlpha;
|
||||
mSourceAlphaAvailable = true;
|
||||
return mSourceAlphaIndex;
|
||||
}
|
||||
|
||||
// Otherwise, create a primitive description to turn the previous filter's
|
||||
// output into a SourceAlpha input.
|
||||
FilterPrimitiveDescription descr(PrimitiveType::ToAlpha);
|
||||
descr.SetInputPrimitive(0, mSourceGraphicIndex);
|
||||
|
||||
const FilterPrimitiveDescription& sourcePrimitiveDescr =
|
||||
aPrimitiveDescrs[mSourceGraphicIndex];
|
||||
descr.SetPrimitiveSubregion(sourcePrimitiveDescr.PrimitiveSubregion());
|
||||
descr.SetIsTainted(sourcePrimitiveDescr.IsTainted());
|
||||
if (mSourceGraphicIndex >= 0) {
|
||||
const FilterPrimitiveDescription& sourcePrimitiveDescr =
|
||||
aPrimitiveDescrs[mSourceGraphicIndex];
|
||||
descr.SetPrimitiveSubregion(sourcePrimitiveDescr.PrimitiveSubregion());
|
||||
descr.SetIsTainted(sourcePrimitiveDescr.IsTainted());
|
||||
|
||||
ColorSpace colorSpace = sourcePrimitiveDescr.OutputColorSpace();
|
||||
descr.SetInputColorSpace(0, colorSpace);
|
||||
descr.SetOutputColorSpace(colorSpace);
|
||||
ColorSpace colorSpace = sourcePrimitiveDescr.OutputColorSpace();
|
||||
descr.SetInputColorSpace(0, colorSpace);
|
||||
descr.SetOutputColorSpace(colorSpace);
|
||||
} else {
|
||||
descr.SetPrimitiveSubregion(ToIntRect(mFilterSpaceBounds));
|
||||
descr.SetIsTainted(true);
|
||||
descr.SetInputColorSpace(0, ColorSpace::SRGB);
|
||||
descr.SetOutputColorSpace(ColorSpace::SRGB);
|
||||
}
|
||||
|
||||
aPrimitiveDescrs.AppendElement(descr);
|
||||
mSourceAlphaIndex = aPrimitiveDescrs.Length() - 1;
|
||||
|
|
Загрузка…
Ссылка в новой задаче