2004-10-14 23:02:53 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 11:12:37 +00: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/. */
|
2004-10-14 23:02:53 +00:00
|
|
|
|
2006-05-16 15:55:01 +00:00
|
|
|
#ifndef __NS_SVGPAINTSERVERFRAME_H__
|
|
|
|
#define __NS_SVGPAINTSERVERFRAME_H__
|
2004-10-14 23:02:53 +00:00
|
|
|
|
2013-05-29 19:37:49 +00:00
|
|
|
#include "mozilla/Attributes.h"
|
2012-03-20 12:15:55 +00:00
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
#include "nsFrame.h"
|
|
|
|
#include "nsIFrame.h"
|
|
|
|
#include "nsQueryFrame.h"
|
2006-06-01 15:31:15 +00:00
|
|
|
#include "nsSVGContainerFrame.h"
|
2012-03-18 10:32:02 +00:00
|
|
|
#include "nsSVGUtils.h"
|
2006-05-02 15:05:25 +00:00
|
|
|
|
2006-11-27 17:30:57 +00:00
|
|
|
class gfxContext;
|
2012-03-20 12:15:55 +00:00
|
|
|
class gfxPattern;
|
|
|
|
class nsStyleContext;
|
2004-10-14 23:02:53 +00:00
|
|
|
|
2012-03-20 12:15:55 +00:00
|
|
|
struct gfxRect;
|
|
|
|
|
2006-06-01 15:31:15 +00:00
|
|
|
typedef nsSVGContainerFrame nsSVGPaintServerFrameBase;
|
2005-03-09 19:24:18 +00:00
|
|
|
|
2008-10-01 00:51:05 +00:00
|
|
|
class nsSVGPaintServerFrame : public nsSVGPaintServerFrameBase
|
2006-05-16 15:55:01 +00:00
|
|
|
{
|
2007-09-07 09:30:51 +00:00
|
|
|
protected:
|
2012-03-10 19:28:06 +00:00
|
|
|
nsSVGPaintServerFrame(nsStyleContext* aContext)
|
|
|
|
: nsSVGPaintServerFrameBase(aContext)
|
|
|
|
{
|
2013-07-12 07:13:07 +00:00
|
|
|
AddStateBits(NS_FRAME_IS_NONDISPLAY);
|
2012-03-10 19:28:06 +00:00
|
|
|
}
|
2005-03-09 19:24:18 +00:00
|
|
|
|
2007-09-07 09:30:51 +00:00
|
|
|
public:
|
2009-09-12 16:49:24 +00:00
|
|
|
NS_DECL_FRAMEARENA_HELPERS
|
|
|
|
|
2010-07-01 16:40:30 +00:00
|
|
|
/**
|
|
|
|
* Constructs a gfxPattern of the paint server rendering.
|
2012-07-13 23:18:38 +00: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 16:40:30 +00:00
|
|
|
*/
|
|
|
|
virtual already_AddRefed<gfxPattern>
|
|
|
|
GetPaintServerPattern(nsIFrame *aSource,
|
2012-07-13 23:18:38 +00:00
|
|
|
const gfxMatrix& aContextMatrix,
|
2012-05-18 08:34:25 +00:00
|
|
|
nsStyleSVGPaint nsStyleSVG::*aFillOrStroke,
|
2010-07-01 16:40:30 +00:00
|
|
|
float aOpacity,
|
2012-07-30 14:20:58 +00:00
|
|
|
const gfxRect *aOverrideBounds = nullptr) = 0;
|
2010-07-01 16:40:30 +00:00
|
|
|
|
|
|
|
/**
|
2007-04-23 09:11:19 +00:00
|
|
|
* Configure paint server prior to rendering
|
2011-10-17 14:59:28 +00:00
|
|
|
* @return false to skip rendering
|
2007-04-23 09:11:19 +00:00
|
|
|
*/
|
2011-09-29 06:19:26 +00:00
|
|
|
virtual bool SetupPaintServer(gfxContext *aContext,
|
2012-08-05 19:10:21 +00:00
|
|
|
nsIFrame *aSource,
|
2012-05-18 08:34:25 +00:00
|
|
|
nsStyleSVGPaint nsStyleSVG::*aFillOrStroke,
|
|
|
|
float aOpacity);
|
2010-07-01 16:40:19 +00:00
|
|
|
|
2012-07-20 16:41:29 +00:00
|
|
|
// nsIFrame methods:
|
2013-02-14 11:12:27 +00:00
|
|
|
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|
|
|
const nsRect& aDirtyRect,
|
|
|
|
const nsDisplayListSet& aLists) MOZ_OVERRIDE {}
|
2012-07-20 16:41:29 +00:00
|
|
|
|
2013-05-29 19:37:49 +00:00
|
|
|
virtual bool IsFrameOfType(uint32_t aFlags) const MOZ_OVERRIDE
|
2010-07-01 16:40:19 +00:00
|
|
|
{
|
|
|
|
return nsSVGPaintServerFrameBase::IsFrameOfType(aFlags & ~nsIFrame::eSVGPaintServer);
|
|
|
|
}
|
2006-05-16 15:55:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __NS_SVGPAINTSERVERFRAME_H__
|