1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef __NS_SVGPAINTSERVERFRAME_H__
7 #define __NS_SVGPAINTSERVERFRAME_H__
9 #include "mozilla/Attributes.h"
13 #include "nsQueryFrame.h"
14 #include "nsSVGContainerFrame.h"
15 #include "nsSVGUtils.h"
23 typedef nsSVGContainerFrame nsSVGPaintServerFrameBase
;
25 class nsSVGPaintServerFrame
: public nsSVGPaintServerFrameBase
28 nsSVGPaintServerFrame(nsStyleContext
* aContext
)
29 : nsSVGPaintServerFrameBase(aContext
)
31 AddStateBits(NS_FRAME_IS_NONDISPLAY
);
35 NS_DECL_FRAMEARENA_HELPERS
38 * Constructs a gfxPattern of the paint server rendering.
40 * @param aContextMatrix The transform matrix that is currently applied to
41 * the gfxContext that is being drawn to. This is needed by SVG patterns so
42 * that surfaces of the correct size can be created. (SVG gradients are
43 * vector based, so it's not used there.)
45 virtual already_AddRefed
<gfxPattern
>
46 GetPaintServerPattern(nsIFrame
*aSource
,
47 const gfxMatrix
& aContextMatrix
,
48 nsStyleSVGPaint
nsStyleSVG::*aFillOrStroke
,
50 const gfxRect
*aOverrideBounds
= nullptr) = 0;
53 * Configure paint server prior to rendering
54 * @return false to skip rendering
56 virtual bool SetupPaintServer(gfxContext
*aContext
,
58 nsStyleSVGPaint
nsStyleSVG::*aFillOrStroke
,
62 virtual void BuildDisplayList(nsDisplayListBuilder
* aBuilder
,
63 const nsRect
& aDirtyRect
,
64 const nsDisplayListSet
& aLists
) MOZ_OVERRIDE
{}
66 virtual bool IsFrameOfType(uint32_t aFlags
) const MOZ_OVERRIDE
68 return nsSVGPaintServerFrameBase::IsFrameOfType(aFlags
& ~nsIFrame::eSVGPaintServer
);
72 #endif // __NS_SVGPAINTSERVERFRAME_H__