Remove support for svg.stroke_flatness & svg.bezier_flatness prefs. No-one uses them. Not part of default builds - SVG only.

This commit is contained in:
alex.fritze%crocodile-clips.com 2004-02-26 18:36:59 +00:00
Родитель 2798d3ca7a
Коммит 1b36dac0d5
3 изменённых файлов: 12 добавлений и 47 удалений

Просмотреть файл

@ -53,6 +53,13 @@
#include "nsMemory.h"
#include "prdtoa.h"
// comment from art_vpath_path.c: The Adobe PostScript reference
// manual defines flatness as the maximum deviation between any
// point on the vpath approximation and the corresponding point on the
// "true" curve, and we follow this definition here. A value of 0.25
// should ensure high quality for aa rendering.
#define SVG_BEZIER_FLATNESS 0.5
/**
* \addtogroup libart_renderer Libart Rendering Engine
* @{
@ -87,8 +94,6 @@ protected:
ArtSVP *GetFill();
ArtSVP *GetStroke();
double GetBezierFlatness();
private:
nsCOMPtr<nsISVGPathGeometrySource> mSource;
nsCOMPtr<nsISVGRendererRegion> mCoveredRegion;
@ -204,7 +209,7 @@ nsSVGLibartPathGeometry::GetPath()
// 3. convert the bpath into a vpath:
if (bpath)
mVPath = art_bez_path_to_vec(bpath, GetBezierFlatness());
mVPath = art_bez_path_to_vec(bpath, SVG_BEZIER_FLATNESS);
return mVPath;
}
@ -229,30 +234,6 @@ nsSVGLibartPathGeometry::GetStroke()
return mStroke.GetSvp();
}
double
nsSVGLibartPathGeometry::GetBezierFlatness()
{
// comment from art_vpath_path.c: The Adobe PostScript reference
// manual defines flatness as the maximum deviation between any
// point on the vpath approximation and the corresponding point on the
// "true" curve, and we follow this definition here. A value of 0.25
// should ensure high quality for aa rendering.
double flatness = 0.5;
nsCOMPtr<nsIPref> prefs(do_GetService(NS_PREF_CONTRACTID));
if (!prefs) return flatness;
// XXX: wouldn't it be great if nsIPref had a 'GetFloatPref()'-function?
char *valuestr = nsnull;
if (NS_SUCCEEDED(prefs->CopyCharPref("svg.bezier_flatness",&valuestr)) && (valuestr)) {
flatness = PR_strtod(valuestr, nsnull);
nsMemory::Free(valuestr);
}
return flatness;
}
//----------------------------------------------------------------------
// nsISVGRendererPathGeometry methods:

Просмотреть файл

@ -46,6 +46,8 @@
#include "nsIDOMSVGMatrix.h"
#include <math.h>
#define SVG_STROKE_FLATNESS 0.5
void
nsSVGStroke::Build(ArtVpath* path, nsISVGPathGeometrySource* source)
{
@ -185,22 +187,7 @@ nsSVGStroke::Build(ArtVpath* path, nsISVGPathGeometrySource* source)
captype,
width,
miterlimit,
getFlatness());
SVG_STROKE_FLATNESS);
art_free(path);
}
double nsSVGStroke::getFlatness()
{
double flatness = 0.5;
nsCOMPtr<nsIPref> prefs(do_GetService(NS_PREF_CONTRACTID));
if (!prefs) return flatness;
// XXX: wouldn't it be great if nsIPref had a 'GetFloatPref()'-function?
char *valuestr = nsnull;
if (NS_SUCCEEDED(prefs->CopyCharPref("svg.stroke_flatness",&valuestr)) && (valuestr)) {
flatness = PR_strtod(valuestr, nsnull);
nsMemory::Free(valuestr);
}
return flatness;
}

Просмотреть файл

@ -51,10 +51,7 @@ class nsISVGPathGeometrySource;
class nsSVGStroke : public nsSVGRenderItem
{
public:
void Build(ArtVpath* path, nsISVGPathGeometrySource* source);
protected:
double getFlatness();
void Build(ArtVpath* path, nsISVGPathGeometrySource* source);
};
/** @} */