blob: 4aac3d3d021786ab3e6a2e03fe56d8933b498216 [file] [log] [blame]
Chris Dalton1a325d22017-07-14 15:17:41 -06001/*
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 "GrCCPRCoverageProcessor.h"
9
Robert Phillips2890fbf2017-07-26 15:48:41 -040010#include "GrRenderTargetProxy.h"
Chris Dalton1a325d22017-07-14 15:17:41 -060011#include "ccpr/GrCCPRTriangleProcessor.h"
12#include "ccpr/GrCCPRQuadraticProcessor.h"
13#include "ccpr/GrCCPRCubicProcessor.h"
14#include "glsl/GrGLSLFragmentShaderBuilder.h"
15#include "glsl/GrGLSLGeometryShaderBuilder.h"
16#include "glsl/GrGLSLProgramBuilder.h"
17#include "glsl/GrGLSLVertexShaderBuilder.h"
18
19const char* GrCCPRCoverageProcessor::GetProcessorName(Mode mode) {
20 switch (mode) {
21 case Mode::kTriangleHulls:
22 return "GrCCPRTriangleHullAndEdgeProcessor (hulls)";
23 case Mode::kTriangleEdges:
24 return "GrCCPRTriangleHullAndEdgeProcessor (edges)";
25 case Mode::kCombinedTriangleHullsAndEdges:
26 return "GrCCPRTriangleHullAndEdgeProcessor (combined hulls & edges)";
27 case Mode::kTriangleCorners:
28 return "GrCCPRTriangleCornerProcessor";
29 case Mode::kQuadraticHulls:
30 return "GrCCPRQuadraticHullProcessor";
Chris Daltonb072bb62017-08-07 09:00:46 -060031 case Mode::kQuadraticCorners:
32 return "GrCCPRQuadraticCornerProcessor";
Chris Dalton7f578bf2017-09-05 16:46:48 -060033 case Mode::kSerpentineHulls:
34 return "GrCCPRCubicHullProcessor (serpentine)";
35 case Mode::kLoopHulls:
36 return "GrCCPRCubicHullProcessor (loop)";
37 case Mode::kSerpentineCorners:
38 return "GrCCPRCubicCornerProcessor (serpentine)";
39 case Mode::kLoopCorners:
40 return "GrCCPRCubicCornerProcessor (loop)";
Chris Dalton1a325d22017-07-14 15:17:41 -060041 }
Ben Wagnerb4aab9a2017-08-16 10:53:04 -040042 SK_ABORT("Unexpected ccpr coverage processor mode.");
Chris Dalton1a325d22017-07-14 15:17:41 -060043 return nullptr;
44}
45
46GrCCPRCoverageProcessor::GrCCPRCoverageProcessor(Mode mode, GrBuffer* pointsBuffer)
47 : fMode(mode)
Chris Daltonc1e59632017-09-05 00:30:07 -060048 , fInstanceAttrib(this->addInstanceAttrib("instance", InstanceArrayFormat(mode),
Chris Dalton1a325d22017-07-14 15:17:41 -060049 kHigh_GrSLPrecision)) {
50 fPointsBufferAccess.reset(kRG_float_GrPixelConfig, pointsBuffer, kVertex_GrShaderFlag);
51 this->addBufferAccess(&fPointsBufferAccess);
52
53 this->setWillUseGeoShader();
54
55 this->initClassID<GrCCPRCoverageProcessor>();
56}
57
58void GrCCPRCoverageProcessor::getGLSLProcessorKey(const GrShaderCaps&,
59 GrProcessorKeyBuilder* b) const {
60 b->add32(int(fMode));
61}
62
63GrGLSLPrimitiveProcessor* GrCCPRCoverageProcessor::createGLSLInstance(const GrShaderCaps&) const {
64 switch (fMode) {
65 using GeometryType = GrCCPRTriangleHullAndEdgeProcessor::GeometryType;
66
67 case Mode::kTriangleHulls:
68 return new GrCCPRTriangleHullAndEdgeProcessor(GeometryType::kHulls);
69 case Mode::kTriangleEdges:
70 return new GrCCPRTriangleHullAndEdgeProcessor(GeometryType::kEdges);
71 case Mode::kCombinedTriangleHullsAndEdges:
72 return new GrCCPRTriangleHullAndEdgeProcessor(GeometryType::kHullsAndEdges);
73 case Mode::kTriangleCorners:
74 return new GrCCPRTriangleCornerProcessor();
75 case Mode::kQuadraticHulls:
76 return new GrCCPRQuadraticHullProcessor();
Chris Daltonb072bb62017-08-07 09:00:46 -060077 case Mode::kQuadraticCorners:
78 return new GrCCPRQuadraticCornerProcessor();
Chris Dalton7f578bf2017-09-05 16:46:48 -060079 case Mode::kSerpentineHulls:
80 return new GrCCPRCubicHullProcessor(GrCCPRCubicProcessor::CubicType::kSerpentine);
81 case Mode::kLoopHulls:
82 return new GrCCPRCubicHullProcessor(GrCCPRCubicProcessor::CubicType::kLoop);
83 case Mode::kSerpentineCorners:
84 return new GrCCPRCubicCornerProcessor(GrCCPRCubicProcessor::CubicType::kSerpentine);
85 case Mode::kLoopCorners:
86 return new GrCCPRCubicCornerProcessor(GrCCPRCubicProcessor::CubicType::kLoop);
Chris Dalton1a325d22017-07-14 15:17:41 -060087 }
Ben Wagnerb4aab9a2017-08-16 10:53:04 -040088 SK_ABORT("Unexpected ccpr coverage processor mode.");
Chris Dalton1a325d22017-07-14 15:17:41 -060089 return nullptr;
90}
91
92using PrimitiveProcessor = GrCCPRCoverageProcessor::PrimitiveProcessor;
93
94void PrimitiveProcessor::onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) {
95 const GrCCPRCoverageProcessor& proc = args.fGP.cast<GrCCPRCoverageProcessor>();
96
97 GrGLSLVaryingHandler* varyingHandler = args.fVaryingHandler;
98 switch (fCoverageType) {
99 case CoverageType::kOne:
100 case CoverageType::kShader:
101 varyingHandler->addFlatVarying("wind", &fFragWind, kLow_GrSLPrecision);
102 break;
103 case CoverageType::kInterpolated:
104 varyingHandler->addVarying("coverage_times_wind", &fFragCoverageTimesWind,
105 kMedium_GrSLPrecision);
106 break;
107 }
108 this->resetVaryings(varyingHandler);
109
110 varyingHandler->emitAttributes(proc);
111
112 this->emitVertexShader(proc, args.fVertBuilder, args.fTexelBuffers[0], args.fRTAdjustName,
113 gpArgs);
114 this->emitGeometryShader(proc, args.fGeomBuilder, args.fRTAdjustName);
115 this->emitCoverage(proc, args.fFragBuilder, args.fOutputColor, args.fOutputCoverage);
116
117 SkASSERT(!args.fFPCoordTransformHandler->nextCoordTransform());
118}
119
120void PrimitiveProcessor::emitVertexShader(const GrCCPRCoverageProcessor& proc,
121 GrGLSLVertexBuilder* v,
122 const TexelBufferHandle& pointsBuffer,
123 const char* rtAdjust, GrGPArgs* gpArgs) const {
Chris Daltonc1e59632017-09-05 00:30:07 -0600124 v->codeAppendf("int packedoffset = %s[%i];", proc.instanceAttrib(), proc.atlasOffsetIdx());
Ethan Nicholasf7b88202017-09-18 14:10:39 -0400125 v->codeAppend ("highfloat2 atlasoffset = highfloat2((packedoffset<<16) >> 16, "
126 "packedoffset >> 16);");
Chris Dalton1a325d22017-07-14 15:17:41 -0600127
128 this->onEmitVertexShader(proc, v, pointsBuffer, "atlasoffset", rtAdjust, gpArgs);
129}
130
131void PrimitiveProcessor::emitGeometryShader(const GrCCPRCoverageProcessor& proc,
132 GrGLSLGeometryBuilder* g, const char* rtAdjust) const {
133 g->declareGlobal(fGeomWind);
134 this->emitWind(g, rtAdjust, fGeomWind.c_str());
135
136 SkString emitVertexFn;
137 SkSTArray<2, GrShaderVar> emitArgs;
Ethan Nicholasf7b88202017-09-18 14:10:39 -0400138 const char* position = emitArgs.emplace_back("position", kHighFloat2_GrSLType,
139 GrShaderVar::kNonArray).c_str();
140 const char* coverage = emitArgs.emplace_back("coverage", kHighFloat_GrSLType,
141 GrShaderVar::kNonArray).c_str();
Chris Dalton1a325d22017-07-14 15:17:41 -0600142 g->emitFunction(kVoid_GrSLType, "emitVertex", emitArgs.count(), emitArgs.begin(), [&]() {
143 SkString fnBody;
144 this->emitPerVertexGeometryCode(&fnBody, position, coverage, fGeomWind.c_str());
145 if (fFragWind.gsOut()) {
146 fnBody.appendf("%s = %s;", fFragWind.gsOut(), fGeomWind.c_str());
147 }
148 if (fFragCoverageTimesWind.gsOut()) {
149 fnBody.appendf("%s = %s * %s;",
150 fFragCoverageTimesWind.gsOut(), coverage, fGeomWind.c_str());
151 }
Ethan Nicholasf7b88202017-09-18 14:10:39 -0400152 fnBody.append ("gl_Position = highfloat4(position, 0, 1);");
Chris Dalton1a325d22017-07-14 15:17:41 -0600153 fnBody.append ("EmitVertex();");
154 return fnBody;
155 }().c_str(), &emitVertexFn);
156
Ethan Nicholasf7b88202017-09-18 14:10:39 -0400157 g->codeAppendf("highfloat2 bloat = %f * abs(%s.xz);", kAABloatRadius, rtAdjust);
Chris Dalton1a325d22017-07-14 15:17:41 -0600158
159#ifdef SK_DEBUG
Chris Daltona640c492017-09-11 22:04:03 -0700160 if (proc.debugVisualizationsEnabled()) {
161 g->codeAppendf("bloat *= %f;", proc.debugBloat());
Chris Dalton1a325d22017-07-14 15:17:41 -0600162 }
163#endif
164
165 return this->onEmitGeometryShader(g, emitVertexFn.c_str(), fGeomWind.c_str(), rtAdjust);
166}
167
168int PrimitiveProcessor::emitHullGeometry(GrGLSLGeometryBuilder* g, const char* emitVertexFn,
169 const char* polygonPts, int numSides,
Chris Dalton7f578bf2017-09-05 16:46:48 -0600170 const char* wedgeIdx, const char* midpoint) const {
Chris Dalton1a325d22017-07-14 15:17:41 -0600171 SkASSERT(numSides >= 3);
172
Chris Dalton7f578bf2017-09-05 16:46:48 -0600173 if (!midpoint) {
Ethan Nicholasf7b88202017-09-18 14:10:39 -0400174 g->codeAppendf("highfloat2 midpoint = %s * highfloat%i(%f);",
Chris Dalton1a325d22017-07-14 15:17:41 -0600175 polygonPts, numSides, 1.0 / numSides);
Chris Dalton7f578bf2017-09-05 16:46:48 -0600176 midpoint = "midpoint";
Chris Dalton1a325d22017-07-14 15:17:41 -0600177 }
178
179 g->codeAppendf("int previdx = (%s + %i) %% %i, "
180 "nextidx = (%s + 1) %% %i;",
181 wedgeIdx, numSides - 1, numSides, wedgeIdx, numSides);
182
Ethan Nicholasf7b88202017-09-18 14:10:39 -0400183 g->codeAppendf("highfloat2 self = %s[%s];"
184 "int leftidx = %s > 0 ? previdx : nextidx;"
185 "int rightidx = %s > 0 ? nextidx : previdx;",
Chris Dalton1a325d22017-07-14 15:17:41 -0600186 polygonPts, wedgeIdx, fGeomWind.c_str(), fGeomWind.c_str());
187
188 // Which quadrant does the vector from self -> right fall into?
Ethan Nicholasf7b88202017-09-18 14:10:39 -0400189 g->codeAppendf("highfloat2 right = %s[rightidx];", polygonPts);
Chris Dalton1a325d22017-07-14 15:17:41 -0600190 if (3 == numSides) {
191 // TODO: evaluate perf gains.
Ethan Nicholasf7b88202017-09-18 14:10:39 -0400192 g->codeAppend ("highfloat2 qsr = sign(right - self);");
Chris Dalton1a325d22017-07-14 15:17:41 -0600193 } else {
194 SkASSERT(4 == numSides);
Ethan Nicholasf7b88202017-09-18 14:10:39 -0400195 g->codeAppendf("highfloat2 diag = %s[(%s + 2) %% 4];", polygonPts, wedgeIdx);
196 g->codeAppend ("highfloat2 qsr = sign((right != self ? right : diag) - self);");
Chris Dalton1a325d22017-07-14 15:17:41 -0600197 }
198
199 // Which quadrant does the vector from left -> self fall into?
Ethan Nicholasf7b88202017-09-18 14:10:39 -0400200 g->codeAppendf("highfloat2 qls = sign(self - %s[leftidx]);", polygonPts);
Chris Dalton1a325d22017-07-14 15:17:41 -0600201
202 // d2 just helps us reduce triangle counts with orthogonal, axis-aligned lines.
203 // TODO: evaluate perf gains.
204 const char* dr2 = "dr";
205 if (3 == numSides) {
206 // TODO: evaluate perf gains.
Ethan Nicholasf7b88202017-09-18 14:10:39 -0400207 g->codeAppend ("highfloat2 dr = highfloat2(qsr.y != 0 ? +qsr.y : +qsr.x, "
208 "qsr.x != 0 ? -qsr.x : +qsr.y);");
209 g->codeAppend ("highfloat2 dr2 = highfloat2(qsr.y != 0 ? +qsr.y : -qsr.x, "
210 "qsr.x != 0 ? -qsr.x : -qsr.y);");
211 g->codeAppend ("highfloat2 dl = highfloat2(qls.y != 0 ? +qls.y : +qls.x, "
212 "qls.x != 0 ? -qls.x : +qls.y);");
Chris Dalton1a325d22017-07-14 15:17:41 -0600213 dr2 = "dr2";
214 } else {
Ethan Nicholasf7b88202017-09-18 14:10:39 -0400215 g->codeAppend ("highfloat2 dr = highfloat2(qsr.y != 0 ? +qsr.y : 1, "
216 "qsr.x != 0 ? -qsr.x : 1);");
217 g->codeAppend ("highfloat2 dl = (qls == highfloat2(0)) ? dr : "
218 "highfloat2(qls.y != 0 ? +qls.y : 1, qls.x != 0 ? -qls.x : 1);");
Chris Dalton1a325d22017-07-14 15:17:41 -0600219 }
Ethan Nicholas5af9ea32017-07-28 15:19:46 -0400220 g->codeAppendf("bool2 dnotequal = notEqual(%s, dl);", dr2);
Chris Dalton1a325d22017-07-14 15:17:41 -0600221
222 // Emit one third of what is the convex hull of pixel-size boxes centered on the vertices.
223 // Each invocation emits a different third.
Chris Dalton1a325d22017-07-14 15:17:41 -0600224 g->codeAppendf("%s(right + bloat * dr, 1);", emitVertexFn);
Chris Dalton7f578bf2017-09-05 16:46:48 -0600225 g->codeAppendf("%s(%s, 1);", emitVertexFn, midpoint);
Chris Dalton1a325d22017-07-14 15:17:41 -0600226 g->codeAppendf("%s(self + bloat * %s, 1);", emitVertexFn, dr2);
227 g->codeAppend ("if (any(dnotequal)) {");
228 g->codeAppendf( "%s(self + bloat * dl, 1);", emitVertexFn);
229 g->codeAppend ("}");
230 g->codeAppend ("if (all(dnotequal)) {");
Ethan Nicholasf7b88202017-09-18 14:10:39 -0400231 g->codeAppendf( "%s(self + bloat * highfloat2(-dl.y, dl.x), 1);", emitVertexFn);
Chris Dalton1a325d22017-07-14 15:17:41 -0600232 g->codeAppend ("}");
233 g->codeAppend ("EndPrimitive();");
234
Chris Dalton7f578bf2017-09-05 16:46:48 -0600235 return 5;
Chris Dalton1a325d22017-07-14 15:17:41 -0600236}
237
238int PrimitiveProcessor::emitEdgeGeometry(GrGLSLGeometryBuilder* g, const char* emitVertexFn,
239 const char* leftPt, const char* rightPt,
240 const char* distanceEquation) const {
241 if (!distanceEquation) {
Ethan Nicholasf7b88202017-09-18 14:10:39 -0400242 this->emitEdgeDistanceEquation(g, leftPt, rightPt, "highfloat3 edge_distance_equation");
Chris Dalton1a325d22017-07-14 15:17:41 -0600243 distanceEquation = "edge_distance_equation";
244 }
245
246 // qlr is defined in emitEdgeDistanceEquation.
Ethan Nicholasf7b88202017-09-18 14:10:39 -0400247 g->codeAppendf("highfloat2x2 endpts = highfloat2x2(%s - bloat * qlr, %s + bloat * qlr);",
Chris Dalton1a325d22017-07-14 15:17:41 -0600248 leftPt, rightPt);
Ethan Nicholasf7b88202017-09-18 14:10:39 -0400249 g->codeAppendf("half2 endpts_coverage = %s.xy * endpts + %s.z;",
Chris Dalton1a325d22017-07-14 15:17:41 -0600250 distanceEquation, distanceEquation);
251
252 // d1 is defined in emitEdgeDistanceEquation.
Ethan Nicholasf7b88202017-09-18 14:10:39 -0400253 g->codeAppend ("highfloat2 d2 = d1;");
Chris Dalton1a325d22017-07-14 15:17:41 -0600254 g->codeAppend ("bool aligned = qlr.x == 0 || qlr.y == 0;");
255 g->codeAppend ("if (aligned) {");
256 g->codeAppend ( "d1 -= qlr;");
257 g->codeAppend ( "d2 += qlr;");
258 g->codeAppend ("}");
259
260 // Emit the convex hull of 2 pixel-size boxes centered on the endpoints of the edge. Each
261 // invocation emits a different edge. Emit negative coverage that subtracts the appropiate
262 // amount back out from the hull we drew above.
263 g->codeAppend ("if (!aligned) {");
264 g->codeAppendf( "%s(endpts[0], endpts_coverage[0]);", emitVertexFn);
265 g->codeAppend ("}");
266 g->codeAppendf("%s(%s + bloat * d1, -1);", emitVertexFn, leftPt);
267 g->codeAppendf("%s(%s - bloat * d2, 0);", emitVertexFn, leftPt);
268 g->codeAppendf("%s(%s + bloat * d2, -1);", emitVertexFn, rightPt);
269 g->codeAppendf("%s(%s - bloat * d1, 0);", emitVertexFn, rightPt);
270 g->codeAppend ("if (!aligned) {");
271 g->codeAppendf( "%s(endpts[1], endpts_coverage[1]);", emitVertexFn);
272 g->codeAppend ("}");
273 g->codeAppend ("EndPrimitive();");
274
275 return 6;
276}
277
278void PrimitiveProcessor::emitEdgeDistanceEquation(GrGLSLGeometryBuilder* g,
279 const char* leftPt, const char* rightPt,
280 const char* outputDistanceEquation) const {
281 // Which quadrant does the vector from left -> right fall into?
Ethan Nicholasf7b88202017-09-18 14:10:39 -0400282 g->codeAppendf("highfloat2 qlr = sign(%s - %s);", rightPt, leftPt);
283 g->codeAppend ("highfloat2 d1 = highfloat2(qlr.y, -qlr.x);");
Chris Dalton1a325d22017-07-14 15:17:41 -0600284
Ethan Nicholasf7b88202017-09-18 14:10:39 -0400285 g->codeAppendf("highfloat2 n = highfloat2(%s.y - %s.y, %s.x - %s.x);",
Chris Dalton1a325d22017-07-14 15:17:41 -0600286 rightPt, leftPt, leftPt, rightPt);
Ethan Nicholasf7b88202017-09-18 14:10:39 -0400287 g->codeAppendf("highfloat2 kk = n * highfloat2x2(%s + bloat * d1, %s - bloat * d1);",
Ethan Nicholas5af9ea32017-07-28 15:19:46 -0400288 leftPt, leftPt);
Chris Dalton1a325d22017-07-14 15:17:41 -0600289 // Clamp for when n=0. wind=0 when n=0 so as long as we don't get Inf or NaN we are fine.
Ethan Nicholasf7b88202017-09-18 14:10:39 -0400290 g->codeAppendf("highfloat scale = 1 / max(kk[0] - kk[1], 1e-30);");
Chris Dalton1a325d22017-07-14 15:17:41 -0600291
Ethan Nicholasf7b88202017-09-18 14:10:39 -0400292 g->codeAppendf("%s = half3(-n, kk[1]) * scale;", outputDistanceEquation);
Chris Dalton1a325d22017-07-14 15:17:41 -0600293}
294
Chris Daltonb072bb62017-08-07 09:00:46 -0600295int PrimitiveProcessor::emitCornerGeometry(GrGLSLGeometryBuilder* g, const char* emitVertexFn,
296 const char* pt) const {
Ethan Nicholasf7b88202017-09-18 14:10:39 -0400297 g->codeAppendf("%s(%s + highfloat2(-bloat.x, -bloat.y), 1);", emitVertexFn, pt);
298 g->codeAppendf("%s(%s + highfloat2(-bloat.x, +bloat.y), 1);", emitVertexFn, pt);
299 g->codeAppendf("%s(%s + highfloat2(+bloat.x, -bloat.y), 1);", emitVertexFn, pt);
300 g->codeAppendf("%s(%s + highfloat2(+bloat.x, +bloat.y), 1);", emitVertexFn, pt);
Chris Daltonb072bb62017-08-07 09:00:46 -0600301 g->codeAppend ("EndPrimitive();");
302
303 return 4;
304}
305
Chris Dalton1a325d22017-07-14 15:17:41 -0600306void PrimitiveProcessor::emitCoverage(const GrCCPRCoverageProcessor& proc, GrGLSLFragmentBuilder* f,
307 const char* outputColor, const char* outputCoverage) const {
308 switch (fCoverageType) {
309 case CoverageType::kOne:
310 f->codeAppendf("%s.a = %s;", outputColor, fFragWind.fsIn());
311 break;
312 case CoverageType::kInterpolated:
313 f->codeAppendf("%s.a = %s;", outputColor, fFragCoverageTimesWind.fsIn());
314 break;
315 case CoverageType::kShader:
Ethan Nicholasf7b88202017-09-18 14:10:39 -0400316 f->codeAppendf("half coverage = 0;");
Chris Dalton1a325d22017-07-14 15:17:41 -0600317 this->emitShaderCoverage(f, "coverage");
318 f->codeAppendf("%s.a = coverage * %s;", outputColor, fFragWind.fsIn());
319 break;
320 }
321
Ethan Nicholasf7b88202017-09-18 14:10:39 -0400322 f->codeAppendf("%s = half4(1);", outputCoverage);
Chris Dalton1a325d22017-07-14 15:17:41 -0600323
324#ifdef SK_DEBUG
Chris Daltona640c492017-09-11 22:04:03 -0700325 if (proc.debugVisualizationsEnabled()) {
Ethan Nicholasf7b88202017-09-18 14:10:39 -0400326 f->codeAppendf("%s = half4(-%s.a, %s.a, 0, 1);", outputColor, outputColor, outputColor);
Chris Dalton1a325d22017-07-14 15:17:41 -0600327 }
328#endif
329}
330
331int PrimitiveProcessor::defineSoftSampleLocations(GrGLSLFragmentBuilder* f,
332 const char* samplesName) const {
333 // Standard DX11 sample locations.
334#if defined(SK_BUILD_FOR_ANDROID) || defined(SK_BUILD_FOR_IOS)
Ethan Nicholasf7b88202017-09-18 14:10:39 -0400335 f->defineConstant("highfloat2[8]", samplesName, "highfloat2[8]("
336 "highfloat2(+1, -3)/16, highfloat2(-1, +3)/16, highfloat2(+5, +1)/16, highfloat2(-3, -5)/16, "
337 "highfloat2(-5, +5)/16, highfloat2(-7, -1)/16, highfloat2(+3, +7)/16, highfloat2(+7, -7)/16."
Chris Dalton1a325d22017-07-14 15:17:41 -0600338 ")");
339 return 8;
340#else
Ethan Nicholasf7b88202017-09-18 14:10:39 -0400341 f->defineConstant("highfloat2[16]", samplesName, "highfloat2[16]("
342 "highfloat2(+1, +1)/16, highfloat2(-1, -3)/16, highfloat2(-3, +2)/16, highfloat2(+4, -1)/16, "
343 "highfloat2(-5, -2)/16, highfloat2(+2, +5)/16, highfloat2(+5, +3)/16, highfloat2(+3, -5)/16, "
344 "highfloat2(-2, +6)/16, highfloat2( 0, -7)/16, highfloat2(-4, -6)/16, highfloat2(-6, +4)/16, "
345 "highfloat2(-8, 0)/16, highfloat2(+7, -4)/16, highfloat2(+6, +7)/16, highfloat2(-7, -8)/16."
Chris Dalton1a325d22017-07-14 15:17:41 -0600346 ")");
347 return 16;
348#endif
349}
350
351#ifdef SK_DEBUG
352
353#include "GrRenderTarget.h"
354
Robert Phillips2890fbf2017-07-26 15:48:41 -0400355void GrCCPRCoverageProcessor::Validate(GrRenderTargetProxy* atlasProxy) {
356 SkASSERT(kAtlasOrigin == atlasProxy->origin());
357 SkASSERT(GrPixelConfigIsAlphaOnly(atlasProxy->config()));
358 SkASSERT(GrPixelConfigIsFloatingPoint(atlasProxy->config()));
Chris Dalton1a325d22017-07-14 15:17:41 -0600359}
360
361#endif