[webkit-dev] Some problems with text color

Artem Ananiev Artem.Ananiev at Sun.COM
Wed Oct 24 09:56:34 PDT 2007


Hi,

I have recently noticed the following problem with GraphicsContext class. 
Sometimes it renders text with a wrong color. Usually this happens when 
painting a rectangle which contains two text blocks of different color: the 
second is usually painted with the same color as the first.

I tried to trace all the calls to GraphicsContext, here they are:

  savePlatformState()  <-- at this moment the current color is black
  setPlatformStrokeColor(red)
  Font::drawText()  <-- first string is painted in red, which is correct
  Font::drawText()  <-- second string is painted in red, but black is expected
  restorePlatformState()  <-- color is restored to black

I'd expect the latter two lines to be reversed. Another assumption is that the 
call to setPlatformStrokeColor() affects only a single subsequent call to 
drawText(), but this looks strange.

Any ideas?

Thanks,

Artem


More information about the webkit-dev mailing list