From 0f78fc2fc29463af7340fa5c7efac6f82dbba26b Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Fri, 27 Aug 2021 02:02:52 +0200 Subject: Every function in SplashXPathScanner is const --- splash/SplashXPathScanner.cc | 12 ++++++------ splash/SplashXPathScanner.h | 16 ++++++++-------- 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 . - void getSpanBounds(int y, int *spanXMin, int *spanXMax); + void getSpanBounds(int y, int *spanXMin, int *spanXMax) const; // Returns true if (,) is inside the path. - bool test(int x, int y); + bool test(int x, int y) const; // Returns true if the entire span ([,], ) 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 . Returns the min and // max x coordinates with non-zero pixels in and . - 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 and . This function // will update and . - 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); -- cgit v1.2.3