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 | |
60 /////////////////////////////////////////////////////////////////////////////// | 52 /////////////////////////////////////////////////////////////////////////////// |
61 | 53 |
62 SkFlattenable* SkComposePathEffect::CreateProc(SkReadBuffer& buffer) { | 54 SkFlattenable* SkComposePathEffect::CreateProc(SkReadBuffer& buffer) { |
63 SkAutoTUnref<SkPathEffect> pe0(buffer.readPathEffect()); | 55 SkAutoTUnref<SkPathEffect> pe0(buffer.readPathEffect()); |
64 SkAutoTUnref<SkPathEffect> pe1(buffer.readPathEffect()); | 56 SkAutoTUnref<SkPathEffect> pe1(buffer.readPathEffect()); |
65 return SkComposePathEffect::Create(pe0, pe1); | 57 return SkComposePathEffect::Create(pe0, pe1); |
66 } | 58 } |
67 | 59 |
68 bool SkComposePathEffect::filterPath(SkPath* dst, const SkPath& src, | 60 bool SkComposePathEffect::filterPath(SkPath* dst, const SkPath& src, |
69 SkStrokeRec* rec, const SkRect* cullRect) const { | 61 SkStrokeRec* rec, const SkRect* cullRect) const { |
(...skipping 18 matching lines...) Expand all Loading... |
88 SkAutoTUnref<SkPathEffect> pe1(buffer.readPathEffect()); | 80 SkAutoTUnref<SkPathEffect> pe1(buffer.readPathEffect()); |
89 return SkSumPathEffect::Create(pe0, pe1); | 81 return SkSumPathEffect::Create(pe0, pe1); |
90 } | 82 } |
91 | 83 |
92 bool SkSumPathEffect::filterPath(SkPath* dst, const SkPath& src, | 84 bool SkSumPathEffect::filterPath(SkPath* dst, const SkPath& src, |
93 SkStrokeRec* rec, const SkRect* cullRect) const { | 85 SkStrokeRec* rec, const SkRect* cullRect) const { |
94 // use bit-or so that we always call both, even if the first one succeeds | 86 // use bit-or so that we always call both, even if the first one succeeds |
95 return fPE0->filterPath(dst, src, rec, cullRect) | | 87 return fPE0->filterPath(dst, src, rec, cullRect) | |
96 fPE1->filterPath(dst, src, rec, cullRect); | 88 fPE1->filterPath(dst, src, rec, cullRect); |
97 } | 89 } |
OLD | NEW |