OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
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 "GrFragmentProcessor.h" | 8 #include "GrFragmentProcessor.h" |
9 #include "GrCoordTransform.h" | 9 #include "GrCoordTransform.h" |
10 #include "GrInvariantOutput.h" | 10 #include "GrInvariantOutput.h" |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 if (!child->fTextureAccesses.empty()) { | 99 if (!child->fTextureAccesses.empty()) { |
100 fTextureAccesses.push_back_n(child->fTextureAccesses.count(), | 100 fTextureAccesses.push_back_n(child->fTextureAccesses.count(), |
101 child->fTextureAccesses.begin()); | 101 child->fTextureAccesses.begin()); |
102 } | 102 } |
103 | 103 |
104 this->combineRequiredFeatures(*child); | 104 this->combineRequiredFeatures(*child); |
105 | 105 |
106 if (child->usesLocalCoords()) { | 106 if (child->usesLocalCoords()) { |
107 fUsesLocalCoords = true; | 107 fUsesLocalCoords = true; |
108 } | 108 } |
109 if (child->usesDistanceVectorField()) { | |
110 fUsesDistanceVectorField = true; | |
111 } | |
112 | 109 |
113 int index = fChildProcessors.count(); | 110 int index = fChildProcessors.count(); |
114 fChildProcessors.push_back(child.release()); | 111 fChildProcessors.push_back(child.release()); |
115 | 112 |
116 return index; | 113 return index; |
117 } | 114 } |
118 | 115 |
119 void GrFragmentProcessor::notifyRefCntIsZero() const { | 116 void GrFragmentProcessor::notifyRefCntIsZero() const { |
120 // See comment above GrProgramElement for a detailed explanation of why we d
o this. | 117 // See comment above GrProgramElement for a detailed explanation of why we d
o this. |
121 for (int i = 0; i < fChildProcessors.count(); ++i) { | 118 for (int i = 0; i < fChildProcessors.count(); ++i) { |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 } else { | 410 } else { |
414 series += firstIdx; | 411 series += firstIdx; |
415 cnt -= firstIdx; | 412 cnt -= firstIdx; |
416 } | 413 } |
417 | 414 |
418 if (1 == cnt) { | 415 if (1 == cnt) { |
419 return series[0]; | 416 return series[0]; |
420 } | 417 } |
421 return sk_sp<GrFragmentProcessor>(new SeriesFragmentProcessor(series, cnt)); | 418 return sk_sp<GrFragmentProcessor>(new SeriesFragmentProcessor(series, cnt)); |
422 } | 419 } |
OLD | NEW |