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 1896 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1907 void SkPath::RawIter::setPath(const SkPath& path) { | 1907 void SkPath::RawIter::setPath(const SkPath& path) { |
1908 fPts = path.fPathRef->points(); | 1908 fPts = path.fPathRef->points(); |
1909 fVerbs = path.fPathRef->verbs(); | 1909 fVerbs = path.fPathRef->verbs(); |
1910 fVerbStop = path.fPathRef->verbsMemBegin(); | 1910 fVerbStop = path.fPathRef->verbsMemBegin(); |
1911 fConicWeights = path.fPathRef->conicWeights() - 1; // begin one behind | 1911 fConicWeights = path.fPathRef->conicWeights() - 1; // begin one behind |
1912 fMoveTo.fX = fMoveTo.fY = 0; | 1912 fMoveTo.fX = fMoveTo.fY = 0; |
1913 fLastPt.fX = fLastPt.fY = 0; | 1913 fLastPt.fX = fLastPt.fY = 0; |
1914 } | 1914 } |
1915 | 1915 |
1916 SkPath::Verb SkPath::RawIter::next(SkPoint pts[4]) { | 1916 SkPath::Verb SkPath::RawIter::next(SkPoint pts[4]) { |
1917 SkASSERT(NULL != pts); | 1917 SkASSERT(pts); |
1918 if (fVerbs == fVerbStop) { | 1918 if (fVerbs == fVerbStop) { |
1919 return kDone_Verb; | 1919 return kDone_Verb; |
1920 } | 1920 } |
1921 | 1921 |
1922 // fVerbs points one beyond next verb so decrement first. | 1922 // fVerbs points one beyond next verb so decrement first. |
1923 unsigned verb = *(--fVerbs); | 1923 unsigned verb = *(--fVerbs); |
1924 const SkPoint* srcPts = fPts; | 1924 const SkPoint* srcPts = fPts; |
1925 | 1925 |
1926 switch (verb) { | 1926 switch (verb) { |
1927 case kMove_Verb: | 1927 case kMove_Verb: |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2000 fFillType = (packed >> kFillType_SerializationShift) & 0xFF; | 2000 fFillType = (packed >> kFillType_SerializationShift) & 0xFF; |
2001 fDirection = (packed >> kDirection_SerializationShift) & 0x3; | 2001 fDirection = (packed >> kDirection_SerializationShift) & 0x3; |
2002 SkPathRef* pathRef = SkPathRef::CreateFromBuffer(&buffer); | 2002 SkPathRef* pathRef = SkPathRef::CreateFromBuffer(&buffer); |
2003 | 2003 |
2004 size_t sizeRead = 0; | 2004 size_t sizeRead = 0; |
2005 if (buffer.isValid()) { | 2005 if (buffer.isValid()) { |
2006 fPathRef.reset(pathRef); | 2006 fPathRef.reset(pathRef); |
2007 SkDEBUGCODE(this->validate();) | 2007 SkDEBUGCODE(this->validate();) |
2008 buffer.skipToAlign4(); | 2008 buffer.skipToAlign4(); |
2009 sizeRead = buffer.pos(); | 2009 sizeRead = buffer.pos(); |
2010 } else if (NULL != pathRef) { | 2010 } else if (pathRef) { |
2011 // If the buffer is not valid, pathRef should be NULL | 2011 // If the buffer is not valid, pathRef should be NULL |
2012 sk_throw(); | 2012 sk_throw(); |
2013 } | 2013 } |
2014 return sizeRead; | 2014 return sizeRead; |
2015 } | 2015 } |
2016 | 2016 |
2017 /////////////////////////////////////////////////////////////////////////////// | 2017 /////////////////////////////////////////////////////////////////////////////// |
2018 | 2018 |
2019 #include "SkString.h" | 2019 #include "SkString.h" |
2020 #include "SkStream.h" | 2020 #include "SkStream.h" |
(...skipping 773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2794 switch (this->getFillType()) { | 2794 switch (this->getFillType()) { |
2795 case SkPath::kEvenOdd_FillType: | 2795 case SkPath::kEvenOdd_FillType: |
2796 case SkPath::kInverseEvenOdd_FillType: | 2796 case SkPath::kInverseEvenOdd_FillType: |
2797 w &= 1; | 2797 w &= 1; |
2798 break; | 2798 break; |
2799 default: | 2799 default: |
2800 break; | 2800 break; |
2801 } | 2801 } |
2802 return SkToBool(w); | 2802 return SkToBool(w); |
2803 } | 2803 } |
OLD | NEW |