[poppler] Branch 'poppler-0.14' - poppler/GfxState.cc

Carlos Garcia Campos carlosgc at kemper.freedesktop.org
Mon Jun 21 08:24:51 PDT 2010


 poppler/GfxState.cc |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit ef199a210394a0935b83156795c3b09c37dfc7e4
Author: Carlos Garcia Campos <carlosgc at gnome.org>
Date:   Mon Jun 21 17:19:22 2010 +0200

    Reduce pow operations in GfxCalRGBColorSpace::getXYZ()
    
    We were doing the same pow operation 3 times!. It makes document
    attached to bug #28591 render a little faster.

diff --git a/poppler/GfxState.cc b/poppler/GfxState.cc
index 76cb010..61dac24 100644
--- a/poppler/GfxState.cc
+++ b/poppler/GfxState.cc
@@ -909,12 +909,12 @@ void GfxCalRGBColorSpace::getXYZ(GfxColor *color,
   double *pX, double *pY, double *pZ) {
   double A, B, C;
 
-  A = colToDbl(color->c[0]);
-  B = colToDbl(color->c[1]);
-  C = colToDbl(color->c[2]);
-  *pX = mat[0]*pow(A,gammaR)+mat[3]*pow(B,gammaG)+mat[6]*pow(C,gammaB);
-  *pY = mat[1]*pow(A,gammaR)+mat[4]*pow(B,gammaG)+mat[7]*pow(C,gammaB);
-  *pZ = mat[2]*pow(A,gammaR)+mat[5]*pow(B,gammaG)+mat[8]*pow(C,gammaB);
+  A = pow(colToDbl(color->c[0]), gammaR);
+  B = pow(colToDbl(color->c[1]), gammaG);
+  C = pow(colToDbl(color->c[2]), gammaB);
+  *pX = mat[0] * A + mat[3] * B + mat[6] * C;
+  *pY = mat[1] * A + mat[4] * B + mat[7] * C;
+  *pZ = mat[2] * A + mat[5] * B + mat[8] * C;
 }
 
 void GfxCalRGBColorSpace::getGray(GfxColor *color, GfxGray *gray) {


More information about the poppler mailing list