Brian Salomon | b4d6106 | 2017-07-12 11:24:41 -0400 | [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 | |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 8 | #include "src/gpu/GrAppliedClip.h" |
| 9 | #include "src/gpu/GrProcessorSet.h" |
Robert Phillips | ce97857 | 2020-02-28 11:56:44 -0500 | [diff] [blame] | 10 | #include "src/gpu/GrProgramInfo.h" |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 11 | #include "src/gpu/GrUserStencilSettings.h" |
| 12 | #include "src/gpu/SkGr.h" |
Michael Ludwig | 663afe5 | 2019-06-03 16:46:19 -0400 | [diff] [blame] | 13 | #include "src/gpu/geometry/GrRect.h" |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 14 | #include "src/gpu/ops/GrSimpleMeshDrawOpHelper.h" |
Brian Salomon | b4d6106 | 2017-07-12 11:24:41 -0400 | [diff] [blame] | 15 | |
Robert Phillips | 360ec18 | 2020-03-26 13:29:50 -0400 | [diff] [blame] | 16 | GrSimpleMeshDrawOpHelper::GrSimpleMeshDrawOpHelper(const MakeArgs& args, |
| 17 | GrAAType aaType, |
Chris Dalton | baa1b35 | 2019-04-03 12:03:00 -0600 | [diff] [blame] | 18 | InputFlags inputFlags) |
Brian Salomon | b4d6106 | 2017-07-12 11:24:41 -0400 | [diff] [blame] | 19 | : fProcessors(args.fProcessorSet) |
Chris Dalton | baa1b35 | 2019-04-03 12:03:00 -0600 | [diff] [blame] | 20 | , fPipelineFlags((GrPipeline::InputFlags)inputFlags) |
Brian Salomon | b4d6106 | 2017-07-12 11:24:41 -0400 | [diff] [blame] | 21 | , fAAType((int)aaType) |
Brian Salomon | b4d6106 | 2017-07-12 11:24:41 -0400 | [diff] [blame] | 22 | , fUsesLocalCoords(false) |
Brian Osman | 605c6d5 | 2019-03-15 12:10:35 -0400 | [diff] [blame] | 23 | , fCompatibleWithCoverageAsAlpha(false) { |
Brian Salomon | b4d6106 | 2017-07-12 11:24:41 -0400 | [diff] [blame] | 24 | SkDEBUGCODE(fDidAnalysis = false); |
Brian Salomon | bfd18cd | 2017-08-09 16:27:09 -0400 | [diff] [blame] | 25 | SkDEBUGCODE(fMadePipeline = false); |
Brian Salomon | b4d6106 | 2017-07-12 11:24:41 -0400 | [diff] [blame] | 26 | if (GrAATypeIsHW(aaType)) { |
Chris Dalton | baa1b35 | 2019-04-03 12:03:00 -0600 | [diff] [blame] | 27 | fPipelineFlags |= GrPipeline::InputFlags::kHWAntialias; |
Brian Salomon | b4d6106 | 2017-07-12 11:24:41 -0400 | [diff] [blame] | 28 | } |
| 29 | } |
| 30 | |
| 31 | GrSimpleMeshDrawOpHelper::~GrSimpleMeshDrawOpHelper() { |
| 32 | if (fProcessors) { |
| 33 | fProcessors->~GrProcessorSet(); |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | GrDrawOp::FixedFunctionFlags GrSimpleMeshDrawOpHelper::fixedFunctionFlags() const { |
Robert Phillips | 360ec18 | 2020-03-26 13:29:50 -0400 | [diff] [blame] | 38 | return GrAATypeIsHW(this->aaType()) ? GrDrawOp::FixedFunctionFlags::kUsesHWAA |
| 39 | : GrDrawOp::FixedFunctionFlags::kNone; |
Brian Salomon | b4d6106 | 2017-07-12 11:24:41 -0400 | [diff] [blame] | 40 | } |
| 41 | |
| 42 | bool GrSimpleMeshDrawOpHelper::isCompatible(const GrSimpleMeshDrawOpHelper& that, |
| 43 | const GrCaps& caps, const SkRect& thisBounds, |
Robert Phillips | b69001f | 2019-10-29 12:16:35 -0400 | [diff] [blame] | 44 | const SkRect& thatBounds, bool ignoreAAType) const { |
Brian Salomon | b4d6106 | 2017-07-12 11:24:41 -0400 | [diff] [blame] | 45 | if (SkToBool(fProcessors) != SkToBool(that.fProcessors)) { |
| 46 | return false; |
| 47 | } |
| 48 | if (fProcessors) { |
| 49 | if (*fProcessors != *that.fProcessors) { |
| 50 | return false; |
| 51 | } |
Brian Salomon | b4d6106 | 2017-07-12 11:24:41 -0400 | [diff] [blame] | 52 | } |
Robert Phillips | b69001f | 2019-10-29 12:16:35 -0400 | [diff] [blame] | 53 | |
| 54 | #ifdef SK_DEBUG |
| 55 | if (ignoreAAType) { |
| 56 | // If we're ignoring AA it should be bc we already know they are the same or that |
| 57 | // the are different but are compatible (i.e., one is AA and the other is None) |
Robert Phillips | bbd459d | 2019-10-29 14:40:03 -0400 | [diff] [blame] | 58 | SkASSERT(fAAType == that.fAAType || |
| 59 | GrMeshDrawOp::CanUpgradeAAOnMerge(this->aaType(), that.aaType())); |
Robert Phillips | b69001f | 2019-10-29 12:16:35 -0400 | [diff] [blame] | 60 | } |
| 61 | #endif |
| 62 | |
| 63 | bool result = fPipelineFlags == that.fPipelineFlags && |
| 64 | (ignoreAAType || fAAType == that.fAAType); |
Brian Osman | 605c6d5 | 2019-03-15 12:10:35 -0400 | [diff] [blame] | 65 | SkASSERT(!result || fCompatibleWithCoverageAsAlpha == that.fCompatibleWithCoverageAsAlpha); |
Brian Salomon | b4d6106 | 2017-07-12 11:24:41 -0400 | [diff] [blame] | 66 | SkASSERT(!result || fUsesLocalCoords == that.fUsesLocalCoords); |
| 67 | return result; |
| 68 | } |
| 69 | |
Chris Dalton | 4b62aed | 2019-01-15 11:53:00 -0700 | [diff] [blame] | 70 | GrProcessorSet::Analysis GrSimpleMeshDrawOpHelper::finalizeProcessors( |
Chris Dalton | 6ce447a | 2019-06-23 18:07:38 -0600 | [diff] [blame] | 71 | const GrCaps& caps, const GrAppliedClip* clip, bool hasMixedSampledCoverage, |
| 72 | GrClampType clampType, GrProcessorAnalysisCoverage geometryCoverage, |
| 73 | SkPMColor4f* geometryColor, bool* wideColor) { |
Chris Dalton | b8fff0d | 2019-03-05 10:11:58 -0700 | [diff] [blame] | 74 | GrProcessorAnalysisColor color = *geometryColor; |
Brian Osman | 5ced0bf | 2019-03-15 10:15:29 -0400 | [diff] [blame] | 75 | auto result = this->finalizeProcessors( |
Chris Dalton | 6ce447a | 2019-06-23 18:07:38 -0600 | [diff] [blame] | 76 | caps, clip, hasMixedSampledCoverage, clampType, geometryCoverage, &color); |
Chris Dalton | b8fff0d | 2019-03-05 10:11:58 -0700 | [diff] [blame] | 77 | color.isConstant(geometryColor); |
Brian Osman | 8fa7ab4 | 2019-03-18 10:22:42 -0400 | [diff] [blame] | 78 | if (wideColor) { |
Brian Osman | 2715bf5 | 2019-12-06 14:38:47 -0500 | [diff] [blame] | 79 | *wideColor = !geometryColor->fitsInBytes(); |
Brian Osman | 8fa7ab4 | 2019-03-18 10:22:42 -0400 | [diff] [blame] | 80 | } |
Chris Dalton | b8fff0d | 2019-03-05 10:11:58 -0700 | [diff] [blame] | 81 | return result; |
| 82 | } |
| 83 | |
| 84 | GrProcessorSet::Analysis GrSimpleMeshDrawOpHelper::finalizeProcessors( |
| 85 | const GrCaps& caps, const GrAppliedClip* clip, const GrUserStencilSettings* userStencil, |
Chris Dalton | 6ce447a | 2019-06-23 18:07:38 -0600 | [diff] [blame] | 86 | bool hasMixedSampledCoverage, GrClampType clampType, |
| 87 | GrProcessorAnalysisCoverage geometryCoverage, GrProcessorAnalysisColor* geometryColor) { |
Brian Salomon | b4d6106 | 2017-07-12 11:24:41 -0400 | [diff] [blame] | 88 | SkDEBUGCODE(fDidAnalysis = true); |
| 89 | GrProcessorSet::Analysis analysis; |
| 90 | if (fProcessors) { |
| 91 | GrProcessorAnalysisCoverage coverage = geometryCoverage; |
| 92 | if (GrProcessorAnalysisCoverage::kNone == coverage) { |
John Stiles | 59e18dc | 2020-07-22 18:18:12 -0400 | [diff] [blame] | 93 | coverage = clip->hasCoverageFragmentProcessor() |
Brian Salomon | b4d6106 | 2017-07-12 11:24:41 -0400 | [diff] [blame] | 94 | ? GrProcessorAnalysisCoverage::kSingleChannel |
| 95 | : GrProcessorAnalysisCoverage::kNone; |
| 96 | } |
Brian Osman | cf86085 | 2018-10-31 14:04:39 -0400 | [diff] [blame] | 97 | SkPMColor4f overrideColor; |
Chris Dalton | 6ce447a | 2019-06-23 18:07:38 -0600 | [diff] [blame] | 98 | analysis = fProcessors->finalize(*geometryColor, coverage, clip, userStencil, |
| 99 | hasMixedSampledCoverage, caps, clampType, &overrideColor); |
Brian Salomon | 0088f94 | 2017-07-12 11:51:27 -0400 | [diff] [blame] | 100 | if (analysis.inputColorIsOverridden()) { |
| 101 | *geometryColor = overrideColor; |
| 102 | } |
Brian Salomon | b4d6106 | 2017-07-12 11:24:41 -0400 | [diff] [blame] | 103 | } else { |
| 104 | analysis = GrProcessorSet::EmptySetAnalysis(); |
| 105 | } |
Brian Salomon | b4d6106 | 2017-07-12 11:24:41 -0400 | [diff] [blame] | 106 | fUsesLocalCoords = analysis.usesLocalCoords(); |
Brian Osman | 605c6d5 | 2019-03-15 12:10:35 -0400 | [diff] [blame] | 107 | fCompatibleWithCoverageAsAlpha = analysis.isCompatibleWithCoverageAsAlpha(); |
Chris Dalton | 4b62aed | 2019-01-15 11:53:00 -0700 | [diff] [blame] | 108 | return analysis; |
Brian Salomon | b4d6106 | 2017-07-12 11:24:41 -0400 | [diff] [blame] | 109 | } |
| 110 | |
Robert Phillips | 3968fcb | 2019-12-05 16:40:31 -0500 | [diff] [blame] | 111 | const GrPipeline* GrSimpleMeshDrawOpHelper::CreatePipeline( |
Robert Phillips | 6c59fe4 | 2020-02-27 09:30:37 -0500 | [diff] [blame] | 112 | const GrCaps* caps, |
| 113 | SkArenaAlloc* arena, |
Brian Salomon | 8afde5f | 2020-04-01 16:22:00 -0400 | [diff] [blame] | 114 | GrSwizzle writeViewSwizzle, |
Robert Phillips | 6c59fe4 | 2020-02-27 09:30:37 -0500 | [diff] [blame] | 115 | GrAppliedClip&& appliedClip, |
| 116 | const GrXferProcessor::DstProxyView& dstProxyView, |
| 117 | GrProcessorSet&& processorSet, |
Chris Dalton | 1b6a43c | 2020-09-25 12:21:18 -0600 | [diff] [blame^] | 118 | GrPipeline::InputFlags pipelineFlags) { |
Robert Phillips | 3968fcb | 2019-12-05 16:40:31 -0500 | [diff] [blame] | 119 | GrPipeline::InitArgs pipelineArgs; |
| 120 | |
| 121 | pipelineArgs.fInputFlags = pipelineFlags; |
Robert Phillips | ce97857 | 2020-02-28 11:56:44 -0500 | [diff] [blame] | 122 | pipelineArgs.fCaps = caps; |
| 123 | pipelineArgs.fDstProxyView = dstProxyView; |
Brian Salomon | 8afde5f | 2020-04-01 16:22:00 -0400 | [diff] [blame] | 124 | pipelineArgs.fWriteSwizzle = writeViewSwizzle; |
Robert Phillips | 3968fcb | 2019-12-05 16:40:31 -0500 | [diff] [blame] | 125 | |
Robert Phillips | 6c59fe4 | 2020-02-27 09:30:37 -0500 | [diff] [blame] | 126 | return arena->make<GrPipeline>(pipelineArgs, |
| 127 | std::move(processorSet), |
| 128 | std::move(appliedClip)); |
| 129 | } |
| 130 | |
| 131 | const GrPipeline* GrSimpleMeshDrawOpHelper::CreatePipeline( |
| 132 | GrOpFlushState* flushState, |
| 133 | GrProcessorSet&& processorSet, |
Chris Dalton | 1b6a43c | 2020-09-25 12:21:18 -0600 | [diff] [blame^] | 134 | GrPipeline::InputFlags pipelineFlags) { |
Robert Phillips | 6c59fe4 | 2020-02-27 09:30:37 -0500 | [diff] [blame] | 135 | return CreatePipeline(&flushState->caps(), |
| 136 | flushState->allocator(), |
Brian Salomon | 8afde5f | 2020-04-01 16:22:00 -0400 | [diff] [blame] | 137 | flushState->writeView()->swizzle(), |
Robert Phillips | 6c59fe4 | 2020-02-27 09:30:37 -0500 | [diff] [blame] | 138 | flushState->detachAppliedClip(), |
| 139 | flushState->dstProxyView(), |
| 140 | std::move(processorSet), |
Chris Dalton | 1b6a43c | 2020-09-25 12:21:18 -0600 | [diff] [blame^] | 141 | pipelineFlags); |
Robert Phillips | 6c59fe4 | 2020-02-27 09:30:37 -0500 | [diff] [blame] | 142 | } |
| 143 | |
| 144 | const GrPipeline* GrSimpleMeshDrawOpHelper::createPipeline(GrOpFlushState* flushState) { |
| 145 | return CreatePipeline(&flushState->caps(), |
| 146 | flushState->allocator(), |
Brian Salomon | 8afde5f | 2020-04-01 16:22:00 -0400 | [diff] [blame] | 147 | flushState->writeView()->swizzle(), |
Robert Phillips | 6c59fe4 | 2020-02-27 09:30:37 -0500 | [diff] [blame] | 148 | flushState->detachAppliedClip(), |
| 149 | flushState->dstProxyView(), |
| 150 | this->detachProcessorSet(), |
| 151 | this->pipelineFlags()); |
Chris Dalton | 07cdcfc9 | 2019-02-26 11:13:22 -0700 | [diff] [blame] | 152 | } |
| 153 | |
Chris Dalton | 1b6a43c | 2020-09-25 12:21:18 -0600 | [diff] [blame^] | 154 | const GrPipeline* GrSimpleMeshDrawOpHelper::createPipeline( |
| 155 | const GrCaps* caps, |
| 156 | SkArenaAlloc* arena, |
| 157 | GrSwizzle writeViewSwizzle, |
| 158 | GrAppliedClip&& appliedClip, |
| 159 | const GrXferProcessor::DstProxyView& dstProxyView) { |
| 160 | return GrSimpleMeshDrawOpHelper::CreatePipeline(caps, |
| 161 | arena, |
| 162 | writeViewSwizzle, |
| 163 | std::move(appliedClip), |
| 164 | dstProxyView, |
| 165 | this->detachProcessorSet(), |
| 166 | this->pipelineFlags()); |
| 167 | } |
| 168 | |
Robert Phillips | ce97857 | 2020-02-28 11:56:44 -0500 | [diff] [blame] | 169 | GrProgramInfo* GrSimpleMeshDrawOpHelper::CreateProgramInfo( |
| 170 | const GrCaps* caps, |
| 171 | SkArenaAlloc* arena, |
Brian Salomon | 8afde5f | 2020-04-01 16:22:00 -0400 | [diff] [blame] | 172 | const GrSurfaceProxyView* writeView, |
Robert Phillips | ce97857 | 2020-02-28 11:56:44 -0500 | [diff] [blame] | 173 | GrAppliedClip&& appliedClip, |
| 174 | const GrXferProcessor::DstProxyView& dstProxyView, |
| 175 | GrGeometryProcessor* geometryProcessor, |
| 176 | GrProcessorSet&& processorSet, |
Robert Phillips | ac6156c | 2020-02-28 16:02:40 -0500 | [diff] [blame] | 177 | GrPrimitiveType primitiveType, |
Greg Daniel | d358cbe | 2020-09-11 09:33:54 -0400 | [diff] [blame] | 178 | GrXferBarrierFlags renderPassXferBarriers, |
Robert Phillips | ac6156c | 2020-02-28 16:02:40 -0500 | [diff] [blame] | 179 | GrPipeline::InputFlags pipelineFlags, |
Robert Phillips | 709e240 | 2020-03-23 18:29:16 +0000 | [diff] [blame] | 180 | const GrUserStencilSettings* stencilSettings) { |
Robert Phillips | ce97857 | 2020-02-28 11:56:44 -0500 | [diff] [blame] | 181 | auto pipeline = CreatePipeline(caps, |
| 182 | arena, |
Brian Salomon | 8afde5f | 2020-04-01 16:22:00 -0400 | [diff] [blame] | 183 | writeView->swizzle(), |
Robert Phillips | ce97857 | 2020-02-28 11:56:44 -0500 | [diff] [blame] | 184 | std::move(appliedClip), |
| 185 | dstProxyView, |
| 186 | std::move(processorSet), |
Chris Dalton | 1b6a43c | 2020-09-25 12:21:18 -0600 | [diff] [blame^] | 187 | pipelineFlags); |
Robert Phillips | ce97857 | 2020-02-28 11:56:44 -0500 | [diff] [blame] | 188 | |
Greg Daniel | d358cbe | 2020-09-11 09:33:54 -0400 | [diff] [blame] | 189 | return CreateProgramInfo(arena, pipeline, writeView, geometryProcessor, primitiveType, |
Chris Dalton | 1b6a43c | 2020-09-25 12:21:18 -0600 | [diff] [blame^] | 190 | renderPassXferBarriers, stencilSettings); |
Robert Phillips | 4f93c57 | 2020-03-18 08:13:53 -0400 | [diff] [blame] | 191 | } |
| 192 | |
| 193 | GrProgramInfo* GrSimpleMeshDrawOpHelper::CreateProgramInfo(SkArenaAlloc* arena, |
| 194 | const GrPipeline* pipeline, |
Brian Salomon | 8afde5f | 2020-04-01 16:22:00 -0400 | [diff] [blame] | 195 | const GrSurfaceProxyView* writeView, |
Robert Phillips | 4f93c57 | 2020-03-18 08:13:53 -0400 | [diff] [blame] | 196 | GrGeometryProcessor* geometryProcessor, |
Greg Daniel | d358cbe | 2020-09-11 09:33:54 -0400 | [diff] [blame] | 197 | GrPrimitiveType primitiveType, |
Chris Dalton | 1b6a43c | 2020-09-25 12:21:18 -0600 | [diff] [blame^] | 198 | GrXferBarrierFlags xferBarrierFlags, |
| 199 | const GrUserStencilSettings* stencilSettings) { |
Brian Salomon | 8afde5f | 2020-04-01 16:22:00 -0400 | [diff] [blame] | 200 | GrRenderTargetProxy* outputProxy = writeView->asRenderTargetProxy(); |
Robert Phillips | ce97857 | 2020-02-28 11:56:44 -0500 | [diff] [blame] | 201 | |
Robert Phillips | ce97857 | 2020-02-28 11:56:44 -0500 | [diff] [blame] | 202 | auto tmp = arena->make<GrProgramInfo>(outputProxy->numSamples(), |
| 203 | outputProxy->numStencilSamples(), |
| 204 | outputProxy->backendFormat(), |
Brian Salomon | 8afde5f | 2020-04-01 16:22:00 -0400 | [diff] [blame] | 205 | writeView->origin(), |
Robert Phillips | ce97857 | 2020-02-28 11:56:44 -0500 | [diff] [blame] | 206 | pipeline, |
Chris Dalton | 1b6a43c | 2020-09-25 12:21:18 -0600 | [diff] [blame^] | 207 | stencilSettings, |
Robert Phillips | ce97857 | 2020-02-28 11:56:44 -0500 | [diff] [blame] | 208 | geometryProcessor, |
Greg Daniel | d358cbe | 2020-09-11 09:33:54 -0400 | [diff] [blame] | 209 | primitiveType, |
| 210 | 0, |
Chris Dalton | 1b6a43c | 2020-09-25 12:21:18 -0600 | [diff] [blame^] | 211 | xferBarrierFlags); |
Robert Phillips | ce97857 | 2020-02-28 11:56:44 -0500 | [diff] [blame] | 212 | return tmp; |
| 213 | } |
| 214 | |
Robert Phillips | b58098f | 2020-03-02 16:25:29 -0500 | [diff] [blame] | 215 | GrProgramInfo* GrSimpleMeshDrawOpHelper::createProgramInfo( |
| 216 | const GrCaps* caps, |
| 217 | SkArenaAlloc* arena, |
Brian Salomon | 8afde5f | 2020-04-01 16:22:00 -0400 | [diff] [blame] | 218 | const GrSurfaceProxyView* writeView, |
Robert Phillips | b58098f | 2020-03-02 16:25:29 -0500 | [diff] [blame] | 219 | GrAppliedClip&& appliedClip, |
| 220 | const GrXferProcessor::DstProxyView& dstProxyView, |
| 221 | GrGeometryProcessor* gp, |
Greg Daniel | d358cbe | 2020-09-11 09:33:54 -0400 | [diff] [blame] | 222 | GrPrimitiveType primType, |
| 223 | GrXferBarrierFlags renderPassXferBarriers) { |
Robert Phillips | b58098f | 2020-03-02 16:25:29 -0500 | [diff] [blame] | 224 | return CreateProgramInfo(caps, |
| 225 | arena, |
Brian Salomon | 8afde5f | 2020-04-01 16:22:00 -0400 | [diff] [blame] | 226 | writeView, |
Robert Phillips | b58098f | 2020-03-02 16:25:29 -0500 | [diff] [blame] | 227 | std::move(appliedClip), |
| 228 | dstProxyView, |
| 229 | gp, |
| 230 | this->detachProcessorSet(), |
| 231 | primType, |
Greg Daniel | d358cbe | 2020-09-11 09:33:54 -0400 | [diff] [blame] | 232 | renderPassXferBarriers, |
Robert Phillips | b58098f | 2020-03-02 16:25:29 -0500 | [diff] [blame] | 233 | this->pipelineFlags()); |
| 234 | } |
| 235 | |
John Stiles | 8d9bf64 | 2020-08-12 15:07:45 -0400 | [diff] [blame] | 236 | #if GR_TEST_UTILS |
Chris Dalton | baa1b35 | 2019-04-03 12:03:00 -0600 | [diff] [blame] | 237 | static void dump_pipeline_flags(GrPipeline::InputFlags flags, SkString* result) { |
| 238 | if (GrPipeline::InputFlags::kNone != flags) { |
| 239 | if (flags & GrPipeline::InputFlags::kSnapVerticesToPixelCenters) { |
| 240 | result->append("Snap vertices to pixel center.\n"); |
| 241 | } |
| 242 | if (flags & GrPipeline::InputFlags::kHWAntialias) { |
| 243 | result->append("HW Antialiasing enabled.\n"); |
| 244 | } |
Chris Dalton | 1b6a43c | 2020-09-25 12:21:18 -0600 | [diff] [blame^] | 245 | if (flags & GrPipeline::InputFlags::kWireframe) { |
| 246 | result->append("Wireframe enabled.\n"); |
| 247 | } |
| 248 | if (flags & GrPipeline::InputFlags::kConservativeRaster) { |
| 249 | result->append("Conservative raster enabled.\n"); |
| 250 | } |
Chris Dalton | baa1b35 | 2019-04-03 12:03:00 -0600 | [diff] [blame] | 251 | return; |
| 252 | } |
| 253 | result->append("No pipeline flags\n"); |
| 254 | } |
| 255 | |
Brian Salomon | b4d6106 | 2017-07-12 11:24:41 -0400 | [diff] [blame] | 256 | SkString GrSimpleMeshDrawOpHelper::dumpInfo() const { |
Brian Salomon | 91326c3 | 2017-08-09 16:02:19 -0400 | [diff] [blame] | 257 | const GrProcessorSet& processors = fProcessors ? *fProcessors : GrProcessorSet::EmptySet(); |
| 258 | SkString result = processors.dumpProcessors(); |
Brian Salomon | b4d6106 | 2017-07-12 11:24:41 -0400 | [diff] [blame] | 259 | result.append("AA Type: "); |
| 260 | switch (this->aaType()) { |
| 261 | case GrAAType::kNone: |
| 262 | result.append(" none\n"); |
| 263 | break; |
| 264 | case GrAAType::kCoverage: |
| 265 | result.append(" coverage\n"); |
| 266 | break; |
| 267 | case GrAAType::kMSAA: |
| 268 | result.append(" msaa\n"); |
| 269 | break; |
Brian Salomon | b4d6106 | 2017-07-12 11:24:41 -0400 | [diff] [blame] | 270 | } |
Chris Dalton | baa1b35 | 2019-04-03 12:03:00 -0600 | [diff] [blame] | 271 | dump_pipeline_flags(fPipelineFlags, &result); |
Brian Salomon | b4d6106 | 2017-07-12 11:24:41 -0400 | [diff] [blame] | 272 | return result; |
| 273 | } |
Brian Osman | 9a390ac | 2018-11-12 09:47:48 -0500 | [diff] [blame] | 274 | #endif |