Ignore:
Timestamp:
Aug 27, 2010, 11:00:52 AM (11 years ago)
Author:
Silvan Scherrer
Message:

poppler update to 0.14.2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/poppler/mypoppler/poppler/SplashOutputDev.cc

    r277 r461  
    2121// Copyright (C) 2007 Koji Otani <sho@bbr.jp>
    2222// Copyright (C) 2009 Petr Gajdos <pgajdos@novell.com>
    23 // Copyright (C) 2009 Thomas Freitag <Thomas.Freitag@alfa.de>
     23// Copyright (C) 2009, 2010 Thomas Freitag <Thomas.Freitag@alfa.de>
    2424// Copyright (C) 2009 Carlos Garcia Campos <carlosgc@gnome.org>
    2525// Copyright (C) 2009 William Bader <williambader@hotmail.com>
     26// Copyright (C) 2010 Patrick Spendrin <ps_ml@gmx.de>
     27// Copyright (C) 2010 Brian Cameron <brian.cameron@oracle.com>
    2628//
    2729// To see a description of the changes please see the Changelog file that
     
    6567extern "C" int unlink(char *filename);
    6668#endif
     69#endif
     70
     71#ifdef _MSC_VER
     72#include <float.h>
     73#define isfinite(x) _finite(x)
     74#endif
     75
     76#ifdef __sun
     77#include <ieeefp.h>
     78#define isfinite(x) finite(x)
    6779#endif
    6880
     
    19691981
    19701982void SplashOutputDev::endMaskClip(GfxState * state) {
    1971         splash->setSoftMask(NULL);
     1983  double bbox[4] = {0,0,1,1}; // dummy
     1984  /* transfer mask to alpha channel! */
     1985  // memcpy(maskBitmap->getAlphaPtr(), maskBitmap->getDataPtr(), bitmap->getRowSize() * bitmap->getHeight());
     1986  // memset(maskBitmap->getDataPtr(), 0, bitmap->getRowSize() * bitmap->getHeight());
     1987  int c;
     1988  Guchar *dest = bitmap->getAlphaPtr();
     1989  Guchar *src = maskBitmap->getDataPtr();
     1990  for (c= 0; c < maskBitmap->getRowSize() * maskBitmap->getHeight(); c++) {
     1991    dest[c] = src[c];
     1992  }
     1993  delete maskBitmap;
     1994  maskBitmap = NULL;
     1995  endTransparencyGroup(state);
     1996  paintTransparencyGroup(state, bbox);
    19721997}
    19731998
     
    19842009
    19852010  ctm = state->getCTM();
     2011  for (int i = 0; i < 6; ++i) {
     2012    if (!isfinite(ctm[i])) return;
     2013  }
    19862014  mat[0] = ctm[0];
    19872015  mat[1] = ctm[1];
     
    19992027
    20002028  if (state->getFillColorSpace()->getMode() == csPattern) {
    2001     SplashBitmap *maskBitmap;
    20022029    Splash *maskSplash;
    20032030    SplashColor maskColor;
    2004    
     2031
     2032    /* from beginTransparencyGroup: */
     2033    // push a new stack entry
     2034    SplashTransparencyGroup *transpGroup = new SplashTransparencyGroup();
     2035    transpGroup->tx = 0;
     2036    transpGroup->ty = 0;
     2037    transpGroup->blendingColorSpace = NULL;
     2038    transpGroup->isolated = gFalse;
     2039    transpGroup->next = transpGroupStack;
     2040    transpGroupStack = transpGroup;
     2041    // save state
     2042    transpGroup->origBitmap = bitmap;
     2043    transpGroup->origSplash = splash;
     2044    //~ this ignores the blendingColorSpace arg
     2045    // create the temporary bitmap
     2046    bitmap = new SplashBitmap(bitmap->getWidth(), bitmap->getHeight(), bitmapRowPad, colorMode, gTrue,
     2047                              bitmapTopDown);
     2048    splash = new Splash(bitmap, vectorAntialias,
     2049                        transpGroup->origSplash->getScreen());
     2050    splash->blitTransparent(transpGroup->origBitmap, 0, 0, 0, 0, bitmap->getWidth(), bitmap->getHeight());
     2051    splash->setInNonIsolatedGroup(transpGroup->origBitmap, 0, 0);
     2052    transpGroup->tBitmap = bitmap;
     2053
    20052054    maskBitmap = new SplashBitmap(bitmap->getWidth(), bitmap->getHeight(), 1, splashModeMono8, gFalse);
    20062055    maskSplash = new Splash(maskBitmap, vectorAntialias);
     
    20112060    maskSplash->fillImageMask(&imageMaskSrc, &imgMaskData,  width, height, mat, t3GlyphStack != NULL);
    20122061    delete maskSplash;
    2013     splash->setSoftMask(maskBitmap);
    20142062  } else {
    20152063    splash->fillImageMask(&imageMaskSrc, &imgMaskData, width, height, mat, t3GlyphStack != NULL);
     
    22622310
    22632311  ctm = state->getCTM();
     2312  for (i = 0; i < 6; ++i) {
     2313    if (!isfinite(ctm[i])) return;
     2314  }
    22642315  mat[0] = ctm[0];
    22652316  mat[1] = ctm[1];
     
    25292580
    25302581    ctm = state->getCTM();
     2582    for (i = 0; i < 6; ++i) {
     2583      if (!isfinite(ctm[i])) {
     2584        delete maskBitmap;
     2585        return;
     2586      }
     2587    }
    25312588    mat[0] = ctm[0];
    25322589    mat[1] = ctm[1];
     
    26402697
    26412698  ctm = state->getCTM();
     2699  for (i = 0; i < 6; ++i) {
     2700    if (!isfinite(ctm[i])) return;
     2701  }
    26422702  mat[0] = ctm[0];
    26432703  mat[1] = ctm[1];
     
    29823042  softMask = new SplashBitmap(bitmap->getWidth(), bitmap->getHeight(),
    29833043                              1, splashModeMono8, gFalse);
    2984   memset(softMask->getDataPtr(), 0,
     3044  unsigned char fill = 0;
     3045  if (transpGroupStack->blendingColorSpace) {
     3046        transpGroupStack->blendingColorSpace->getGray(backdropColor, &gray);
     3047        fill = colToByte(gray);
     3048  }
     3049  memset(softMask->getDataPtr(), fill,
    29853050         softMask->getRowSize() * softMask->getHeight());
    29863051  p = softMask->getDataPtr() + ty * softMask->getRowSize() + tx;
Note: See TracChangeset for help on using the changeset viewer.