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

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

Issue 872043002: Add patheffects to debugger printout (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix merge conflict Created 5 years, 11 months 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/SkPaint.cpp ('k') | src/effects/Sk1DPathEffect.cpp » ('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 /* 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
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 #ifndef SK_IGNORE_TO_STRING
53 void SkPairPathEffect::toString(SkString* str) const {
54 str->appendf("first: ");
55 if (fPE0) {
56 fPE0->toString(str);
57 }
58 str->appendf(" second: ");
59 if (fPE1) {
60 fPE1->toString(str);
61 }
62 }
63 #endif
64
52 /////////////////////////////////////////////////////////////////////////////// 65 ///////////////////////////////////////////////////////////////////////////////
53 66
54 SkFlattenable* SkComposePathEffect::CreateProc(SkReadBuffer& buffer) { 67 SkFlattenable* SkComposePathEffect::CreateProc(SkReadBuffer& buffer) {
55 SkAutoTUnref<SkPathEffect> pe0(buffer.readPathEffect()); 68 SkAutoTUnref<SkPathEffect> pe0(buffer.readPathEffect());
56 SkAutoTUnref<SkPathEffect> pe1(buffer.readPathEffect()); 69 SkAutoTUnref<SkPathEffect> pe1(buffer.readPathEffect());
57 return SkComposePathEffect::Create(pe0, pe1); 70 return SkComposePathEffect::Create(pe0, pe1);
58 } 71 }
59 72
60 bool SkComposePathEffect::filterPath(SkPath* dst, const SkPath& src, 73 bool SkComposePathEffect::filterPath(SkPath* dst, const SkPath& src,
61 SkStrokeRec* rec, const SkRect* cullRect) const { 74 SkStrokeRec* rec, const SkRect* cullRect) const {
62 // we may have failed to unflatten these, so we have to check 75 // we may have failed to unflatten these, so we have to check
63 if (!fPE0 || !fPE1) { 76 if (!fPE0 || !fPE1) {
64 return false; 77 return false;
65 } 78 }
66 79
67 SkPath tmp; 80 SkPath tmp;
68 const SkPath* ptr = &src; 81 const SkPath* ptr = &src;
69 82
70 if (fPE1->filterPath(&tmp, src, rec, cullRect)) { 83 if (fPE1->filterPath(&tmp, src, rec, cullRect)) {
71 ptr = &tmp; 84 ptr = &tmp;
72 } 85 }
73 return fPE0->filterPath(dst, *ptr, rec, cullRect); 86 return fPE0->filterPath(dst, *ptr, rec, cullRect);
74 } 87 }
75 88
89
90 #ifndef SK_IGNORE_TO_STRING
91 void SkComposePathEffect::toString(SkString* str) const {
92 str->appendf("SkComposePathEffect: (");
93 this->INHERITED::toString(str);
94 str->appendf(")");
95 }
96 #endif
97
76 /////////////////////////////////////////////////////////////////////////////// 98 ///////////////////////////////////////////////////////////////////////////////
77 99
78 SkFlattenable* SkSumPathEffect::CreateProc(SkReadBuffer& buffer) { 100 SkFlattenable* SkSumPathEffect::CreateProc(SkReadBuffer& buffer) {
79 SkAutoTUnref<SkPathEffect> pe0(buffer.readPathEffect()); 101 SkAutoTUnref<SkPathEffect> pe0(buffer.readPathEffect());
80 SkAutoTUnref<SkPathEffect> pe1(buffer.readPathEffect()); 102 SkAutoTUnref<SkPathEffect> pe1(buffer.readPathEffect());
81 return SkSumPathEffect::Create(pe0, pe1); 103 return SkSumPathEffect::Create(pe0, pe1);
82 } 104 }
83 105
84 bool SkSumPathEffect::filterPath(SkPath* dst, const SkPath& src, 106 bool SkSumPathEffect::filterPath(SkPath* dst, const SkPath& src,
85 SkStrokeRec* rec, const SkRect* cullRect) const { 107 SkStrokeRec* rec, const SkRect* cullRect) const {
86 // use bit-or so that we always call both, even if the first one succeeds 108 // use bit-or so that we always call both, even if the first one succeeds
87 return fPE0->filterPath(dst, src, rec, cullRect) | 109 return fPE0->filterPath(dst, src, rec, cullRect) |
88 fPE1->filterPath(dst, src, rec, cullRect); 110 fPE1->filterPath(dst, src, rec, cullRect);
89 } 111 }
112
113
114 #ifndef SK_IGNORE_TO_STRING
115 void SkSumPathEffect::toString(SkString* str) const {
116 str->appendf("SkSumPathEffect: (");
117 this->INHERITED::toString(str);
118 str->appendf(")");
119 }
120 #endif
OLDNEW
« no previous file with comments | « src/core/SkPaint.cpp ('k') | src/effects/Sk1DPathEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698