Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1437)

Issue 4516043: [PDF] Fix bug in graphic state comparison. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 6 months ago by Steve VanDeBogart
Modified:
13 years, 6 months ago
Reviewers:
Chris Guillory
CC:
skia-review_googlegroups.com
Base URL:
https://skia.googlecode.com/svn/trunk
Visibility:
Public.

Description

[PDF] Fix bug in graphic state comparison. SkPDFGraphicState::GSCanonicalEntry::operator== was out of sync with SkPDFGraphicState::populateDict leading to graphic state objects with the same value. Committed: http://code.google.com/p/skia/source/detail?r=1278

Patch Set 1 #

Total comments: 6

Patch Set 2 : Address comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+22 lines, -13 lines) Patch
M src/pdf/SkPDFGraphicState.cpp View 1 1 chunk +22 lines, -13 lines 0 comments Download

Messages

Total messages: 4
Steve VanDeBogart
13 years, 6 months ago (2011-05-09 08:19:22 UTC) #1
Chris Guillory
LGTM. Some comments. http://codereview.appspot.com/4516043/diff/1/src/pdf/SkPDFGraphicState.cpp File src/pdf/SkPDFGraphicState.cpp (right): http://codereview.appspot.com/4516043/diff/1/src/pdf/SkPDFGraphicState.cpp#newcode191 src/pdf/SkPDFGraphicState.cpp:191: const char* aXfermodeString = blendModeFromXfermode(aXfermodeName); Nit: ...
13 years, 6 months ago (2011-05-09 08:37:46 UTC) #2
Chris Guillory
On 2011/05/09 08:37:46, Chris Guillory wrote: > LGTM. Some comments. > > http://codereview.appspot.com/4516043/diff/1/src/pdf/SkPDFGraphicState.cpp > File ...
13 years, 6 months ago (2011-05-09 08:38:10 UTC) #3
Steve VanDeBogart
13 years, 6 months ago (2011-05-09 17:33:33 UTC) #4
http://codereview.appspot.com/4516043/diff/1/src/pdf/SkPDFGraphicState.cpp
File src/pdf/SkPDFGraphicState.cpp (right):

http://codereview.appspot.com/4516043/diff/1/src/pdf/SkPDFGraphicState.cpp#ne...
src/pdf/SkPDFGraphicState.cpp:191: const char* aXfermodeString =
blendModeFromXfermode(aXfermodeName);
On 2011/05/09 08:37:46, Chris Guillory wrote:
> Nit: Almost seems like we want to assert that aXfermodeString isn't NULL.

Done.

http://codereview.appspot.com/4516043/diff/1/src/pdf/SkPDFGraphicState.cpp#ne...
src/pdf/SkPDFGraphicState.cpp:204: return strcmp(aXfermodeString,
bXfermodeString) == 0;
On 2011/05/09 08:37:46, Chris Guillory wrote:
> Optional: Can we get away with just doing a pointer comparison here? Maybe
> update the comments of blendModeFromXfermode to indicate that it returns the
> address of a string literal constant that can be used for this type of
> comparison.

Yea, I considered that, but it's pretty fragile.  The strings are short, so the
overhead for doing it the robust way isn't too bad.

http://codereview.appspot.com/4516043/diff/1/src/pdf/SkPDFGraphicState.cpp#ne...
src/pdf/SkPDFGraphicState.cpp:204: return strcmp(aXfermodeString,
bXfermodeString) == 0;
On 2011/05/09 08:37:46, Chris Guillory wrote:
> Nit: !strcmp

In this case, I prefer == 0.  !foo implies that foo failed, but in this case
!foo is success, so foo == 0 indicates that better.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b