Avoid counting verbs twice in SkPath::isEmpty()

Remove redundant call to SkPathRef::countVerbs. The intention was
probably to count points. Instead, assert that all two-verb paths
begin with a 'move' and that if the second verb is a 'line', then the
point count is indeed two.

BUG=1478
R=bsalomon@google.com

Author: kkinnunen@nvidia.com

Review URL: https://chromiumcodereview.appspot.com/22171002

git-svn-id: http://skia.googlecode.com/svn/trunk@10527 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
commit-bot@chromium.org 2013-08-05 13:23:13 +00:00
parent 7e5d18664b
commit a62efcc1e0

View File

@ -380,11 +380,11 @@ bool SkPath::isEmpty() const {
bool SkPath::isLine(SkPoint line[2]) const {
int verbCount = fPathRef->countVerbs();
int ptCount = fPathRef->countVerbs();
if (2 == verbCount && 2 == ptCount) {
if (kMove_Verb == fPathRef->atVerb(0) &&
kLine_Verb == fPathRef->atVerb(1)) {
if (2 == verbCount) {
SkASSERT(kMove_Verb == fPathRef->atVerb(0));
if (kLine_Verb == fPathRef->atVerb(1)) {
SkASSERT(2 == fPathRef->countPoints());
if (line) {
const SkPoint* pts = fPathRef->points();
line[0] = pts[0];