Brian Salomon | 92ce594 | 2017-01-18 11:01:10 -0500 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2017 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
| 8 | #include "GrProcessorSet.h" |
Brian Salomon | 5298dc8 | 2017-02-22 11:52:03 -0500 | [diff] [blame] | 9 | #include "GrAppliedClip.h" |
| 10 | #include "GrCaps.h" |
Chris Dalton | b8fff0d | 2019-03-05 10:11:58 -0700 | [diff] [blame] | 11 | #include "GrUserStencilSettings.h" |
Brian Salomon | 3185384 | 2017-03-28 16:32:05 -0400 | [diff] [blame] | 12 | #include "GrXferProcessor.h" |
Brian Salomon | 477d0ef | 2017-07-14 10:12:26 -0400 | [diff] [blame] | 13 | #include "SkBlendModePriv.h" |
Brian Salomon | 48d1b4c | 2017-04-08 07:38:53 -0400 | [diff] [blame] | 14 | #include "effects/GrPorterDuffXferProcessor.h" |
Brian Salomon | 92ce594 | 2017-01-18 11:01:10 -0500 | [diff] [blame] | 15 | |
Brian Salomon | 292bf7a | 2017-05-17 09:43:55 -0400 | [diff] [blame] | 16 | const GrProcessorSet& GrProcessorSet::EmptySet() { |
Brian Salomon | 91326c3 | 2017-08-09 16:02:19 -0400 | [diff] [blame] | 17 | static GrProcessorSet gEmpty(GrProcessorSet::Empty::kEmpty); |
Brian Salomon | 292bf7a | 2017-05-17 09:43:55 -0400 | [diff] [blame] | 18 | return gEmpty; |
| 19 | } |
Brian Salomon | 6d4b65e | 2017-05-03 17:06:09 -0400 | [diff] [blame] | 20 | |
Brian Salomon | 91326c3 | 2017-08-09 16:02:19 -0400 | [diff] [blame] | 21 | GrProcessorSet GrProcessorSet::MakeEmptySet() { |
| 22 | return GrProcessorSet(GrProcessorSet::Empty::kEmpty); |
| 23 | } |
| 24 | |
Brian Salomon | 48d1b4c | 2017-04-08 07:38:53 -0400 | [diff] [blame] | 25 | GrProcessorSet::GrProcessorSet(GrPaint&& paint) : fXP(paint.getXPFactory()) { |
Brian Salomon | f87e2b9 | 2017-01-19 11:31:50 -0500 | [diff] [blame] | 26 | fFlags = 0; |
Brian Salomon | 8d2f90b | 2017-03-13 09:11:58 -0400 | [diff] [blame] | 27 | if (paint.numColorFragmentProcessors() <= kMaxColorProcessors) { |
| 28 | fColorFragmentProcessorCnt = paint.numColorFragmentProcessors(); |
| 29 | fFragmentProcessors.reset(paint.numTotalFragmentProcessors()); |
| 30 | int i = 0; |
| 31 | for (auto& fp : paint.fColorFragmentProcessors) { |
Brian Salomon | 5f970fe | 2017-06-16 17:30:59 -0400 | [diff] [blame] | 32 | SkASSERT(fp.get()); |
Brian Salomon | aff329b | 2017-08-11 09:40:37 -0400 | [diff] [blame] | 33 | fFragmentProcessors[i++] = std::move(fp); |
Brian Salomon | 8d2f90b | 2017-03-13 09:11:58 -0400 | [diff] [blame] | 34 | } |
| 35 | for (auto& fp : paint.fCoverageFragmentProcessors) { |
Brian Salomon | 5f970fe | 2017-06-16 17:30:59 -0400 | [diff] [blame] | 36 | SkASSERT(fp.get()); |
Brian Salomon | aff329b | 2017-08-11 09:40:37 -0400 | [diff] [blame] | 37 | fFragmentProcessors[i++] = std::move(fp); |
Brian Salomon | 8d2f90b | 2017-03-13 09:11:58 -0400 | [diff] [blame] | 38 | } |
Brian Salomon | 8d2f90b | 2017-03-13 09:11:58 -0400 | [diff] [blame] | 39 | } else { |
| 40 | SkDebugf("Insane number of color fragment processors in paint. Dropping all processors."); |
| 41 | fColorFragmentProcessorCnt = 0; |
Brian Salomon | f87e2b9 | 2017-01-19 11:31:50 -0500 | [diff] [blame] | 42 | } |
Mike Klein | 1688507 | 2018-12-11 09:54:31 -0500 | [diff] [blame] | 43 | SkDEBUGCODE(paint.fAlive = false;) |
Brian Salomon | 92ce594 | 2017-01-18 11:01:10 -0500 | [diff] [blame] | 44 | } |
Brian Salomon | 5298dc8 | 2017-02-22 11:52:03 -0500 | [diff] [blame] | 45 | |
Brian Salomon | 477d0ef | 2017-07-14 10:12:26 -0400 | [diff] [blame] | 46 | GrProcessorSet::GrProcessorSet(SkBlendMode mode) |
| 47 | : fXP(SkBlendMode_AsXPFactory(mode)) |
| 48 | , fColorFragmentProcessorCnt(0) |
| 49 | , fFragmentProcessorOffset(0) |
| 50 | , fFlags(0) {} |
| 51 | |
Brian Salomon | aff329b | 2017-08-11 09:40:37 -0400 | [diff] [blame] | 52 | GrProcessorSet::GrProcessorSet(std::unique_ptr<GrFragmentProcessor> colorFP) |
Brian Salomon | 82ddc94 | 2017-07-14 12:00:13 -0400 | [diff] [blame] | 53 | : fFragmentProcessors(1) |
| 54 | , fXP((const GrXPFactory*)nullptr) |
| 55 | , fColorFragmentProcessorCnt(1) |
| 56 | , fFragmentProcessorOffset(0) |
| 57 | , fFlags(0) { |
| 58 | SkASSERT(colorFP); |
Brian Salomon | aff329b | 2017-08-11 09:40:37 -0400 | [diff] [blame] | 59 | fFragmentProcessors[0] = std::move(colorFP); |
Brian Salomon | 82ddc94 | 2017-07-14 12:00:13 -0400 | [diff] [blame] | 60 | } |
| 61 | |
Brian Salomon | 91326c3 | 2017-08-09 16:02:19 -0400 | [diff] [blame] | 62 | GrProcessorSet::GrProcessorSet(GrProcessorSet&& that) |
| 63 | : fXP(std::move(that.fXP)) |
| 64 | , fColorFragmentProcessorCnt(that.fColorFragmentProcessorCnt) |
| 65 | , fFragmentProcessorOffset(0) |
| 66 | , fFlags(that.fFlags) { |
| 67 | fFragmentProcessors.reset(that.fFragmentProcessors.count() - that.fFragmentProcessorOffset); |
| 68 | for (int i = 0; i < fFragmentProcessors.count(); ++i) { |
Brian Salomon | aff329b | 2017-08-11 09:40:37 -0400 | [diff] [blame] | 69 | fFragmentProcessors[i] = |
| 70 | std::move(that.fFragmentProcessors[i + that.fFragmentProcessorOffset]); |
Brian Salomon | 91326c3 | 2017-08-09 16:02:19 -0400 | [diff] [blame] | 71 | } |
| 72 | that.fColorFragmentProcessorCnt = 0; |
| 73 | that.fFragmentProcessors.reset(0); |
| 74 | } |
| 75 | |
Brian Salomon | 54d212e | 2017-03-21 14:22:38 -0400 | [diff] [blame] | 76 | GrProcessorSet::~GrProcessorSet() { |
Brian Salomon | 48d1b4c | 2017-04-08 07:38:53 -0400 | [diff] [blame] | 77 | if (this->isFinalized() && this->xferProcessor()) { |
Brian Salomon | d61c9d9 | 2017-04-10 10:54:25 -0400 | [diff] [blame] | 78 | this->xferProcessor()->unref(); |
Brian Salomon | 54d212e | 2017-03-21 14:22:38 -0400 | [diff] [blame] | 79 | } |
| 80 | } |
| 81 | |
Brian Osman | 9a390ac | 2018-11-12 09:47:48 -0500 | [diff] [blame] | 82 | #ifdef SK_DEBUG |
Brian Salomon | 82dfd3d | 2017-06-14 12:30:35 -0400 | [diff] [blame] | 83 | SkString dump_fragment_processor_tree(const GrFragmentProcessor* fp, int indentCnt) { |
| 84 | SkString result; |
| 85 | SkString indentString; |
| 86 | for (int i = 0; i < indentCnt; ++i) { |
| 87 | indentString.append(" "); |
| 88 | } |
| 89 | result.appendf("%s%s %s \n", indentString.c_str(), fp->name(), fp->dumpInfo().c_str()); |
| 90 | if (fp->numChildProcessors()) { |
| 91 | for (int i = 0; i < fp->numChildProcessors(); ++i) { |
| 92 | result += dump_fragment_processor_tree(&fp->childProcessor(i), indentCnt + 1); |
| 93 | } |
| 94 | } |
| 95 | return result; |
| 96 | } |
| 97 | |
| 98 | SkString GrProcessorSet::dumpProcessors() const { |
| 99 | SkString result; |
| 100 | if (this->numFragmentProcessors()) { |
| 101 | if (this->numColorFragmentProcessors()) { |
| 102 | result.append("Color Fragment Processors:\n"); |
| 103 | for (int i = 0; i < this->numColorFragmentProcessors(); ++i) { |
| 104 | result += dump_fragment_processor_tree(this->colorFragmentProcessor(i), 1); |
| 105 | } |
| 106 | } else { |
| 107 | result.append("No color fragment processors.\n"); |
| 108 | } |
| 109 | if (this->numCoverageFragmentProcessors()) { |
| 110 | result.append("Coverage Fragment Processors:\n"); |
| 111 | for (int i = 0; i < this->numColorFragmentProcessors(); ++i) { |
| 112 | result += dump_fragment_processor_tree(this->coverageFragmentProcessor(i), 1); |
| 113 | } |
| 114 | } else { |
| 115 | result.append("No coverage fragment processors.\n"); |
| 116 | } |
| 117 | } else { |
| 118 | result.append("No color or coverage fragment processors.\n"); |
| 119 | } |
| 120 | if (this->isFinalized()) { |
| 121 | result.append("Xfer Processor: "); |
| 122 | if (this->xferProcessor()) { |
| 123 | result.appendf("%s\n", this->xferProcessor()->name()); |
| 124 | } else { |
| 125 | result.append("SrcOver\n"); |
| 126 | } |
| 127 | } else { |
Derek Sollenberger | 08c0629 | 2019-01-24 16:30:28 +0000 | [diff] [blame] | 128 | result.append("XP Factory dumping not implemented.\n"); |
Brian Salomon | 82dfd3d | 2017-06-14 12:30:35 -0400 | [diff] [blame] | 129 | } |
| 130 | return result; |
| 131 | } |
Brian Osman | 9a390ac | 2018-11-12 09:47:48 -0500 | [diff] [blame] | 132 | #endif |
Brian Salomon | 82dfd3d | 2017-06-14 12:30:35 -0400 | [diff] [blame] | 133 | |
Brian Salomon | 54d212e | 2017-03-21 14:22:38 -0400 | [diff] [blame] | 134 | bool GrProcessorSet::operator==(const GrProcessorSet& that) const { |
Brian Salomon | 48d1b4c | 2017-04-08 07:38:53 -0400 | [diff] [blame] | 135 | SkASSERT(this->isFinalized()); |
| 136 | SkASSERT(that.isFinalized()); |
Brian Salomon | 70288c0 | 2017-03-24 12:27:17 -0400 | [diff] [blame] | 137 | int fpCount = this->numFragmentProcessors(); |
Brian Salomon | 48d1b4c | 2017-04-08 07:38:53 -0400 | [diff] [blame] | 138 | if (((fFlags ^ that.fFlags) & ~kFinalized_Flag) || fpCount != that.numFragmentProcessors() || |
Brian Salomon | 54d212e | 2017-03-21 14:22:38 -0400 | [diff] [blame] | 139 | fColorFragmentProcessorCnt != that.fColorFragmentProcessorCnt) { |
| 140 | return false; |
| 141 | } |
Brian Salomon | 70288c0 | 2017-03-24 12:27:17 -0400 | [diff] [blame] | 142 | |
| 143 | for (int i = 0; i < fpCount; ++i) { |
| 144 | int a = i + fFragmentProcessorOffset; |
| 145 | int b = i + that.fFragmentProcessorOffset; |
| 146 | if (!fFragmentProcessors[a]->isEqual(*that.fFragmentProcessors[b])) { |
Brian Salomon | 54d212e | 2017-03-21 14:22:38 -0400 | [diff] [blame] | 147 | return false; |
| 148 | } |
| 149 | } |
Brian Salomon | 48d1b4c | 2017-04-08 07:38:53 -0400 | [diff] [blame] | 150 | // Most of the time both of these are null |
| 151 | if (!this->xferProcessor() && !that.xferProcessor()) { |
| 152 | return true; |
Brian Salomon | 54d212e | 2017-03-21 14:22:38 -0400 | [diff] [blame] | 153 | } |
Brian Salomon | 48d1b4c | 2017-04-08 07:38:53 -0400 | [diff] [blame] | 154 | const GrXferProcessor& thisXP = this->xferProcessor() |
| 155 | ? *this->xferProcessor() |
| 156 | : GrPorterDuffXPFactory::SimpleSrcOverXP(); |
| 157 | const GrXferProcessor& thatXP = that.xferProcessor() |
| 158 | ? *that.xferProcessor() |
| 159 | : GrPorterDuffXPFactory::SimpleSrcOverXP(); |
| 160 | return thisXP.isEqual(thatXP); |
Brian Salomon | 54d212e | 2017-03-21 14:22:38 -0400 | [diff] [blame] | 161 | } |
| 162 | |
Chris Dalton | b8fff0d | 2019-03-05 10:11:58 -0700 | [diff] [blame] | 163 | GrProcessorSet::Analysis GrProcessorSet::finalize( |
| 164 | const GrProcessorAnalysisColor& colorInput, const GrProcessorAnalysisCoverage coverageInput, |
| 165 | const GrAppliedClip* clip, const GrUserStencilSettings* userStencil, GrFSAAType fsaaType, |
Brian Osman | 5ced0bf | 2019-03-15 10:15:29 -0400 | [diff] [blame] | 166 | const GrCaps& caps, GrClampType clampType, SkPMColor4f* overrideInputColor) { |
Brian Salomon | 48d1b4c | 2017-04-08 07:38:53 -0400 | [diff] [blame] | 167 | SkASSERT(!this->isFinalized()); |
| 168 | SkASSERT(!fFragmentProcessorOffset); |
Brian Salomon | 5298dc8 | 2017-02-22 11:52:03 -0500 | [diff] [blame] | 169 | |
Brian Salomon | 48d1b4c | 2017-04-08 07:38:53 -0400 | [diff] [blame] | 170 | GrProcessorSet::Analysis analysis; |
Brian Salomon | 48d1b4c | 2017-04-08 07:38:53 -0400 | [diff] [blame] | 171 | analysis.fCompatibleWithCoverageAsAlpha = GrProcessorAnalysisCoverage::kLCD != coverageInput; |
| 172 | |
Brian Salomon | aff329b | 2017-08-11 09:40:37 -0400 | [diff] [blame] | 173 | const std::unique_ptr<const GrFragmentProcessor>* fps = |
| 174 | fFragmentProcessors.get() + fFragmentProcessorOffset; |
| 175 | GrColorFragmentProcessorAnalysis colorAnalysis( |
| 176 | colorInput, unique_ptr_address_as_pointer_address(fps), fColorFragmentProcessorCnt); |
Brian Salomon | 48d1b4c | 2017-04-08 07:38:53 -0400 | [diff] [blame] | 177 | analysis.fCompatibleWithCoverageAsAlpha &= |
| 178 | colorAnalysis.allProcessorsCompatibleWithCoverageAsAlpha(); |
| 179 | fps += fColorFragmentProcessorCnt; |
| 180 | int n = this->numCoverageFragmentProcessors(); |
Brian Salomon | 5298dc8 | 2017-02-22 11:52:03 -0500 | [diff] [blame] | 181 | bool hasCoverageFP = n > 0; |
Brian Salomon | 3185384 | 2017-03-28 16:32:05 -0400 | [diff] [blame] | 182 | bool coverageUsesLocalCoords = false; |
Brian Salomon | bfafcba | 2017-03-02 08:49:19 -0500 | [diff] [blame] | 183 | for (int i = 0; i < n; ++i) { |
Brian Salomon | 5298dc8 | 2017-02-22 11:52:03 -0500 | [diff] [blame] | 184 | if (!fps[i]->compatibleWithCoverageAsAlpha()) { |
Brian Salomon | 48d1b4c | 2017-04-08 07:38:53 -0400 | [diff] [blame] | 185 | analysis.fCompatibleWithCoverageAsAlpha = false; |
Brian Salomon | 5298dc8 | 2017-02-22 11:52:03 -0500 | [diff] [blame] | 186 | } |
Brian Salomon | 3185384 | 2017-03-28 16:32:05 -0400 | [diff] [blame] | 187 | coverageUsesLocalCoords |= fps[i]->usesLocalCoords(); |
Brian Salomon | 5298dc8 | 2017-02-22 11:52:03 -0500 | [diff] [blame] | 188 | } |
Chris Dalton | 6982400 | 2017-10-31 00:37:52 -0600 | [diff] [blame] | 189 | if (clip) { |
| 190 | hasCoverageFP = hasCoverageFP || clip->numClipCoverageFragmentProcessors(); |
| 191 | for (int i = 0; i < clip->numClipCoverageFragmentProcessors(); ++i) { |
| 192 | const GrFragmentProcessor* clipFP = clip->clipCoverageFragmentProcessor(i); |
| 193 | analysis.fCompatibleWithCoverageAsAlpha &= clipFP->compatibleWithCoverageAsAlpha(); |
| 194 | coverageUsesLocalCoords |= clipFP->usesLocalCoords(); |
| 195 | } |
Brian Salomon | 5298dc8 | 2017-02-22 11:52:03 -0500 | [diff] [blame] | 196 | } |
Brian Salomon | 48d1b4c | 2017-04-08 07:38:53 -0400 | [diff] [blame] | 197 | int colorFPsToEliminate = colorAnalysis.initialProcessorsToEliminate(overrideInputColor); |
| 198 | analysis.fInputColorType = static_cast<Analysis::PackedInputColorType>( |
| 199 | colorFPsToEliminate ? Analysis::kOverridden_InputColorType |
| 200 | : Analysis::kOriginal_InputColorType); |
Brian Salomon | 5298dc8 | 2017-02-22 11:52:03 -0500 | [diff] [blame] | 201 | |
Brian Salomon | a811b12 | 2017-03-30 08:21:32 -0400 | [diff] [blame] | 202 | GrProcessorAnalysisCoverage outputCoverage; |
| 203 | if (GrProcessorAnalysisCoverage::kLCD == coverageInput) { |
| 204 | outputCoverage = GrProcessorAnalysisCoverage::kLCD; |
| 205 | } else if (hasCoverageFP || GrProcessorAnalysisCoverage::kSingleChannel == coverageInput) { |
| 206 | outputCoverage = GrProcessorAnalysisCoverage::kSingleChannel; |
Brian Salomon | 5298dc8 | 2017-02-22 11:52:03 -0500 | [diff] [blame] | 207 | } else { |
Brian Salomon | a811b12 | 2017-03-30 08:21:32 -0400 | [diff] [blame] | 208 | outputCoverage = GrProcessorAnalysisCoverage::kNone; |
Brian Salomon | 3185384 | 2017-03-28 16:32:05 -0400 | [diff] [blame] | 209 | } |
Brian Salomon | 3185384 | 2017-03-28 16:32:05 -0400 | [diff] [blame] | 210 | |
| 211 | GrXPFactory::AnalysisProperties props = GrXPFactory::GetAnalysisProperties( |
Brian Osman | 5ced0bf | 2019-03-15 10:15:29 -0400 | [diff] [blame] | 212 | this->xpFactory(), colorAnalysis.outputColor(), outputCoverage, caps, clampType); |
Brian Salomon | 48d1b4c | 2017-04-08 07:38:53 -0400 | [diff] [blame] | 213 | if (!this->numCoverageFragmentProcessors() && |
Brian Salomon | a811b12 | 2017-03-30 08:21:32 -0400 | [diff] [blame] | 214 | GrProcessorAnalysisCoverage::kNone == coverageInput) { |
Brian Salomon | 3185384 | 2017-03-28 16:32:05 -0400 | [diff] [blame] | 215 | } |
Brian Salomon | 48d1b4c | 2017-04-08 07:38:53 -0400 | [diff] [blame] | 216 | analysis.fRequiresDstTexture = |
| 217 | SkToBool(props & GrXPFactory::AnalysisProperties::kRequiresDstTexture); |
| 218 | analysis.fCompatibleWithCoverageAsAlpha &= |
Brian Salomon | 3185384 | 2017-03-28 16:32:05 -0400 | [diff] [blame] | 219 | SkToBool(props & GrXPFactory::AnalysisProperties::kCompatibleWithAlphaAsCoverage); |
Chris Dalton | 945ee65 | 2019-01-23 09:10:36 -0700 | [diff] [blame] | 220 | analysis.fRequiresNonOverlappingDraws = SkToBool( |
| 221 | props & GrXPFactory::AnalysisProperties::kRequiresNonOverlappingDraws); |
Brian Salomon | 3185384 | 2017-03-28 16:32:05 -0400 | [diff] [blame] | 222 | if (props & GrXPFactory::AnalysisProperties::kIgnoresInputColor) { |
Brian Salomon | 48d1b4c | 2017-04-08 07:38:53 -0400 | [diff] [blame] | 223 | colorFPsToEliminate = this->numColorFragmentProcessors(); |
| 224 | analysis.fInputColorType = |
| 225 | static_cast<Analysis::PackedInputColorType>(Analysis::kIgnored_InputColorType); |
| 226 | analysis.fUsesLocalCoords = coverageUsesLocalCoords; |
Brian Salomon | 3185384 | 2017-03-28 16:32:05 -0400 | [diff] [blame] | 227 | } else { |
Brian Salomon | 48d1b4c | 2017-04-08 07:38:53 -0400 | [diff] [blame] | 228 | analysis.fUsesLocalCoords = coverageUsesLocalCoords | colorAnalysis.usesLocalCoords(); |
Brian Salomon | 5298dc8 | 2017-02-22 11:52:03 -0500 | [diff] [blame] | 229 | } |
Brian Salomon | 48d1b4c | 2017-04-08 07:38:53 -0400 | [diff] [blame] | 230 | for (int i = 0; i < colorFPsToEliminate; ++i) { |
Brian Salomon | aff329b | 2017-08-11 09:40:37 -0400 | [diff] [blame] | 231 | fFragmentProcessors[i].reset(nullptr); |
Brian Salomon | 5dac9b3 | 2017-04-08 02:53:30 +0000 | [diff] [blame] | 232 | } |
Brian Salomon | 48d1b4c | 2017-04-08 07:38:53 -0400 | [diff] [blame] | 233 | for (int i = colorFPsToEliminate; i < fFragmentProcessors.count(); ++i) { |
Brian Salomon | aff329b | 2017-08-11 09:40:37 -0400 | [diff] [blame] | 234 | fFragmentProcessors[i]->markPendingExecution(); |
Brian Salomon | 48d1b4c | 2017-04-08 07:38:53 -0400 | [diff] [blame] | 235 | } |
| 236 | fFragmentProcessorOffset = colorFPsToEliminate; |
| 237 | fColorFragmentProcessorCnt -= colorFPsToEliminate; |
| 238 | |
Chris Dalton | b8fff0d | 2019-03-05 10:11:58 -0700 | [diff] [blame] | 239 | bool hasMixedSampledCoverage = (GrFSAAType::kMixedSamples == fsaaType) |
| 240 | && !userStencil->testAlwaysPasses((clip) ? clip->hasStencilClip() : false); |
Brian Salomon | 48d1b4c | 2017-04-08 07:38:53 -0400 | [diff] [blame] | 241 | auto xp = GrXPFactory::MakeXferProcessor(this->xpFactory(), colorAnalysis.outputColor(), |
Brian Osman | 5ced0bf | 2019-03-15 10:15:29 -0400 | [diff] [blame] | 242 | outputCoverage, hasMixedSampledCoverage, caps, |
| 243 | clampType); |
Brian Salomon | d61c9d9 | 2017-04-10 10:54:25 -0400 | [diff] [blame] | 244 | fXP.fProcessor = xp.release(); |
Brian Salomon | 48d1b4c | 2017-04-08 07:38:53 -0400 | [diff] [blame] | 245 | |
Brian Salomon | d61c9d9 | 2017-04-10 10:54:25 -0400 | [diff] [blame] | 246 | fFlags |= kFinalized_Flag; |
Brian Salomon | 48d1b4c | 2017-04-08 07:38:53 -0400 | [diff] [blame] | 247 | analysis.fIsInitialized = true; |
Chris Dalton | 945ee65 | 2019-01-23 09:10:36 -0700 | [diff] [blame] | 248 | #ifdef SK_DEBUG |
| 249 | bool hasXferBarrier = |
| 250 | fXP.fProcessor && |
| 251 | GrXferBarrierType::kNone_GrXferBarrierType != fXP.fProcessor->xferBarrierType(caps); |
| 252 | bool needsNonOverlappingDraws = analysis.fRequiresDstTexture || hasXferBarrier; |
| 253 | SkASSERT(analysis.fRequiresNonOverlappingDraws == needsNonOverlappingDraws); |
| 254 | #endif |
Brian Salomon | 48d1b4c | 2017-04-08 07:38:53 -0400 | [diff] [blame] | 255 | return analysis; |
Brian Salomon | 70288c0 | 2017-03-24 12:27:17 -0400 | [diff] [blame] | 256 | } |