зеркало из https://github.com/mozilla/pjs.git
Bug 345511 - remove nsISVGMaskFrame. r+sr=roc
This commit is contained in:
Родитель
07cabefe9d
Коммит
3a4546517e
|
@ -43,61 +43,6 @@
|
||||||
#include "nsSVGMaskElement.h"
|
#include "nsSVGMaskElement.h"
|
||||||
#include "nsIDOMSVGMatrix.h"
|
#include "nsIDOMSVGMatrix.h"
|
||||||
|
|
||||||
typedef nsSVGContainerFrame nsSVGMaskFrameBase;
|
|
||||||
|
|
||||||
class nsSVGMaskFrame : public nsSVGMaskFrameBase,
|
|
||||||
public nsISVGMaskFrame
|
|
||||||
{
|
|
||||||
friend nsIFrame*
|
|
||||||
NS_NewSVGMaskFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsStyleContext* aContext);
|
|
||||||
|
|
||||||
NS_IMETHOD InitSVG();
|
|
||||||
|
|
||||||
public:
|
|
||||||
nsSVGMaskFrame(nsStyleContext* aContext) : nsSVGMaskFrameBase(aContext) {}
|
|
||||||
|
|
||||||
// nsISupports interface:
|
|
||||||
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
|
|
||||||
NS_IMETHOD_(nsrefcnt) AddRef() { return NS_OK; }
|
|
||||||
NS_IMETHOD_(nsrefcnt) Release() { return NS_OK; }
|
|
||||||
|
|
||||||
// nsISVGMaskFrame interface:
|
|
||||||
NS_IMETHOD MaskPaint(nsISVGRendererCanvas* aCanvas,
|
|
||||||
nsISVGRendererSurface* aSurface,
|
|
||||||
nsISVGChildFrame* aParent,
|
|
||||||
nsCOMPtr<nsIDOMSVGMatrix> aMatrix,
|
|
||||||
float aOpacity = 1.0f);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the "type" of the frame
|
|
||||||
*
|
|
||||||
* @see nsLayoutAtoms::svgMaskFrame
|
|
||||||
*/
|
|
||||||
virtual nsIAtom* GetType() const;
|
|
||||||
|
|
||||||
#ifdef DEBUG
|
|
||||||
NS_IMETHOD GetFrameName(nsAString& aResult) const
|
|
||||||
{
|
|
||||||
return MakeFrameName(NS_LITERAL_STRING("SVGMask"), aResult);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
private:
|
|
||||||
PRUint16 GetMaskUnits();
|
|
||||||
PRUint16 GetMaskContentUnits();
|
|
||||||
|
|
||||||
nsISVGChildFrame *mMaskParent;
|
|
||||||
nsCOMPtr<nsIDOMSVGMatrix> mMaskParentMatrix;
|
|
||||||
|
|
||||||
// nsSVGContainerFrame methods:
|
|
||||||
virtual already_AddRefed<nsIDOMSVGMatrix> GetCanvasTM();
|
|
||||||
};
|
|
||||||
|
|
||||||
NS_INTERFACE_MAP_BEGIN(nsSVGMaskFrame)
|
|
||||||
NS_INTERFACE_MAP_ENTRY(nsISVGMaskFrame)
|
|
||||||
NS_INTERFACE_MAP_END_INHERITING(nsSVGMaskFrameBase)
|
|
||||||
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// Implementation
|
// Implementation
|
||||||
|
|
||||||
|
@ -108,7 +53,7 @@ NS_NewSVGMaskFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsStyleContex
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
NS_GetSVGMaskFrame(nsISVGMaskFrame **aResult,
|
NS_GetSVGMaskFrame(nsSVGMaskFrame **aResult,
|
||||||
nsIURI *aURI, nsIContent *aContent)
|
nsIURI *aURI, nsIContent *aContent)
|
||||||
{
|
{
|
||||||
*aResult = nsnull;
|
*aResult = nsnull;
|
||||||
|
@ -190,7 +135,7 @@ static unsigned char rgb2lin[256] = {
|
||||||
239, 241, 243, 245, 248, 250, 252, 255
|
239, 241, 243, 245, 248, 250, 252, 255
|
||||||
};
|
};
|
||||||
|
|
||||||
NS_IMETHODIMP
|
nsresult
|
||||||
nsSVGMaskFrame::MaskPaint(nsISVGRendererCanvas* aCanvas,
|
nsSVGMaskFrame::MaskPaint(nsISVGRendererCanvas* aCanvas,
|
||||||
nsISVGRendererSurface* aSurface,
|
nsISVGRendererSurface* aSurface,
|
||||||
nsISVGChildFrame* aParent,
|
nsISVGChildFrame* aParent,
|
||||||
|
|
|
@ -37,33 +37,56 @@
|
||||||
#ifndef __NS_SVGMASKFRAME_H__
|
#ifndef __NS_SVGMASKFRAME_H__
|
||||||
#define __NS_SVGMASKFRAME_H__
|
#define __NS_SVGMASKFRAME_H__
|
||||||
|
|
||||||
#include "nsISupports.h"
|
#include "nsSVGContainerFrame.h"
|
||||||
|
|
||||||
class nsISVGRendererCanvas;
|
|
||||||
class nsISVGRendererSurface;
|
class nsISVGRendererSurface;
|
||||||
class nsISVGChildFrame;
|
|
||||||
class nsIDOMSVGMatrix;
|
|
||||||
class nsIURI;
|
|
||||||
class nsIContent;
|
|
||||||
|
|
||||||
#define NS_ISVGMASKFRAME_IID \
|
typedef nsSVGContainerFrame nsSVGMaskFrameBase;
|
||||||
{0x122fe62b, 0xa4cb, 0x49d4, {0xbf, 0xd7, 0x26, 0x67, 0x58, 0x28, 0xff, 0x02}}
|
|
||||||
|
|
||||||
class nsISVGMaskFrame : public nsISupports {
|
class nsSVGMaskFrame : public nsSVGMaskFrameBase
|
||||||
public:
|
{
|
||||||
NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISVGMASKFRAME_IID)
|
friend nsIFrame*
|
||||||
|
NS_NewSVGMaskFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsStyleContext* aContext);
|
||||||
|
|
||||||
NS_IMETHOD MaskPaint(nsISVGRendererCanvas* aCanvas,
|
NS_IMETHOD InitSVG();
|
||||||
nsISVGRendererSurface* aSurface,
|
|
||||||
nsISVGChildFrame* aParent,
|
public:
|
||||||
nsCOMPtr<nsIDOMSVGMatrix> aMatrix,
|
nsSVGMaskFrame(nsStyleContext* aContext) : nsSVGMaskFrameBase(aContext) {}
|
||||||
float aOpacity = 1.0f) = 0;
|
|
||||||
|
// nsSVGMaskFrame method:
|
||||||
|
nsresult MaskPaint(nsISVGRendererCanvas* aCanvas,
|
||||||
|
nsISVGRendererSurface* aSurface,
|
||||||
|
nsISVGChildFrame* aParent,
|
||||||
|
nsCOMPtr<nsIDOMSVGMatrix> aMatrix,
|
||||||
|
float aOpacity = 1.0f);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the "type" of the frame
|
||||||
|
*
|
||||||
|
* @see nsLayoutAtoms::svgMaskFrame
|
||||||
|
*/
|
||||||
|
virtual nsIAtom* GetType() const;
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
NS_IMETHOD GetFrameName(nsAString& aResult) const
|
||||||
|
{
|
||||||
|
return MakeFrameName(NS_LITERAL_STRING("SVGMask"), aResult);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
private:
|
||||||
|
PRUint16 GetMaskUnits();
|
||||||
|
PRUint16 GetMaskContentUnits();
|
||||||
|
|
||||||
|
nsISVGChildFrame *mMaskParent;
|
||||||
|
nsCOMPtr<nsIDOMSVGMatrix> mMaskParentMatrix;
|
||||||
|
|
||||||
|
// nsSVGContainerFrame methods:
|
||||||
|
virtual already_AddRefed<nsIDOMSVGMatrix> GetCanvasTM();
|
||||||
};
|
};
|
||||||
|
|
||||||
NS_DEFINE_STATIC_IID_ACCESSOR(nsISVGMaskFrame, NS_ISVGMASKFRAME_IID)
|
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
NS_GetSVGMaskFrame(nsISVGMaskFrame **aResult,
|
NS_GetSVGMaskFrame(nsSVGMaskFrame **aResult,
|
||||||
nsIURI *aURI, nsIContent *aContent);
|
nsIURI *aURI, nsIContent *aContent);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -551,7 +551,7 @@ AddEffectProperties(nsIFrame *aFrame)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (style->mMask && !(aFrame->GetStateBits() & NS_STATE_SVG_MASKED)) {
|
if (style->mMask && !(aFrame->GetStateBits() & NS_STATE_SVG_MASKED)) {
|
||||||
nsISVGMaskFrame *mask;
|
nsSVGMaskFrame *mask;
|
||||||
NS_GetSVGMaskFrame(&mask, style->mMask, aFrame->GetContent());
|
NS_GetSVGMaskFrame(&mask, style->mMask, aFrame->GetContent());
|
||||||
if (mask) {
|
if (mask) {
|
||||||
aFrame->SetProperty(nsGkAtoms::mask, mask);
|
aFrame->SetProperty(nsGkAtoms::mask, mask);
|
||||||
|
@ -597,8 +597,8 @@ GetMaskSurface(nsISVGRendererCanvas *aCanvas, nsIFrame *aFrame, float opacity)
|
||||||
nsISVGChildFrame *svgChildFrame;
|
nsISVGChildFrame *svgChildFrame;
|
||||||
CallQueryInterface(aFrame, &svgChildFrame);
|
CallQueryInterface(aFrame, &svgChildFrame);
|
||||||
|
|
||||||
nsISVGMaskFrame *mask;
|
nsSVGMaskFrame *mask;
|
||||||
mask = NS_STATIC_CAST(nsISVGMaskFrame *,
|
mask = NS_STATIC_CAST(nsSVGMaskFrame *,
|
||||||
aFrame->GetProperty(nsGkAtoms::mask));
|
aFrame->GetProperty(nsGkAtoms::mask));
|
||||||
|
|
||||||
nsSVGUtils::GetSurface(nsSVGUtils::GetOuterSVGFrame(aFrame),
|
nsSVGUtils::GetSurface(nsSVGUtils::GetOuterSVGFrame(aFrame),
|
||||||
|
|
Загрузка…
Ссылка в новой задаче