[poppler] Patch proposal: Implementation for real gouraud shaded triangles

Christian Feuersaenger cfeuersaenger at googlemail.com
Sun Oct 10 10:40:02 PDT 2010


Dear Thomas,

thanks for the testing! I will submit the corrected real shader patch to 
the mailing list as soon as I have made the final code adjustments (your 
mail is thus a litte bit too early - you are the only one who has seen 
the modifications so far). The code adjustments are quite small, I only 
wanted to think where to place the colorspace conversion routine (a 
static function in Splash.cc as I realized it so far appears to be too 
simple).

I'll contact the mailing list as soon as the patch is ready; but I 
appreciate the beta-testing!

Best regards

Christian

Am 10.10.2010 12:11, schrieb Thomas Freitag:
>  Hi Albert & Christian!
>
> I tested the bugfix and the (corrected) improvement patch aginst 
> splash mode CMYK and grayscale (I forced SplashOutputDev to produce a 
> CMYK and a grayscale bitmap), and I found no problems with it. Because 
> the bugfix for gouraud shading produces outputs much more likely the 
> acrobat reader output, I would appreciate a commit to the actual 
> branch as soon as it runs through the rgeression tests.
>
> Best regards,
> Thomas
>
> Am 08.10.2010 22:23, schrieb Christian Feuersaenger:
>> Am 07.10.2010 23:08, schrieb Albert Astals Cid:
>>> A Dimecres, 6 d'octubre de 2010, Christian Feuersaenger va escriure:
>>>> Am 05.10.2010 22:59, schrieb Albert Astals Cid:
>>>>> A Dijous, 30 de setembre de 2010, Christian Feuersaenger va escriure:
>>>>>> Hello Albert,
>>>>>>
>>>>>> Am 30.09.2010 00:00, schrieb Albert Astals Cid:
>>>>>>> A Dijous, 19 d'agost de 2010, vàreu escriure:
>>>>>>>> Dear Albert,
>>>>>>>>
>>>>>>>> attached you find a test.pdf in which the improvements can be 
>>>>>>>> seen.
>>>>>>>>
>>>>>>>> The rendering quality of my patch is much better; it eliminates 
>>>>>>>> the
>>>>>>>> moire effects of the flat shading approximation (top left image).
>>>>>>>>
>>>>>>>> Compare also the image with opacity on page 2 of test.pdf.
>>>>>>>>
>>>>>>>> Besides the improved rendering quality, the most obvious change 
>>>>>>>> is the
>>>>>>>> required runtime: on my system, the default xpdf requires 15 
>>>>>>>> seconds
>>>>>>>> until it stops rendering the first page whereas xpdf with poppler
>>>>>>>> support and my new patch requires about one second. The pdftoppm
>>>>>>>> utility is also considerably faster.
>>>>>>>>
>>>>>>>> Let me stress that the patch is unrelated to my previous 
>>>>>>>> bugfixes, so
>>>>>>>> rendering problems are only fixed together with the other bugfix.
>>>>>>> I'm not sure i understand this last sentence, you say that the 
>>>>>>> patches
>>>>>>> are
>>>>>>> unrelated but then you say the bugs are only fixed together with 
>>>>>>> the
>>>>>>> other
>>>>>>> patch?
>>>>>>>
>>>>>>> Should i run a regression test over this patch or does it need 
>>>>>>> to be in
>>>>>>> conjunction with the other patch?
>>>>>> The "Implementation for real gouraud shaded triangles" is more a new
>>>>>> feature than simply a bugfix: it re-implements the shaders for the
>>>>>> splash device. Its purpose is mainly a vastly improved rendering 
>>>>>> speed.
>>>>>> I'd suggest to run regression tests on this implementation 
>>>>>> separately
>>>>>> from my other patch proposals.
>>>>>>
>>>>>> The other patch proposals (you have  processed them already; I still
>>>>>> have to investigate your problem report) are bug fixes which 
>>>>>> should be
>>>>>> tested separately.
>>>>>>
>>>>>> My last remark is to be understood as follows:
>>>>>> 1. if you view test.pdf with both patches, you have best quality and
>>>>>> highest speed.
>>>>>> 2. if you view test.pdf only with the given patch, you have high 
>>>>>> speed
>>>>>> and good quality for the triangle patches, but the coons patch 
>>>>>> things
>>>>>> will be buggy.
>>>>>> 3. if you only process the other patch proposal (the bugfixes 
>>>>>> which are
>>>>>> not part of mail), the coons patches are rendered correctly; but the
>>>>>> triangle patches are slow and only approximately correct due to the
>>>>>> piecewise flat triangle approximation as it is currently done in
>>>>>> libpoppler.
>>>>>>
>>>>>> I think the most reliable quality verification can be gained by 
>>>>>> testing
>>>>>> both patches separately.
>>>>> Ok, i've ran the test regression over this aptch and everything 
>>>>> seems to
>>>>> be ok, could you please fix the FIXME and TODO you have in the code?
>>>> Hello Albert,
>>>>
>>>> I'm glad the regression tests passed. Concerning the FIXME and TODO
>>>> list: They constitute (without exception) additional features which do
>>>> not limit the application of the patch (falling back to the old
>>>> implementations automatically). I am willing to work on the FIXMEs, 
>>>> but
>>>> a realization might not be finished before the beginning of the new 
>>>> year
>>>> due to my personal time schedule for the next months.
>>>>
>>>> I suggest to incorporate the patch into libpoppler as-is, and I will
>>>> work on the remaining feature requests eventually.
>>> Not really, i want at least splashModeXBGR8 fixed (can can just try 
>>> it with
>>> qt4/test/test-poppler-qt4) before commiting since is what the Qt 
>>> frontend uses
>>> that is the major user of the Splash backend.
>>>
>>> I attach the patch as i tried.
>>>
>>> Albert
>>
>> Ok, I'll attempt it. Thank you for the details.
>>
>> Best regards
>>
>> Christian
>>
>>
>>>> Best regards
>>>>
>>>> Christian
>>>>
>>>>> Thanks,
>>>>>
>>>>>     Albert
>>>>>> Best regards
>>>>>>
>>>>>> Christian
>>>>>>
>>>>>> PS
>>>>>> Sorry if you get notifications because of 'Post by non-member to a
>>>>>> members-only list'... I keep clicking onto the wrong email 
>>>>>> address :(
>>>>>> (have now registered both of them)
>>>>>>
>>>>>>> Albert
>>>>>>>
>>>>>>>> Best regards
>>>>>>>>
>>>>>>>> Christian
>>>>>>>>
>>>>>>>> Am 18.08.2010 23:15, schrieb Albert Astals Cid:
>>>>>>>>> A Dijous, 15 de juliol de 2010, Christian Feuersaenger va 
>>>>>>>>> escriure:
>>>>>>>>>> Dear poppler developers,
>>>>>>>>>>
>>>>>>>>>> hereby I propose a new patch for a high quality, fast gouraud
>>>>>>>>>> shader for
>>>>>>>>>> triangle shadings.
>>>>>>>>>>
>>>>>>>>>> The patch provides
>>>>>>>>>> - scalable triangle shadings (in contrast to the old approach),
>>>>>>>>>> - correct shading, no approximation using flat triangles,
>>>>>>>>>> - greatly (!) improved rendering speed,
>>>>>>>>>> - support for opacity (in contrast to the previous approach).
>>>>>>>>>>
>>>>>>>>>> This patch is relative to the master branch,
>>>>>>>>>> git show poppler-0.14.0-91-g31ac578 .
>>>>>>>>>>
>>>>>>>>>> It is unrelated to my previous patch proposals concerning 
>>>>>>>>>> shadings;
>>>>>>>>>> the
>>>>>>>>>> other patch proposal (my mail several weeks ago) is still 
>>>>>>>>>> important
>>>>>>>>>> and
>>>>>>>>>> relevant. The patch in this mail is independent and does not
>>>>>>>>>> include my
>>>>>>>>>> previous patch proposals.
>>>>>>>>>>
>>>>>>>>>> I tested the new patch with pdftoppm and with the 
>>>>>>>>>> xpdf-poppler fork
>>>>>>>>>> of Rogerio Brito; it appears to work reliable. I tested
>>>>>>>>>> - matrix shadings and triangle patch shadings (Types 4 and 5),
>>>>>>>>>> - degenerated triangles,
>>>>>>>>>> - clipping,
>>>>>>>>>> - opacity,
>>>>>>>>>> - RGB color spaces.
>>>>>>>>>>
>>>>>>>>>> The implementation now supports these shadings on a display 
>>>>>>>>>> driver
>>>>>>>>>> level
>>>>>>>>>> and is implemented directly in the splash device (using scanline
>>>>>>>>>> sweeps).
>>>>>>>>>>
>>>>>>>>>> I've been defensive: I have no test cases for other color 
>>>>>>>>>> spaces and
>>>>>>>>>> I have no test data for non-parametric shadings. Consequently, I
>>>>>>>>>> disabled
>>>>>>>>>> the shader for these cases; it will fall back to the existing
>>>>>>>>>> solutions
>>>>>>>>>> (approximate shading by means of many flat triangles).
>>>>>>>>>>
>>>>>>>>>> I hope you find my patch proposal useful. I believe it is 
>>>>>>>>>> worthy of
>>>>>>>>>> being part of libpoppler.
>>>>>>>>> Do you have a pdf where we can see the improvement this patch 
>>>>>>>>> gives?
>>>>>>>>>
>>>>>>>>> Albert
>>>>>>>>>
>>>>>>>>>> Thanks,
>>>>>>>>>>
>>>>>>>>>> Christian
>>>>>>>>> _______________________________________________
>>>>>>>>> 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
>>
>> _______________________________________________
>> 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



More information about the poppler mailing list