Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(176)

Side by Side Diff: src/core/SkPathRef.cpp

Issue 1491843006: add support for capped hairlines (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add comment Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/core/SkDraw.cpp ('k') | src/core/SkScan.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkBuffer.h" 8 #include "SkBuffer.h"
9 #include "SkOncePtr.h" 9 #include "SkOncePtr.h"
10 #include "SkPath.h" 10 #include "SkPath.h"
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after
566 case SkPath::kClose_Verb: 566 case SkPath::kClose_Verb:
567 break; 567 break;
568 case SkPath::kDone_Verb: 568 case SkPath::kDone_Verb:
569 SkASSERT(fVerbs == fVerbStop); 569 SkASSERT(fVerbs == fVerbStop);
570 break; 570 break;
571 } 571 }
572 fPts = srcPts; 572 fPts = srcPts;
573 return (uint8_t) verb; 573 return (uint8_t) verb;
574 } 574 }
575 575
576 uint8_t SkPathRef::Iter::peek() const {
577 const uint8_t* next = fVerbs - 1;
578 return next <= fVerbStop ? (uint8_t) SkPath::kDone_Verb : *next;
579 }
580
576 #ifdef SK_DEBUG 581 #ifdef SK_DEBUG
577 void SkPathRef::validate() const { 582 void SkPathRef::validate() const {
578 this->INHERITED::validate(); 583 this->INHERITED::validate();
579 SkASSERT(static_cast<ptrdiff_t>(fFreeSpace) >= 0); 584 SkASSERT(static_cast<ptrdiff_t>(fFreeSpace) >= 0);
580 SkASSERT(reinterpret_cast<intptr_t>(fVerbs) - reinterpret_cast<intptr_t>(fPo ints) >= 0); 585 SkASSERT(reinterpret_cast<intptr_t>(fVerbs) - reinterpret_cast<intptr_t>(fPo ints) >= 0);
581 SkASSERT((nullptr == fPoints) == (nullptr == fVerbs)); 586 SkASSERT((nullptr == fPoints) == (nullptr == fVerbs));
582 SkASSERT(!(nullptr == fPoints && 0 != fFreeSpace)); 587 SkASSERT(!(nullptr == fPoints && 0 != fFreeSpace));
583 SkASSERT(!(nullptr == fPoints && 0 != fFreeSpace)); 588 SkASSERT(!(nullptr == fPoints && 0 != fFreeSpace));
584 SkASSERT(!(nullptr == fPoints && fPointCnt)); 589 SkASSERT(!(nullptr == fPoints && fPointCnt));
585 SkASSERT(!(nullptr == fVerbs && fVerbCnt)); 590 SkASSERT(!(nullptr == fVerbs && fVerbCnt));
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
639 break; 644 break;
640 default: 645 default:
641 SkDEBUGFAIL("Unknown Verb"); 646 SkDEBUGFAIL("Unknown Verb");
642 break; 647 break;
643 } 648 }
644 } 649 }
645 SkASSERT(mask == fSegmentMask); 650 SkASSERT(mask == fSegmentMask);
646 #endif // SK_DEBUG_PATH 651 #endif // SK_DEBUG_PATH
647 } 652 }
648 #endif 653 #endif
OLDNEW
« no previous file with comments | « src/core/SkDraw.cpp ('k') | src/core/SkScan.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698