Chris Dalton | d7291ba | 2019-03-07 14:17:03 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2019 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 "gm/gm.h" |
Ben Wagner | 7fde8e1 | 2019-05-01 17:28:53 -0400 | [diff] [blame] | 9 | #include "include/core/SkBlendMode.h" |
| 10 | #include "include/core/SkCanvas.h" |
| 11 | #include "include/core/SkColorSpace.h" |
| 12 | #include "include/core/SkMatrix.h" |
| 13 | #include "include/core/SkRect.h" |
| 14 | #include "include/core/SkRefCnt.h" |
| 15 | #include "include/core/SkSize.h" |
| 16 | #include "include/core/SkString.h" |
| 17 | #include "include/core/SkTypes.h" |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 18 | #include "include/gpu/GrContext.h" |
Ben Wagner | 7fde8e1 | 2019-05-01 17:28:53 -0400 | [diff] [blame] | 19 | #include "include/gpu/GrTypes.h" |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 20 | #include "include/private/GrRecordingContext.h" |
Ben Wagner | 7fde8e1 | 2019-05-01 17:28:53 -0400 | [diff] [blame] | 21 | #include "include/private/GrTypesPriv.h" |
| 22 | #include "include/private/SkColorData.h" |
| 23 | #include "src/gpu/GrBuffer.h" |
| 24 | #include "src/gpu/GrCaps.h" |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 25 | #include "src/gpu/GrClip.h" |
Ben Wagner | 7fde8e1 | 2019-05-01 17:28:53 -0400 | [diff] [blame] | 26 | #include "src/gpu/GrColorSpaceXform.h" |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 27 | #include "src/gpu/GrContextPriv.h" |
Ben Wagner | 7fde8e1 | 2019-05-01 17:28:53 -0400 | [diff] [blame] | 28 | #include "src/gpu/GrGeometryProcessor.h" |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 29 | #include "src/gpu/GrMemoryPool.h" |
Ben Wagner | 7fde8e1 | 2019-05-01 17:28:53 -0400 | [diff] [blame] | 30 | #include "src/gpu/GrMesh.h" |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 31 | #include "src/gpu/GrOpFlushState.h" |
Greg Daniel | 2d41d0d | 2019-08-26 11:08:51 -0400 | [diff] [blame] | 32 | #include "src/gpu/GrOpsRenderPass.h" |
Ben Wagner | 7fde8e1 | 2019-05-01 17:28:53 -0400 | [diff] [blame] | 33 | #include "src/gpu/GrPaint.h" |
| 34 | #include "src/gpu/GrPipeline.h" |
| 35 | #include "src/gpu/GrPrimitiveProcessor.h" |
| 36 | #include "src/gpu/GrProcessor.h" |
| 37 | #include "src/gpu/GrProcessorSet.h" |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 38 | #include "src/gpu/GrRecordingContextPriv.h" |
| 39 | #include "src/gpu/GrRenderTargetContext.h" |
| 40 | #include "src/gpu/GrRenderTargetContextPriv.h" |
Brian Salomon | 201cdbb | 2019-08-14 17:00:30 -0400 | [diff] [blame] | 41 | #include "src/gpu/GrSamplerState.h" |
Ben Wagner | 7fde8e1 | 2019-05-01 17:28:53 -0400 | [diff] [blame] | 42 | #include "src/gpu/GrShaderCaps.h" |
| 43 | #include "src/gpu/GrShaderVar.h" |
Greg Daniel | f91aeb2 | 2019-06-18 09:58:02 -0400 | [diff] [blame] | 44 | #include "src/gpu/GrSurfaceProxy.h" |
| 45 | #include "src/gpu/GrTextureProxy.h" |
Ben Wagner | 7fde8e1 | 2019-05-01 17:28:53 -0400 | [diff] [blame] | 46 | #include "src/gpu/GrUserStencilSettings.h" |
| 47 | #include "src/gpu/effects/GrPorterDuffXferProcessor.h" |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 48 | #include "src/gpu/glsl/GrGLSLFragmentShaderBuilder.h" |
| 49 | #include "src/gpu/glsl/GrGLSLGeometryProcessor.h" |
Ben Wagner | 7fde8e1 | 2019-05-01 17:28:53 -0400 | [diff] [blame] | 50 | #include "src/gpu/glsl/GrGLSLPrimitiveProcessor.h" |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 51 | #include "src/gpu/glsl/GrGLSLProgramBuilder.h" |
| 52 | #include "src/gpu/glsl/GrGLSLVarying.h" |
| 53 | #include "src/gpu/glsl/GrGLSLVertexGeoBuilder.h" |
Ben Wagner | 7fde8e1 | 2019-05-01 17:28:53 -0400 | [diff] [blame] | 54 | #include "src/gpu/ops/GrDrawOp.h" |
| 55 | #include "src/gpu/ops/GrOp.h" |
| 56 | |
| 57 | #include <memory> |
| 58 | #include <utility> |
| 59 | |
| 60 | class GrAppliedClip; |
| 61 | class GrGLSLProgramDataManager; |
Chris Dalton | d7291ba | 2019-03-07 14:17:03 -0700 | [diff] [blame] | 62 | |
| 63 | namespace skiagm { |
| 64 | |
| 65 | enum class GradType : bool { |
| 66 | kHW, |
| 67 | kSW |
| 68 | }; |
| 69 | |
| 70 | /** |
| 71 | * This test ensures that the shaderBuilder's sample offsets and sample mask are correlated with |
| 72 | * actual HW sample locations. It does so by drawing pseudo-random subpixel boxes, and only turning |
| 73 | * off the samples whose locations fall inside the boxes. |
| 74 | */ |
| 75 | class SampleLocationsGM : public GpuGM { |
| 76 | public: |
| 77 | SampleLocationsGM(GradType gradType, GrSurfaceOrigin origin) |
| 78 | : fGradType(gradType) |
| 79 | , fOrigin(origin) {} |
| 80 | |
| 81 | private: |
Hal Canary | fa3305a | 2019-07-18 12:36:54 -0400 | [diff] [blame] | 82 | SkString onShortName() override { |
| 83 | return SkStringPrintf("samplelocations%s%s", |
| 84 | (GradType::kHW == fGradType) ? "_hwgrad" : "_swgrad", |
| 85 | (kTopLeft_GrSurfaceOrigin == fOrigin) ? "_topleft" : "_botleft"); |
| 86 | } |
| 87 | |
Chris Dalton | d7291ba | 2019-03-07 14:17:03 -0700 | [diff] [blame] | 88 | SkISize onISize() override { return SkISize::Make(200, 200); } |
| 89 | DrawResult onDraw(GrContext*, GrRenderTargetContext*, SkCanvas*, SkString* errorMsg) override; |
| 90 | |
| 91 | const GradType fGradType; |
| 92 | const GrSurfaceOrigin fOrigin; |
| 93 | }; |
| 94 | |
| 95 | //////////////////////////////////////////////////////////////////////////////////////////////////// |
| 96 | // SkSL code. |
| 97 | |
| 98 | class SampleLocationsTestProcessor : public GrGeometryProcessor { |
| 99 | public: |
| 100 | SampleLocationsTestProcessor(GradType gradType) |
| 101 | : GrGeometryProcessor(kSampleLocationsTestProcessor_ClassID) |
| 102 | , fGradType(gradType) { |
| 103 | this->setWillUseCustomFeature(CustomFeatures::kSampleLocations); |
| 104 | } |
| 105 | const char* name() const override { return "SampleLocationsTestProcessor"; } |
| 106 | void getGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder* b) const final { |
| 107 | b->add32((uint32_t)fGradType); |
| 108 | } |
| 109 | GrGLSLPrimitiveProcessor* createGLSLInstance(const GrShaderCaps&) const final; |
| 110 | |
| 111 | private: |
| 112 | const GradType fGradType; |
| 113 | |
| 114 | class Impl; |
| 115 | }; |
| 116 | |
| 117 | class SampleLocationsTestProcessor::Impl : public GrGLSLGeometryProcessor { |
| 118 | void onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) override { |
| 119 | const auto& proc = args.fGP.cast<SampleLocationsTestProcessor>(); |
| 120 | auto* v = args.fVertBuilder; |
| 121 | auto* f = args.fFragBuilder; |
| 122 | |
| 123 | GrGLSLVarying coord(kFloat2_GrSLType); |
| 124 | GrGLSLVarying grad(kFloat2_GrSLType); |
| 125 | args.fVaryingHandler->addVarying("coord", &coord); |
| 126 | if (GradType::kSW == proc.fGradType) { |
| 127 | args.fVaryingHandler->addVarying("grad", &grad); |
| 128 | } |
| 129 | |
| 130 | // Pixel grid. |
| 131 | v->codeAppendf("int x = sk_InstanceID %% 200;"); |
| 132 | v->codeAppendf("int y = sk_InstanceID / 200;"); |
| 133 | |
| 134 | // Create pseudo-random rectangles inside a 16x16 subpixel grid. This works out nicely |
| 135 | // because there are 17 positions on the grid (including both edges), and 17 is a great |
| 136 | // prime number for generating pseudo-random numbers. |
| 137 | v->codeAppendf("int ileft = (sk_InstanceID*929) %% 17;"); |
| 138 | v->codeAppendf("int iright = ileft + 1 + ((sk_InstanceID*1637) %% (17 - ileft));"); |
| 139 | v->codeAppendf("int itop = (sk_InstanceID*313) %% 17;"); |
| 140 | v->codeAppendf("int ibot = itop + 1 + ((sk_InstanceID*1901) %% (17 - itop));"); |
| 141 | |
| 142 | // Outset (or inset) the rectangle, for the very likely scenario that samples fall on exact |
| 143 | // 16ths of a pixel. GL_SUBPIXEL_BITS is allowed to be as low as 4, so try not to let the |
| 144 | // outset value to get too small. |
| 145 | v->codeAppendf("float outset = 1/32.0;"); |
| 146 | v->codeAppendf("outset = (0 == (x + y) %% 2) ? -outset : +outset;"); |
| 147 | v->codeAppendf("float l = ileft/16.0 - outset;"); |
| 148 | v->codeAppendf("float r = iright/16.0 + outset;"); |
| 149 | v->codeAppendf("float t = itop/16.0 - outset;"); |
| 150 | v->codeAppendf("float b = ibot/16.0 + outset;"); |
| 151 | |
| 152 | v->codeAppendf("float2 vertexpos;"); |
| 153 | v->codeAppendf("vertexpos.x = float(x) + ((0 == (sk_VertexID %% 2)) ? l : r);"); |
| 154 | v->codeAppendf("vertexpos.y = float(y) + ((0 == (sk_VertexID / 2)) ? t : b);"); |
| 155 | gpArgs->fPositionVar.set(kFloat2_GrSLType, "vertexpos"); |
| 156 | |
| 157 | v->codeAppendf("%s.x = (0 == (sk_VertexID %% 2)) ? -1 : +1;", coord.vsOut()); |
| 158 | v->codeAppendf("%s.y = (0 == (sk_VertexID / 2)) ? -1 : +1;", coord.vsOut()); |
| 159 | if (GradType::kSW == proc.fGradType) { |
| 160 | v->codeAppendf("%s = 2/float2(r - l, b - t);", grad.vsOut()); |
| 161 | } |
| 162 | |
| 163 | // Fragment shader: Output RED. |
| 164 | f->codeAppendf("%s = half4(1,0,0,1);", args.fOutputColor); |
| 165 | f->codeAppendf("%s = half4(1);", args.fOutputCoverage); |
| 166 | |
| 167 | // Now turn off all the samples inside our sub-rectangle. As long as the shaderBuilder's |
| 168 | // sample offsets and sample mask are correlated with actual HW sample locations, no red |
| 169 | // will bleed through. |
| 170 | f->codeAppendf("for (int i = 0; i < %i; ++i) {", |
| 171 | f->getProgramBuilder()->effectiveSampleCnt()); |
| 172 | if (GradType::kHW == proc.fGradType) { |
| 173 | f->codeAppendf("float2x2 grad = float2x2(dFdx(%s), dFdy(%s));", |
| 174 | coord.fsIn(), coord.fsIn()); |
| 175 | } else { |
| 176 | f->codeAppendf("float2x2 grad = float2x2(%s.x, 0, 0, %s.y);", grad.fsIn(), grad.fsIn()); |
| 177 | } |
| 178 | f->codeAppendf( "float2 samplecoord = %s[i] * grad + %s;", |
| 179 | f->sampleOffsets(), coord.fsIn()); |
| 180 | f->codeAppendf( "if (all(lessThanEqual(abs(samplecoord), float2(1)))) {"); |
| 181 | f->maskOffMultisampleCoverage( |
Chris Dalton | 0dffbab | 2019-03-27 13:08:50 -0600 | [diff] [blame] | 182 | "~(1 << i)", GrGLSLFPFragmentBuilder::ScopeFlags::kInsideLoop); |
Chris Dalton | d7291ba | 2019-03-07 14:17:03 -0700 | [diff] [blame] | 183 | f->codeAppendf( "}"); |
| 184 | f->codeAppendf("}"); |
| 185 | } |
| 186 | |
| 187 | void setData(const GrGLSLProgramDataManager&, const GrPrimitiveProcessor&, |
| 188 | FPCoordTransformIter&&) override {} |
| 189 | }; |
| 190 | |
| 191 | GrGLSLPrimitiveProcessor* SampleLocationsTestProcessor::createGLSLInstance( |
| 192 | const GrShaderCaps&) const { |
| 193 | return new Impl(); |
| 194 | } |
| 195 | |
| 196 | //////////////////////////////////////////////////////////////////////////////////////////////////// |
| 197 | // Draw Op. |
| 198 | |
| 199 | class SampleLocationsTestOp : public GrDrawOp { |
| 200 | public: |
| 201 | DEFINE_OP_CLASS_ID |
| 202 | |
| 203 | static std::unique_ptr<GrDrawOp> Make( |
| 204 | GrRecordingContext* ctx, const SkMatrix& viewMatrix, GradType gradType) { |
| 205 | GrOpMemoryPool* pool = ctx->priv().opMemoryPool(); |
| 206 | return pool->allocate<SampleLocationsTestOp>(gradType); |
| 207 | } |
| 208 | |
| 209 | private: |
| 210 | SampleLocationsTestOp(GradType gradType) : GrDrawOp(ClassID()), fGradType(gradType) { |
Greg Daniel | 5faf474 | 2019-10-01 15:14:44 -0400 | [diff] [blame] | 211 | this->setBounds(SkRect::MakeIWH(200, 200), HasAABloat::kNo, IsHairline::kNo); |
Chris Dalton | d7291ba | 2019-03-07 14:17:03 -0700 | [diff] [blame] | 212 | } |
| 213 | |
| 214 | const char* name() const override { return "SampleLocationsTestOp"; } |
| 215 | FixedFunctionFlags fixedFunctionFlags() const override { |
| 216 | return FixedFunctionFlags::kUsesHWAA | FixedFunctionFlags::kUsesStencil; |
| 217 | } |
Chris Dalton | 6ce447a | 2019-06-23 18:07:38 -0600 | [diff] [blame] | 218 | GrProcessorSet::Analysis finalize(const GrCaps&, const GrAppliedClip*, |
| 219 | bool hasMixedSampledCoverage, GrClampType) override { |
Chris Dalton | d7291ba | 2019-03-07 14:17:03 -0700 | [diff] [blame] | 220 | return GrProcessorSet::EmptySetAnalysis(); |
| 221 | } |
| 222 | void onPrepare(GrOpFlushState*) override {} |
| 223 | void onExecute(GrOpFlushState* flushState, const SkRect& chainBounds) override { |
| 224 | static constexpr GrUserStencilSettings kStencilWrite( |
| 225 | GrUserStencilSettings::StaticInit< |
| 226 | 0x0001, |
| 227 | GrUserStencilTest::kAlways, |
| 228 | 0xffff, |
| 229 | GrUserStencilOp::kReplace, |
| 230 | GrUserStencilOp::kKeep, |
| 231 | 0xffff>() |
| 232 | ); |
| 233 | |
| 234 | GrPipeline pipeline(GrScissorTest::kDisabled, SkBlendMode::kSrcOver, |
Robert Phillips | 405413f | 2019-10-04 10:39:28 -0400 | [diff] [blame] | 235 | flushState->drawOpArgs().outputSwizzle(), |
Chris Dalton | baa1b35 | 2019-04-03 12:03:00 -0600 | [diff] [blame] | 236 | GrPipeline::InputFlags::kHWAntialias, &kStencilWrite); |
| 237 | |
Robert Phillips | 901aff0 | 2019-10-08 12:32:56 -0400 | [diff] [blame] | 238 | SampleLocationsTestProcessor primProc(fGradType); |
| 239 | |
| 240 | GrProgramInfo programInfo(flushState->drawOpArgs().numSamples(), |
| 241 | flushState->drawOpArgs().origin(), |
| 242 | pipeline, |
| 243 | primProc, |
Robert Phillips | 2d8a95e | 2019-10-10 12:50:22 -0400 | [diff] [blame] | 244 | nullptr, nullptr, 0); |
Robert Phillips | 901aff0 | 2019-10-08 12:32:56 -0400 | [diff] [blame] | 245 | |
Chris Dalton | d7291ba | 2019-03-07 14:17:03 -0700 | [diff] [blame] | 246 | GrMesh mesh(GrPrimitiveType::kTriangleStrip); |
| 247 | mesh.setInstanced(nullptr, 200*200, 0, 4); |
Robert Phillips | 901aff0 | 2019-10-08 12:32:56 -0400 | [diff] [blame] | 248 | flushState->opsRenderPass()->draw(programInfo, &mesh, 1, SkRect::MakeIWH(200, 200)); |
Chris Dalton | d7291ba | 2019-03-07 14:17:03 -0700 | [diff] [blame] | 249 | } |
| 250 | |
| 251 | const GradType fGradType; |
| 252 | |
| 253 | friend class ::GrOpMemoryPool; // for ctor |
| 254 | }; |
| 255 | |
| 256 | //////////////////////////////////////////////////////////////////////////////////////////////////// |
| 257 | // Test. |
| 258 | |
Chris Dalton | d7291ba | 2019-03-07 14:17:03 -0700 | [diff] [blame] | 259 | DrawResult SampleLocationsGM::onDraw( |
| 260 | GrContext* ctx, GrRenderTargetContext* rtc, SkCanvas* canvas, SkString* errorMsg) { |
Chris Dalton | d7291ba | 2019-03-07 14:17:03 -0700 | [diff] [blame] | 261 | if (!ctx->priv().caps()->sampleLocationsSupport()) { |
| 262 | *errorMsg = "Requires support for sample locations."; |
| 263 | return DrawResult::kSkip; |
| 264 | } |
Robert Phillips | d9ddd07 | 2019-10-23 12:26:55 +0000 | [diff] [blame] | 265 | if (!ctx->priv().caps()->shaderCaps()->sampleVariablesSupport()) { |
| 266 | *errorMsg = "Requires support for sample variables."; |
Chris Dalton | d7291ba | 2019-03-07 14:17:03 -0700 | [diff] [blame] | 267 | return DrawResult::kSkip; |
| 268 | } |
Chris Dalton | effee20 | 2019-07-01 22:28:03 -0600 | [diff] [blame] | 269 | if (rtc->numSamples() <= 1 && !ctx->priv().caps()->mixedSamplesSupport()) { |
| 270 | *errorMsg = "MSAA and mixed samples only."; |
| 271 | return DrawResult::kSkip; |
| 272 | } |
| 273 | |
| 274 | auto offscreenRTC = ctx->priv().makeDeferredRenderTargetContext( |
Brian Salomon | 4bc0c1f | 2019-09-30 15:12:27 -0400 | [diff] [blame] | 275 | SkBackingFit::kExact, 200, 200, rtc->colorInfo().colorType(), nullptr, |
Chris Dalton | effee20 | 2019-07-01 22:28:03 -0600 | [diff] [blame] | 276 | rtc->numSamples(), GrMipMapped::kNo, fOrigin); |
| 277 | if (!offscreenRTC) { |
| 278 | *errorMsg = "Failed to create offscreen render target."; |
| 279 | return DrawResult::kFail; |
| 280 | } |
| 281 | if (offscreenRTC->numSamples() <= 1 && |
| 282 | !offscreenRTC->proxy()->canUseMixedSamples(*ctx->priv().caps())) { |
| 283 | *errorMsg = "MSAA and mixed samples only."; |
| 284 | return DrawResult::kSkip; |
| 285 | } |
Chris Dalton | d7291ba | 2019-03-07 14:17:03 -0700 | [diff] [blame] | 286 | |
| 287 | static constexpr GrUserStencilSettings kStencilCover( |
| 288 | GrUserStencilSettings::StaticInit< |
| 289 | 0x0000, |
| 290 | GrUserStencilTest::kNotEqual, |
| 291 | 0xffff, |
| 292 | GrUserStencilOp::kZero, |
| 293 | GrUserStencilOp::kKeep, |
| 294 | 0xffff>() |
| 295 | ); |
| 296 | |
Chris Dalton | effee20 | 2019-07-01 22:28:03 -0600 | [diff] [blame] | 297 | offscreenRTC->clear(nullptr, {0,1,0,1}, GrRenderTargetContext::CanClearFullscreen::kYes); |
Chris Dalton | d7291ba | 2019-03-07 14:17:03 -0700 | [diff] [blame] | 298 | |
Chris Dalton | effee20 | 2019-07-01 22:28:03 -0600 | [diff] [blame] | 299 | // Stencil. |
| 300 | offscreenRTC->priv().testingOnly_addDrawOp( |
| 301 | SampleLocationsTestOp::Make(ctx, canvas->getTotalMatrix(), fGradType)); |
Chris Dalton | 6ce447a | 2019-06-23 18:07:38 -0600 | [diff] [blame] | 302 | |
Chris Dalton | effee20 | 2019-07-01 22:28:03 -0600 | [diff] [blame] | 303 | // Cover. |
| 304 | GrPaint coverPaint; |
| 305 | coverPaint.setColor4f({1,0,0,1}); |
| 306 | coverPaint.setXPFactory(GrPorterDuffXPFactory::Get(SkBlendMode::kSrcOver)); |
| 307 | rtc->priv().stencilRect(GrNoClip(), &kStencilCover, std::move(coverPaint), GrAA::kNo, |
| 308 | SkMatrix::I(), SkRect::MakeWH(200, 200)); |
Chris Dalton | d7291ba | 2019-03-07 14:17:03 -0700 | [diff] [blame] | 309 | |
Chris Dalton | effee20 | 2019-07-01 22:28:03 -0600 | [diff] [blame] | 310 | // Copy offscreen texture to canvas. |
| 311 | rtc->drawTexture( |
| 312 | GrNoClip(), sk_ref_sp(offscreenRTC->asTextureProxy()), |
Greg Daniel | c594e62 | 2019-10-15 14:01:49 -0400 | [diff] [blame] | 313 | offscreenRTC->colorInfo().colorType(), GrSamplerState::Filter::kNearest, |
| 314 | SkBlendMode::kSrc, SK_PMColor4fWHITE, {0,0,200,200}, {0,0,200,200}, GrAA::kNo, |
| 315 | GrQuadAAFlags::kNone, SkCanvas::SrcRectConstraint::kStrict_SrcRectConstraint, |
| 316 | SkMatrix::I(), nullptr); |
Chris Dalton | d7291ba | 2019-03-07 14:17:03 -0700 | [diff] [blame] | 317 | |
| 318 | return skiagm::DrawResult::kOk; |
| 319 | } |
| 320 | |
| 321 | DEF_GM( return new SampleLocationsGM(GradType::kHW, kTopLeft_GrSurfaceOrigin); ) |
| 322 | DEF_GM( return new SampleLocationsGM(GradType::kHW, kBottomLeft_GrSurfaceOrigin); ) |
| 323 | DEF_GM( return new SampleLocationsGM(GradType::kSW, kTopLeft_GrSurfaceOrigin); ) |
| 324 | DEF_GM( return new SampleLocationsGM(GradType::kSW, kBottomLeft_GrSurfaceOrigin); ) |
| 325 | |
| 326 | } |