Drawing fake bold text, line and normal text made normal text bolder on PDF.

When PDF uses fake bold text, it uses stroke and fill for the
text. After that, line is drawn. It creates new ContextEntry which
GraphicStateEntry has 0 fTextScaleX. Since fTextScaleX is 0,
GraphicStackState::updateDrawingState() doesn't update text fill mode or
the PDF page. When the normal text is drawn, it reuse the line's
ContextEntry because GraphicStateEntry::compareInitialState() returns
true. However, since the reused GraphicsStateEntry's fTextScaleX is 0,
the text fill mode is not updated to fill, and the text is drawn in
stroke and fill mode.

When the fTextScaleX is changed, we should not reuse GraphicStateEntry
even if ether of fTextScaleX is 0.

BUG=skia:2132
R=reed@google.com, vandebo@chromium.org, bungeman@google.com

Author: yuki.sekiguchi@access-company.com

Review URL: https://codereview.chromium.org/137923005

git-svn-id: http://skia.googlecode.com/svn/trunk@13369 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
commit-bot@chromium.org 2014-02-07 19:39:57 +00:00
Родитель 244b288431
Коммит b000d76af4
2 изменённых файлов: 9 добавлений и 9 удалений

Просмотреть файл

@ -11,6 +11,7 @@
#
# Please keep the list sorted.
ACCESS CO., LTD. <*@access-company.com>
ARM <*@arm.com>
Google Inc. <*@google.com>
Intel <*@intel.com>

Просмотреть файл

@ -232,15 +232,14 @@ GraphicStateEntry::GraphicStateEntry() : fColor(SK_ColorBLACK),
fMatrix.reset();
}
bool GraphicStateEntry::compareInitialState(const GraphicStateEntry& b) {
return fColor == b.fColor &&
fShaderIndex == b.fShaderIndex &&
fGraphicStateIndex == b.fGraphicStateIndex &&
fMatrix == b.fMatrix &&
fClipStack == b.fClipStack &&
(fTextScaleX == 0 ||
b.fTextScaleX == 0 ||
(fTextScaleX == b.fTextScaleX && fTextFill == b.fTextFill));
bool GraphicStateEntry::compareInitialState(const GraphicStateEntry& cur) {
return fColor == cur.fColor &&
fShaderIndex == cur.fShaderIndex &&
fGraphicStateIndex == cur.fGraphicStateIndex &&
fMatrix == cur.fMatrix &&
fClipStack == cur.fClipStack &&
(fTextScaleX == 0 ||
(fTextScaleX == cur.fTextScaleX && fTextFill == cur.fTextFill));
}
class GraphicStackState {