[Poppler-bugs] [Bug 27482] Colorizing text and masks in pattern colorspace

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu Apr 8 09:12:59 PDT 2010


https://bugs.freedesktop.org/show_bug.cgi?id=27482

--- Comment #3 from thomasf <Thomas.Freitag at alfa.de> 2010-04-08 09:12:59 PDT ---
(In reply to comment #2)
> I've noticed that you use out->restoreState(state); several times in Gfx.cc,
> why not using Gfx::restoreState, and it doesn't seem to be a previous
> saveState() for any of them. Is it really needed? output devs already call
> save/restore in beginTextObject/endTextObject

Hi Carlos!

Three questions in one :-) 
a) why using out->restoreState? 
The implementation in SplashOutputDev and PSOutputDev is in the way, that image
masks or text is set as clipping path, therefore in starting text or image mask
colorizing need to save the state (in the output device) for later remove the
clipping path again correctly. Of cource I could use there the Gfx::saveState,
but I need only to save the state in the ouptut device.
After filling the clipping path with doPatternFill, we have to remove the
clipping path, and that is done by out->restoreState.
b) where is out->saveState?
It is done, when recognized that text or an image mask has to be set in pattern
colorspace, Gfx remembers this in setting either textHaveCSPattern or
maskHaveCSPattern to gTrue only if the output device supports it, colorspace is
pattern colorspace AND output device calls it own saveState.
c) why not using Gfx::restoreState
I thought it was clearer, when calling out->saveState in the implementation,
just calling out->restoreState to remove clipping path again.

Best regards,
Thomas

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the Poppler-bugs mailing list