2006-05-02 15:05:25 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
|
|
|
*
|
|
|
|
* The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
* the License. You may obtain a copy of the License at
|
|
|
|
* http://www.mozilla.org/MPL/
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* License.
|
|
|
|
*
|
|
|
|
* The Original Code is the Mozilla SVG project.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is IBM Corporation.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 2006
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
|
|
|
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
|
|
|
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
|
|
|
|
|
|
|
#include "nsPresContext.h"
|
|
|
|
#include "nsSVGUtils.h"
|
|
|
|
#include "nsSVGGeometryFrame.h"
|
2006-05-16 15:55:01 +00:00
|
|
|
#include "nsSVGPaintServerFrame.h"
|
|
|
|
#include "nsContentUtils.h"
|
2006-05-02 15:05:25 +00:00
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// nsISupports methods
|
|
|
|
|
|
|
|
NS_INTERFACE_MAP_BEGIN(nsSVGGeometryFrame)
|
|
|
|
NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
|
|
|
|
NS_INTERFACE_MAP_ENTRY(nsISVGValueObserver)
|
|
|
|
NS_INTERFACE_MAP_END_INHERITING(nsSVGGeometryFrameBase)
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
|
|
|
|
nsSVGGeometryFrame::nsSVGGeometryFrame(nsStyleContext* aContext)
|
2006-05-27 18:48:09 +00:00
|
|
|
: nsSVGGeometryFrameBase(aContext)
|
2006-05-02 15:05:25 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2006-07-19 14:44:51 +00:00
|
|
|
void
|
|
|
|
nsSVGGeometryFrame::Destroy()
|
|
|
|
{
|
|
|
|
// Remove the properties before the frame goes away, since we need it for QI
|
|
|
|
RemovePaintServerProperties();
|
|
|
|
nsSVGGeometryFrameBase::Destroy();
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsSVGGeometryFrame::RemovePaintServerProperties()
|
|
|
|
{
|
|
|
|
DeleteProperty(nsGkAtoms::fill);
|
|
|
|
DeleteProperty(nsGkAtoms::stroke);
|
|
|
|
RemoveStateBits(NS_STATE_SVG_PSERVER_MASK);
|
|
|
|
}
|
|
|
|
|
2006-05-16 15:55:01 +00:00
|
|
|
nsSVGPaintServerFrame *
|
|
|
|
nsSVGGeometryFrame::GetPaintServer(const nsStyleSVGPaint *aPaint)
|
|
|
|
{
|
|
|
|
if (aPaint->mType != eStyleSVGPaintType_Server)
|
|
|
|
return nsnull;
|
|
|
|
|
|
|
|
nsIURI *uri;
|
|
|
|
uri = aPaint->mPaint.mPaintServer;
|
|
|
|
if (!uri)
|
|
|
|
return nsnull;
|
|
|
|
|
|
|
|
nsIFrame *result;
|
|
|
|
if (NS_FAILED(nsSVGUtils::GetReferencedFrame(&result, uri, mContent,
|
|
|
|
GetPresContext()->PresShell())))
|
|
|
|
return nsnull;
|
|
|
|
|
|
|
|
nsIAtom *type = result->GetType();
|
|
|
|
if (type != nsGkAtoms::svgLinearGradientFrame &&
|
|
|
|
type != nsGkAtoms::svgRadialGradientFrame &&
|
|
|
|
type != nsGkAtoms::svgPatternFrame)
|
|
|
|
return nsnull;
|
|
|
|
|
|
|
|
// Loop check for pattern
|
|
|
|
if (type == nsGkAtoms::svgPatternFrame &&
|
|
|
|
nsContentUtils::ContentIsDescendantOf(mContent, result->GetContent()))
|
|
|
|
return nsnull;
|
|
|
|
|
|
|
|
nsSVGPaintServerFrame *server =
|
|
|
|
NS_STATIC_CAST(nsSVGPaintServerFrame*, result);
|
|
|
|
|
|
|
|
server->AddObserver(this);
|
|
|
|
return server;
|
2006-05-02 15:05:25 +00:00
|
|
|
}
|
|
|
|
|
2006-06-01 15:31:15 +00:00
|
|
|
NS_IMETHODIMP
|
|
|
|
nsSVGGeometryFrame::InitSVG()
|
|
|
|
{
|
|
|
|
AddStateBits(mParent->GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD);
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2006-05-02 15:05:25 +00:00
|
|
|
NS_IMETHODIMP
|
|
|
|
nsSVGGeometryFrame::DidSetStyleContext()
|
|
|
|
{
|
|
|
|
// One of the styles that might have been changed are the urls that
|
|
|
|
// point to gradients, etc. Drop our cached values to those
|
2006-07-19 14:44:51 +00:00
|
|
|
RemovePaintServerProperties();
|
2006-05-02 15:05:25 +00:00
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsSVGGeometryFrame::WillModifySVGObservable(nsISVGValue* observable,
|
|
|
|
nsISVGValue::modificationType aModType)
|
|
|
|
{
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsSVGGeometryFrame::DidModifySVGObservable(nsISVGValue* observable,
|
|
|
|
nsISVGValue::modificationType aModType)
|
|
|
|
{
|
2006-05-27 18:48:09 +00:00
|
|
|
if (!(GetStateBits() & NS_STATE_SVG_PSERVER_MASK))
|
|
|
|
return NS_OK;
|
|
|
|
|
2006-05-11 20:01:12 +00:00
|
|
|
nsIFrame *frame;
|
|
|
|
CallQueryInterface(observable, &frame);
|
2006-05-02 15:05:25 +00:00
|
|
|
|
2006-05-11 20:01:12 +00:00
|
|
|
if (!frame)
|
2006-05-02 15:05:25 +00:00
|
|
|
return NS_OK;
|
|
|
|
|
2006-05-27 18:48:09 +00:00
|
|
|
if (GetStateBits() & NS_STATE_SVG_FILL_PSERVER) {
|
|
|
|
nsIFrame *ps = NS_STATIC_CAST(nsIFrame*, GetProperty(nsGkAtoms::fill));
|
|
|
|
if (frame == ps) {
|
|
|
|
if (aModType == nsISVGValue::mod_die) {
|
|
|
|
DeleteProperty(nsGkAtoms::fill);
|
|
|
|
RemoveStateBits(NS_STATE_SVG_FILL_PSERVER);
|
|
|
|
}
|
|
|
|
UpdateGraphic();
|
|
|
|
}
|
2006-05-11 20:01:12 +00:00
|
|
|
}
|
2006-05-02 15:05:25 +00:00
|
|
|
|
2006-05-27 18:48:09 +00:00
|
|
|
if (GetStateBits() & NS_STATE_SVG_STROKE_PSERVER) {
|
|
|
|
nsIFrame *ps = NS_STATIC_CAST(nsIFrame*, GetProperty(nsGkAtoms::stroke));
|
|
|
|
if (frame == ps) {
|
|
|
|
if (aModType == nsISVGValue::mod_die) {
|
|
|
|
DeleteProperty(nsGkAtoms::stroke);
|
|
|
|
RemoveStateBits(NS_STATE_SVG_STROKE_PSERVER);
|
|
|
|
}
|
|
|
|
UpdateGraphic();
|
|
|
|
}
|
2006-05-02 15:05:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
|
|
|
|
float
|
|
|
|
nsSVGGeometryFrame::GetStrokeWidth()
|
|
|
|
{
|
2006-07-19 14:46:50 +00:00
|
|
|
return
|
|
|
|
nsSVGUtils::CoordToFloat(GetPresContext(),
|
|
|
|
GetType() == nsGkAtoms::svgGlyphFrame ? mContent->GetParent() : mContent,
|
|
|
|
GetStyleSVG()->mStrokeWidth);
|
2006-05-02 15:05:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
nsSVGGeometryFrame::GetStrokeDashArray(double **aDashes, PRUint32 *aCount)
|
|
|
|
{
|
|
|
|
*aDashes = nsnull;
|
|
|
|
*aCount = 0;
|
|
|
|
|
|
|
|
PRUint32 count = GetStyleSVG()->mStrokeDasharrayLength;
|
|
|
|
double *dashes = nsnull;
|
|
|
|
|
|
|
|
if (count) {
|
|
|
|
const nsStyleCoord *dasharray = GetStyleSVG()->mStrokeDasharray;
|
|
|
|
nsPresContext *presContext = GetPresContext();
|
|
|
|
float totalLength = 0.0f;
|
|
|
|
|
|
|
|
dashes = new double[count];
|
|
|
|
if (dashes) {
|
|
|
|
for (PRUint32 i = 0; i < count; i++) {
|
|
|
|
dashes[i] =
|
|
|
|
nsSVGUtils::CoordToFloat(presContext, mContent, dasharray[i]);
|
|
|
|
if (dashes[i] < 0.0f) {
|
|
|
|
delete [] dashes;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
totalLength += dashes[i];
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
return NS_ERROR_OUT_OF_MEMORY;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (totalLength == 0.0f) {
|
|
|
|
delete [] dashes;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
*aDashes = dashes;
|
|
|
|
*aCount = count;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
float
|
|
|
|
nsSVGGeometryFrame::GetStrokeDashoffset()
|
|
|
|
{
|
|
|
|
return
|
|
|
|
nsSVGUtils::CoordToFloat(GetPresContext(), mContent,
|
|
|
|
GetStyleSVG()->mStrokeDashoffset);
|
|
|
|
}
|
|
|
|
|
|
|
|
PRUint16
|
|
|
|
nsSVGGeometryFrame::GetClipRule()
|
|
|
|
{
|
|
|
|
return GetStyleSVG()->mClipRule;
|
|
|
|
}
|
|
|
|
|
2006-05-27 18:48:09 +00:00
|
|
|
static void
|
|
|
|
PServerPropertyDtor(void *aObject, nsIAtom *aPropertyName,
|
|
|
|
void *aPropertyValue, void *aData)
|
|
|
|
{
|
|
|
|
nsIFrame *ps = NS_STATIC_CAST(nsIFrame*, aPropertyValue);
|
|
|
|
nsSVGUtils::RemoveObserver(NS_STATIC_CAST(nsIFrame*, aObject), ps);
|
|
|
|
}
|
|
|
|
|
2006-05-16 15:55:01 +00:00
|
|
|
PRBool
|
|
|
|
nsSVGGeometryFrame::HasStroke()
|
2006-05-02 15:05:25 +00:00
|
|
|
{
|
2006-05-27 18:48:09 +00:00
|
|
|
if (!(GetStateBits() & NS_STATE_SVG_STROKE_PSERVER)) {
|
|
|
|
nsIFrame *ps = GetPaintServer(&GetStyleSVG()->mStroke);
|
|
|
|
if (ps) {
|
|
|
|
SetProperty(nsGkAtoms::stroke, ps, PServerPropertyDtor);
|
|
|
|
AddStateBits(NS_STATE_SVG_STROKE_PSERVER);
|
|
|
|
}
|
|
|
|
}
|
2006-05-02 15:05:25 +00:00
|
|
|
|
|
|
|
// cairo will stop rendering if stroke-width is less than or equal to zero
|
2006-05-16 15:55:01 +00:00
|
|
|
if (GetStrokeWidth() <= 0)
|
|
|
|
return PR_FALSE;
|
2006-05-02 15:05:25 +00:00
|
|
|
|
2006-05-16 15:55:01 +00:00
|
|
|
if (GetStyleSVG()->mStroke.mType == eStyleSVGPaintType_Color ||
|
|
|
|
(GetStyleSVG()->mStroke.mType == eStyleSVGPaintType_Server &&
|
2006-05-27 18:48:09 +00:00
|
|
|
(GetStateBits() & NS_STATE_SVG_STROKE_PSERVER)))
|
2006-05-16 15:55:01 +00:00
|
|
|
return PR_TRUE;
|
2006-05-02 15:05:25 +00:00
|
|
|
|
2006-05-16 15:55:01 +00:00
|
|
|
return PR_FALSE;
|
2006-05-02 15:05:25 +00:00
|
|
|
}
|
|
|
|
|
2006-05-16 15:55:01 +00:00
|
|
|
PRBool
|
|
|
|
nsSVGGeometryFrame::HasFill()
|
2006-05-02 15:05:25 +00:00
|
|
|
{
|
2006-05-27 18:48:09 +00:00
|
|
|
if (!(GetStateBits() & NS_STATE_SVG_FILL_PSERVER)) {
|
|
|
|
nsIFrame *ps = GetPaintServer(&GetStyleSVG()->mFill);
|
|
|
|
if (ps) {
|
|
|
|
SetProperty(nsGkAtoms::fill, ps, PServerPropertyDtor);
|
|
|
|
AddStateBits(NS_STATE_SVG_FILL_PSERVER);
|
|
|
|
}
|
|
|
|
}
|
2006-05-02 15:05:25 +00:00
|
|
|
|
2006-05-16 15:55:01 +00:00
|
|
|
if (GetStyleSVG()->mFill.mType == eStyleSVGPaintType_Color ||
|
2006-05-27 18:48:09 +00:00
|
|
|
(GetStyleSVG()->mFill.mType == eStyleSVGPaintType_Server &&
|
|
|
|
(GetStateBits() & NS_STATE_SVG_FILL_PSERVER)))
|
2006-05-16 15:55:01 +00:00
|
|
|
return PR_TRUE;
|
2006-05-02 15:05:25 +00:00
|
|
|
|
2006-05-16 15:55:01 +00:00
|
|
|
return PR_FALSE;
|
2006-05-02 15:05:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
PRBool
|
|
|
|
nsSVGGeometryFrame::IsClipChild()
|
|
|
|
{
|
2006-05-03 19:39:21 +00:00
|
|
|
nsIContent *node = mContent;
|
2006-05-02 15:05:25 +00:00
|
|
|
|
|
|
|
do {
|
2006-05-03 19:39:21 +00:00
|
|
|
// Return false if we find a non-svg ancestor. Non-SVG elements are not
|
|
|
|
// allowed inside an SVG clipPath element.
|
|
|
|
if (node->GetNameSpaceID() != kNameSpaceID_SVG) {
|
2006-05-02 15:05:25 +00:00
|
|
|
break;
|
|
|
|
}
|
2006-05-03 19:39:21 +00:00
|
|
|
if (node->NodeInfo()->Equals(nsGkAtoms::clipPath, kNameSpaceID_SVG)) {
|
|
|
|
return PR_TRUE;
|
|
|
|
}
|
2006-05-02 15:05:25 +00:00
|
|
|
node = node->GetParent();
|
|
|
|
} while (node);
|
|
|
|
|
|
|
|
return PR_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
SetupCairoColor(cairo_t *aCtx, nscolor aRGB, float aOpacity)
|
|
|
|
{
|
|
|
|
cairo_set_source_rgba(aCtx,
|
|
|
|
NS_GET_R(aRGB)/255.0,
|
|
|
|
NS_GET_G(aRGB)/255.0,
|
|
|
|
NS_GET_B(aRGB)/255.0,
|
|
|
|
aOpacity);
|
|
|
|
}
|
|
|
|
|
2006-05-16 15:55:01 +00:00
|
|
|
nsresult
|
|
|
|
nsSVGGeometryFrame::SetupCairoFill(nsISVGRendererCanvas *aCanvas,
|
|
|
|
cairo_t *aCtx,
|
|
|
|
void **aClosure)
|
2006-05-02 15:05:25 +00:00
|
|
|
{
|
|
|
|
if (GetStyleSVG()->mFillRule == NS_STYLE_FILL_RULE_EVENODD)
|
|
|
|
cairo_set_fill_rule(aCtx, CAIRO_FILL_RULE_EVEN_ODD);
|
|
|
|
else
|
|
|
|
cairo_set_fill_rule(aCtx, CAIRO_FILL_RULE_WINDING);
|
|
|
|
|
2006-05-27 18:48:09 +00:00
|
|
|
if (GetStateBits() & NS_STATE_SVG_FILL_PSERVER) {
|
|
|
|
nsSVGPaintServerFrame *ps = NS_STATIC_CAST(nsSVGPaintServerFrame*,
|
|
|
|
GetProperty(nsGkAtoms::fill));
|
|
|
|
return ps->SetupPaintServer(aCanvas, aCtx, this,
|
|
|
|
GetStyleSVG()->mFillOpacity,
|
|
|
|
aClosure);
|
|
|
|
} else
|
2006-05-16 15:55:01 +00:00
|
|
|
SetupCairoColor(aCtx,
|
|
|
|
GetStyleSVG()->mFill.mPaint.mColor,
|
|
|
|
GetStyleSVG()->mFillOpacity);
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsSVGGeometryFrame::CleanupCairoFill(cairo_t *aCtx, void *aClosure)
|
|
|
|
{
|
2006-05-27 18:48:09 +00:00
|
|
|
if (GetStateBits() & NS_STATE_SVG_FILL_PSERVER) {
|
|
|
|
nsSVGPaintServerFrame *ps = NS_STATIC_CAST(nsSVGPaintServerFrame*,
|
|
|
|
GetProperty(nsGkAtoms::fill));
|
|
|
|
ps->CleanupPaintServer(aCtx, aClosure);
|
|
|
|
}
|
2006-05-02 15:05:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsSVGGeometryFrame::SetupCairoStrokeGeometry(cairo_t *aCtx)
|
|
|
|
{
|
|
|
|
cairo_set_line_width(aCtx, GetStrokeWidth());
|
|
|
|
|
|
|
|
switch (GetStyleSVG()->mStrokeLinecap) {
|
|
|
|
case NS_STYLE_STROKE_LINECAP_BUTT:
|
|
|
|
cairo_set_line_cap(aCtx, CAIRO_LINE_CAP_BUTT);
|
|
|
|
break;
|
|
|
|
case NS_STYLE_STROKE_LINECAP_ROUND:
|
|
|
|
cairo_set_line_cap(aCtx, CAIRO_LINE_CAP_ROUND);
|
|
|
|
break;
|
|
|
|
case NS_STYLE_STROKE_LINECAP_SQUARE:
|
|
|
|
cairo_set_line_cap(aCtx, CAIRO_LINE_CAP_SQUARE);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
cairo_set_miter_limit(aCtx, GetStyleSVG()->mStrokeMiterlimit);
|
|
|
|
|
|
|
|
switch (GetStyleSVG()->mStrokeLinejoin) {
|
|
|
|
case NS_STYLE_STROKE_LINEJOIN_MITER:
|
|
|
|
cairo_set_line_join(aCtx, CAIRO_LINE_JOIN_MITER);
|
|
|
|
break;
|
|
|
|
case NS_STYLE_STROKE_LINEJOIN_ROUND:
|
|
|
|
cairo_set_line_join(aCtx, CAIRO_LINE_JOIN_ROUND);
|
|
|
|
break;
|
|
|
|
case NS_STYLE_STROKE_LINEJOIN_BEVEL:
|
|
|
|
cairo_set_line_join(aCtx, CAIRO_LINE_JOIN_BEVEL);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-08-07 16:41:58 +00:00
|
|
|
void
|
|
|
|
nsSVGGeometryFrame::SetupCairoStrokeHitGeometry(cairo_t *aCtx)
|
2006-05-02 15:05:25 +00:00
|
|
|
{
|
|
|
|
SetupCairoStrokeGeometry(aCtx);
|
|
|
|
|
|
|
|
double *dashArray;
|
|
|
|
PRUint32 count;
|
|
|
|
GetStrokeDashArray(&dashArray, &count);
|
|
|
|
if (count > 0) {
|
|
|
|
cairo_set_dash(aCtx, dashArray, count, GetStrokeDashoffset());
|
|
|
|
delete [] dashArray;
|
|
|
|
}
|
2006-08-07 16:41:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
nsSVGGeometryFrame::SetupCairoStroke(nsISVGRendererCanvas *aCanvas,
|
|
|
|
cairo_t *aCtx,
|
|
|
|
void **aClosure)
|
|
|
|
{
|
|
|
|
SetupCairoStrokeHitGeometry(aCtx);
|
2006-05-02 15:05:25 +00:00
|
|
|
|
2006-05-27 18:48:09 +00:00
|
|
|
if (GetStateBits() & NS_STATE_SVG_STROKE_PSERVER) {
|
|
|
|
nsSVGPaintServerFrame *ps = NS_STATIC_CAST(nsSVGPaintServerFrame*,
|
|
|
|
GetProperty(nsGkAtoms::stroke));
|
|
|
|
return ps->SetupPaintServer(aCanvas, aCtx, this,
|
|
|
|
GetStyleSVG()->mStrokeOpacity,
|
|
|
|
aClosure);
|
|
|
|
} else
|
2006-05-16 15:55:01 +00:00
|
|
|
SetupCairoColor(aCtx,
|
|
|
|
GetStyleSVG()->mStroke.mPaint.mColor,
|
|
|
|
GetStyleSVG()->mStrokeOpacity);
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsSVGGeometryFrame::CleanupCairoStroke(cairo_t *aCtx, void *aClosure)
|
|
|
|
{
|
2006-05-27 18:48:09 +00:00
|
|
|
if (GetStateBits() & NS_STATE_SVG_STROKE_PSERVER) {
|
|
|
|
nsSVGPaintServerFrame *ps = NS_STATIC_CAST(nsSVGPaintServerFrame*,
|
|
|
|
GetProperty(nsGkAtoms::stroke));
|
|
|
|
ps->CleanupPaintServer(aCtx, aClosure);
|
|
|
|
}
|
2006-05-02 15:05:25 +00:00
|
|
|
}
|