Understanding the rendering pipeline

View: New views
4 Messages — Rating Filter:   Alert me  

Understanding the rendering pipeline

by Tuom Larsen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

I'm trying to read the sources but I'm not sure if I quite follow. Is this so far correct:
- poppler reads a pdf, gets the number of pages
- pick one page, locate xref, read its page object, retrieve the rest of objects and xobjects
- if a command is found, binary-search for the right operator function and call it
- ? (dump()?)
- everything gets rendered to a memory buffer on init or view_set_page() and bit-blipped to a window on expose event

What I don't get is how and where are the operators rendered to the memory buffer? How gets a page state transformed to pixels? Is there performed a binary search for every command in pdf?

_______________________________________________
poppler mailing list
poppler@...
http://lists.freedesktop.org/mailman/listinfo/poppler

Re: Understanding the rendering pipeline

by Albert Astals Cid-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

A Divendres, 9 d'octubre de 2009, Tuom Larsen va escriure:

> Hello,
>
> I'm trying to read the sources but I'm not sure if I quite follow. Is this
> so far correct:
> - poppler reads a pdf, gets the number of pages
> - pick one page, locate xref, read its page object, retrieve the rest of
> objects and xobjects
> - if a command is found, binary-search for the right operator function and
> call it
> - ? (dump()?)
> - everything gets rendered to a memory buffer on init or view_set_page()
>  and bit-blipped to a window on expose event
>
> What I don't get is how and where are the operators rendered to the memory
> buffer?

Well, each of the commands get called and this goes through the outputdev that
"draws" things

> How gets a page state transformed to pixels?
By commands like "draw line"

> Is there performed a binary search for every command in pdf?

Yes, but it's actually cheap so don't bother optimizing that it'll give you a
0.00000001% performance boost at most.

Albert

>

_______________________________________________
poppler mailing list
poppler@...
http://lists.freedesktop.org/mailman/listinfo/poppler

Re: Understanding the rendering pipeline

by Tuom Larsen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



On Sun, Oct 18, 2009 at 10:57 PM, Albert Astals Cid <aacid@...> wrote:
> buffer?

> What I don't get is how and where are the operators rendered to the memory
Well, each of the commands get called and this goes through the outputdev that
"draws" things

> How gets a page state transformed to pixels?
By commands like "draw line"

> Is there performed a binary search for every command in pdf?

Yes, but it's actually cheap so don't bother optimizing that it'll give you a
0.00000001% performance boost at most.

Hello,
thanks for the reply!
If I understood correctly: in PDF, say there are 1000 lines. Is the binary search for outputdev's appropriate callback called 1000 times? I thought there is some kind of cache (this is what I was trying to find in the source) but you are saying that it is fast enough? Is this correct? Fair enough...
Thanks for the info, once more!

_______________________________________________
poppler mailing list
poppler@...
http://lists.freedesktop.org/mailman/listinfo/poppler

Re: Understanding the rendering pipeline

by Albert Astals Cid-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

A Dijous, 22 d'octubre de 2009, Tuom Larsen va escriure:

> On Sun, Oct 18, 2009 at 10:57 PM, Albert Astals Cid <aacid@...> wrote:
> > > buffer?
> > >
> > > What I don't get is how and where are the operators rendered to the
> >
> > memory
> > Well, each of the commands get called and this goes through the outputdev
> > that
> > "draws" things
> >
> > > How gets a page state transformed to pixels?
> >
> > By commands like "draw line"
> >
> > > Is there performed a binary search for every command in pdf?
> >
> > Yes, but it's actually cheap so don't bother optimizing that it'll give
> > you a
> > 0.00000001% performance boost at most.
>
> Hello,
> thanks for the reply!
> If I understood correctly: in PDF, say there are 1000 lines. Is the binary
> search for outputdev's appropriate callback called 1000 times? I thought
> there is some kind of cache (this is what I was trying to find in the
> source) but you are saying that it is fast enough? Is this correct?

Compared to the cost of actually rendering the line, yes, O(log(N)) where N is
< 200 is cheap

Albert

> Fair
> enough...
> Thanks for the info, once more!
>

_______________________________________________
poppler mailing list
poppler@...
http://lists.freedesktop.org/mailman/listinfo/poppler