[poppler] Implement Type 4, 5, 6, 7 shadings using cairo mesh gradients

Thomas Freitag Thomas.Freitag at kabelmail.de
Tue Jan 25 06:46:30 PST 2011


Am 25.01.2011 15:29, schrieb Carlos Garcia Campos:
> Excerpts from Thomas Freitag's message of mar ene 25 09:27:24 +0100 2011:
>> Am 25.01.2011 09:15, schrieb Carlos Garcia Campos:
>>> Excerpts from Albert Astals Cid's message of lun ene 24 19:53:50 +0100 2011:
>>>> A Dilluns, 24 de gener de 2011, Thomas Freitag va escriure:
>>>>> Am 24.01.2011 14:17, schrieb Carlos Garcia Campos:
>>>>>> Cairo 1.11.2 has a new mesh pattern that can be used to implement 6/7
>>>>>> type gradients. Adrian has an updated poppler branch that implements
>>>>>> mesh gradients in cairo backend:
>>>>>>
>>>>>> http://cgit.freedesktop.org/~ajohnson/poppler/log/?h=mesh
>>>>>>
>>>>>> I've tried it and it works great, it fixes bugs #28836 and #32791 (and
>>>>>> maybe others). I haven't pushed the patch yet becuase it contains
>>>>>> minimal changes in Gfx.cc. If nobody objects I'll push it to master
>>>>>> branch only.
>>>>> I had a quick look at what Adrian has done in Gfc.cc, and think, that is
>>>>> a little bit misusing of out->gouraudTriangleShadedFill( state, shading)
>>>>> and out->patchMeshShadedFill( state, shading):
>>>>>
>>>>> When these functions returns gTrue, this indicates that all work has
>>>>> already be done in the output device. How Adrian implements it is very
>>>>> special to Cairo. But it is quite ease to change it:
>>>>> Just move the lines
>>>> Agreed with Thomas.
>>> contentIsHidden() is private to Gfx, and all other patterns do the
>>> clip and fill in Gfx
>> Yeah, unfortunately contentIsHidden is private to Gfx, so probably there
>> should be a return if contentIsHidden() before calling the shading
>> routines in the output devices.
> I'm not sure it's correct, the spec says:
>
> When a piece of optional content in a PDF file is determined that it
> shall be hidden, the following occurs:
>   - The content shall not be drawn.
>   - Graphics state operations, such as setting the colour,
>     transformation matrix, and clipping, shall still be applied.
Okay, Carlos: But we speak here from filling with a pattern, not from a 
simple fill operation. That we simulate that with fill operations should 
not lead to the fact, that the fill color should be changed, when 
content shall not be drawn. And the fill colorspace (i.e. the pattern 
colorspace) is already set. Therefore in my opinion it should be 
sufficient to return if contentIsHidden() returns true. But that's only 
my opinion.

Thomas

> I think that's why we check whether content is hidden right before
> filling.
>
>> But You're not true, that clip and fill
>> is done in Gfx, this is special to cairo which is the only device that
>> supports useFillColorStop() and can therefore use the clip and fill from
>> Gfx. At least in SplashOutputDev the done work (implemented by Christian
>> Feuers?nger) in gouraudTriangleShadedFill would be overwritten and
>> probably causes wrong results.
>>
>> Thomas
>>>> Albert
>>>>
>>>>
>>>> _______________________________________________
>>>> poppler mailing list
>>>> poppler at lists.freedesktop.org
>>>> http://lists.freedesktop.org/mailman/listinfo/poppler




More information about the poppler mailing list