зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1517938 - Move nsSVGIntegerPair and nsSVGNumberPair to the mozilla namespace r=jwatt
--HG-- rename : dom/svg/nsSVGIntegerPair.cpp => dom/svg/SVGIntegerPair.cpp rename : dom/svg/nsSVGIntegerPair.h => dom/svg/SVGIntegerPair.h rename : dom/svg/nsSVGNumberPair.cpp => dom/svg/SVGNumberPair.cpp rename : dom/svg/nsSVGNumberPair.h => dom/svg/SVGNumberPair.h
This commit is contained in:
Родитель
cd17224a07
Коммит
5530126c12
|
@ -402,7 +402,7 @@ void nsAttrValue::SetTo(const SVGAngle& aValue, const nsAString* aSerialized) {
|
|||
SetSVGType(eSVGAngle, &aValue, aSerialized);
|
||||
}
|
||||
|
||||
void nsAttrValue::SetTo(const nsSVGIntegerPair& aValue,
|
||||
void nsAttrValue::SetTo(const SVGIntegerPair& aValue,
|
||||
const nsAString* aSerialized) {
|
||||
SetSVGType(eSVGIntegerPair, &aValue, aSerialized);
|
||||
}
|
||||
|
@ -432,7 +432,7 @@ void nsAttrValue::SetTo(const SVGNumberList& aValue,
|
|||
SetSVGType(eSVGNumberList, &aValue, aSerialized);
|
||||
}
|
||||
|
||||
void nsAttrValue::SetTo(const nsSVGNumberPair& aValue,
|
||||
void nsAttrValue::SetTo(const SVGNumberPair& aValue,
|
||||
const nsAString* aSerialized) {
|
||||
SetSVGType(eSVGNumberPair, &aValue, aSerialized);
|
||||
}
|
||||
|
|
|
@ -152,13 +152,15 @@ class nsAttrValue {
|
|||
void SetTo(nsIURI* aValue, const nsAString* aSerialized);
|
||||
void SetTo(const nsIntMargin& aValue);
|
||||
void SetTo(const mozilla::SVGAngle& aValue, const nsAString* aSerialized);
|
||||
void SetTo(const nsSVGIntegerPair& aValue, const nsAString* aSerialized);
|
||||
void SetTo(const mozilla::SVGIntegerPair& aValue,
|
||||
const nsAString* aSerialized);
|
||||
void SetTo(const nsSVGLength2& aValue, const nsAString* aSerialized);
|
||||
void SetTo(const mozilla::SVGLengthList& aValue,
|
||||
const nsAString* aSerialized);
|
||||
void SetTo(const mozilla::SVGNumberList& aValue,
|
||||
const nsAString* aSerialized);
|
||||
void SetTo(const nsSVGNumberPair& aValue, const nsAString* aSerialized);
|
||||
void SetTo(const mozilla::SVGNumberPair& aValue,
|
||||
const nsAString* aSerialized);
|
||||
void SetTo(const mozilla::SVGPathData& aValue, const nsAString* aSerialized);
|
||||
void SetTo(const mozilla::SVGPointList& aValue, const nsAString* aSerialized);
|
||||
void SetTo(const mozilla::SVGAnimatedPreserveAspectRatio& aValue,
|
||||
|
|
|
@ -45,11 +45,11 @@ struct MiscContainer final {
|
|||
mozilla::AtomArray* mAtomArray;
|
||||
nsIntMargin* mIntMargin;
|
||||
const mozilla::SVGAngle* mSVGAngle;
|
||||
const nsSVGIntegerPair* mSVGIntegerPair;
|
||||
const mozilla::SVGIntegerPair* mSVGIntegerPair;
|
||||
const nsSVGLength2* mSVGLength;
|
||||
const mozilla::SVGLengthList* mSVGLengthList;
|
||||
const mozilla::SVGNumberList* mSVGNumberList;
|
||||
const nsSVGNumberPair* mSVGNumberPair;
|
||||
const mozilla::SVGNumberPair* mSVGNumberPair;
|
||||
const mozilla::SVGPathData* mSVGPathData;
|
||||
const mozilla::SVGPointList* mSVGPointList;
|
||||
const mozilla::SVGAnimatedPreserveAspectRatio* mSVGPreserveAspectRatio;
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
|
||||
#include "SVGAttrValueWrapper.h"
|
||||
#include "SVGAngle.h"
|
||||
#include "nsSVGIntegerPair.h"
|
||||
#include "SVGIntegerPair.h"
|
||||
#include "nsSVGLength2.h"
|
||||
#include "nsSVGNumberPair.h"
|
||||
#include "SVGNumberPair.h"
|
||||
#include "nsSVGViewBox.h"
|
||||
#include "SVGAnimatedPreserveAspectRatio.h"
|
||||
#include "SVGLengthList.h"
|
||||
|
@ -18,7 +18,7 @@
|
|||
#include "SVGStringList.h"
|
||||
#include "SVGTransformList.h"
|
||||
|
||||
using namespace mozilla;
|
||||
namespace mozilla {
|
||||
|
||||
/*static*/ void SVGAttrValueWrapper::ToString(const SVGAngle* aAngle,
|
||||
nsAString& aResult) {
|
||||
|
@ -26,7 +26,7 @@ using namespace mozilla;
|
|||
}
|
||||
|
||||
/*static*/ void SVGAttrValueWrapper::ToString(
|
||||
const nsSVGIntegerPair* aIntegerPair, nsAString& aResult) {
|
||||
const SVGIntegerPair* aIntegerPair, nsAString& aResult) {
|
||||
aIntegerPair->GetBaseValueString(aResult);
|
||||
}
|
||||
|
||||
|
@ -45,8 +45,8 @@ using namespace mozilla;
|
|||
aNumberList->GetValueAsString(aResult);
|
||||
}
|
||||
|
||||
/*static*/ void SVGAttrValueWrapper::ToString(
|
||||
const nsSVGNumberPair* aNumberPair, nsAString& aResult) {
|
||||
/*static*/ void SVGAttrValueWrapper::ToString(const SVGNumberPair* aNumberPair,
|
||||
nsAString& aResult) {
|
||||
aNumberPair->GetBaseValueString(aResult);
|
||||
}
|
||||
|
||||
|
@ -80,3 +80,5 @@ using namespace mozilla;
|
|||
nsAString& aResult) {
|
||||
aViewBox->GetBaseValueString(aResult);
|
||||
}
|
||||
|
||||
} // namespace mozilla
|
||||
|
|
|
@ -14,45 +14,36 @@
|
|||
|
||||
#include "nsString.h"
|
||||
|
||||
class nsSVGIntegerPair;
|
||||
class nsSVGLength2;
|
||||
class nsSVGNumberPair;
|
||||
class nsSVGViewBox;
|
||||
|
||||
namespace mozilla {
|
||||
class SVGAngle;
|
||||
class SVGIntegerPair;
|
||||
class SVGLengthList;
|
||||
class SVGNumberList;
|
||||
class SVGNumberPair;
|
||||
class SVGPathData;
|
||||
class SVGPointList;
|
||||
class SVGAnimatedPreserveAspectRatio;
|
||||
class SVGStringList;
|
||||
class SVGTransformList;
|
||||
} // namespace mozilla
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
class SVGAttrValueWrapper {
|
||||
public:
|
||||
static void ToString(const SVGAngle* aAngle, nsAString& aResult);
|
||||
static void ToString(const nsSVGIntegerPair* aIntegerPair,
|
||||
nsAString& aResult);
|
||||
static void ToString(const SVGIntegerPair* aIntegerPair, nsAString& aResult);
|
||||
static void ToString(const nsSVGLength2* aLength, nsAString& aResult);
|
||||
static void ToString(const mozilla::SVGLengthList* aLengthList,
|
||||
nsAString& aResult);
|
||||
static void ToString(const mozilla::SVGNumberList* aNumberList,
|
||||
nsAString& aResult);
|
||||
static void ToString(const nsSVGNumberPair* aNumberPair, nsAString& aResult);
|
||||
static void ToString(const mozilla::SVGPathData* aPathData,
|
||||
nsAString& aResult);
|
||||
static void ToString(const mozilla::SVGPointList* aPointList,
|
||||
nsAString& aResult);
|
||||
static void ToString(const SVGLengthList* aLengthList, nsAString& aResult);
|
||||
static void ToString(const SVGNumberList* aNumberList, nsAString& aResult);
|
||||
static void ToString(const SVGNumberPair* aNumberPair, nsAString& aResult);
|
||||
static void ToString(const SVGPathData* aPathData, nsAString& aResult);
|
||||
static void ToString(const SVGPointList* aPointList, nsAString& aResult);
|
||||
static void ToString(
|
||||
const mozilla::SVGAnimatedPreserveAspectRatio* aPreserveAspectRatio,
|
||||
const SVGAnimatedPreserveAspectRatio* aPreserveAspectRatio,
|
||||
nsAString& aResult);
|
||||
static void ToString(const mozilla::SVGStringList* aStringList,
|
||||
nsAString& aResult);
|
||||
static void ToString(const mozilla::SVGTransformList* aTransformList,
|
||||
static void ToString(const SVGStringList* aStringList, nsAString& aResult);
|
||||
static void ToString(const SVGTransformList* aTransformList,
|
||||
nsAString& aResult);
|
||||
static void ToString(const nsSVGViewBox* aViewBox, nsAString& aResult);
|
||||
};
|
||||
|
|
|
@ -47,11 +47,11 @@
|
|||
#include "nsSVGBoolean.h"
|
||||
#include "SVGEnum.h"
|
||||
#include "nsSVGInteger.h"
|
||||
#include "nsSVGIntegerPair.h"
|
||||
#include "SVGIntegerPair.h"
|
||||
#include "nsSVGLength2.h"
|
||||
#include "SVGMotionSMILAttr.h"
|
||||
#include "nsSVGNumber2.h"
|
||||
#include "nsSVGNumberPair.h"
|
||||
#include "SVGNumberPair.h"
|
||||
#include "nsSVGString.h"
|
||||
#include "nsSVGViewBox.h"
|
||||
#include <stdarg.h>
|
||||
|
@ -407,7 +407,7 @@ bool SVGElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute,
|
|||
}
|
||||
|
||||
if (!foundMatch) {
|
||||
// Check for nsSVGNumberPair attribute
|
||||
// Check for SVGNumberPair attribute
|
||||
NumberPairAttributesInfo numberPairInfo = GetNumberPairInfo();
|
||||
for (i = 0; i < numberPairInfo.mNumberPairCount; i++) {
|
||||
if (aAttribute == numberPairInfo.mNumberPairInfo[i].mName) {
|
||||
|
@ -443,7 +443,7 @@ bool SVGElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute,
|
|||
}
|
||||
|
||||
if (!foundMatch) {
|
||||
// Check for nsSVGIntegerPair attribute
|
||||
// Check for SVGIntegerPair attribute
|
||||
IntegerPairAttributesInfo integerPairInfo = GetIntegerPairInfo();
|
||||
for (i = 0; i < integerPairInfo.mIntegerPairCount; i++) {
|
||||
if (aAttribute == integerPairInfo.mIntegerPairInfo[i].mName) {
|
||||
|
|
|
@ -29,10 +29,8 @@
|
|||
|
||||
class nsSVGBoolean;
|
||||
class nsSVGInteger;
|
||||
class nsSVGIntegerPair;
|
||||
class nsSVGLength2;
|
||||
class nsSVGNumber2;
|
||||
class nsSVGNumberPair;
|
||||
class nsSVGString;
|
||||
class nsSVGViewBox;
|
||||
|
||||
|
@ -44,14 +42,16 @@ class DeclarationBlock;
|
|||
|
||||
class SVGAngle;
|
||||
class SVGAnimatedNumberList;
|
||||
class SVGNumberList;
|
||||
class SVGAnimatedPathSegList;
|
||||
class SVGAnimatedPointList;
|
||||
class SVGAnimatedPreserveAspectRatio;
|
||||
class SVGAnimatedTransformList;
|
||||
class SVGAnimatedLengthList;
|
||||
class SVGEnum;
|
||||
class SVGUserUnitList;
|
||||
class SVGAnimatedPointList;
|
||||
class SVGAnimatedPathSegList;
|
||||
class SVGAnimatedPreserveAspectRatio;
|
||||
class SVGAnimatedTransformList;
|
||||
class SVGIntegerPair;
|
||||
class SVGNumberList;
|
||||
class SVGNumberPair;
|
||||
class SVGStringList;
|
||||
class DOMSVGStringList;
|
||||
|
||||
|
@ -389,11 +389,11 @@ class SVGElement : public SVGElementBase // nsIContent
|
|||
};
|
||||
|
||||
struct NumberPairAttributesInfo {
|
||||
nsSVGNumberPair* const mNumberPairs;
|
||||
SVGNumberPair* const mNumberPairs;
|
||||
const NumberPairInfo* const mNumberPairInfo;
|
||||
const uint32_t mNumberPairCount;
|
||||
|
||||
NumberPairAttributesInfo(nsSVGNumberPair* aNumberPairs,
|
||||
NumberPairAttributesInfo(SVGNumberPair* aNumberPairs,
|
||||
NumberPairInfo* aNumberPairInfo,
|
||||
uint32_t aNumberPairCount)
|
||||
: mNumberPairs(aNumberPairs),
|
||||
|
@ -429,11 +429,11 @@ class SVGElement : public SVGElementBase // nsIContent
|
|||
};
|
||||
|
||||
struct IntegerPairAttributesInfo {
|
||||
nsSVGIntegerPair* const mIntegerPairs;
|
||||
SVGIntegerPair* const mIntegerPairs;
|
||||
const IntegerPairInfo* const mIntegerPairInfo;
|
||||
const uint32_t mIntegerPairCount;
|
||||
|
||||
IntegerPairAttributesInfo(nsSVGIntegerPair* aIntegerPairs,
|
||||
IntegerPairAttributesInfo(SVGIntegerPair* aIntegerPairs,
|
||||
IntegerPairInfo* aIntegerPairInfo,
|
||||
uint32_t aIntegerPairCount)
|
||||
: mIntegerPairs(aIntegerPairs),
|
||||
|
|
|
@ -68,12 +68,12 @@ already_AddRefed<SVGAnimatedString> SVGFEConvolveMatrixElement::In1() {
|
|||
|
||||
already_AddRefed<SVGAnimatedInteger> SVGFEConvolveMatrixElement::OrderX() {
|
||||
return mIntegerPairAttributes[ORDER].ToDOMAnimatedInteger(
|
||||
nsSVGIntegerPair::eFirst, this);
|
||||
SVGIntegerPair::eFirst, this);
|
||||
}
|
||||
|
||||
already_AddRefed<SVGAnimatedInteger> SVGFEConvolveMatrixElement::OrderY() {
|
||||
return mIntegerPairAttributes[ORDER].ToDOMAnimatedInteger(
|
||||
nsSVGIntegerPair::eSecond, this);
|
||||
SVGIntegerPair::eSecond, this);
|
||||
}
|
||||
|
||||
already_AddRefed<DOMSVGAnimatedNumberList>
|
||||
|
@ -111,13 +111,13 @@ already_AddRefed<SVGAnimatedNumber> SVGFEConvolveMatrixElement::Bias() {
|
|||
already_AddRefed<SVGAnimatedNumber>
|
||||
SVGFEConvolveMatrixElement::KernelUnitLengthX() {
|
||||
return mNumberPairAttributes[KERNEL_UNIT_LENGTH].ToDOMAnimatedNumber(
|
||||
nsSVGNumberPair::eFirst, this);
|
||||
SVGNumberPair::eFirst, this);
|
||||
}
|
||||
|
||||
already_AddRefed<SVGAnimatedNumber>
|
||||
SVGFEConvolveMatrixElement::KernelUnitLengthY() {
|
||||
return mNumberPairAttributes[KERNEL_UNIT_LENGTH].ToDOMAnimatedNumber(
|
||||
nsSVGNumberPair::eSecond, this);
|
||||
SVGNumberPair::eSecond, this);
|
||||
}
|
||||
|
||||
void SVGFEConvolveMatrixElement::GetSourceImageNames(
|
||||
|
@ -136,9 +136,9 @@ FilterPrimitiveDescription SVGFEConvolveMatrixElement::GetPrimitiveDescription(
|
|||
uint32_t kmLength = kernelMatrix.Length();
|
||||
|
||||
int32_t orderX =
|
||||
mIntegerPairAttributes[ORDER].GetAnimValue(nsSVGIntegerPair::eFirst);
|
||||
mIntegerPairAttributes[ORDER].GetAnimValue(SVGIntegerPair::eFirst);
|
||||
int32_t orderY =
|
||||
mIntegerPairAttributes[ORDER].GetAnimValue(nsSVGIntegerPair::eSecond);
|
||||
mIntegerPairAttributes[ORDER].GetAnimValue(SVGIntegerPair::eSecond);
|
||||
|
||||
if (orderX <= 0 || orderY <= 0 ||
|
||||
static_cast<uint32_t>(orderX * orderY) != kmLength) {
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
#include "SVGEnum.h"
|
||||
#include "SVGFilters.h"
|
||||
#include "nsSVGInteger.h"
|
||||
#include "nsSVGIntegerPair.h"
|
||||
#include "SVGIntegerPair.h"
|
||||
#include "nsSVGNumber2.h"
|
||||
#include "nsSVGString.h"
|
||||
|
||||
|
@ -82,7 +82,7 @@ class SVGFEConvolveMatrixElement : public SVGFEConvolveMatrixElementBase {
|
|||
static NumberInfo sNumberInfo[2];
|
||||
|
||||
enum { KERNEL_UNIT_LENGTH };
|
||||
nsSVGNumberPair mNumberPairAttributes[1];
|
||||
SVGNumberPair mNumberPairAttributes[1];
|
||||
static NumberPairInfo sNumberPairInfo[1];
|
||||
|
||||
enum { TARGET_X, TARGET_Y };
|
||||
|
@ -90,7 +90,7 @@ class SVGFEConvolveMatrixElement : public SVGFEConvolveMatrixElementBase {
|
|||
static IntegerInfo sIntegerInfo[2];
|
||||
|
||||
enum { ORDER };
|
||||
nsSVGIntegerPair mIntegerPairAttributes[1];
|
||||
SVGIntegerPair mIntegerPairAttributes[1];
|
||||
static IntegerPairInfo sIntegerPairInfo[1];
|
||||
|
||||
enum { PRESERVEALPHA };
|
||||
|
|
|
@ -45,13 +45,13 @@ SVGFEDiffuseLightingElement::DiffuseConstant() {
|
|||
already_AddRefed<SVGAnimatedNumber>
|
||||
SVGFEDiffuseLightingElement::KernelUnitLengthX() {
|
||||
return mNumberPairAttributes[KERNEL_UNIT_LENGTH].ToDOMAnimatedNumber(
|
||||
nsSVGNumberPair::eFirst, this);
|
||||
SVGNumberPair::eFirst, this);
|
||||
}
|
||||
|
||||
already_AddRefed<SVGAnimatedNumber>
|
||||
SVGFEDiffuseLightingElement::KernelUnitLengthY() {
|
||||
return mNumberPairAttributes[KERNEL_UNIT_LENGTH].ToDOMAnimatedNumber(
|
||||
nsSVGNumberPair::eSecond, this);
|
||||
SVGNumberPair::eSecond, this);
|
||||
}
|
||||
|
||||
FilterPrimitiveDescription SVGFEDiffuseLightingElement::GetPrimitiveDescription(
|
||||
|
|
|
@ -52,12 +52,12 @@ already_AddRefed<SVGAnimatedNumber> SVGFEDropShadowElement::Dy() {
|
|||
|
||||
already_AddRefed<SVGAnimatedNumber> SVGFEDropShadowElement::StdDeviationX() {
|
||||
return mNumberPairAttributes[STD_DEV].ToDOMAnimatedNumber(
|
||||
nsSVGNumberPair::eFirst, this);
|
||||
SVGNumberPair::eFirst, this);
|
||||
}
|
||||
|
||||
already_AddRefed<SVGAnimatedNumber> SVGFEDropShadowElement::StdDeviationY() {
|
||||
return mNumberPairAttributes[STD_DEV].ToDOMAnimatedNumber(
|
||||
nsSVGNumberPair::eSecond, this);
|
||||
SVGNumberPair::eSecond, this);
|
||||
}
|
||||
|
||||
void SVGFEDropShadowElement::SetStdDeviation(float stdDeviationX,
|
||||
|
@ -72,10 +72,10 @@ FilterPrimitiveDescription SVGFEDropShadowElement::GetPrimitiveDescription(
|
|||
nsTArray<RefPtr<SourceSurface>>& aInputImages) {
|
||||
float stdX = aInstance->GetPrimitiveNumber(SVGContentUtils::X,
|
||||
&mNumberPairAttributes[STD_DEV],
|
||||
nsSVGNumberPair::eFirst);
|
||||
SVGNumberPair::eFirst);
|
||||
float stdY = aInstance->GetPrimitiveNumber(SVGContentUtils::Y,
|
||||
&mNumberPairAttributes[STD_DEV],
|
||||
nsSVGNumberPair::eSecond);
|
||||
SVGNumberPair::eSecond);
|
||||
if (stdX < 0 || stdY < 0) {
|
||||
return FilterPrimitiveDescription();
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
#include "SVGFilters.h"
|
||||
#include "nsSVGNumber2.h"
|
||||
#include "nsSVGNumberPair.h"
|
||||
#include "SVGNumberPair.h"
|
||||
#include "nsSVGString.h"
|
||||
|
||||
nsresult NS_NewSVGFEDropShadowElement(
|
||||
|
@ -67,7 +67,7 @@ class SVGFEDropShadowElement : public SVGFEDropShadowElementBase {
|
|||
static NumberInfo sNumberInfo[2];
|
||||
|
||||
enum { STD_DEV };
|
||||
nsSVGNumberPair mNumberPairAttributes[1];
|
||||
SVGNumberPair mNumberPairAttributes[1];
|
||||
static NumberPairInfo sNumberPairInfo[1];
|
||||
|
||||
enum { RESULT, IN1 };
|
||||
|
|
|
@ -41,12 +41,12 @@ already_AddRefed<SVGAnimatedString> SVGFEGaussianBlurElement::In1() {
|
|||
|
||||
already_AddRefed<SVGAnimatedNumber> SVGFEGaussianBlurElement::StdDeviationX() {
|
||||
return mNumberPairAttributes[STD_DEV].ToDOMAnimatedNumber(
|
||||
nsSVGNumberPair::eFirst, this);
|
||||
SVGNumberPair::eFirst, this);
|
||||
}
|
||||
|
||||
already_AddRefed<SVGAnimatedNumber> SVGFEGaussianBlurElement::StdDeviationY() {
|
||||
return mNumberPairAttributes[STD_DEV].ToDOMAnimatedNumber(
|
||||
nsSVGNumberPair::eSecond, this);
|
||||
SVGNumberPair::eSecond, this);
|
||||
}
|
||||
|
||||
void SVGFEGaussianBlurElement::SetStdDeviation(float stdDeviationX,
|
||||
|
@ -61,10 +61,10 @@ FilterPrimitiveDescription SVGFEGaussianBlurElement::GetPrimitiveDescription(
|
|||
nsTArray<RefPtr<SourceSurface>>& aInputImages) {
|
||||
float stdX = aInstance->GetPrimitiveNumber(SVGContentUtils::X,
|
||||
&mNumberPairAttributes[STD_DEV],
|
||||
nsSVGNumberPair::eFirst);
|
||||
SVGNumberPair::eFirst);
|
||||
float stdY = aInstance->GetPrimitiveNumber(SVGContentUtils::Y,
|
||||
&mNumberPairAttributes[STD_DEV],
|
||||
nsSVGNumberPair::eSecond);
|
||||
SVGNumberPair::eSecond);
|
||||
if (stdX < 0 || stdY < 0) {
|
||||
return FilterPrimitiveDescription();
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#define mozilla_dom_SVGFEGaussianBlurElement_h
|
||||
|
||||
#include "SVGFilters.h"
|
||||
#include "nsSVGNumberPair.h"
|
||||
#include "SVGNumberPair.h"
|
||||
#include "nsSVGString.h"
|
||||
|
||||
nsresult NS_NewSVGFEGaussianBlurElement(
|
||||
|
@ -56,7 +56,7 @@ class SVGFEGaussianBlurElement : public SVGFEGaussianBlurElementBase {
|
|||
virtual StringAttributesInfo GetStringInfo() override;
|
||||
|
||||
enum { STD_DEV };
|
||||
nsSVGNumberPair mNumberPairAttributes[1];
|
||||
SVGNumberPair mNumberPairAttributes[1];
|
||||
static NumberPairInfo sNumberPairInfo[1];
|
||||
|
||||
enum { RESULT, IN1 };
|
||||
|
|
|
@ -53,12 +53,12 @@ already_AddRefed<SVGAnimatedEnumeration> SVGFEMorphologyElement::Operator() {
|
|||
|
||||
already_AddRefed<SVGAnimatedNumber> SVGFEMorphologyElement::RadiusX() {
|
||||
return mNumberPairAttributes[RADIUS].ToDOMAnimatedNumber(
|
||||
nsSVGNumberPair::eFirst, this);
|
||||
SVGNumberPair::eFirst, this);
|
||||
}
|
||||
|
||||
already_AddRefed<SVGAnimatedNumber> SVGFEMorphologyElement::RadiusY() {
|
||||
return mNumberPairAttributes[RADIUS].ToDOMAnimatedNumber(
|
||||
nsSVGNumberPair::eSecond, this);
|
||||
SVGNumberPair::eSecond, this);
|
||||
}
|
||||
|
||||
void SVGFEMorphologyElement::SetRadius(float rx, float ry) {
|
||||
|
@ -80,11 +80,11 @@ void SVGFEMorphologyElement::GetRXY(int32_t* aRX, int32_t* aRY,
|
|||
// issues.
|
||||
*aRX = NSToIntCeil(aInstance.GetPrimitiveNumber(
|
||||
SVGContentUtils::X, &mNumberPairAttributes[RADIUS],
|
||||
nsSVGNumberPair::eFirst) -
|
||||
SVGNumberPair::eFirst) -
|
||||
MORPHOLOGY_EPSILON);
|
||||
*aRY = NSToIntCeil(aInstance.GetPrimitiveNumber(
|
||||
SVGContentUtils::Y, &mNumberPairAttributes[RADIUS],
|
||||
nsSVGNumberPair::eSecond) -
|
||||
SVGNumberPair::eSecond) -
|
||||
MORPHOLOGY_EPSILON);
|
||||
}
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
#include "SVGEnum.h"
|
||||
#include "SVGFilters.h"
|
||||
#include "nsSVGNumberPair.h"
|
||||
#include "SVGNumberPair.h"
|
||||
#include "nsSVGString.h"
|
||||
|
||||
nsresult NS_NewSVGFEMorphologyElement(
|
||||
|
@ -61,7 +61,7 @@ class SVGFEMorphologyElement : public SVGFEMorphologyElementBase {
|
|||
virtual StringAttributesInfo GetStringInfo() override;
|
||||
|
||||
enum { RADIUS };
|
||||
nsSVGNumberPair mNumberPairAttributes[1];
|
||||
SVGNumberPair mNumberPairAttributes[1];
|
||||
static NumberPairInfo sNumberPairInfo[1];
|
||||
|
||||
enum { OPERATOR };
|
||||
|
|
|
@ -48,13 +48,13 @@ SVGFESpecularLightingElement::SpecularExponent() {
|
|||
already_AddRefed<SVGAnimatedNumber>
|
||||
SVGFESpecularLightingElement::KernelUnitLengthX() {
|
||||
return mNumberPairAttributes[KERNEL_UNIT_LENGTH].ToDOMAnimatedNumber(
|
||||
nsSVGNumberPair::eFirst, this);
|
||||
SVGNumberPair::eFirst, this);
|
||||
}
|
||||
|
||||
already_AddRefed<SVGAnimatedNumber>
|
||||
SVGFESpecularLightingElement::KernelUnitLengthY() {
|
||||
return mNumberPairAttributes[KERNEL_UNIT_LENGTH].ToDOMAnimatedNumber(
|
||||
nsSVGNumberPair::eSecond, this);
|
||||
SVGNumberPair::eSecond, this);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
|
|
@ -62,12 +62,12 @@ NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFETurbulenceElement)
|
|||
|
||||
already_AddRefed<SVGAnimatedNumber> SVGFETurbulenceElement::BaseFrequencyX() {
|
||||
return mNumberPairAttributes[BASE_FREQ].ToDOMAnimatedNumber(
|
||||
nsSVGNumberPair::eFirst, this);
|
||||
SVGNumberPair::eFirst, this);
|
||||
}
|
||||
|
||||
already_AddRefed<SVGAnimatedNumber> SVGFETurbulenceElement::BaseFrequencyY() {
|
||||
return mNumberPairAttributes[BASE_FREQ].ToDOMAnimatedNumber(
|
||||
nsSVGNumberPair::eSecond, this);
|
||||
SVGNumberPair::eSecond, this);
|
||||
}
|
||||
|
||||
already_AddRefed<SVGAnimatedInteger> SVGFETurbulenceElement::NumOctaves() {
|
||||
|
@ -91,9 +91,9 @@ FilterPrimitiveDescription SVGFETurbulenceElement::GetPrimitiveDescription(
|
|||
const nsTArray<bool>& aInputsAreTainted,
|
||||
nsTArray<RefPtr<SourceSurface>>& aInputImages) {
|
||||
float fX =
|
||||
mNumberPairAttributes[BASE_FREQ].GetAnimValue(nsSVGNumberPair::eFirst);
|
||||
mNumberPairAttributes[BASE_FREQ].GetAnimValue(SVGNumberPair::eFirst);
|
||||
float fY =
|
||||
mNumberPairAttributes[BASE_FREQ].GetAnimValue(nsSVGNumberPair::eSecond);
|
||||
mNumberPairAttributes[BASE_FREQ].GetAnimValue(SVGNumberPair::eSecond);
|
||||
float seed = mNumberAttributes[OCTAVES].GetAnimValue();
|
||||
uint32_t octaves =
|
||||
clamped(mIntegerAttributes[OCTAVES].GetAnimValue(), 0, MAX_OCTAVES);
|
||||
|
|
|
@ -68,7 +68,7 @@ class SVGFETurbulenceElement : public SVGFETurbulenceElementBase {
|
|||
static NumberInfo sNumberInfo[1];
|
||||
|
||||
enum { BASE_FREQ };
|
||||
nsSVGNumberPair mNumberPairAttributes[1];
|
||||
SVGNumberPair mNumberPairAttributes[1];
|
||||
static NumberPairInfo sNumberPairInfo[1];
|
||||
|
||||
enum { OCTAVES };
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
#define mozilla_dom_SVGFilterElement_h
|
||||
|
||||
#include "SVGEnum.h"
|
||||
#include "nsSVGIntegerPair.h"
|
||||
#include "nsSVGLength2.h"
|
||||
#include "nsSVGString.h"
|
||||
#include "mozilla/dom/SVGElement.h"
|
||||
|
|
|
@ -14,14 +14,10 @@
|
|||
#include "nsIFrame.h"
|
||||
#include "nsLayoutUtils.h"
|
||||
#include "SVGAnimatedNumberList.h"
|
||||
#include "nsSVGBoolean.h"
|
||||
#include "SVGEnum.h"
|
||||
#include "nsSVGFilterInstance.h"
|
||||
#include "nsSVGInteger.h"
|
||||
#include "nsSVGIntegerPair.h"
|
||||
#include "nsSVGNumber2.h"
|
||||
#include "nsSVGNumberPair.h"
|
||||
#include "SVGNumberList.h"
|
||||
#include "SVGNumberPair.h"
|
||||
#include "nsSVGString.h"
|
||||
#include "mozilla/ArrayUtils.h"
|
||||
#include "mozilla/ComputedStyle.h"
|
||||
|
@ -148,15 +144,15 @@ bool SVGFE::StyleIsSetToSRGB() {
|
|||
}
|
||||
|
||||
Size SVGFE::GetKernelUnitLength(nsSVGFilterInstance* aInstance,
|
||||
nsSVGNumberPair* aKernelUnitLength) {
|
||||
SVGNumberPair* aKernelUnitLength) {
|
||||
if (!aKernelUnitLength->IsExplicitlySet()) {
|
||||
return Size(1, 1);
|
||||
}
|
||||
|
||||
float kernelX = aInstance->GetPrimitiveNumber(
|
||||
SVGContentUtils::X, aKernelUnitLength, nsSVGNumberPair::eFirst);
|
||||
SVGContentUtils::X, aKernelUnitLength, SVGNumberPair::eFirst);
|
||||
float kernelY = aInstance->GetPrimitiveNumber(
|
||||
SVGContentUtils::Y, aKernelUnitLength, nsSVGNumberPair::eSecond);
|
||||
SVGContentUtils::Y, aKernelUnitLength, SVGNumberPair::eSecond);
|
||||
return Size(kernelX, kernelY);
|
||||
}
|
||||
|
||||
|
|
|
@ -8,16 +8,15 @@
|
|||
#define __NS_SVGFILTERSELEMENT_H__
|
||||
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/dom/SVGElement.h"
|
||||
#include "FilterSupport.h"
|
||||
#include "nsImageLoadingContent.h"
|
||||
#include "nsSVGLength2.h"
|
||||
#include "nsSVGString.h"
|
||||
#include "SVGElement.h"
|
||||
#include "nsSVGNumber2.h"
|
||||
#include "nsSVGNumberPair.h"
|
||||
#include "FilterSupport.h"
|
||||
#include "SVGNumberPair.h"
|
||||
|
||||
class nsSVGFilterInstance;
|
||||
class nsSVGNumberPair;
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
@ -147,7 +146,7 @@ class SVGFE : public SVGFEBase {
|
|||
virtual LengthAttributesInfo GetLengthInfo() override;
|
||||
|
||||
Size GetKernelUnitLength(nsSVGFilterInstance* aInstance,
|
||||
nsSVGNumberPair* aKernelUnitLength);
|
||||
SVGNumberPair* aKernelUnitLength);
|
||||
|
||||
enum { ATTR_X, ATTR_Y, ATTR_WIDTH, ATTR_HEIGHT };
|
||||
nsSVGLength2 mLengthAttributes[4];
|
||||
|
@ -226,7 +225,7 @@ class SVGFELightingElement : public SVGFELightingElementBase {
|
|||
static NumberInfo sNumberInfo[4];
|
||||
|
||||
enum { KERNEL_UNIT_LENGTH };
|
||||
nsSVGNumberPair mNumberPairAttributes[1];
|
||||
SVGNumberPair mNumberPairAttributes[1];
|
||||
static NumberPairInfo sNumberPairInfo[1];
|
||||
|
||||
enum { RESULT, IN1 };
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "nsSVGIntegerPair.h"
|
||||
#include "SVGIntegerPair.h"
|
||||
#include "nsSVGAttrTearoffTable.h"
|
||||
#include "nsCharSeparatedTokenizer.h"
|
||||
#include "nsError.h"
|
||||
|
@ -13,14 +13,13 @@
|
|||
#include "SVGContentUtils.h"
|
||||
#include "SVGIntegerPairSMILType.h"
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::dom;
|
||||
|
||||
static nsSVGAttrTearoffTable<nsSVGIntegerPair,
|
||||
nsSVGIntegerPair::DOMAnimatedInteger>
|
||||
namespace mozilla {
|
||||
|
||||
static nsSVGAttrTearoffTable<SVGIntegerPair, SVGIntegerPair::DOMAnimatedInteger>
|
||||
sSVGFirstAnimatedIntegerTearoffTable;
|
||||
static nsSVGAttrTearoffTable<nsSVGIntegerPair,
|
||||
nsSVGIntegerPair::DOMAnimatedInteger>
|
||||
static nsSVGAttrTearoffTable<SVGIntegerPair, SVGIntegerPair::DOMAnimatedInteger>
|
||||
sSVGSecondAnimatedIntegerTearoffTable;
|
||||
|
||||
/* Implementation */
|
||||
|
@ -53,8 +52,8 @@ static nsresult ParseIntegerOptionalInteger(const nsAString& aValue,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult nsSVGIntegerPair::SetBaseValueString(const nsAString& aValueAsString,
|
||||
SVGElement* aSVGElement) {
|
||||
nsresult SVGIntegerPair::SetBaseValueString(const nsAString& aValueAsString,
|
||||
SVGElement* aSVGElement) {
|
||||
int32_t val[2];
|
||||
|
||||
nsresult rv = ParseIntegerOptionalInteger(aValueAsString, val);
|
||||
|
@ -79,7 +78,7 @@ nsresult nsSVGIntegerPair::SetBaseValueString(const nsAString& aValueAsString,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
void nsSVGIntegerPair::GetBaseValueString(nsAString& aValueAsString) const {
|
||||
void SVGIntegerPair::GetBaseValueString(nsAString& aValueAsString) const {
|
||||
aValueAsString.Truncate();
|
||||
aValueAsString.AppendInt(mBaseVal[0]);
|
||||
if (mBaseVal[0] != mBaseVal[1]) {
|
||||
|
@ -88,8 +87,8 @@ void nsSVGIntegerPair::GetBaseValueString(nsAString& aValueAsString) const {
|
|||
}
|
||||
}
|
||||
|
||||
void nsSVGIntegerPair::SetBaseValue(int32_t aValue, PairIndex aPairIndex,
|
||||
SVGElement* aSVGElement) {
|
||||
void SVGIntegerPair::SetBaseValue(int32_t aValue, PairIndex aPairIndex,
|
||||
SVGElement* aSVGElement) {
|
||||
uint32_t index = (aPairIndex == eFirst ? 0 : 1);
|
||||
if (mIsBaseSet && mBaseVal[index] == aValue) {
|
||||
return;
|
||||
|
@ -106,8 +105,8 @@ void nsSVGIntegerPair::SetBaseValue(int32_t aValue, PairIndex aPairIndex,
|
|||
aSVGElement->DidChangeIntegerPair(mAttrEnum, emptyOrOldValue);
|
||||
}
|
||||
|
||||
void nsSVGIntegerPair::SetBaseValues(int32_t aValue1, int32_t aValue2,
|
||||
SVGElement* aSVGElement) {
|
||||
void SVGIntegerPair::SetBaseValues(int32_t aValue1, int32_t aValue2,
|
||||
SVGElement* aSVGElement) {
|
||||
if (mIsBaseSet && mBaseVal[0] == aValue1 && mBaseVal[1] == aValue2) {
|
||||
return;
|
||||
}
|
||||
|
@ -125,8 +124,8 @@ void nsSVGIntegerPair::SetBaseValues(int32_t aValue1, int32_t aValue2,
|
|||
aSVGElement->DidChangeIntegerPair(mAttrEnum, emptyOrOldValue);
|
||||
}
|
||||
|
||||
void nsSVGIntegerPair::SetAnimValue(const int32_t aValue[2],
|
||||
SVGElement* aSVGElement) {
|
||||
void SVGIntegerPair::SetAnimValue(const int32_t aValue[2],
|
||||
SVGElement* aSVGElement) {
|
||||
if (mIsAnimated && mAnimVal[0] == aValue[0] && mAnimVal[1] == aValue[1]) {
|
||||
return;
|
||||
}
|
||||
|
@ -136,7 +135,7 @@ void nsSVGIntegerPair::SetAnimValue(const int32_t aValue[2],
|
|||
aSVGElement->DidAnimateIntegerPair(mAttrEnum);
|
||||
}
|
||||
|
||||
already_AddRefed<SVGAnimatedInteger> nsSVGIntegerPair::ToDOMAnimatedInteger(
|
||||
already_AddRefed<SVGAnimatedInteger> SVGIntegerPair::ToDOMAnimatedInteger(
|
||||
PairIndex aIndex, SVGElement* aSVGElement) {
|
||||
RefPtr<DOMAnimatedInteger> domAnimatedInteger =
|
||||
aIndex == eFirst ? sSVGFirstAnimatedIntegerTearoffTable.GetTearoff(this)
|
||||
|
@ -154,7 +153,7 @@ already_AddRefed<SVGAnimatedInteger> nsSVGIntegerPair::ToDOMAnimatedInteger(
|
|||
return domAnimatedInteger.forget();
|
||||
}
|
||||
|
||||
nsSVGIntegerPair::DOMAnimatedInteger::~DOMAnimatedInteger() {
|
||||
SVGIntegerPair::DOMAnimatedInteger::~DOMAnimatedInteger() {
|
||||
if (mIndex == eFirst) {
|
||||
sSVGFirstAnimatedIntegerTearoffTable.RemoveTearoff(mVal);
|
||||
} else {
|
||||
|
@ -162,11 +161,11 @@ nsSVGIntegerPair::DOMAnimatedInteger::~DOMAnimatedInteger() {
|
|||
}
|
||||
}
|
||||
|
||||
UniquePtr<nsISMILAttr> nsSVGIntegerPair::ToSMILAttr(SVGElement* aSVGElement) {
|
||||
UniquePtr<nsISMILAttr> SVGIntegerPair::ToSMILAttr(SVGElement* aSVGElement) {
|
||||
return MakeUnique<SMILIntegerPair>(this, aSVGElement);
|
||||
}
|
||||
|
||||
nsresult nsSVGIntegerPair::SMILIntegerPair::ValueFromString(
|
||||
nsresult SVGIntegerPair::SMILIntegerPair::ValueFromString(
|
||||
const nsAString& aStr, const dom::SVGAnimationElement* /*aSrcElement*/,
|
||||
nsSMILValue& aValue, bool& aPreventCachingOfSandwich) const {
|
||||
int32_t values[2];
|
||||
|
@ -185,14 +184,14 @@ nsresult nsSVGIntegerPair::SMILIntegerPair::ValueFromString(
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
nsSMILValue nsSVGIntegerPair::SMILIntegerPair::GetBaseValue() const {
|
||||
nsSMILValue SVGIntegerPair::SMILIntegerPair::GetBaseValue() const {
|
||||
nsSMILValue val(SVGIntegerPairSMILType::Singleton());
|
||||
val.mU.mIntPair[0] = mVal->mBaseVal[0];
|
||||
val.mU.mIntPair[1] = mVal->mBaseVal[1];
|
||||
return val;
|
||||
}
|
||||
|
||||
void nsSVGIntegerPair::SMILIntegerPair::ClearAnimValue() {
|
||||
void SVGIntegerPair::SMILIntegerPair::ClearAnimValue() {
|
||||
if (mVal->mIsAnimated) {
|
||||
mVal->mIsAnimated = false;
|
||||
mVal->mAnimVal[0] = mVal->mBaseVal[0];
|
||||
|
@ -201,7 +200,7 @@ void nsSVGIntegerPair::SMILIntegerPair::ClearAnimValue() {
|
|||
}
|
||||
}
|
||||
|
||||
nsresult nsSVGIntegerPair::SMILIntegerPair::SetAnimValue(
|
||||
nsresult SVGIntegerPair::SMILIntegerPair::SetAnimValue(
|
||||
const nsSMILValue& aValue) {
|
||||
NS_ASSERTION(aValue.mType == SVGIntegerPairSMILType::Singleton(),
|
||||
"Unexpected type to assign animated value");
|
||||
|
@ -210,3 +209,5 @@ nsresult nsSVGIntegerPair::SMILIntegerPair::SetAnimValue(
|
|||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
} // namespace mozilla
|
|
@ -10,20 +10,19 @@
|
|||
#include "nsCycleCollectionParticipant.h"
|
||||
#include "nsError.h"
|
||||
#include "nsISMILAttr.h"
|
||||
#include "SVGElement.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/dom/SVGAnimatedInteger.h"
|
||||
#include "mozilla/UniquePtr.h"
|
||||
#include "mozilla/dom/SVGAnimatedInteger.h"
|
||||
|
||||
class nsSMILValue;
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
class SVGAnimationElement;
|
||||
class SVGElement;
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
class nsSVGIntegerPair {
|
||||
class SVGIntegerPair {
|
||||
public:
|
||||
typedef mozilla::dom::SVGElement SVGElement;
|
||||
|
||||
|
@ -71,14 +70,14 @@ class nsSVGIntegerPair {
|
|||
|
||||
public:
|
||||
struct DOMAnimatedInteger final : public mozilla::dom::SVGAnimatedInteger {
|
||||
DOMAnimatedInteger(nsSVGIntegerPair* aVal, PairIndex aIndex,
|
||||
DOMAnimatedInteger(SVGIntegerPair* aVal, PairIndex aIndex,
|
||||
SVGElement* aSVGElement)
|
||||
: mozilla::dom::SVGAnimatedInteger(aSVGElement),
|
||||
mVal(aVal),
|
||||
mIndex(aIndex) {}
|
||||
virtual ~DOMAnimatedInteger();
|
||||
|
||||
nsSVGIntegerPair* mVal; // kept alive because it belongs to content
|
||||
SVGIntegerPair* mVal; // kept alive because it belongs to content
|
||||
PairIndex mIndex; // are we the first or second integer
|
||||
|
||||
virtual int32_t BaseVal() override { return mVal->GetBaseValue(mIndex); }
|
||||
|
@ -96,13 +95,13 @@ class nsSVGIntegerPair {
|
|||
|
||||
struct SMILIntegerPair : public nsISMILAttr {
|
||||
public:
|
||||
SMILIntegerPair(nsSVGIntegerPair* aVal, SVGElement* aSVGElement)
|
||||
SMILIntegerPair(SVGIntegerPair* aVal, SVGElement* aSVGElement)
|
||||
: mVal(aVal), mSVGElement(aSVGElement) {}
|
||||
|
||||
// These will stay alive because a nsISMILAttr only lives as long
|
||||
// as the Compositing step, and DOM elements don't get a chance to
|
||||
// die during that.
|
||||
nsSVGIntegerPair* mVal;
|
||||
SVGIntegerPair* mVal;
|
||||
SVGElement* mSVGElement;
|
||||
|
||||
// nsISMILAttr methods
|
||||
|
@ -116,4 +115,6 @@ class nsSVGIntegerPair {
|
|||
};
|
||||
};
|
||||
|
||||
} // namespace mozilla
|
||||
|
||||
#endif //__NS_SVGINTEGERPAIR_H__
|
|
@ -4,21 +4,20 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "nsSVGNumberPair.h"
|
||||
#include "SVGNumberPair.h"
|
||||
#include "nsSVGAttrTearoffTable.h"
|
||||
#include "nsCharSeparatedTokenizer.h"
|
||||
#include "nsSMILValue.h"
|
||||
#include "SVGContentUtils.h"
|
||||
#include "SVGNumberPairSMILType.h"
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::dom;
|
||||
|
||||
static nsSVGAttrTearoffTable<nsSVGNumberPair,
|
||||
nsSVGNumberPair::DOMAnimatedNumber>
|
||||
namespace mozilla {
|
||||
|
||||
static nsSVGAttrTearoffTable<SVGNumberPair, SVGNumberPair::DOMAnimatedNumber>
|
||||
sSVGFirstAnimatedNumberTearoffTable;
|
||||
static nsSVGAttrTearoffTable<nsSVGNumberPair,
|
||||
nsSVGNumberPair::DOMAnimatedNumber>
|
||||
static nsSVGAttrTearoffTable<SVGNumberPair, SVGNumberPair::DOMAnimatedNumber>
|
||||
sSVGSecondAnimatedNumberTearoffTable;
|
||||
|
||||
static nsresult ParseNumberOptionalNumber(const nsAString& aValue,
|
||||
|
@ -49,8 +48,8 @@ static nsresult ParseNumberOptionalNumber(const nsAString& aValue,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult nsSVGNumberPair::SetBaseValueString(const nsAString& aValueAsString,
|
||||
SVGElement* aSVGElement) {
|
||||
nsresult SVGNumberPair::SetBaseValueString(const nsAString& aValueAsString,
|
||||
SVGElement* aSVGElement) {
|
||||
float val[2];
|
||||
|
||||
nsresult rv = ParseNumberOptionalNumber(aValueAsString, val);
|
||||
|
@ -74,7 +73,7 @@ nsresult nsSVGNumberPair::SetBaseValueString(const nsAString& aValueAsString,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
void nsSVGNumberPair::GetBaseValueString(nsAString& aValueAsString) const {
|
||||
void SVGNumberPair::GetBaseValueString(nsAString& aValueAsString) const {
|
||||
aValueAsString.Truncate();
|
||||
aValueAsString.AppendFloat(mBaseVal[0]);
|
||||
if (mBaseVal[0] != mBaseVal[1]) {
|
||||
|
@ -83,8 +82,8 @@ void nsSVGNumberPair::GetBaseValueString(nsAString& aValueAsString) const {
|
|||
}
|
||||
}
|
||||
|
||||
void nsSVGNumberPair::SetBaseValue(float aValue, PairIndex aPairIndex,
|
||||
SVGElement* aSVGElement) {
|
||||
void SVGNumberPair::SetBaseValue(float aValue, PairIndex aPairIndex,
|
||||
SVGElement* aSVGElement) {
|
||||
uint32_t index = (aPairIndex == eFirst ? 0 : 1);
|
||||
if (mIsBaseSet && mBaseVal[index] == aValue) {
|
||||
return;
|
||||
|
@ -100,8 +99,8 @@ void nsSVGNumberPair::SetBaseValue(float aValue, PairIndex aPairIndex,
|
|||
aSVGElement->DidChangeNumberPair(mAttrEnum, emptyOrOldValue);
|
||||
}
|
||||
|
||||
void nsSVGNumberPair::SetBaseValues(float aValue1, float aValue2,
|
||||
SVGElement* aSVGElement) {
|
||||
void SVGNumberPair::SetBaseValues(float aValue1, float aValue2,
|
||||
SVGElement* aSVGElement) {
|
||||
if (mIsBaseSet && mBaseVal[0] == aValue1 && mBaseVal[1] == aValue2) {
|
||||
return;
|
||||
}
|
||||
|
@ -118,8 +117,8 @@ void nsSVGNumberPair::SetBaseValues(float aValue1, float aValue2,
|
|||
aSVGElement->DidChangeNumberPair(mAttrEnum, emptyOrOldValue);
|
||||
}
|
||||
|
||||
void nsSVGNumberPair::SetAnimValue(const float aValue[2],
|
||||
SVGElement* aSVGElement) {
|
||||
void SVGNumberPair::SetAnimValue(const float aValue[2],
|
||||
SVGElement* aSVGElement) {
|
||||
if (mIsAnimated && mAnimVal[0] == aValue[0] && mAnimVal[1] == aValue[1]) {
|
||||
return;
|
||||
}
|
||||
|
@ -129,7 +128,7 @@ void nsSVGNumberPair::SetAnimValue(const float aValue[2],
|
|||
aSVGElement->DidAnimateNumberPair(mAttrEnum);
|
||||
}
|
||||
|
||||
already_AddRefed<SVGAnimatedNumber> nsSVGNumberPair::ToDOMAnimatedNumber(
|
||||
already_AddRefed<SVGAnimatedNumber> SVGNumberPair::ToDOMAnimatedNumber(
|
||||
PairIndex aIndex, SVGElement* aSVGElement) {
|
||||
RefPtr<DOMAnimatedNumber> domAnimatedNumber =
|
||||
aIndex == eFirst ? sSVGFirstAnimatedNumberTearoffTable.GetTearoff(this)
|
||||
|
@ -146,7 +145,7 @@ already_AddRefed<SVGAnimatedNumber> nsSVGNumberPair::ToDOMAnimatedNumber(
|
|||
return domAnimatedNumber.forget();
|
||||
}
|
||||
|
||||
nsSVGNumberPair::DOMAnimatedNumber::~DOMAnimatedNumber() {
|
||||
SVGNumberPair::DOMAnimatedNumber::~DOMAnimatedNumber() {
|
||||
if (mIndex == eFirst) {
|
||||
sSVGFirstAnimatedNumberTearoffTable.RemoveTearoff(mVal);
|
||||
} else {
|
||||
|
@ -154,11 +153,11 @@ nsSVGNumberPair::DOMAnimatedNumber::~DOMAnimatedNumber() {
|
|||
}
|
||||
}
|
||||
|
||||
UniquePtr<nsISMILAttr> nsSVGNumberPair::ToSMILAttr(SVGElement* aSVGElement) {
|
||||
UniquePtr<nsISMILAttr> SVGNumberPair::ToSMILAttr(SVGElement* aSVGElement) {
|
||||
return MakeUnique<SMILNumberPair>(this, aSVGElement);
|
||||
}
|
||||
|
||||
nsresult nsSVGNumberPair::SMILNumberPair::ValueFromString(
|
||||
nsresult SVGNumberPair::SMILNumberPair::ValueFromString(
|
||||
const nsAString& aStr, const dom::SVGAnimationElement* /*aSrcElement*/,
|
||||
nsSMILValue& aValue, bool& aPreventCachingOfSandwich) const {
|
||||
float values[2];
|
||||
|
@ -177,14 +176,14 @@ nsresult nsSVGNumberPair::SMILNumberPair::ValueFromString(
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
nsSMILValue nsSVGNumberPair::SMILNumberPair::GetBaseValue() const {
|
||||
nsSMILValue SVGNumberPair::SMILNumberPair::GetBaseValue() const {
|
||||
nsSMILValue val(&SVGNumberPairSMILType::sSingleton);
|
||||
val.mU.mNumberPair[0] = mVal->mBaseVal[0];
|
||||
val.mU.mNumberPair[1] = mVal->mBaseVal[1];
|
||||
return val;
|
||||
}
|
||||
|
||||
void nsSVGNumberPair::SMILNumberPair::ClearAnimValue() {
|
||||
void SVGNumberPair::SMILNumberPair::ClearAnimValue() {
|
||||
if (mVal->mIsAnimated) {
|
||||
mVal->mIsAnimated = false;
|
||||
mVal->mAnimVal[0] = mVal->mBaseVal[0];
|
||||
|
@ -193,7 +192,7 @@ void nsSVGNumberPair::SMILNumberPair::ClearAnimValue() {
|
|||
}
|
||||
}
|
||||
|
||||
nsresult nsSVGNumberPair::SMILNumberPair::SetAnimValue(
|
||||
nsresult SVGNumberPair::SMILNumberPair::SetAnimValue(
|
||||
const nsSMILValue& aValue) {
|
||||
NS_ASSERTION(aValue.mType == &SVGNumberPairSMILType::sSingleton,
|
||||
"Unexpected type to assign animated value");
|
||||
|
@ -202,3 +201,5 @@ nsresult nsSVGNumberPair::SMILNumberPair::SetAnimValue(
|
|||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
} // namespace mozilla
|
|
@ -11,9 +11,8 @@
|
|||
#include "nsError.h"
|
||||
#include "nsISMILAttr.h"
|
||||
#include "nsMathUtils.h"
|
||||
#include "SVGElement.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/dom/SVGAnimatedNumber.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/FloatingPoint.h"
|
||||
#include "mozilla/UniquePtr.h"
|
||||
|
||||
|
@ -22,10 +21,10 @@ class nsSMILValue;
|
|||
namespace mozilla {
|
||||
namespace dom {
|
||||
class SVGAnimationElement;
|
||||
class SVGElement;
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
class nsSVGNumberPair {
|
||||
class SVGNumberPair {
|
||||
public:
|
||||
typedef mozilla::dom::SVGElement SVGElement;
|
||||
|
||||
|
@ -72,14 +71,14 @@ class nsSVGNumberPair {
|
|||
|
||||
public:
|
||||
struct DOMAnimatedNumber final : public mozilla::dom::SVGAnimatedNumber {
|
||||
DOMAnimatedNumber(nsSVGNumberPair* aVal, PairIndex aIndex,
|
||||
DOMAnimatedNumber(SVGNumberPair* aVal, PairIndex aIndex,
|
||||
SVGElement* aSVGElement)
|
||||
: mozilla::dom::SVGAnimatedNumber(aSVGElement),
|
||||
mVal(aVal),
|
||||
mIndex(aIndex) {}
|
||||
virtual ~DOMAnimatedNumber();
|
||||
|
||||
nsSVGNumberPair* mVal; // kept alive because it belongs to content
|
||||
SVGNumberPair* mVal; // kept alive because it belongs to content
|
||||
PairIndex mIndex; // are we the first or second number
|
||||
|
||||
virtual float BaseVal() override { return mVal->GetBaseValue(mIndex); }
|
||||
|
@ -98,13 +97,13 @@ class nsSVGNumberPair {
|
|||
|
||||
struct SMILNumberPair : public nsISMILAttr {
|
||||
public:
|
||||
SMILNumberPair(nsSVGNumberPair* aVal, SVGElement* aSVGElement)
|
||||
SMILNumberPair(SVGNumberPair* aVal, SVGElement* aSVGElement)
|
||||
: mVal(aVal), mSVGElement(aSVGElement) {}
|
||||
|
||||
// These will stay alive because a nsISMILAttr only lives as long
|
||||
// as the Compositing step, and DOM elements don't get a chance to
|
||||
// die during that.
|
||||
nsSVGNumberPair* mVal;
|
||||
SVGNumberPair* mVal;
|
||||
SVGElement* mSVGElement;
|
||||
|
||||
// nsISMILAttr methods
|
||||
|
@ -118,4 +117,6 @@ class nsSVGNumberPair {
|
|||
};
|
||||
};
|
||||
|
||||
} // namespace mozilla
|
||||
|
||||
#endif //__NS_SVGNUMBERPAIR_H__
|
|
@ -125,10 +125,8 @@ UNIFIED_SOURCES += [
|
|||
'nsISVGPoint.cpp',
|
||||
'nsSVGBoolean.cpp',
|
||||
'nsSVGInteger.cpp',
|
||||
'nsSVGIntegerPair.cpp',
|
||||
'nsSVGLength2.cpp',
|
||||
'nsSVGNumber2.cpp',
|
||||
'nsSVGNumberPair.cpp',
|
||||
'nsSVGString.cpp',
|
||||
'nsSVGViewBox.cpp',
|
||||
'SVGAElement.cpp',
|
||||
|
@ -194,6 +192,7 @@ UNIFIED_SOURCES += [
|
|||
'SVGGradientElement.cpp',
|
||||
'SVGGraphicsElement.cpp',
|
||||
'SVGImageElement.cpp',
|
||||
'SVGIntegerPair.cpp',
|
||||
'SVGIntegerPairSMILType.cpp',
|
||||
'SVGLength.cpp',
|
||||
'SVGLengthList.cpp',
|
||||
|
@ -210,6 +209,7 @@ UNIFIED_SOURCES += [
|
|||
'SVGMPathElement.cpp',
|
||||
'SVGNumberList.cpp',
|
||||
'SVGNumberListSMILType.cpp',
|
||||
'SVGNumberPair.cpp',
|
||||
'SVGNumberPairSMILType.cpp',
|
||||
'SVGOrientSMILType.cpp',
|
||||
'SVGPathData.cpp',
|
||||
|
|
|
@ -11,13 +11,11 @@
|
|||
#include "gfxPoint.h"
|
||||
#include "gfxRect.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "FilterSupport.h"
|
||||
#include "nsHashKeys.h"
|
||||
#include "nsPoint.h"
|
||||
#include "nsRect.h"
|
||||
#include "nsSize.h"
|
||||
#include "SVGFilters.h"
|
||||
#include "nsSVGNumber2.h"
|
||||
#include "nsSVGNumberPair.h"
|
||||
#include "nsTArray.h"
|
||||
#include "nsIFrame.h"
|
||||
#include "mozilla/gfx/2D.h"
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
#include "gfxRect.h"
|
||||
#include "SVGFilters.h"
|
||||
#include "nsSVGNumber2.h"
|
||||
#include "nsSVGNumberPair.h"
|
||||
#include "SVGNumberPair.h"
|
||||
#include "nsTArray.h"
|
||||
|
||||
class nsSVGFilterFrame;
|
||||
|
@ -65,6 +65,7 @@ class SVGFilterElement;
|
|||
* "filter space point" = (20, 20)
|
||||
*/
|
||||
class nsSVGFilterInstance {
|
||||
typedef mozilla::SVGNumberPair SVGNumberPair;
|
||||
typedef mozilla::gfx::Point3D Point3D;
|
||||
typedef mozilla::gfx::IntRect IntRect;
|
||||
typedef mozilla::gfx::SourceSurface SourceSurface;
|
||||
|
@ -113,8 +114,8 @@ class nsSVGFilterInstance {
|
|||
const nsSVGNumber2* aNumber) const {
|
||||
return GetPrimitiveNumber(aCtxType, aNumber->GetAnimValue());
|
||||
}
|
||||
float GetPrimitiveNumber(uint8_t aCtxType, const nsSVGNumberPair* aNumberPair,
|
||||
nsSVGNumberPair::PairIndex aIndex) const {
|
||||
float GetPrimitiveNumber(uint8_t aCtxType, const SVGNumberPair* aNumberPair,
|
||||
SVGNumberPair::PairIndex aIndex) const {
|
||||
return GetPrimitiveNumber(aCtxType, aNumberPair->GetAnimValue(aIndex));
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче