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