summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2021-08-27 02:02:52 +0200
committerAlbert Astals Cid <aacid@kde.org>2021-08-27 02:19:47 +0200
commit0f78fc2fc29463af7340fa5c7efac6f82dbba26b (patch)
tree508da0d45edbf77a6e1b01e9a96b0062d9508551
parentd6c4d5d98f016d552c54bc86c42883d660adb70c (diff)
Every function in SplashXPathScanner is const
-rw-r--r--splash/SplashXPathScanner.cc12
-rw-r--r--splash/SplashXPathScanner.h16
2 files changed, 14 insertions, 14 deletions
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);