[poppler] Implemented Type 4/5 shading for Splash Device

Albert Astals Cid aacid at kde.org
Sun Jun 27 09:55:56 PDT 2010


A Diumenge, 20 de juny de 2010, Albert Astals Cid va escriure:
> A Divendres, 18 de juny de 2010, Albert Astals Cid va escriure:
> > A Dimecres, 16 de juny de 2010, Christian Feuersaenger va escriure:
> > > Dear Poppler Developers,
> > > 
> > > attached you find my bugfix proposal to improve rendering of Type 4/5
> > > Shadings (Gouraud Interpolated Triangle Shadings).
> > > 
> > > What it does is:
> > > 1. implement the Function lookup to fix buggy display of parameterized
> > > shadings,
> > > 
> > > 2. Improve the triangle refinement control such that it runs 5 times
> > > faster,
> > > 
> > > 3. Share path memory between successive flat triangles which gains
> > > another 10% runtime improvement (avoids many new/delete operations).
> > > 
> > > I believe the changes are stable and should work without problems. The
> > > attached patch file patches against branch poppler-0.14 . Note that I
> > > changed the access policies to GfxSubPath: it has no setter methods
> > > which allows to re-use the same path with different coordinates (Point
> > > 3 of the list above).
> > 
> > I'm running the regression testing with your patch, if no regressions are
> > detected then we can look at the code and see if we like it or not :D
> > 
> > Thanks for the patch :-)
> 
> Passed the regression testing fine, will have a look at the code later
> today.

It took a bit more than expected, sorry about that.

I've removed the debug code and the #ifdef for the speedup, since yes, we 
obviously want the speedup, i'm attaching my work in progress patch.

I like you to do two things though.

Please change

+  // preallocate a path.
+  // Overwriting the coordinates saves about 10% at runtime for larger
+  // shadings.
+  state->moveTo(0., 0.);
+  state->lineTo(1., 0.);
+  state->lineTo(0., 1.);
+  state->closePath();

to a proper call like state->preallocatePath(); or something like this, since 
that four lines smell "big hack" and even though it is a hack i think it makes 
sense to have a function for it and not just create a fake triangle.

Can you please explain/rephrase

+    // this always produces output -- even for parameterized ranges.
+    // But it is wrong for parameterized colors:

Thanks for the patch and sorry again for the delay.

Albert

> 
> Albert
> 
> > Albert
> > 
> > > Looking forward to your opinions,
> > > 
> > > best regards
> > > 
> > > Christian
> > > 
> > > PS
> > > I will send patch files for the implemented draft of *real* gouraud
> > > interpolated shadings when they become more or less stable.
> > > 
> > > Am 14.06.2010 23:07, schrieb Albert Astals Cid:
> > > > A Dilluns, 14 de juny de 2010, Christian Feuersaenger va escriure:
> > > >> Hi Albert,
> > > >> 
> > > >> thank you for the fast reply and your positive answer!
> > > >> 
> > > >> I will use the next days to apply the xpdf patches to libpoppler.
> > > >> 
> > > >> I intent to patch the patched triangle refinement to your stable
> > > >> branch, which appears to be the poppler-0.14 (?). I consider it to
> > > >> be a bugfix.
> > > > 
> > > > Right poppler 0.14 is our stable branch.
> > > > 
> > > >> The interpolated shader is not yet stable and may need some
> > > >> revisions. I will continue working on it, preferrable on a separate
> > > >> branch. If you like, I can try to make a www git repository
> > > >> somewhere such that you can fetch my changes and merge them to
> > > >> whereever you want.
> > > > 
> > > > Personally i'd prefer that you send the patches to the mailing list,
> > > > makes easier for more people to see them and comment if they feel
> > > > like.
> > > > 
> > > > Albert
> > > > 
> > > >> For the moment, you find my test.pdf attached. it has been generated
> > > >> with latex and the unstable version of \usepackage{pgfplots},
> > > >> http://pgfplots.sourceforge.net/; I also attached the .tex sources.
> > > >> 
> > > >> So, thank you for the positive feedback.
> > > >> 
> > > >> Best regards
> > > >> 
> > > >> Christian
> > > >> 
> > > >>   >>  >   I am sure my additions are valueable and propose them for
> > > >>   >>  >   usage in libpoppler: the bugfix/speed improvement is
> > > >>   >>  >   directly usable and
> > > >> 
> > > >> stable
> > > >> 
> > > >>   >>  >   and the lowlevel shader will need some more time. I could
> > > >>   >>  >   also
> > > >> 
> > > >> use some
> > > >> 
> > > >>   >>  >   advice to get the integration with transparency, blending
> > > >>   >>  >   and
> > > >> 
> > > >> whatever
> > > >> 
> > > >>   >>  >   correctly. I started with the xpdf sources, so I would
> > > >>   >>  >   also
> > > >> 
> > > >> appreciate
> > > >> 
> > > >>   >>  >   any hints how you communicate changes between xpdf and
> > > >>   >>  >   libpoppler
> > > >> 
> > > >> if you
> > > >> 
> > > >>   >>  >   are interested in my proposal.
> > > >>   >  
> > > >>   >  Yes, we are interested in your patches, basically what we would
> > > >>   >  need
> > > >> 
> > > >> you is to
> > > >> 
> > > >>   >  provide a patch over poppler sources, you can choose wheter you
> > > >>   >  want
> > > >> 
> > > >> to make
> > > >> 
> > > >>   >  it against git master branch, git poppler-0.14 branch or the
> > > >>   >  released
> > > >> 
> > > >> 0.14.0
> > > >> 
> > > >>   >  tarball.
> > > >>   >  
> > > >>   >  Also it would be interesting to have the PDF you have used for
> > > >>   >  testing.
> > > >>   >  
> > > >>   >  Thanks,
> > > >>   >  
> > > >>   >     Albert
> > > >> 
> > > >> _______________________________________________
> > > >> poppler mailing list
> > > >> poppler at lists.freedesktop.org
> > > >> http://lists.freedesktop.org/mailman/listinfo/poppler
> > > > 
> > > > _______________________________________________
> > > > poppler mailing list
> > > > poppler at lists.freedesktop.org
> > > > http://lists.freedesktop.org/mailman/listinfo/poppler
> > 
> > _______________________________________________
> > poppler mailing list
> > poppler at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/poppler
> 
> _______________________________________________
> poppler mailing list
> poppler at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/poppler
-------------- next part --------------
A non-text attachment was scrubbed...
Name: type45.patch
Type: text/x-patch
Size: 10342 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/poppler/attachments/20100627/c0503949/attachment-0001.bin>


More information about the poppler mailing list