blob: 51475abd6e7e288c0e59fae4150d16ee6a731ce7 [file] [log] [blame]
Chris Daltond7291ba2019-03-07 14:17:03 -07001/*
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 Kleinc0bd9f92019-04-23 12:05:21 -05008#include "gm/gm.h"
Ben Wagner7fde8e12019-05-01 17:28:53 -04009#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"
Robert Phillipsb7bfbc22020-07-01 12:55:01 -040018#include "include/gpu/GrRecordingContext.h"
Ben Wagner7fde8e12019-05-01 17:28:53 -040019#include "include/gpu/GrTypes.h"
Ben Wagner7fde8e12019-05-01 17:28:53 -040020#include "include/private/GrTypesPriv.h"
21#include "include/private/SkColorData.h"
22#include "src/gpu/GrBuffer.h"
23#include "src/gpu/GrCaps.h"
Ben Wagner7fde8e12019-05-01 17:28:53 -040024#include "src/gpu/GrColorSpaceXform.h"
Mike Kleinc0bd9f92019-04-23 12:05:21 -050025#include "src/gpu/GrContextPriv.h"
Ben Wagner7fde8e12019-05-01 17:28:53 -040026#include "src/gpu/GrGeometryProcessor.h"
Mike Kleinc0bd9f92019-04-23 12:05:21 -050027#include "src/gpu/GrMemoryPool.h"
28#include "src/gpu/GrOpFlushState.h"
Greg Daniel2d41d0d2019-08-26 11:08:51 -040029#include "src/gpu/GrOpsRenderPass.h"
Ben Wagner7fde8e12019-05-01 17:28:53 -040030#include "src/gpu/GrPaint.h"
31#include "src/gpu/GrPipeline.h"
32#include "src/gpu/GrPrimitiveProcessor.h"
33#include "src/gpu/GrProcessor.h"
34#include "src/gpu/GrProcessorSet.h"
Mike Kleinc0bd9f92019-04-23 12:05:21 -050035#include "src/gpu/GrRecordingContextPriv.h"
36#include "src/gpu/GrRenderTargetContext.h"
37#include "src/gpu/GrRenderTargetContextPriv.h"
Brian Salomon201cdbb2019-08-14 17:00:30 -040038#include "src/gpu/GrSamplerState.h"
Ben Wagner7fde8e12019-05-01 17:28:53 -040039#include "src/gpu/GrShaderCaps.h"
40#include "src/gpu/GrShaderVar.h"
Greg Danielf91aeb22019-06-18 09:58:02 -040041#include "src/gpu/GrSurfaceProxy.h"
42#include "src/gpu/GrTextureProxy.h"
Ben Wagner7fde8e12019-05-01 17:28:53 -040043#include "src/gpu/GrUserStencilSettings.h"
44#include "src/gpu/effects/GrPorterDuffXferProcessor.h"
Mike Kleinc0bd9f92019-04-23 12:05:21 -050045#include "src/gpu/glsl/GrGLSLFragmentShaderBuilder.h"
46#include "src/gpu/glsl/GrGLSLGeometryProcessor.h"
Ben Wagner7fde8e12019-05-01 17:28:53 -040047#include "src/gpu/glsl/GrGLSLPrimitiveProcessor.h"
Mike Kleinc0bd9f92019-04-23 12:05:21 -050048#include "src/gpu/glsl/GrGLSLProgramBuilder.h"
49#include "src/gpu/glsl/GrGLSLVarying.h"
50#include "src/gpu/glsl/GrGLSLVertexGeoBuilder.h"
Ben Wagner7fde8e12019-05-01 17:28:53 -040051#include "src/gpu/ops/GrDrawOp.h"
52#include "src/gpu/ops/GrOp.h"
Robert Phillips34cea002019-11-21 16:02:34 -050053#include "tools/gpu/ProxyUtils.h"
Ben Wagner7fde8e12019-05-01 17:28:53 -040054
55#include <memory>
56#include <utility>
57
58class GrAppliedClip;
59class GrGLSLProgramDataManager;
Chris Daltond7291ba2019-03-07 14:17:03 -070060
61namespace skiagm {
62
63enum class GradType : bool {
64 kHW,
65 kSW
66};
67
68/**
69 * This test ensures that the shaderBuilder's sample offsets and sample mask are correlated with
70 * actual HW sample locations. It does so by drawing pseudo-random subpixel boxes, and only turning
71 * off the samples whose locations fall inside the boxes.
72 */
73class SampleLocationsGM : public GpuGM {
74public:
75 SampleLocationsGM(GradType gradType, GrSurfaceOrigin origin)
76 : fGradType(gradType)
77 , fOrigin(origin) {}
78
79private:
Hal Canaryfa3305a2019-07-18 12:36:54 -040080 SkString onShortName() override {
81 return SkStringPrintf("samplelocations%s%s",
82 (GradType::kHW == fGradType) ? "_hwgrad" : "_swgrad",
83 (kTopLeft_GrSurfaceOrigin == fOrigin) ? "_topleft" : "_botleft");
84 }
85
Chris Daltond7291ba2019-03-07 14:17:03 -070086 SkISize onISize() override { return SkISize::Make(200, 200); }
Robert Phillips95c250c2020-06-29 15:36:12 -040087 DrawResult onDraw(GrRecordingContext*, GrRenderTargetContext*,
88 SkCanvas*, SkString* errorMsg) override;
Chris Daltond7291ba2019-03-07 14:17:03 -070089
90 const GradType fGradType;
91 const GrSurfaceOrigin fOrigin;
92};
93
94////////////////////////////////////////////////////////////////////////////////////////////////////
95// SkSL code.
96
97class SampleLocationsTestProcessor : public GrGeometryProcessor {
98public:
Robert Phillipsfbfc3552019-11-18 11:50:54 -050099 static GrGeometryProcessor* Make(SkArenaAlloc* arena, GradType gradType) {
100 return arena->make<SampleLocationsTestProcessor>(gradType);
101 }
102
103 const char* name() const override { return "SampleLocationsTestProcessor"; }
104
105 void getGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder* b) const final {
106 b->add32((uint32_t)fGradType);
107 }
108
109 GrGLSLPrimitiveProcessor* createGLSLInstance(const GrShaderCaps&) const final;
110
111private:
112 friend class ::SkArenaAlloc; // for access to ctor
113
Chris Daltond7291ba2019-03-07 14:17:03 -0700114 SampleLocationsTestProcessor(GradType gradType)
115 : GrGeometryProcessor(kSampleLocationsTestProcessor_ClassID)
116 , fGradType(gradType) {
117 this->setWillUseCustomFeature(CustomFeatures::kSampleLocations);
118 }
Chris Daltond7291ba2019-03-07 14:17:03 -0700119
Chris Daltond7291ba2019-03-07 14:17:03 -0700120 const GradType fGradType;
121
122 class Impl;
Robert Phillipsfbfc3552019-11-18 11:50:54 -0500123
124 typedef GrGeometryProcessor INHERITED;
Chris Daltond7291ba2019-03-07 14:17:03 -0700125};
126
127class SampleLocationsTestProcessor::Impl : public GrGLSLGeometryProcessor {
128 void onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) override {
129 const auto& proc = args.fGP.cast<SampleLocationsTestProcessor>();
130 auto* v = args.fVertBuilder;
131 auto* f = args.fFragBuilder;
132
133 GrGLSLVarying coord(kFloat2_GrSLType);
134 GrGLSLVarying grad(kFloat2_GrSLType);
135 args.fVaryingHandler->addVarying("coord", &coord);
136 if (GradType::kSW == proc.fGradType) {
137 args.fVaryingHandler->addVarying("grad", &grad);
138 }
139
140 // Pixel grid.
141 v->codeAppendf("int x = sk_InstanceID %% 200;");
142 v->codeAppendf("int y = sk_InstanceID / 200;");
143
144 // Create pseudo-random rectangles inside a 16x16 subpixel grid. This works out nicely
145 // because there are 17 positions on the grid (including both edges), and 17 is a great
146 // prime number for generating pseudo-random numbers.
147 v->codeAppendf("int ileft = (sk_InstanceID*929) %% 17;");
148 v->codeAppendf("int iright = ileft + 1 + ((sk_InstanceID*1637) %% (17 - ileft));");
149 v->codeAppendf("int itop = (sk_InstanceID*313) %% 17;");
150 v->codeAppendf("int ibot = itop + 1 + ((sk_InstanceID*1901) %% (17 - itop));");
151
152 // Outset (or inset) the rectangle, for the very likely scenario that samples fall on exact
153 // 16ths of a pixel. GL_SUBPIXEL_BITS is allowed to be as low as 4, so try not to let the
154 // outset value to get too small.
155 v->codeAppendf("float outset = 1/32.0;");
156 v->codeAppendf("outset = (0 == (x + y) %% 2) ? -outset : +outset;");
157 v->codeAppendf("float l = ileft/16.0 - outset;");
158 v->codeAppendf("float r = iright/16.0 + outset;");
159 v->codeAppendf("float t = itop/16.0 - outset;");
160 v->codeAppendf("float b = ibot/16.0 + outset;");
161
162 v->codeAppendf("float2 vertexpos;");
163 v->codeAppendf("vertexpos.x = float(x) + ((0 == (sk_VertexID %% 2)) ? l : r);");
164 v->codeAppendf("vertexpos.y = float(y) + ((0 == (sk_VertexID / 2)) ? t : b);");
165 gpArgs->fPositionVar.set(kFloat2_GrSLType, "vertexpos");
166
167 v->codeAppendf("%s.x = (0 == (sk_VertexID %% 2)) ? -1 : +1;", coord.vsOut());
168 v->codeAppendf("%s.y = (0 == (sk_VertexID / 2)) ? -1 : +1;", coord.vsOut());
169 if (GradType::kSW == proc.fGradType) {
170 v->codeAppendf("%s = 2/float2(r - l, b - t);", grad.vsOut());
171 }
172
173 // Fragment shader: Output RED.
174 f->codeAppendf("%s = half4(1,0,0,1);", args.fOutputColor);
175 f->codeAppendf("%s = half4(1);", args.fOutputCoverage);
176
177 // Now turn off all the samples inside our sub-rectangle. As long as the shaderBuilder's
178 // sample offsets and sample mask are correlated with actual HW sample locations, no red
179 // will bleed through.
180 f->codeAppendf("for (int i = 0; i < %i; ++i) {",
181 f->getProgramBuilder()->effectiveSampleCnt());
182 if (GradType::kHW == proc.fGradType) {
183 f->codeAppendf("float2x2 grad = float2x2(dFdx(%s), dFdy(%s));",
184 coord.fsIn(), coord.fsIn());
185 } else {
186 f->codeAppendf("float2x2 grad = float2x2(%s.x, 0, 0, %s.y);", grad.fsIn(), grad.fsIn());
187 }
188 f->codeAppendf( "float2 samplecoord = %s[i] * grad + %s;",
189 f->sampleOffsets(), coord.fsIn());
190 f->codeAppendf( "if (all(lessThanEqual(abs(samplecoord), float2(1)))) {");
191 f->maskOffMultisampleCoverage(
Chris Dalton0dffbab2019-03-27 13:08:50 -0600192 "~(1 << i)", GrGLSLFPFragmentBuilder::ScopeFlags::kInsideLoop);
Chris Daltond7291ba2019-03-07 14:17:03 -0700193 f->codeAppendf( "}");
194 f->codeAppendf("}");
195 }
196
Brian Osman609f1592020-07-01 15:14:39 -0400197 void setData(const GrGLSLProgramDataManager&, const GrPrimitiveProcessor&) override {}
Chris Daltond7291ba2019-03-07 14:17:03 -0700198};
199
200GrGLSLPrimitiveProcessor* SampleLocationsTestProcessor::createGLSLInstance(
201 const GrShaderCaps&) const {
202 return new Impl();
203}
204
205////////////////////////////////////////////////////////////////////////////////////////////////////
206// Draw Op.
207
Robert Phillipsfbfc3552019-11-18 11:50:54 -0500208static constexpr GrUserStencilSettings gStencilWrite(
209 GrUserStencilSettings::StaticInit<
210 0x0001,
211 GrUserStencilTest::kAlways,
212 0xffff,
213 GrUserStencilOp::kReplace,
214 GrUserStencilOp::kKeep,
215 0xffff>()
216);
217
Chris Daltond7291ba2019-03-07 14:17:03 -0700218class SampleLocationsTestOp : public GrDrawOp {
219public:
220 DEFINE_OP_CLASS_ID
221
222 static std::unique_ptr<GrDrawOp> Make(
223 GrRecordingContext* ctx, const SkMatrix& viewMatrix, GradType gradType) {
224 GrOpMemoryPool* pool = ctx->priv().opMemoryPool();
225 return pool->allocate<SampleLocationsTestOp>(gradType);
226 }
227
228private:
229 SampleLocationsTestOp(GradType gradType) : GrDrawOp(ClassID()), fGradType(gradType) {
Greg Daniel5faf4742019-10-01 15:14:44 -0400230 this->setBounds(SkRect::MakeIWH(200, 200), HasAABloat::kNo, IsHairline::kNo);
Chris Daltond7291ba2019-03-07 14:17:03 -0700231 }
232
233 const char* name() const override { return "SampleLocationsTestOp"; }
234 FixedFunctionFlags fixedFunctionFlags() const override {
235 return FixedFunctionFlags::kUsesHWAA | FixedFunctionFlags::kUsesStencil;
236 }
Chris Dalton6ce447a2019-06-23 18:07:38 -0600237 GrProcessorSet::Analysis finalize(const GrCaps&, const GrAppliedClip*,
238 bool hasMixedSampledCoverage, GrClampType) override {
Chris Daltond7291ba2019-03-07 14:17:03 -0700239 return GrProcessorSet::EmptySetAnalysis();
240 }
Chris Daltond7291ba2019-03-07 14:17:03 -0700241
Robert Phillipsac6156c2020-02-28 16:02:40 -0500242
243 GrProgramInfo* createProgramInfo(const GrCaps* caps,
244 SkArenaAlloc* arena,
Brian Salomon8afde5f2020-04-01 16:22:00 -0400245 const GrSurfaceProxyView* writeView,
Robert Phillipsac6156c2020-02-28 16:02:40 -0500246 GrAppliedClip&& appliedClip,
247 const GrXferProcessor::DstProxyView& dstProxyView) const {
248 GrGeometryProcessor* geomProc = SampleLocationsTestProcessor::Make(arena, fGradType);
249
250 GrPipeline::InputFlags flags = GrPipeline::InputFlags::kHWAntialias;
251
Brian Salomon8afde5f2020-04-01 16:22:00 -0400252 return sk_gpu_test::CreateProgramInfo(caps, arena, writeView,
Robert Phillipsac6156c2020-02-28 16:02:40 -0500253 std::move(appliedClip), dstProxyView,
254 geomProc, SkBlendMode::kSrcOver,
255 GrPrimitiveType::kTriangleStrip,
256 flags, &gStencilWrite);
257 }
258
259 GrProgramInfo* createProgramInfo(GrOpFlushState* flushState) const {
260 return this->createProgramInfo(&flushState->caps(),
261 flushState->allocator(),
Brian Salomon8afde5f2020-04-01 16:22:00 -0400262 flushState->writeView(),
Robert Phillipsac6156c2020-02-28 16:02:40 -0500263 flushState->detachAppliedClip(),
264 flushState->dstProxyView());
265 }
266
Robert Phillipsfbfc3552019-11-18 11:50:54 -0500267 void onPrePrepare(GrRecordingContext* context,
Brian Salomon8afde5f2020-04-01 16:22:00 -0400268 const GrSurfaceProxyView* writeView,
Robert Phillips34cea002019-11-21 16:02:34 -0500269 GrAppliedClip* clip,
Robert Phillips8053c972019-11-21 10:44:53 -0500270 const GrXferProcessor::DstProxyView& dstProxyView) final {
Robert Phillipsfbfc3552019-11-18 11:50:54 -0500271 // We're going to create the GrProgramInfo (and the GrPipeline and geometry processor
272 // it relies on) in the DDL-record-time arena.
273 SkArenaAlloc* arena = context->priv().recordTimeAllocator();
Chris Daltonbaa1b352019-04-03 12:03:00 -0600274
Robert Phillips34cea002019-11-21 16:02:34 -0500275 // This is equivalent to a GrOpFlushState::detachAppliedClip
Michael Ludwigd1d997e2020-06-04 15:52:44 -0400276 GrAppliedClip appliedClip = clip ? std::move(*clip) : GrAppliedClip::Disabled();
Robert Phillipsfbfc3552019-11-18 11:50:54 -0500277
Brian Salomon8afde5f2020-04-01 16:22:00 -0400278 fProgramInfo = this->createProgramInfo(context->priv().caps(), arena, writeView,
Robert Phillipsac6156c2020-02-28 16:02:40 -0500279 std::move(appliedClip), dstProxyView);
Robert Phillipsfbfc3552019-11-18 11:50:54 -0500280
Robert Phillipsac6156c2020-02-28 16:02:40 -0500281 context->priv().recordProgramInfo(fProgramInfo);
Robert Phillipsfbfc3552019-11-18 11:50:54 -0500282 }
283
284 void onPrepare(GrOpFlushState*) final {}
285
286 void onExecute(GrOpFlushState* flushState, const SkRect& chainBounds) final {
Robert Phillips34cea002019-11-21 16:02:34 -0500287 if (!fProgramInfo) {
Robert Phillipsac6156c2020-02-28 16:02:40 -0500288 fProgramInfo = this->createProgramInfo(flushState);
Robert Phillips34cea002019-11-21 16:02:34 -0500289 }
290
Chris Daltonaa0e45c2020-03-16 10:05:11 -0600291 flushState->bindPipelineAndScissorClip(*fProgramInfo, SkRect::MakeIWH(200, 200));
292 flushState->bindBuffers(nullptr, nullptr, nullptr);
293 flushState->drawInstanced(200*200, 0, 4, 0);
Chris Daltond7291ba2019-03-07 14:17:03 -0700294 }
295
296 const GradType fGradType;
297
Robert Phillipsfbfc3552019-11-18 11:50:54 -0500298 // The program info (and both the GrPipeline and GrPrimitiveProcessor it relies on), when
Robert Phillips34cea002019-11-21 16:02:34 -0500299 // allocated, are allocated in either the ddl-record-time or flush-time arena. It is the
300 // arena's job to free up their memory so we just have a bare programInfo pointer here. We
301 // don't even store the GrPipeline and GrPrimitiveProcessor pointers here bc they are
302 // guaranteed to have the same lifetime as the program info.
Robert Phillipsfbfc3552019-11-18 11:50:54 -0500303 GrProgramInfo* fProgramInfo = nullptr;
304
Chris Daltond7291ba2019-03-07 14:17:03 -0700305 friend class ::GrOpMemoryPool; // for ctor
Robert Phillipsfbfc3552019-11-18 11:50:54 -0500306
307 typedef GrDrawOp INHERITED;
Chris Daltond7291ba2019-03-07 14:17:03 -0700308};
309
310////////////////////////////////////////////////////////////////////////////////////////////////////
311// Test.
312
Robert Phillips95c250c2020-06-29 15:36:12 -0400313DrawResult SampleLocationsGM::onDraw(GrRecordingContext* ctx, GrRenderTargetContext* rtc,
314 SkCanvas* canvas, SkString* errorMsg) {
Chris Daltond7291ba2019-03-07 14:17:03 -0700315 if (!ctx->priv().caps()->sampleLocationsSupport()) {
316 *errorMsg = "Requires support for sample locations.";
317 return DrawResult::kSkip;
318 }
Chris Dalton8a64a442019-10-29 18:54:58 -0600319 if (!ctx->priv().caps()->shaderCaps()->sampleMaskSupport()) {
320 *errorMsg = "Requires support for sample mask.";
Chris Daltond7291ba2019-03-07 14:17:03 -0700321 return DrawResult::kSkip;
322 }
Chris Dalton03fdf6a2020-04-07 12:31:59 -0600323 if (!ctx->priv().caps()->drawInstancedSupport()) {
324 *errorMsg = "Requires support for instanced rendering.";
325 return DrawResult::kSkip;
326 }
Chris Daltoneffee202019-07-01 22:28:03 -0600327 if (rtc->numSamples() <= 1 && !ctx->priv().caps()->mixedSamplesSupport()) {
328 *errorMsg = "MSAA and mixed samples only.";
329 return DrawResult::kSkip;
330 }
331
Greg Daniele20fcad2020-01-08 11:52:34 -0500332 auto offscreenRTC = GrRenderTargetContext::Make(
333 ctx, rtc->colorInfo().colorType(), nullptr, SkBackingFit::kExact, {200, 200},
334 rtc->numSamples(), GrMipMapped::kNo, GrProtected::kNo, fOrigin);
Chris Daltoneffee202019-07-01 22:28:03 -0600335 if (!offscreenRTC) {
336 *errorMsg = "Failed to create offscreen render target.";
337 return DrawResult::kFail;
338 }
339 if (offscreenRTC->numSamples() <= 1 &&
Greg Daniel46e366a2019-12-16 14:38:36 -0500340 !offscreenRTC->asRenderTargetProxy()->canUseMixedSamples(*ctx->priv().caps())) {
Chris Daltoneffee202019-07-01 22:28:03 -0600341 *errorMsg = "MSAA and mixed samples only.";
342 return DrawResult::kSkip;
343 }
Chris Daltond7291ba2019-03-07 14:17:03 -0700344
345 static constexpr GrUserStencilSettings kStencilCover(
346 GrUserStencilSettings::StaticInit<
347 0x0000,
348 GrUserStencilTest::kNotEqual,
349 0xffff,
350 GrUserStencilOp::kZero,
351 GrUserStencilOp::kKeep,
352 0xffff>()
353 );
354
Michael Ludwig81d41722020-05-26 16:57:38 -0400355 offscreenRTC->clear({0,1,0,1});
Chris Daltond7291ba2019-03-07 14:17:03 -0700356
Chris Daltoneffee202019-07-01 22:28:03 -0600357 // Stencil.
358 offscreenRTC->priv().testingOnly_addDrawOp(
359 SampleLocationsTestOp::Make(ctx, canvas->getTotalMatrix(), fGradType));
Chris Dalton6ce447a2019-06-23 18:07:38 -0600360
Chris Daltoneffee202019-07-01 22:28:03 -0600361 // Cover.
362 GrPaint coverPaint;
363 coverPaint.setColor4f({1,0,0,1});
364 coverPaint.setXPFactory(GrPorterDuffXPFactory::Get(SkBlendMode::kSrcOver));
Michael Ludwig7c12e282020-05-29 09:54:07 -0400365 rtc->priv().stencilRect(nullptr, &kStencilCover, std::move(coverPaint), GrAA::kNo,
Chris Daltoneffee202019-07-01 22:28:03 -0600366 SkMatrix::I(), SkRect::MakeWH(200, 200));
Chris Daltond7291ba2019-03-07 14:17:03 -0700367
Chris Daltoneffee202019-07-01 22:28:03 -0600368 // Copy offscreen texture to canvas.
Michael Ludwig7c12e282020-05-29 09:54:07 -0400369 rtc->drawTexture(nullptr, offscreenRTC->readSurfaceView(),
Greg Daniel40903af2020-01-30 14:55:05 -0500370 offscreenRTC->colorInfo().alphaType(),
Brian Salomonfc118442019-11-22 19:09:27 -0500371 GrSamplerState::Filter::kNearest, SkBlendMode::kSrc, SK_PMColor4fWHITE,
372 {0,0,200,200}, {0,0,200,200}, GrAA::kNo, GrQuadAAFlags::kNone,
373 SkCanvas::SrcRectConstraint::kStrict_SrcRectConstraint, SkMatrix::I(),
374 nullptr);
Chris Daltond7291ba2019-03-07 14:17:03 -0700375
376 return skiagm::DrawResult::kOk;
377}
378
379DEF_GM( return new SampleLocationsGM(GradType::kHW, kTopLeft_GrSurfaceOrigin); )
380DEF_GM( return new SampleLocationsGM(GradType::kHW, kBottomLeft_GrSurfaceOrigin); )
381DEF_GM( return new SampleLocationsGM(GradType::kSW, kTopLeft_GrSurfaceOrigin); )
382DEF_GM( return new SampleLocationsGM(GradType::kSW, kBottomLeft_GrSurfaceOrigin); )
383
384}