summaryrefslogtreecommitdiff
path: root/splash
diff options
context:
space:
mode:
authorThomas Freitag <Thomas.Freitag@alfa.de>2013-06-06 23:52:36 +0200
committerAlbert Astals Cid <aacid@kde.org>2013-06-06 23:52:36 +0200
commitbbd27c92b5e5034dc2899ea26b47fcb983209f82 (patch)
tree2c326ae0bfd26f14e24dd1973def6fe0cd5252b2 /splash
parent7847769a24bd3ccf863f653bc2215e84157ccfb6 (diff)
Speed-up some tiling on a 10x factor
Bug #64892
Diffstat (limited to 'splash')
-rw-r--r--splash/Splash.cc15
-rw-r--r--splash/Splash.h3
2 files changed, 13 insertions, 5 deletions
diff --git a/splash/Splash.cc b/splash/Splash.cc
index 6a1891ef..bc7d79ff 100644
--- a/splash/Splash.cc
+++ b/splash/Splash.cc
@@ -3682,7 +3682,7 @@ SplashError Splash::drawImage(SplashImageSource src, void *srcData,
return splashErrBadArg;
}
scaledImg = scaleImage(src, srcData, srcMode, nComps, srcAlpha, w, h,
- scaledWidth, scaledHeight, interpolate);
+ scaledWidth, scaledHeight, interpolate, tilingPattern);
if (scaledImg == NULL) {
return splashErrBadArg;
}
@@ -3720,7 +3720,7 @@ SplashError Splash::drawImage(SplashImageSource src, void *srcData,
return splashErrBadArg;
}
scaledImg = scaleImage(src, srcData, srcMode, nComps, srcAlpha, w, h,
- scaledWidth, scaledHeight, interpolate);
+ scaledWidth, scaledHeight, interpolate, tilingPattern);
if (scaledImg == NULL) {
return splashErrBadArg;
}
@@ -4063,7 +4063,7 @@ static GBool isImageInterpolationRequired(int srcWidth, int srcHeight,
SplashBitmap *Splash::scaleImage(SplashImageSource src, void *srcData,
SplashColorMode srcMode, int nComps,
GBool srcAlpha, int srcWidth, int srcHeight,
- int scaledWidth, int scaledHeight, GBool interpolate) {
+ int scaledWidth, int scaledHeight, GBool interpolate, GBool tilingPattern) {
SplashBitmap *dest;
dest = new SplashBitmap(scaledWidth, scaledHeight, 1, srcMode, srcAlpha, gTrue, bitmap->getSeparationList());
@@ -4081,7 +4081,7 @@ SplashBitmap *Splash::scaleImage(SplashImageSource src, void *srcData,
scaleImageYuXd(src, srcData, srcMode, nComps, srcAlpha,
srcWidth, srcHeight, scaledWidth, scaledHeight, dest);
} else {
- if (isImageInterpolationRequired(srcWidth, srcHeight, scaledWidth, scaledHeight, interpolate)) {
+ if (!tilingPattern && isImageInterpolationRequired(srcWidth, srcHeight, scaledWidth, scaledHeight, interpolate)) {
scaleImageYuXuBilinear(src, srcData, srcMode, nComps, srcAlpha,
srcWidth, srcHeight, scaledWidth, scaledHeight, dest);
} else {
@@ -4971,6 +4971,13 @@ void Splash::vertFlipImage(SplashBitmap *img, int width, int height,
gfree(lineBuf);
}
+void Splash::blitImage(SplashBitmap *src, GBool srcAlpha, int xDest, int yDest) {
+ SplashClipResult clipRes = state->clip->testRect(xDest, yDest, xDest + src->getWidth() - 1, yDest + src->getHeight() - 1);
+ if (clipRes != splashClipAllOutside) {
+ blitImage(src, srcAlpha, xDest, yDest, clipRes);
+ }
+}
+
void Splash::blitImage(SplashBitmap *src, GBool srcAlpha, int xDest, int yDest,
SplashClipResult clipRes) {
SplashPipe pipe;
diff --git a/splash/Splash.h b/splash/Splash.h
index 8bcd1dbc..cf98e6c6 100644
--- a/splash/Splash.h
+++ b/splash/Splash.h
@@ -232,6 +232,7 @@ public:
// zero.
SplashError blitTransparent(SplashBitmap *src, int xSrc, int ySrc,
int xDest, int yDest, int w, int h);
+ void blitImage(SplashBitmap *src, GBool srcAlpha, int xDest, int yDest);
//----- misc
@@ -364,7 +365,7 @@ private:
SplashBitmap *scaleImage(SplashImageSource src, void *srcData,
SplashColorMode srcMode, int nComps,
GBool srcAlpha, int srcWidth, int srcHeight,
- int scaledWidth, int scaledHeight, GBool interpolate);
+ int scaledWidth, int scaledHeight, GBool interpolate, GBool tilingPattern = gFalse);
void scaleImageYdXd(SplashImageSource src, void *srcData,
SplashColorMode srcMode, int nComps,
GBool srcAlpha, int srcWidth, int srcHeight,