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

Christian Feuersaenger ludewich at users.sourceforge.net
Fri Jul 2 12:12:23 PDT 2010


Dear Albert,

I have improved my shading Type 4/5 bugfix as suggested.

More precisely, I
- incorporated your patch file (which removed the debug things),
- improved the code comment which you found misleading (see your mail 
below),
- wrote a clean interface to implement the runtime optimization which 
reduces the new/delete usage.

The last point is probably the most interesting one: I suggest to use a 
"ReusablePathIterator" in GfxState which allows to re-iterate over a 
given (frozen) path as often as one wishes, see the code documentation 
for details.

Attached you find
- the patch, relative to
poppler-0.14.0-3-gb2427d0

- an updated test.pdf (let me know if you are interested in these test 
cases -- they will probably grow even more when I am finished with the 
*real* gouraud shader).

With your permission, I will also try to provide bugfixes for the 
Shading Type 6 implementations (see the test.pdf).

Best regards

Christian

Am 28.06.2010 18:08, schrieb Christian Feuersaenger:
> Hi Albert,
>
> thank you for investing your time in my contributions! I will look into
> your suggestions and commit a new patch proposal once I found a more
> satisfying solution.
>
> I have now test pdfs (and ready applications) for pdf Shading Type 6 and
> Shading Type 7 (patches). There are several graphics bugs which seem
> like bogus memory initialisation when displaying them, so I'll look into
> them as well (unless someone else is currently doing so).
>
> Concerning the low level linear interpolation shader, I've come quite
> far, yet it needs some further attention.
>
> Best regards
>
> Christian
>
> Am 27.06.2010 18:55, schrieb Albert Astals Cid:
>> 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
>>>
>>>
>>> _______________________________________________
>>> 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 --------------
An embedded and charset-unspecified text was scrubbed...
Name: type45.patch_2010-07-02
URL: <http://lists.freedesktop.org/archives/poppler/attachments/20100702/96d5b646/attachment-0001.ksh>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.pdf
Type: application/pdf
Size: 117299 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/poppler/attachments/20100702/96d5b646/attachment-0001.pdf>


More information about the poppler mailing list