Commit bfe82d7c authored by Thomas Freitag's avatar Thomas Freitag Committed by Albert Astals Cid
Browse files

instead of creating new scanner just copy the existing ones

parent dd507d1a
Pipeline #385926 passed with stages
in 6 minutes and 40 seconds
......@@ -72,7 +72,6 @@ SplashClip::SplashClip(SplashCoord x0, SplashCoord y0, SplashCoord x1, SplashCoo
SplashClip::SplashClip(SplashClip *clip)
{
int yMinAA, yMaxAA;
int i;
antialias = clip->antialias;
......@@ -92,14 +91,7 @@ SplashClip::SplashClip(SplashClip *clip)
for (i = 0; i < length; ++i) {
paths[i] = clip->paths[i]->copy();
flags[i] = clip->flags[i];
if (antialias) {
yMinAA = yMinI * splashAASize;
yMaxAA = (yMaxI + 1) * splashAASize - 1;
} else {
yMinAA = yMinI;
yMaxAA = yMaxI;
}
scanners[i] = new SplashXPathScanner(paths[i], flags[i] & splashClipEO, yMinAA, yMaxAA);
scanners[i] = clip->scanners[i]->copy();
}
}
......
......@@ -112,6 +112,18 @@ SplashXPathScanner::SplashXPathScanner(SplashXPath *xPathA, bool eoA, int clipYM
computeIntersections();
}
SplashXPathScanner::SplashXPathScanner(SplashXPathScanner *scanner)
{
xPath = scanner->xPath;
eo = scanner->eo;
xMin = scanner->xMin;
yMin = scanner->yMin;
xMax = scanner->xMax;
yMax = scanner->yMax;
partialClip = scanner->partialClip;
allIntersections = scanner->allIntersections;
}
SplashXPathScanner::~SplashXPathScanner() { }
void SplashXPathScanner::getBBoxAA(int *xMinA, int *yMinA, int *xMaxA, int *yMaxA)
......
......@@ -53,6 +53,9 @@ public:
// Create a new SplashXPathScanner object. <xPathA> must be sorted.
SplashXPathScanner(SplashXPath *xPathA, bool eoA, int clipYMin, int clipYMax);
// Copy a scanner.
SplashXPathScanner *copy() { return new SplashXPathScanner(this); }
~SplashXPathScanner();
SplashXPathScanner(const SplashXPathScanner &) = delete;
......@@ -93,6 +96,9 @@ public:
// will update <x0> and <x1>.
void clipAALine(SplashBitmap *aaBuf, int *x0, int *x1, int y);
protected:
SplashXPathScanner(SplashXPathScanner *scanner);
private:
void computeIntersections();
bool addIntersection(double segYMin, double segYMax, int y, int x0, int x1, int count);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment