Michael Ludwig | 8f68508 | 2018-09-12 15:23:01 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2018 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 | /************************************************************************************************** |
| 9 | *** This file was autogenerated from GrTwoPointConicalGradientLayout.fp; do not modify. |
| 10 | **************************************************************************************************/ |
| 11 | #include "GrTwoPointConicalGradientLayout.h" |
| 12 | #include "glsl/GrGLSLFragmentProcessor.h" |
| 13 | #include "glsl/GrGLSLFragmentShaderBuilder.h" |
| 14 | #include "glsl/GrGLSLProgramBuilder.h" |
| 15 | #include "GrTexture.h" |
| 16 | #include "SkSLCPP.h" |
| 17 | #include "SkSLUtil.h" |
| 18 | class GrGLSLTwoPointConicalGradientLayout : public GrGLSLFragmentProcessor { |
| 19 | public: |
| 20 | GrGLSLTwoPointConicalGradientLayout() {} |
| 21 | void emitCode(EmitArgs& args) override { |
Mike Klein | a2a5cc0 | 2019-03-19 11:30:11 -0500 | [diff] [blame] | 22 | GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; |
Michael Ludwig | 8f68508 | 2018-09-12 15:23:01 -0400 | [diff] [blame] | 23 | const GrTwoPointConicalGradientLayout& _outer = |
| 24 | args.fFp.cast<GrTwoPointConicalGradientLayout>(); |
| 25 | (void)_outer; |
| 26 | auto gradientMatrix = _outer.gradientMatrix(); |
| 27 | (void)gradientMatrix; |
| 28 | auto type = _outer.type(); |
| 29 | (void)type; |
| 30 | auto isRadiusIncreasing = _outer.isRadiusIncreasing(); |
| 31 | (void)isRadiusIncreasing; |
| 32 | auto isFocalOnCircle = _outer.isFocalOnCircle(); |
| 33 | (void)isFocalOnCircle; |
| 34 | auto isWellBehaved = _outer.isWellBehaved(); |
| 35 | (void)isWellBehaved; |
| 36 | auto isSwapped = _outer.isSwapped(); |
| 37 | (void)isSwapped; |
| 38 | auto isNativelyFocal = _outer.isNativelyFocal(); |
| 39 | (void)isNativelyFocal; |
| 40 | auto focalParams = _outer.focalParams(); |
| 41 | (void)focalParams; |
Mike Klein | a2a5cc0 | 2019-03-19 11:30:11 -0500 | [diff] [blame] | 42 | fFocalParamsVar = args.fUniformHandler->addUniform( |
| 43 | kFragment_GrShaderFlag, kHalf2_GrSLType, "focalParams"); |
Michael Ludwig | 8f68508 | 2018-09-12 15:23:01 -0400 | [diff] [blame] | 44 | SkString sk_TransformedCoords2D_0 = fragBuilder->ensureCoords2D(args.fTransformedCoords[0]); |
| 45 | fragBuilder->codeAppendf( |
Michael Ludwig | bf6bf39 | 2018-09-19 16:46:07 -0400 | [diff] [blame] | 46 | "float2 p = %s;\nfloat t = -1.0;\nhalf v = 1.0;\n@switch (%d) {\n case 1:\n " |
Ethan Nicholas | e1f5502 | 2019-02-05 17:17:40 -0500 | [diff] [blame] | 47 | " {\n half r0_2 = %s.y;\n t = float(r0_2) - p.y * p.y;\n " |
| 48 | " if (t >= 0.0) {\n t = p.x + sqrt(t);\n } else " |
| 49 | "{\n v = -1.0;\n }\n }\n break;\n case " |
| 50 | "0:\n {\n half r0 = %s.x;\n @if (%s) {\n " |
| 51 | " t = length(p) - float(r0);\n } else {\n t = " |
| 52 | "-length(p) - float(r0);\n ", |
Mike Klein | a2a5cc0 | 2019-03-19 11:30:11 -0500 | [diff] [blame] | 53 | sk_TransformedCoords2D_0.c_str(), |
| 54 | (int)_outer.type(), |
Michael Ludwig | 8f68508 | 2018-09-12 15:23:01 -0400 | [diff] [blame] | 55 | args.fUniformHandler->getUniformCStr(fFocalParamsVar), |
| 56 | args.fUniformHandler->getUniformCStr(fFocalParamsVar), |
| 57 | (_outer.isRadiusIncreasing() ? "true" : "false")); |
| 58 | fragBuilder->codeAppendf( |
Ethan Nicholas | e1f5502 | 2019-02-05 17:17:40 -0500 | [diff] [blame] | 59 | " }\n }\n break;\n case 2:\n {\n half invR1 " |
| 60 | "= %s.x;\n half fx = %s.y;\n float x_t = -1.0;\n " |
| 61 | "@if (%s) {\n x_t = dot(p, p) / p.x;\n } else if (%s) " |
| 62 | "{\n x_t = length(p) - p.x * float(invR1);\n } else {\n " |
| 63 | " float temp = p.x * p.x - p.y * p.y;\n if (temp >= " |
| 64 | "0.0) {\n @if (%s || !%s) {\n x_t = " |
| 65 | "-sqrt(temp) - p.x * float(invR1)", |
Michael Ludwig | 8f68508 | 2018-09-12 15:23:01 -0400 | [diff] [blame] | 66 | args.fUniformHandler->getUniformCStr(fFocalParamsVar), |
| 67 | args.fUniformHandler->getUniformCStr(fFocalParamsVar), |
| 68 | (_outer.isFocalOnCircle() ? "true" : "false"), |
| 69 | (_outer.isWellBehaved() ? "true" : "false"), |
| 70 | (_outer.isSwapped() ? "true" : "false"), |
| 71 | (_outer.isRadiusIncreasing() ? "true" : "false")); |
| 72 | fragBuilder->codeAppendf( |
Ethan Nicholas | e1f5502 | 2019-02-05 17:17:40 -0500 | [diff] [blame] | 73 | ";\n } else {\n x_t = sqrt(temp) - p.x * " |
| 74 | "float(invR1);\n }\n }\n }\n " |
| 75 | " @if (!%s) {\n if (x_t <= 0.0) {\n v = -1.0;\n " |
| 76 | " }\n }\n @if (%s) {\n @if (%s) " |
| 77 | "{\n t = x_t;\n } else {\n t " |
| 78 | "= x_t + float(fx);\n }\n } else {\n @if " |
| 79 | "(%s) {\n ", |
Michael Ludwig | 8f68508 | 2018-09-12 15:23:01 -0400 | [diff] [blame] | 80 | (_outer.isWellBehaved() ? "true" : "false"), |
| 81 | (_outer.isRadiusIncreasing() ? "true" : "false"), |
| 82 | (_outer.isNativelyFocal() ? "true" : "false"), |
| 83 | (_outer.isNativelyFocal() ? "true" : "false")); |
| 84 | fragBuilder->codeAppendf( |
Ethan Nicholas | e1f5502 | 2019-02-05 17:17:40 -0500 | [diff] [blame] | 85 | " t = -x_t;\n } else {\n t = -x_t + " |
Michael Ludwig | bf6bf39 | 2018-09-19 16:46:07 -0400 | [diff] [blame] | 86 | "float(fx);\n }\n }\n @if (%s) {\n " |
| 87 | " t = 1.0 - t;\n }\n }\n break;\n}\n%s = " |
| 88 | "half4(half(t), v, 0.0, 0.0);\n", |
Mike Klein | a2a5cc0 | 2019-03-19 11:30:11 -0500 | [diff] [blame] | 89 | (_outer.isSwapped() ? "true" : "false"), |
| 90 | args.fOutputColor); |
Michael Ludwig | 8f68508 | 2018-09-12 15:23:01 -0400 | [diff] [blame] | 91 | } |
| 92 | |
| 93 | private: |
| 94 | void onSetData(const GrGLSLProgramDataManager& pdman, |
Mike Klein | a2a5cc0 | 2019-03-19 11:30:11 -0500 | [diff] [blame] | 95 | const GrFragmentProcessor& _proc) override { |
Michael Ludwig | 8f68508 | 2018-09-12 15:23:01 -0400 | [diff] [blame] | 96 | const GrTwoPointConicalGradientLayout& _outer = |
| 97 | _proc.cast<GrTwoPointConicalGradientLayout>(); |
| 98 | { |
| 99 | const SkPoint& focalParamsValue = _outer.focalParams(); |
| 100 | if (fFocalParamsPrev != focalParamsValue) { |
| 101 | fFocalParamsPrev = focalParamsValue; |
| 102 | pdman.set2f(fFocalParamsVar, focalParamsValue.fX, focalParamsValue.fY); |
| 103 | } |
| 104 | } |
| 105 | } |
Mike Klein | a2a5cc0 | 2019-03-19 11:30:11 -0500 | [diff] [blame] | 106 | SkPoint fFocalParamsPrev = SkPoint::Make(SK_FloatNaN, SK_FloatNaN); |
Michael Ludwig | 8f68508 | 2018-09-12 15:23:01 -0400 | [diff] [blame] | 107 | UniformHandle fFocalParamsVar; |
| 108 | }; |
| 109 | GrGLSLFragmentProcessor* GrTwoPointConicalGradientLayout::onCreateGLSLInstance() const { |
| 110 | return new GrGLSLTwoPointConicalGradientLayout(); |
| 111 | } |
Mike Klein | a2a5cc0 | 2019-03-19 11:30:11 -0500 | [diff] [blame] | 112 | void GrTwoPointConicalGradientLayout::onGetGLSLProcessorKey(const GrShaderCaps& caps, |
Michael Ludwig | 8f68508 | 2018-09-12 15:23:01 -0400 | [diff] [blame] | 113 | GrProcessorKeyBuilder* b) const { |
| 114 | b->add32((int32_t)fType); |
| 115 | b->add32((int32_t)fIsRadiusIncreasing); |
| 116 | b->add32((int32_t)fIsFocalOnCircle); |
| 117 | b->add32((int32_t)fIsWellBehaved); |
| 118 | b->add32((int32_t)fIsSwapped); |
| 119 | b->add32((int32_t)fIsNativelyFocal); |
| 120 | } |
| 121 | bool GrTwoPointConicalGradientLayout::onIsEqual(const GrFragmentProcessor& other) const { |
| 122 | const GrTwoPointConicalGradientLayout& that = other.cast<GrTwoPointConicalGradientLayout>(); |
| 123 | (void)that; |
Mike Klein | a2a5cc0 | 2019-03-19 11:30:11 -0500 | [diff] [blame] | 124 | if (fGradientMatrix != that.fGradientMatrix) |
| 125 | return false; |
| 126 | if (fType != that.fType) |
| 127 | return false; |
| 128 | if (fIsRadiusIncreasing != that.fIsRadiusIncreasing) |
| 129 | return false; |
| 130 | if (fIsFocalOnCircle != that.fIsFocalOnCircle) |
| 131 | return false; |
| 132 | if (fIsWellBehaved != that.fIsWellBehaved) |
| 133 | return false; |
| 134 | if (fIsSwapped != that.fIsSwapped) |
| 135 | return false; |
| 136 | if (fIsNativelyFocal != that.fIsNativelyFocal) |
| 137 | return false; |
| 138 | if (fFocalParams != that.fFocalParams) |
| 139 | return false; |
Michael Ludwig | 8f68508 | 2018-09-12 15:23:01 -0400 | [diff] [blame] | 140 | return true; |
| 141 | } |
| 142 | GrTwoPointConicalGradientLayout::GrTwoPointConicalGradientLayout( |
| 143 | const GrTwoPointConicalGradientLayout& src) |
| 144 | : INHERITED(kGrTwoPointConicalGradientLayout_ClassID, src.optimizationFlags()) |
| 145 | , fGradientMatrix(src.fGradientMatrix) |
| 146 | , fType(src.fType) |
| 147 | , fIsRadiusIncreasing(src.fIsRadiusIncreasing) |
| 148 | , fIsFocalOnCircle(src.fIsFocalOnCircle) |
| 149 | , fIsWellBehaved(src.fIsWellBehaved) |
| 150 | , fIsSwapped(src.fIsSwapped) |
| 151 | , fIsNativelyFocal(src.fIsNativelyFocal) |
| 152 | , fFocalParams(src.fFocalParams) |
| 153 | , fCoordTransform0(src.fCoordTransform0) { |
| 154 | this->addCoordTransform(&fCoordTransform0); |
| 155 | } |
| 156 | std::unique_ptr<GrFragmentProcessor> GrTwoPointConicalGradientLayout::clone() const { |
| 157 | return std::unique_ptr<GrFragmentProcessor>(new GrTwoPointConicalGradientLayout(*this)); |
| 158 | } |
Michael Ludwig | 7f8c524 | 2018-09-14 15:07:55 -0400 | [diff] [blame] | 159 | GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrTwoPointConicalGradientLayout); |
| 160 | #if GR_TEST_UTILS |
| 161 | std::unique_ptr<GrFragmentProcessor> GrTwoPointConicalGradientLayout::TestCreate( |
| 162 | GrProcessorTestData* d) { |
Mike Klein | a2a5cc0 | 2019-03-19 11:30:11 -0500 | [diff] [blame] | 163 | SkScalar scale = GrGradientShader::RandomParams::kGradientScale; |
Michael Ludwig | 083bc15 | 2018-10-01 17:15:15 -0400 | [diff] [blame] | 164 | SkScalar offset = scale / 32.0f; |
| 165 | |
Mike Klein | a2a5cc0 | 2019-03-19 11:30:11 -0500 | [diff] [blame] | 166 | SkPoint center1 = {d->fRandom->nextRangeScalar(0.0f, scale), |
Michael Ludwig | 083bc15 | 2018-10-01 17:15:15 -0400 | [diff] [blame] | 167 | d->fRandom->nextRangeScalar(0.0f, scale)}; |
Mike Klein | a2a5cc0 | 2019-03-19 11:30:11 -0500 | [diff] [blame] | 168 | SkPoint center2 = {d->fRandom->nextRangeScalar(0.0f, scale), |
Michael Ludwig | 083bc15 | 2018-10-01 17:15:15 -0400 | [diff] [blame] | 169 | d->fRandom->nextRangeScalar(0.0f, scale)}; |
| 170 | SkScalar radius1 = d->fRandom->nextRangeScalar(0.0f, scale); |
| 171 | SkScalar radius2 = d->fRandom->nextRangeScalar(0.0f, scale); |
Michael Ludwig | 7f8c524 | 2018-09-14 15:07:55 -0400 | [diff] [blame] | 172 | |
| 173 | constexpr int kTestTypeMask = (1 << 2) - 1, kTestNativelyFocalBit = (1 << 2), |
| 174 | kTestFocalOnCircleBit = (1 << 3), kTestSwappedBit = (1 << 4); |
| 175 | // We won't treat isWellDefined and isRadiusIncreasing specially because they |
| 176 | // should have high probability to be turned on and off as we're getting random |
| 177 | // radii and centers. |
| 178 | |
| 179 | int mask = d->fRandom->nextU(); |
| 180 | int type = mask & kTestTypeMask; |
| 181 | if (type == static_cast<int>(Type::kRadial)) { |
| 182 | center2 = center1; |
| 183 | // Make sure that the radii are different |
| 184 | if (SkScalarNearlyZero(radius1 - radius2)) { |
Michael Ludwig | 083bc15 | 2018-10-01 17:15:15 -0400 | [diff] [blame] | 185 | radius2 += offset; |
Michael Ludwig | 7f8c524 | 2018-09-14 15:07:55 -0400 | [diff] [blame] | 186 | } |
| 187 | } else if (type == static_cast<int>(Type::kStrip)) { |
| 188 | radius1 = SkTMax(radius1, .1f); // Make sure that the radius is non-zero |
| 189 | radius2 = radius1; |
| 190 | // Make sure that the centers are different |
| 191 | if (SkScalarNearlyZero(SkPoint::Distance(center1, center2))) { |
Michael Ludwig | 083bc15 | 2018-10-01 17:15:15 -0400 | [diff] [blame] | 192 | center2.fX += offset; |
Michael Ludwig | 7f8c524 | 2018-09-14 15:07:55 -0400 | [diff] [blame] | 193 | } |
| 194 | } else { // kFocal_Type |
| 195 | // Make sure that the centers are different |
| 196 | if (SkScalarNearlyZero(SkPoint::Distance(center1, center2))) { |
Michael Ludwig | 083bc15 | 2018-10-01 17:15:15 -0400 | [diff] [blame] | 197 | center2.fX += offset; |
Michael Ludwig | 7f8c524 | 2018-09-14 15:07:55 -0400 | [diff] [blame] | 198 | } |
| 199 | |
| 200 | if (kTestNativelyFocalBit & mask) { |
| 201 | radius1 = 0; |
| 202 | } |
| 203 | if (kTestFocalOnCircleBit & mask) { |
| 204 | radius2 = radius1 + SkPoint::Distance(center1, center2); |
| 205 | } |
| 206 | if (kTestSwappedBit & mask) { |
| 207 | std::swap(radius1, radius2); |
| 208 | radius2 = 0; |
| 209 | } |
| 210 | |
| 211 | // Make sure that the radii are different |
| 212 | if (SkScalarNearlyZero(radius1 - radius2)) { |
Michael Ludwig | 083bc15 | 2018-10-01 17:15:15 -0400 | [diff] [blame] | 213 | radius2 += offset; |
Michael Ludwig | 7f8c524 | 2018-09-14 15:07:55 -0400 | [diff] [blame] | 214 | } |
| 215 | } |
| 216 | |
| 217 | if (SkScalarNearlyZero(radius1 - radius2) && |
| 218 | SkScalarNearlyZero(SkPoint::Distance(center1, center2))) { |
Michael Ludwig | 083bc15 | 2018-10-01 17:15:15 -0400 | [diff] [blame] | 219 | radius2 += offset; // make sure that we're not degenerated |
Michael Ludwig | 7f8c524 | 2018-09-14 15:07:55 -0400 | [diff] [blame] | 220 | } |
| 221 | |
| 222 | GrGradientShader::RandomParams params(d->fRandom); |
Mike Klein | a2a5cc0 | 2019-03-19 11:30:11 -0500 | [diff] [blame] | 223 | auto shader = params.fUseColors4f ? SkGradientShader::MakeTwoPointConical(center1, |
| 224 | radius1, |
| 225 | center2, |
| 226 | radius2, |
| 227 | params.fColors4f, |
| 228 | params.fColorSpace, |
| 229 | params.fStops, |
| 230 | params.fColorCount, |
| 231 | params.fTileMode) |
| 232 | : SkGradientShader::MakeTwoPointConical(center1, |
| 233 | radius1, |
| 234 | center2, |
| 235 | radius2, |
| 236 | params.fColors, |
| 237 | params.fStops, |
| 238 | params.fColorCount, |
| 239 | params.fTileMode); |
| 240 | GrTest::TestAsFPArgs asFPArgs(d); |
Michael Ludwig | 7f8c524 | 2018-09-14 15:07:55 -0400 | [diff] [blame] | 241 | std::unique_ptr<GrFragmentProcessor> fp = as_SB(shader)->asFragmentProcessor(asFPArgs.args()); |
| 242 | |
| 243 | GrAlwaysAssert(fp); |
| 244 | return fp; |
| 245 | } |
| 246 | #endif |
Michael Ludwig | 8f68508 | 2018-09-12 15:23:01 -0400 | [diff] [blame] | 247 | |
| 248 | // .fp files do not let you reference outside enum definitions, so we have to explicitly map |
| 249 | // between the two compatible enum defs |
| 250 | GrTwoPointConicalGradientLayout::Type convert_type(SkTwoPointConicalGradient::Type type) { |
| 251 | switch (type) { |
| 252 | case SkTwoPointConicalGradient::Type::kRadial: |
| 253 | return GrTwoPointConicalGradientLayout::Type::kRadial; |
| 254 | case SkTwoPointConicalGradient::Type::kStrip: |
| 255 | return GrTwoPointConicalGradientLayout::Type::kStrip; |
| 256 | case SkTwoPointConicalGradient::Type::kFocal: |
| 257 | return GrTwoPointConicalGradientLayout::Type::kFocal; |
| 258 | } |
| 259 | SkDEBUGFAIL("Should not be reachable"); |
| 260 | return GrTwoPointConicalGradientLayout::Type::kRadial; |
| 261 | } |
| 262 | |
| 263 | std::unique_ptr<GrFragmentProcessor> GrTwoPointConicalGradientLayout::Make( |
Mike Klein | a2a5cc0 | 2019-03-19 11:30:11 -0500 | [diff] [blame] | 264 | const SkTwoPointConicalGradient& grad, |
| 265 | const GrFPArgs& args) { |
Michael Ludwig | 8f68508 | 2018-09-12 15:23:01 -0400 | [diff] [blame] | 266 | GrTwoPointConicalGradientLayout::Type grType = convert_type(grad.getType()); |
| 267 | |
| 268 | // The focalData struct is only valid if isFocal is true |
| 269 | const SkTwoPointConicalGradient::FocalData& focalData = grad.getFocalData(); |
Mike Klein | a2a5cc0 | 2019-03-19 11:30:11 -0500 | [diff] [blame] | 270 | bool isFocal = grType == Type::kFocal; |
Michael Ludwig | 8f68508 | 2018-09-12 15:23:01 -0400 | [diff] [blame] | 271 | |
| 272 | // Calculate optimization switches from gradient specification |
| 273 | bool isFocalOnCircle = isFocal && focalData.isFocalOnCircle(); |
Mike Klein | a2a5cc0 | 2019-03-19 11:30:11 -0500 | [diff] [blame] | 274 | bool isWellBehaved = isFocal && focalData.isWellBehaved(); |
| 275 | bool isSwapped = isFocal && focalData.isSwapped(); |
Michael Ludwig | 8f68508 | 2018-09-12 15:23:01 -0400 | [diff] [blame] | 276 | bool isNativelyFocal = isFocal && focalData.isNativelyFocal(); |
| 277 | |
| 278 | // Type-specific calculations: isRadiusIncreasing, focalParams, and the gradient matrix. |
| 279 | // However, all types start with the total inverse local matrix calculated from the shader |
| 280 | // and args |
Mike Klein | a2a5cc0 | 2019-03-19 11:30:11 -0500 | [diff] [blame] | 281 | bool isRadiusIncreasing; |
| 282 | SkPoint focalParams; // really just a 2D tuple |
Michael Ludwig | 8f68508 | 2018-09-12 15:23:01 -0400 | [diff] [blame] | 283 | SkMatrix matrix; |
| 284 | |
| 285 | // Initialize the base matrix |
| 286 | if (!grad.totalLocalMatrix(args.fPreLocalMatrix, args.fPostLocalMatrix)->invert(&matrix)) { |
| 287 | return nullptr; |
| 288 | } |
| 289 | |
| 290 | if (isFocal) { |
| 291 | isRadiusIncreasing = (1 - focalData.fFocalX) > 0; |
| 292 | |
| 293 | focalParams.set(1.0 / focalData.fR1, focalData.fFocalX); |
| 294 | |
| 295 | matrix.postConcat(grad.getGradientMatrix()); |
| 296 | } else if (grType == Type::kRadial) { |
Mike Klein | a2a5cc0 | 2019-03-19 11:30:11 -0500 | [diff] [blame] | 297 | SkScalar dr = grad.getDiffRadius(); |
Michael Ludwig | 8f68508 | 2018-09-12 15:23:01 -0400 | [diff] [blame] | 298 | isRadiusIncreasing = dr >= 0; |
| 299 | |
| 300 | SkScalar r0 = grad.getStartRadius() / dr; |
| 301 | focalParams.set(r0, r0 * r0); |
| 302 | |
| 303 | // GPU radial matrix is different from the original matrix, since we map the diff radius |
| 304 | // to have |dr| = 1, so manually compute the final gradient matrix here. |
| 305 | |
| 306 | // Map center to (0, 0) |
| 307 | matrix.postTranslate(-grad.getStartCenter().fX, -grad.getStartCenter().fY); |
| 308 | |
| 309 | // scale |diffRadius| to 1 |
| 310 | matrix.postScale(1 / dr, 1 / dr); |
| 311 | } else { // kStrip |
| 312 | isRadiusIncreasing = false; // kStrip doesn't use this flag |
| 313 | |
| 314 | SkScalar r0 = grad.getStartRadius() / grad.getCenterX1(); |
| 315 | focalParams.set(r0, r0 * r0); |
| 316 | |
| 317 | matrix.postConcat(grad.getGradientMatrix()); |
| 318 | } |
| 319 | |
Mike Klein | a2a5cc0 | 2019-03-19 11:30:11 -0500 | [diff] [blame] | 320 | return std::unique_ptr<GrFragmentProcessor>( |
| 321 | new GrTwoPointConicalGradientLayout(matrix, |
| 322 | grType, |
| 323 | isRadiusIncreasing, |
| 324 | isFocalOnCircle, |
| 325 | isWellBehaved, |
| 326 | isSwapped, |
| 327 | isNativelyFocal, |
| 328 | focalParams)); |
Michael Ludwig | 8f68508 | 2018-09-12 15:23:01 -0400 | [diff] [blame] | 329 | } |