зеркало из 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 "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
|
||||
|
||||
|
@ -108,7 +53,7 @@ NS_NewSVGMaskFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsStyleContex
|
|||
}
|
||||
|
||||
nsresult
|
||||
NS_GetSVGMaskFrame(nsISVGMaskFrame **aResult,
|
||||
NS_GetSVGMaskFrame(nsSVGMaskFrame **aResult,
|
||||
nsIURI *aURI, nsIContent *aContent)
|
||||
{
|
||||
*aResult = nsnull;
|
||||
|
@ -190,7 +135,7 @@ static unsigned char rgb2lin[256] = {
|
|||
239, 241, 243, 245, 248, 250, 252, 255
|
||||
};
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsresult
|
||||
nsSVGMaskFrame::MaskPaint(nsISVGRendererCanvas* aCanvas,
|
||||
nsISVGRendererSurface* aSurface,
|
||||
nsISVGChildFrame* aParent,
|
||||
|
|
|
@ -37,33 +37,56 @@
|
|||
#ifndef __NS_SVGMASKFRAME_H__
|
||||
#define __NS_SVGMASKFRAME_H__
|
||||
|
||||
#include "nsISupports.h"
|
||||
#include "nsSVGContainerFrame.h"
|
||||
|
||||
class nsISVGRendererCanvas;
|
||||
class nsISVGRendererSurface;
|
||||
class nsISVGChildFrame;
|
||||
class nsIDOMSVGMatrix;
|
||||
class nsIURI;
|
||||
class nsIContent;
|
||||
|
||||
#define NS_ISVGMASKFRAME_IID \
|
||||
{0x122fe62b, 0xa4cb, 0x49d4, {0xbf, 0xd7, 0x26, 0x67, 0x58, 0x28, 0xff, 0x02}}
|
||||
typedef nsSVGContainerFrame nsSVGMaskFrameBase;
|
||||
|
||||
class nsISVGMaskFrame : public nsISupports {
|
||||
public:
|
||||
NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISVGMASKFRAME_IID)
|
||||
class nsSVGMaskFrame : public nsSVGMaskFrameBase
|
||||
{
|
||||
friend nsIFrame*
|
||||
NS_NewSVGMaskFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsStyleContext* aContext);
|
||||
|
||||
NS_IMETHOD MaskPaint(nsISVGRendererCanvas* aCanvas,
|
||||
NS_IMETHOD InitSVG();
|
||||
|
||||
public:
|
||||
nsSVGMaskFrame(nsStyleContext* aContext) : nsSVGMaskFrameBase(aContext) {}
|
||||
|
||||
// nsSVGMaskFrame method:
|
||||
nsresult MaskPaint(nsISVGRendererCanvas* aCanvas,
|
||||
nsISVGRendererSurface* aSurface,
|
||||
nsISVGChildFrame* aParent,
|
||||
nsCOMPtr<nsIDOMSVGMatrix> aMatrix,
|
||||
float aOpacity = 1.0f) = 0;
|
||||
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
|
||||
NS_GetSVGMaskFrame(nsISVGMaskFrame **aResult,
|
||||
NS_GetSVGMaskFrame(nsSVGMaskFrame **aResult,
|
||||
nsIURI *aURI, nsIContent *aContent);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -551,7 +551,7 @@ AddEffectProperties(nsIFrame *aFrame)
|
|||
}
|
||||
|
||||
if (style->mMask && !(aFrame->GetStateBits() & NS_STATE_SVG_MASKED)) {
|
||||
nsISVGMaskFrame *mask;
|
||||
nsSVGMaskFrame *mask;
|
||||
NS_GetSVGMaskFrame(&mask, style->mMask, aFrame->GetContent());
|
||||
if (mask) {
|
||||
aFrame->SetProperty(nsGkAtoms::mask, mask);
|
||||
|
@ -597,8 +597,8 @@ GetMaskSurface(nsISVGRendererCanvas *aCanvas, nsIFrame *aFrame, float opacity)
|
|||
nsISVGChildFrame *svgChildFrame;
|
||||
CallQueryInterface(aFrame, &svgChildFrame);
|
||||
|
||||
nsISVGMaskFrame *mask;
|
||||
mask = NS_STATIC_CAST(nsISVGMaskFrame *,
|
||||
nsSVGMaskFrame *mask;
|
||||
mask = NS_STATIC_CAST(nsSVGMaskFrame *,
|
||||
aFrame->GetProperty(nsGkAtoms::mask));
|
||||
|
||||
nsSVGUtils::GetSurface(nsSVGUtils::GetOuterSVGFrame(aFrame),
|
||||
|
|
Загрузка…
Ссылка в новой задаче