X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;f=pdf%2Fxpdf%2FGDKSplashOutputDev.cc;h=e570bd0c719b5927f3c7d7e31d0af92a6df891b4;hb=a2f683fe644fded868c536909907282555b1b777;hp=4ef3bb35f984cb76d11e065674eb4dca74ac3155;hpb=179af30116fcee661c68d64885f4a6fe6c0cd679;p=evince.git diff --git a/pdf/xpdf/GDKSplashOutputDev.cc b/pdf/xpdf/GDKSplashOutputDev.cc index 4ef3bb35..e570bd0c 100644 --- a/pdf/xpdf/GDKSplashOutputDev.cc +++ b/pdf/xpdf/GDKSplashOutputDev.cc @@ -41,7 +41,7 @@ static SplashColor makeSplashColor(int r, int g, int b) GDKSplashOutputDev::GDKSplashOutputDev(GdkScreen *screen, void (*redrawCbkA)(void *data), void *redrawCbkDataA): - SplashOutputDev(splashModeRGB8, gFalse, makeSplashColor (255,255,255)), + SplashOutputDev(splashModeRGB8Packed, gFalse, makeSplashColor (255,255,255)), incrementalUpdate (1) { redrawCbk = redrawCbkA; @@ -90,7 +90,7 @@ void GDKSplashOutputDev::endPage() { } void GDKSplashOutputDev::dump() { - if (incrementalUpdate) { + if (incrementalUpdate && redrawCbk) { (*redrawCbk)(redrawCbkData); } } @@ -104,55 +104,24 @@ void GDKSplashOutputDev::redraw(int srcX, int srcY, GdkDrawable *drawable, int destX, int destY, int width, int height) { - SplashColorPtr dataPtr; GdkGC *gc; - guchar *gdk_buf; int gdk_rowstride; - int bw, x, y, r, g, b; - gdk_rowstride = width * 3; - - /* better to draw nothing than crash on a huge image */ - gdk_buf = (guchar*) g_try_malloc (height * gdk_rowstride); - if (gdk_buf == NULL) - return; - - bw = getBitmap()->getWidth(); - dataPtr = getBitmap()->getDataPtr(); - - for (y = 0; y < height; ++y) - { - SplashRGB8 *p; - SplashRGB8 rgb; - guchar *gdk_p; - - p = dataPtr.rgb8 + (y + srcY) * bw + srcX; - gdk_p = gdk_buf + y * gdk_rowstride; - for (x = 0; x < width; ++x) - { - rgb = *p++; - r = splashRGB8R(rgb); - g = splashRGB8G(rgb); - b = splashRGB8B(rgb); - - *gdk_p++ = r; - *gdk_p++ = g; - *gdk_p++ = b; - } - } - + gdk_rowstride = getBitmap()->getRowSize(); gc = gdk_gc_new (drawable); gdk_draw_rgb_image (drawable, gc, destX, destY, width, height, GDK_RGB_DITHER_NORMAL, - gdk_buf, + getBitmap()->getDataPtr().rgb8p + srcY * gdk_rowstride + srcX * 3, gdk_rowstride); g_object_unref (gc); +} - g_free (gdk_buf); +void GDKSplashOutputDev::drawToPixbuf(GdkPixbuf *pixbuf, int pageNum) { + } GBool GDKSplashOutputDev::findText(Unicode *s, int len,