[poppler] 2 commits - splash/SplashXPathScanner.cc splash/SplashXPathScanner.h
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Fri Aug 27 00:21:25 UTC 2021
Rebased ref, commits from common ancestor:
commit 0f78fc2fc29463af7340fa5c7efac6f82dbba26b
Author: Albert Astals Cid <aacid at kde.org>
Date: Fri Aug 27 02:02:52 2021 +0200
Every function in SplashXPathScanner is const
diff --git a/splash/SplashXPathScanner.cc b/splash/SplashXPathScanner.cc
index 4add4267..238e5fcb 100644
--- a/splash/SplashXPathScanner.cc
+++ b/splash/SplashXPathScanner.cc
@@ -124,7 +124,7 @@ SplashXPathScanner::SplashXPathScanner(const SplashXPathScanner *scanner)
SplashXPathScanner::~SplashXPathScanner() { }
-void SplashXPathScanner::getBBoxAA(int *xMinA, int *yMinA, int *xMaxA, int *yMaxA)
+void SplashXPathScanner::getBBoxAA(int *xMinA, int *yMinA, int *xMaxA, int *yMaxA) const
{
*xMinA = xMin / splashAASize;
*yMinA = yMin / splashAASize;
@@ -132,7 +132,7 @@ void SplashXPathScanner::getBBoxAA(int *xMinA, int *yMinA, int *xMaxA, int *yMax
*yMaxA = yMax / splashAASize;
}
-void SplashXPathScanner::getSpanBounds(int y, int *spanXMin, int *spanXMax)
+void SplashXPathScanner::getSpanBounds(int y, int *spanXMin, int *spanXMax) const
{
if (y < yMin || y > yMax) {
*spanXMin = xMax + 1;
@@ -155,7 +155,7 @@ void SplashXPathScanner::getSpanBounds(int y, int *spanXMin, int *spanXMax)
}
}
-bool SplashXPathScanner::test(int x, int y)
+bool SplashXPathScanner::test(int x, int y) const
{
if (y < yMin || y > yMax) {
return false;
@@ -171,7 +171,7 @@ bool SplashXPathScanner::test(int x, int y)
return eo ? (count & 1) : (count != 0);
}
-bool SplashXPathScanner::testSpan(int x0, int x1, int y)
+bool SplashXPathScanner::testSpan(int x0, int x1, int y) const
{
unsigned int i;
@@ -357,7 +357,7 @@ inline bool SplashXPathScanner::addIntersection(double segYMin, double segYMax,
return true;
}
-void SplashXPathScanner::renderAALine(SplashBitmap *aaBuf, int *x0, int *x1, int y, bool adjustVertLine)
+void SplashXPathScanner::renderAALine(SplashBitmap *aaBuf, int *x0, int *x1, int y, bool adjustVertLine) const
{
int xx0, xx1, xx, xxMin, xxMax, yy, yyMax, interCount;
size_t interIdx;
@@ -436,7 +436,7 @@ void SplashXPathScanner::renderAALine(SplashBitmap *aaBuf, int *x0, int *x1, int
*x1 = (xxMax - 1) / splashAASize;
}
-void SplashXPathScanner::clipAALine(SplashBitmap *aaBuf, int *x0, int *x1, int y)
+void SplashXPathScanner::clipAALine(SplashBitmap *aaBuf, int *x0, int *x1, int y) const
{
int xx0, xx1, xx, yy, yyMin, yyMax, interCount;
size_t interIdx;
diff --git a/splash/SplashXPathScanner.h b/splash/SplashXPathScanner.h
index c8c31efd..643b06f3 100644
--- a/splash/SplashXPathScanner.h
+++ b/splash/SplashXPathScanner.h
@@ -62,7 +62,7 @@ public:
SplashXPathScanner &operator=(const SplashXPathScanner &) = delete;
// Return the path's bounding box.
- void getBBox(int *xMinA, int *yMinA, int *xMaxA, int *yMaxA)
+ void getBBox(int *xMinA, int *yMinA, int *xMaxA, int *yMaxA) const
{
*xMinA = xMin;
*yMinA = yMin;
@@ -71,30 +71,30 @@ public:
}
// Return the path's bounding box.
- void getBBoxAA(int *xMinA, int *yMinA, int *xMaxA, int *yMaxA);
+ void getBBoxAA(int *xMinA, int *yMinA, int *xMaxA, int *yMaxA) const;
// Returns true if at least part of the path was outside the
// clipYMin/clipYMax bounds passed to the constructor.
- bool hasPartialClip() { return partialClip; }
+ bool hasPartialClip() const { return partialClip; }
// Return the min/max x values for the span at <y>.
- void getSpanBounds(int y, int *spanXMin, int *spanXMax);
+ void getSpanBounds(int y, int *spanXMin, int *spanXMax) const;
// Returns true if (<x>,<y>) is inside the path.
- bool test(int x, int y);
+ bool test(int x, int y) const;
// Returns true if the entire span ([<x0>,<x1>], <y>) is inside the
// path.
- bool testSpan(int x0, int x1, int y);
+ bool testSpan(int x0, int x1, int y) const;
// Renders one anti-aliased line into <aaBuf>. Returns the min and
// max x coordinates with non-zero pixels in <x0> and <x1>.
- void renderAALine(SplashBitmap *aaBuf, int *x0, int *x1, int y, bool adjustVertLine = false);
+ void renderAALine(SplashBitmap *aaBuf, int *x0, int *x1, int y, bool adjustVertLine = false) const;
// Clips an anti-aliased line by setting pixels to zero. On entry,
// all non-zero pixels are between <x0> and <x1>. This function
// will update <x0> and <x1>.
- void clipAALine(SplashBitmap *aaBuf, int *x0, int *x1, int y);
+ void clipAALine(SplashBitmap *aaBuf, int *x0, int *x1, int y) const;
protected:
SplashXPathScanner(const SplashXPathScanner *scanner);
commit d6c4d5d98f016d552c54bc86c42883d660adb70c
Author: Albert Astals Cid <aacid at kde.org>
Date: Fri Aug 27 02:01:05 2021 +0200
SplashXPathScanner: Don't keep the SplashXPath around
we don't need it
diff --git a/splash/SplashXPathScanner.cc b/splash/SplashXPathScanner.cc
index f8ede09a..4add4267 100644
--- a/splash/SplashXPathScanner.cc
+++ b/splash/SplashXPathScanner.cc
@@ -38,13 +38,12 @@
// SplashXPathScanner
//------------------------------------------------------------------------
-SplashXPathScanner::SplashXPathScanner(SplashXPath *xPathA, bool eoA, int clipYMin, int clipYMax)
+SplashXPathScanner::SplashXPathScanner(const SplashXPath *xPath, bool eoA, int clipYMin, int clipYMax)
{
SplashXPathSeg *seg;
SplashCoord xMinFP, yMinFP, xMaxFP, yMaxFP;
int i;
- xPath = xPathA;
eo = eoA;
partialClip = false;
@@ -109,12 +108,11 @@ SplashXPathScanner::SplashXPathScanner(SplashXPath *xPathA, bool eoA, int clipYM
}
}
- computeIntersections();
+ computeIntersections(xPath);
}
SplashXPathScanner::SplashXPathScanner(const SplashXPathScanner *scanner)
{
- xPath = scanner->xPath;
eo = scanner->eo;
xMin = scanner->xMin;
yMin = scanner->yMin;
@@ -237,7 +235,7 @@ SplashXPathScanIterator::SplashXPathScanIterator(const SplashXPathScanner &scann
}
}
-void SplashXPathScanner::computeIntersections()
+void SplashXPathScanner::computeIntersections(const SplashXPath *xPath)
{
SplashXPathSeg *seg;
SplashCoord segXMin, segXMax, segYMin, segYMax, xx0, xx1;
diff --git a/splash/SplashXPathScanner.h b/splash/SplashXPathScanner.h
index 322688d4..c8c31efd 100644
--- a/splash/SplashXPathScanner.h
+++ b/splash/SplashXPathScanner.h
@@ -51,7 +51,7 @@ class SplashXPathScanner
{
public:
// Create a new SplashXPathScanner object. <xPathA> must be sorted.
- SplashXPathScanner(SplashXPath *xPathA, bool eoA, int clipYMin, int clipYMax);
+ SplashXPathScanner(const SplashXPath *xPath, bool eoA, int clipYMin, int clipYMax);
// Copy a scanner.
SplashXPathScanner *copy() const { return new SplashXPathScanner(this); }
@@ -100,10 +100,9 @@ protected:
SplashXPathScanner(const SplashXPathScanner *scanner);
private:
- void computeIntersections();
+ void computeIntersections(const SplashXPath *xPath);
bool addIntersection(double segYMin, double segYMax, int y, int x0, int x1, int count);
- SplashXPath *xPath;
bool eo;
int xMin, yMin, xMax, yMax;
bool partialClip;
More information about the poppler
mailing list