| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 | 9 |
| 10 #include "SkBuffer.h" | 10 #include "SkBuffer.h" |
| (...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 this->resetFields(); | 373 this->resetFields(); |
| 374 } | 374 } |
| 375 | 375 |
| 376 bool SkPath::isEmpty() const { | 376 bool SkPath::isEmpty() const { |
| 377 SkDEBUGCODE(this->validate();) | 377 SkDEBUGCODE(this->validate();) |
| 378 return 0 == fPathRef->countVerbs(); | 378 return 0 == fPathRef->countVerbs(); |
| 379 } | 379 } |
| 380 | 380 |
| 381 bool SkPath::isLine(SkPoint line[2]) const { | 381 bool SkPath::isLine(SkPoint line[2]) const { |
| 382 int verbCount = fPathRef->countVerbs(); | 382 int verbCount = fPathRef->countVerbs(); |
| 383 int ptCount = fPathRef->countVerbs(); | |
| 384 | 383 |
| 385 if (2 == verbCount && 2 == ptCount) { | 384 if (2 == verbCount) { |
| 386 if (kMove_Verb == fPathRef->atVerb(0) && | 385 SkASSERT(kMove_Verb == fPathRef->atVerb(0)); |
| 387 kLine_Verb == fPathRef->atVerb(1)) { | 386 if (kLine_Verb == fPathRef->atVerb(1)) { |
| 387 SkASSERT(2 == fPathRef->countPoints()); |
| 388 if (line) { | 388 if (line) { |
| 389 const SkPoint* pts = fPathRef->points(); | 389 const SkPoint* pts = fPathRef->points(); |
| 390 line[0] = pts[0]; | 390 line[0] = pts[0]; |
| 391 line[1] = pts[1]; | 391 line[1] = pts[1]; |
| 392 } | 392 } |
| 393 return true; | 393 return true; |
| 394 } | 394 } |
| 395 } | 395 } |
| 396 return false; | 396 return false; |
| 397 } | 397 } |
| (...skipping 2597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2995 switch (this->getFillType()) { | 2995 switch (this->getFillType()) { |
| 2996 case SkPath::kEvenOdd_FillType: | 2996 case SkPath::kEvenOdd_FillType: |
| 2997 case SkPath::kInverseEvenOdd_FillType: | 2997 case SkPath::kInverseEvenOdd_FillType: |
| 2998 w &= 1; | 2998 w &= 1; |
| 2999 break; | 2999 break; |
| 3000 default: | 3000 default: |
| 3001 break; | 3001 break; |
| 3002 } | 3002 } |
| 3003 return SkToBool(w); | 3003 return SkToBool(w); |
| 3004 } | 3004 } |
| OLD | NEW |