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 #include "SkPathEffect.h" | 9 #include "SkPathEffect.h" |
10 #include "SkPath.h" | 10 #include "SkPath.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 } | 42 } |
43 | 43 |
44 /* | 44 /* |
45 Format: [oe0-factory][pe1-factory][pe0-size][pe0-data][pe1-data] | 45 Format: [oe0-factory][pe1-factory][pe0-size][pe0-data][pe1-data] |
46 */ | 46 */ |
47 void SkPairPathEffect::flatten(SkWriteBuffer& buffer) const { | 47 void SkPairPathEffect::flatten(SkWriteBuffer& buffer) const { |
48 buffer.writeFlattenable(fPE0); | 48 buffer.writeFlattenable(fPE0); |
49 buffer.writeFlattenable(fPE1); | 49 buffer.writeFlattenable(fPE1); |
50 } | 50 } |
51 | 51 |
| 52 #ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING |
| 53 SkPairPathEffect::SkPairPathEffect(SkReadBuffer& buffer) { |
| 54 fPE0 = buffer.readPathEffect(); |
| 55 fPE1 = buffer.readPathEffect(); |
| 56 // either of these may fail, so we have to check for nulls later on |
| 57 } |
| 58 #endif |
| 59 |
52 /////////////////////////////////////////////////////////////////////////////// | 60 /////////////////////////////////////////////////////////////////////////////// |
53 | 61 |
54 SkFlattenable* SkComposePathEffect::CreateProc(SkReadBuffer& buffer) { | 62 SkFlattenable* SkComposePathEffect::CreateProc(SkReadBuffer& buffer) { |
55 SkAutoTUnref<SkPathEffect> pe0(buffer.readPathEffect()); | 63 SkAutoTUnref<SkPathEffect> pe0(buffer.readPathEffect()); |
56 SkAutoTUnref<SkPathEffect> pe1(buffer.readPathEffect()); | 64 SkAutoTUnref<SkPathEffect> pe1(buffer.readPathEffect()); |
57 return SkComposePathEffect::Create(pe0, pe1); | 65 return SkComposePathEffect::Create(pe0, pe1); |
58 } | 66 } |
59 | 67 |
60 bool SkComposePathEffect::filterPath(SkPath* dst, const SkPath& src, | 68 bool SkComposePathEffect::filterPath(SkPath* dst, const SkPath& src, |
61 SkStrokeRec* rec, const SkRect* cullRect) const { | 69 SkStrokeRec* rec, const SkRect* cullRect) const { |
(...skipping 18 matching lines...) Expand all Loading... |
80 SkAutoTUnref<SkPathEffect> pe1(buffer.readPathEffect()); | 88 SkAutoTUnref<SkPathEffect> pe1(buffer.readPathEffect()); |
81 return SkSumPathEffect::Create(pe0, pe1); | 89 return SkSumPathEffect::Create(pe0, pe1); |
82 } | 90 } |
83 | 91 |
84 bool SkSumPathEffect::filterPath(SkPath* dst, const SkPath& src, | 92 bool SkSumPathEffect::filterPath(SkPath* dst, const SkPath& src, |
85 SkStrokeRec* rec, const SkRect* cullRect) const { | 93 SkStrokeRec* rec, const SkRect* cullRect) const { |
86 // use bit-or so that we always call both, even if the first one succeeds | 94 // use bit-or so that we always call both, even if the first one succeeds |
87 return fPE0->filterPath(dst, src, rec, cullRect) | | 95 return fPE0->filterPath(dst, src, rec, cullRect) | |
88 fPE1->filterPath(dst, src, rec, cullRect); | 96 fPE1->filterPath(dst, src, rec, cullRect); |
89 } | 97 } |
OLD | NEW |