2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 04:12:37 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* 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/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
#ifndef __NS_SVGPAINTSERVERFRAME_H__
|
|
|
|
#define __NS_SVGPAINTSERVERFRAME_H__
|
|
|
|
|
2012-03-20 05:15:55 -07:00
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
#include "nsFrame.h"
|
|
|
|
#include "nsIFrame.h"
|
|
|
|
#include "nsQueryFrame.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
#include "nsSVGContainerFrame.h"
|
2012-03-18 03:32:02 -07:00
|
|
|
#include "nsSVGUtils.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
class gfxContext;
|
2012-03-20 05:15:55 -07:00
|
|
|
class gfxPattern;
|
|
|
|
class nsStyleContext;
|
2007-03-22 10:30:00 -07:00
|
|
|
class nsSVGGeometryFrame;
|
|
|
|
|
2012-03-20 05:15:55 -07:00
|
|
|
struct gfxRect;
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
typedef nsSVGContainerFrame nsSVGPaintServerFrameBase;
|
|
|
|
|
2008-09-30 17:51:05 -07:00
|
|
|
class nsSVGPaintServerFrame : public nsSVGPaintServerFrameBase
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
2007-09-07 02:30:51 -07:00
|
|
|
protected:
|
2012-03-10 11:28:06 -08:00
|
|
|
nsSVGPaintServerFrame(nsStyleContext* aContext)
|
|
|
|
: nsSVGPaintServerFrameBase(aContext)
|
|
|
|
{
|
|
|
|
AddStateBits(NS_STATE_SVG_NONDISPLAY_CHILD);
|
|
|
|
}
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2007-09-07 02:30:51 -07:00
|
|
|
public:
|
2009-09-12 09:49:24 -07:00
|
|
|
NS_DECL_FRAMEARENA_HELPERS
|
|
|
|
|
2010-07-01 09:40:30 -07:00
|
|
|
/**
|
|
|
|
* Constructs a gfxPattern of the paint server rendering.
|
2012-07-13 16:18:38 -07:00
|
|
|
*
|
|
|
|
* @param aContextMatrix The transform matrix that is currently applied to
|
|
|
|
* the gfxContext that is being drawn to. This is needed by SVG patterns so
|
|
|
|
* that surfaces of the correct size can be created. (SVG gradients are
|
|
|
|
* vector based, so it's not used there.)
|
2010-07-01 09:40:30 -07:00
|
|
|
*/
|
|
|
|
virtual already_AddRefed<gfxPattern>
|
|
|
|
GetPaintServerPattern(nsIFrame *aSource,
|
2012-07-13 16:18:38 -07:00
|
|
|
const gfxMatrix& aContextMatrix,
|
2012-05-18 01:34:25 -07:00
|
|
|
nsStyleSVGPaint nsStyleSVG::*aFillOrStroke,
|
2010-07-01 09:40:30 -07:00
|
|
|
float aOpacity,
|
2012-07-30 07:20:58 -07:00
|
|
|
const gfxRect *aOverrideBounds = nullptr) = 0;
|
2010-07-01 09:40:30 -07:00
|
|
|
|
|
|
|
/**
|
2007-04-23 02:11:19 -07:00
|
|
|
* Configure paint server prior to rendering
|
2011-10-17 07:59:28 -07:00
|
|
|
* @return false to skip rendering
|
2007-04-23 02:11:19 -07:00
|
|
|
*/
|
2011-09-28 23:19:26 -07:00
|
|
|
virtual bool SetupPaintServer(gfxContext *aContext,
|
2012-08-05 12:10:21 -07:00
|
|
|
nsIFrame *aSource,
|
2012-05-18 01:34:25 -07:00
|
|
|
nsStyleSVGPaint nsStyleSVG::*aFillOrStroke,
|
|
|
|
float aOpacity);
|
2010-07-01 09:40:19 -07:00
|
|
|
|
2012-07-20 09:41:29 -07:00
|
|
|
// nsIFrame methods:
|
2013-02-14 03:12:27 -08:00
|
|
|
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|
|
|
const nsRect& aDirtyRect,
|
|
|
|
const nsDisplayListSet& aLists) MOZ_OVERRIDE {}
|
2012-07-20 09:41:29 -07:00
|
|
|
|
2012-08-22 08:56:38 -07:00
|
|
|
virtual bool IsFrameOfType(uint32_t aFlags) const
|
2010-07-01 09:40:19 -07:00
|
|
|
{
|
|
|
|
return nsSVGPaintServerFrameBase::IsFrameOfType(aFlags & ~nsIFrame::eSVGPaintServer);
|
|
|
|
}
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __NS_SVGPAINTSERVERFRAME_H__
|