OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
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 <cmath> | 8 #include <cmath> |
9 #include "SkBuffer.h" | 9 #include "SkBuffer.h" |
10 #include "SkCubicClipper.h" | 10 #include "SkCubicClipper.h" |
(...skipping 2040 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2051 if (!buffer.readS32(&packed)) { | 2051 if (!buffer.readS32(&packed)) { |
2052 return 0; | 2052 return 0; |
2053 } | 2053 } |
2054 | 2054 |
2055 unsigned version = packed & 0xFF; | 2055 unsigned version = packed & 0xFF; |
2056 if (version >= kPathPrivLastMoveToIndex_Version && !buffer.readS32(&fLastMov
eToIndex)) { | 2056 if (version >= kPathPrivLastMoveToIndex_Version && !buffer.readS32(&fLastMov
eToIndex)) { |
2057 return 0; | 2057 return 0; |
2058 } | 2058 } |
2059 | 2059 |
2060 fConvexity = (packed >> kConvexity_SerializationShift) & 0xFF; | 2060 fConvexity = (packed >> kConvexity_SerializationShift) & 0xFF; |
2061 fFillType = (packed >> kFillType_SerializationShift) & 0xFF; | 2061 fFillType = (packed >> kFillType_SerializationShift) & 0x3; |
2062 uint8_t dir = (packed >> kDirection_SerializationShift) & 0x3; | 2062 uint8_t dir = (packed >> kDirection_SerializationShift) & 0x3; |
2063 fIsVolatile = (packed >> kIsVolatile_SerializationShift) & 0x1; | 2063 fIsVolatile = (packed >> kIsVolatile_SerializationShift) & 0x1; |
2064 SkPathRef* pathRef = SkPathRef::CreateFromBuffer(&buffer); | 2064 SkPathRef* pathRef = SkPathRef::CreateFromBuffer(&buffer); |
2065 if (!pathRef) { | 2065 if (!pathRef) { |
2066 return 0; | 2066 return 0; |
2067 } | 2067 } |
2068 | 2068 |
2069 fPathRef.reset(pathRef); | 2069 fPathRef.reset(pathRef); |
2070 SkDEBUGCODE(this->validate();) | 2070 SkDEBUGCODE(this->validate();) |
2071 buffer.skipToAlign4(); | 2071 buffer.skipToAlign4(); |
(...skipping 1291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3363 *direction = SkPath::kCW_Direction; | 3363 *direction = SkPath::kCW_Direction; |
3364 *start = firstDir; | 3364 *start = firstDir; |
3365 } else { | 3365 } else { |
3366 SkASSERT(((secondDir + 1) & 0b11) == firstDir); | 3366 SkASSERT(((secondDir + 1) & 0b11) == firstDir); |
3367 *direction = SkPath::kCCW_Direction; | 3367 *direction = SkPath::kCCW_Direction; |
3368 *start = secondDir; | 3368 *start = secondDir; |
3369 } | 3369 } |
3370 *rect = tempRect; | 3370 *rect = tempRect; |
3371 return true; | 3371 return true; |
3372 } | 3372 } |
OLD | NEW |