[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cairo vs. art and PDFKit

From: Eric Wasylishen
Subject: Re: cairo vs. art and PDFKit
Date: Thu, 23 Feb 2012 13:13:56 -0700

Hi Riccardo,
Thanks for the bug report, this is an interesting one.

It looks like I made some oversights with how NSImageRep expects to be 
overridden - currently it looks like image rep subclasses must override -draw 
in order to work properly. By chance when cairo is not in use, we don't hit 
this bug.

As a quick workaround you can change the -drawRect: method in PDFImageRep.m to 
a -draw method:

- (BOOL) draw
   NSGraphicsContext* gc = GSCurrentContext();
   // fill background with white color
   [[NSColor whiteColor] set];
   DPSrectfill(gc, 0, 0, [self size].width, [self size].height);

   if (pageNeedsUpdate)
      [self _updatePage];

   [page draw];

   // display page content
   //[outputDevice renderPage: [self pageNum]
   //              ofDocument: pdfDoc
   //                 withDPI: [self resolution]];

   return YES;

But this is a hack, of course. It should work as-is.


On 2012-02-23, at 9:16 AM, Riccardo Mottola wrote:

> Hi,
> I noticed that PDFKit (which is used by the PDF inspector in the content 
> inspector of GWorkspace) with current cairo doesn't work anymore, it displays 
> only blank pages (of the correct size, but no content, no graphics, no text). 
> The same plugin run with the art backend (without recompiling anything else 
> besides the backend) works again.
> Richard Stonehouse cna reproduce this too and Sebastian too.
> I wonder what's up and how it can be debugged further.
> Riccardo
> _______________________________________________
> Discuss-gnustep mailing list
> Discuss-gnustep@gnu.org
> https://lists.gnu.org/mailman/listinfo/discuss-gnustep

reply via email to

[Prev in Thread] Current Thread [Next in Thread]