Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [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 "include/core/SkTypes.h" |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 9 | |
| 10 | #if SK_SUPPORT_GPU |
| 11 | |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 12 | #include "include/core/SkCanvas.h" |
| 13 | #include "include/core/SkPaint.h" |
| 14 | #include "include/core/SkPath.h" |
| 15 | #include "samplecode/Sample.h" |
| 16 | #include "src/core/SkMakeUnique.h" |
| 17 | #include "src/core/SkRectPriv.h" |
| 18 | #include "src/gpu/GrClip.h" |
| 19 | #include "src/gpu/GrContextPriv.h" |
| 20 | #include "src/gpu/GrMemoryPool.h" |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 21 | #include "src/gpu/GrRenderTargetContext.h" |
| 22 | #include "src/gpu/GrRenderTargetContextPriv.h" |
| 23 | #include "src/gpu/GrResourceProvider.h" |
| 24 | #include "src/gpu/ccpr/GrCCCoverageProcessor.h" |
| 25 | #include "src/gpu/ccpr/GrCCFillGeometry.h" |
| 26 | #include "src/gpu/ccpr/GrCCStroker.h" |
| 27 | #include "src/gpu/ccpr/GrGSCoverageProcessor.h" |
| 28 | #include "src/gpu/ccpr/GrVSCoverageProcessor.h" |
Michael Ludwig | 663afe5 | 2019-06-03 16:46:19 -0400 | [diff] [blame] | 29 | #include "src/gpu/geometry/GrPathUtils.h" |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 30 | #include "src/gpu/gl/GrGLGpu.h" |
| 31 | #include "src/gpu/glsl/GrGLSLFragmentProcessor.h" |
| 32 | #include "src/gpu/ops/GrDrawOp.h" |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 33 | |
Chris Dalton | 84403d7 | 2018-02-13 21:46:17 -0500 | [diff] [blame] | 34 | using TriPointInstance = GrCCCoverageProcessor::TriPointInstance; |
| 35 | using QuadPointInstance = GrCCCoverageProcessor::QuadPointInstance; |
Chris Dalton | 8dfc70f | 2018-03-26 19:15:22 -0600 | [diff] [blame] | 36 | using PrimitiveType = GrCCCoverageProcessor::PrimitiveType; |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 37 | |
Chris Dalton | a640c49 | 2017-09-11 22:04:03 -0700 | [diff] [blame] | 38 | static constexpr float kDebugBloat = 40; |
| 39 | |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 40 | /** |
| 41 | * This sample visualizes the AA bloat geometry generated by the ccpr geometry shaders. It |
| 42 | * increases the AA bloat by 50x and outputs color instead of coverage (coverage=+1 -> green, |
| 43 | * coverage=0 -> black, coverage=-1 -> red). Use the keys 1-7 to cycle through the different |
| 44 | * geometry processors. |
| 45 | */ |
Ben Wagner | b2c4ea6 | 2018-08-08 11:36:17 -0400 | [diff] [blame] | 46 | class CCPRGeometryView : public Sample { |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 47 | public: |
| 48 | CCPRGeometryView() { this->updateGpuData(); } |
| 49 | void onDrawContent(SkCanvas*) override; |
| 50 | |
Ben Wagner | b2c4ea6 | 2018-08-08 11:36:17 -0400 | [diff] [blame] | 51 | Sample::Click* onFindClickHandler(SkScalar x, SkScalar y, unsigned) override; |
| 52 | bool onClick(Sample::Click*) override; |
| 53 | bool onQuery(Sample::Event* evt) override; |
Hal Canary | 8a02731 | 2019-07-03 10:55:44 -0400 | [diff] [blame] | 54 | SkString name() override { return SkString("CCPRGeometry"); } |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 55 | |
| 56 | private: |
| 57 | class Click; |
Chris Dalton | 8d38a7f | 2018-03-19 14:16:44 -0600 | [diff] [blame] | 58 | class DrawCoverageCountOp; |
| 59 | class VisualizeCoverageCountFP; |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 60 | |
Chris Dalton | 383a2ef | 2018-01-08 17:21:41 -0500 | [diff] [blame] | 61 | void updateAndInval() { this->updateGpuData(); } |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 62 | |
| 63 | void updateGpuData(); |
| 64 | |
Chris Dalton | 8dfc70f | 2018-03-26 19:15:22 -0600 | [diff] [blame] | 65 | PrimitiveType fPrimitiveType = PrimitiveType::kTriangles; |
Chris Dalton | be4ffab | 2017-12-08 10:59:58 -0700 | [diff] [blame] | 66 | SkCubicType fCubicType; |
Chris Dalton | 7f578bf | 2017-09-05 16:46:48 -0600 | [diff] [blame] | 67 | SkMatrix fCubicKLM; |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 68 | |
| 69 | SkPoint fPoints[4] = { |
Chris Dalton | 383a2ef | 2018-01-08 17:21:41 -0500 | [diff] [blame] | 70 | {100.05f, 100.05f}, {400.75f, 100.05f}, {400.75f, 300.95f}, {100.05f, 300.95f}}; |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 71 | |
Chris Dalton | 9f2dab0 | 2018-04-18 14:07:03 -0600 | [diff] [blame] | 72 | float fConicWeight = .5; |
Chris Dalton | 09a7bb2 | 2018-08-31 19:53:15 +0800 | [diff] [blame] | 73 | float fStrokeWidth = 40; |
| 74 | bool fDoStroke = false; |
Chris Dalton | 9f2dab0 | 2018-04-18 14:07:03 -0600 | [diff] [blame] | 75 | |
Chris Dalton | 84403d7 | 2018-02-13 21:46:17 -0500 | [diff] [blame] | 76 | SkTArray<TriPointInstance> fTriPointInstances; |
| 77 | SkTArray<QuadPointInstance> fQuadPointInstances; |
Chris Dalton | 09a7bb2 | 2018-08-31 19:53:15 +0800 | [diff] [blame] | 78 | SkPath fPath; |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 79 | |
Ben Wagner | b2c4ea6 | 2018-08-08 11:36:17 -0400 | [diff] [blame] | 80 | typedef Sample INHERITED; |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 81 | }; |
| 82 | |
Chris Dalton | 8d38a7f | 2018-03-19 14:16:44 -0600 | [diff] [blame] | 83 | class CCPRGeometryView::DrawCoverageCountOp : public GrDrawOp { |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 84 | DEFINE_OP_CLASS_ID |
| 85 | |
| 86 | public: |
Chris Dalton | 8d38a7f | 2018-03-19 14:16:44 -0600 | [diff] [blame] | 87 | DrawCoverageCountOp(CCPRGeometryView* view) : INHERITED(ClassID()), fView(view) { |
Chris Dalton | e163969 | 2018-08-20 14:00:30 -0600 | [diff] [blame] | 88 | this->setBounds(SkRect::MakeIWH(fView->width(), fView->height()), GrOp::HasAABloat::kNo, |
| 89 | GrOp::IsZeroArea::kNo); |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 90 | } |
| 91 | |
Chris Dalton | 8d38a7f | 2018-03-19 14:16:44 -0600 | [diff] [blame] | 92 | const char* name() const override { |
| 93 | return "[Testing/Sample code] CCPRGeometryView::DrawCoverageCountOp"; |
| 94 | } |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 95 | |
| 96 | private: |
| 97 | FixedFunctionFlags fixedFunctionFlags() const override { return FixedFunctionFlags::kNone; } |
Chris Dalton | 6ce447a | 2019-06-23 18:07:38 -0600 | [diff] [blame] | 98 | GrProcessorSet::Analysis finalize(const GrCaps&, const GrAppliedClip*, |
| 99 | bool hasMixedSampledCoverage, GrClampType) override { |
Chris Dalton | 4b62aed | 2019-01-15 11:53:00 -0700 | [diff] [blame] | 100 | return GrProcessorSet::EmptySetAnalysis(); |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 101 | } |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 102 | void onPrepare(GrOpFlushState*) override {} |
Brian Salomon | 588cec7 | 2018-11-14 13:56:37 -0500 | [diff] [blame] | 103 | void onExecute(GrOpFlushState*, const SkRect& chainBounds) override; |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 104 | |
| 105 | CCPRGeometryView* fView; |
| 106 | |
| 107 | typedef GrDrawOp INHERITED; |
| 108 | }; |
| 109 | |
Chris Dalton | 8d38a7f | 2018-03-19 14:16:44 -0600 | [diff] [blame] | 110 | class CCPRGeometryView::VisualizeCoverageCountFP : public GrFragmentProcessor { |
| 111 | public: |
| 112 | VisualizeCoverageCountFP() : GrFragmentProcessor(kTestFP_ClassID, kNone_OptimizationFlags) {} |
| 113 | |
| 114 | private: |
| 115 | const char* name() const override { |
| 116 | return "[Testing/Sample code] CCPRGeometryView::VisualizeCoverageCountFP"; |
| 117 | } |
| 118 | std::unique_ptr<GrFragmentProcessor> clone() const override { |
| 119 | return skstd::make_unique<VisualizeCoverageCountFP>(); |
| 120 | } |
| 121 | void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override {} |
| 122 | bool onIsEqual(const GrFragmentProcessor&) const override { return true; } |
| 123 | |
| 124 | class Impl : public GrGLSLFragmentProcessor { |
| 125 | void emitCode(EmitArgs& args) override { |
| 126 | GrGLSLFPFragmentBuilder* f = args.fFragBuilder; |
| 127 | f->codeAppendf("half count = %s.a;", args.fInputColor); |
| 128 | f->codeAppendf("%s = half4(clamp(-count, 0, 1), clamp(+count, 0, 1), 0, abs(count));", |
| 129 | args.fOutputColor); |
| 130 | } |
| 131 | }; |
| 132 | |
| 133 | GrGLSLFragmentProcessor* onCreateGLSLInstance() const override { return new Impl; } |
| 134 | }; |
| 135 | |
Chris Dalton | 7f578bf | 2017-09-05 16:46:48 -0600 | [diff] [blame] | 136 | static void draw_klm_line(int w, int h, SkCanvas* canvas, const SkScalar line[3], SkColor color) { |
| 137 | SkPoint p1, p2; |
| 138 | if (SkScalarAbs(line[1]) > SkScalarAbs(line[0])) { |
| 139 | // Draw from vertical edge to vertical edge. |
| 140 | p1 = {0, -line[2] / line[1]}; |
Chris Dalton | 383a2ef | 2018-01-08 17:21:41 -0500 | [diff] [blame] | 141 | p2 = {(SkScalar)w, (-line[2] - w * line[0]) / line[1]}; |
Chris Dalton | 7f578bf | 2017-09-05 16:46:48 -0600 | [diff] [blame] | 142 | } else { |
| 143 | // Draw from horizontal edge to horizontal edge. |
| 144 | p1 = {-line[2] / line[0], 0}; |
Chris Dalton | 383a2ef | 2018-01-08 17:21:41 -0500 | [diff] [blame] | 145 | p2 = {(-line[2] - h * line[1]) / line[0], (SkScalar)h}; |
Chris Dalton | 7f578bf | 2017-09-05 16:46:48 -0600 | [diff] [blame] | 146 | } |
| 147 | |
| 148 | SkPaint linePaint; |
| 149 | linePaint.setColor(color); |
| 150 | linePaint.setAlpha(128); |
| 151 | linePaint.setStyle(SkPaint::kStroke_Style); |
| 152 | linePaint.setStrokeWidth(0); |
| 153 | linePaint.setAntiAlias(true); |
| 154 | canvas->drawLine(p1, p2, linePaint); |
| 155 | } |
| 156 | |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 157 | void CCPRGeometryView::onDrawContent(SkCanvas* canvas) { |
Chris Dalton | 8738cf4 | 2018-03-09 11:57:40 -0700 | [diff] [blame] | 158 | canvas->clear(SK_ColorBLACK); |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 159 | |
Chris Dalton | 09a7bb2 | 2018-08-31 19:53:15 +0800 | [diff] [blame] | 160 | if (!fDoStroke) { |
| 161 | SkPaint outlinePaint; |
| 162 | outlinePaint.setColor(0x80ffffff); |
| 163 | outlinePaint.setStyle(SkPaint::kStroke_Style); |
| 164 | outlinePaint.setStrokeWidth(0); |
| 165 | outlinePaint.setAntiAlias(true); |
| 166 | canvas->drawPath(fPath, outlinePaint); |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 167 | } |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 168 | |
Chris Dalton | 7f578bf | 2017-09-05 16:46:48 -0600 | [diff] [blame] | 169 | #if 0 |
| 170 | SkPaint gridPaint; |
| 171 | gridPaint.setColor(0x10000000); |
| 172 | gridPaint.setStyle(SkPaint::kStroke_Style); |
| 173 | gridPaint.setStrokeWidth(0); |
| 174 | gridPaint.setAntiAlias(true); |
Chris Dalton | a640c49 | 2017-09-11 22:04:03 -0700 | [diff] [blame] | 175 | for (int y = 0; y < this->height(); y += kDebugBloat) { |
Chris Dalton | 7f578bf | 2017-09-05 16:46:48 -0600 | [diff] [blame] | 176 | canvas->drawLine(0, y, this->width(), y, gridPaint); |
| 177 | } |
Chris Dalton | a640c49 | 2017-09-11 22:04:03 -0700 | [diff] [blame] | 178 | for (int x = 0; x < this->width(); x += kDebugBloat) { |
Chris Dalton | 7f578bf | 2017-09-05 16:46:48 -0600 | [diff] [blame] | 179 | canvas->drawLine(x, 0, x, this->height(), outlinePaint); |
| 180 | } |
| 181 | #endif |
| 182 | |
Chris Dalton | be4ffab | 2017-12-08 10:59:58 -0700 | [diff] [blame] | 183 | SkString caption; |
Chris Dalton | 383a2ef | 2018-01-08 17:21:41 -0500 | [diff] [blame] | 184 | if (GrRenderTargetContext* rtc = canvas->internal_private_accessTopLayerRenderTargetContext()) { |
Chris Dalton | 8d38a7f | 2018-03-19 14:16:44 -0600 | [diff] [blame] | 185 | // Render coverage count. |
| 186 | GrContext* ctx = canvas->getGrContext(); |
Chris Dalton | e163969 | 2018-08-20 14:00:30 -0600 | [diff] [blame] | 187 | SkASSERT(ctx); |
| 188 | |
Robert Phillips | 9da87e0 | 2019-02-04 13:26:26 -0500 | [diff] [blame] | 189 | GrOpMemoryPool* pool = ctx->priv().opMemoryPool(); |
Ben Wagner | d4bffed | 2018-08-14 17:51:23 -0400 | [diff] [blame] | 190 | |
Brian Salomon | d628747 | 2019-06-24 15:50:07 -0400 | [diff] [blame] | 191 | sk_sp<GrRenderTargetContext> ccbuff = ctx->priv().makeDeferredRenderTargetContext( |
Brian Salomon | 27ae52c | 2019-07-03 11:27:44 -0400 | [diff] [blame] | 192 | SkBackingFit::kApprox, this->width(), this->height(), GrColorType::kAlpha_F16, |
| 193 | nullptr); |
Chris Dalton | 8d38a7f | 2018-03-19 14:16:44 -0600 | [diff] [blame] | 194 | SkASSERT(ccbuff); |
Brian Osman | 9a9baae | 2018-11-05 15:06:26 -0500 | [diff] [blame] | 195 | ccbuff->clear(nullptr, SK_PMColor4fTRANSPARENT, |
| 196 | GrRenderTargetContext::CanClearFullscreen::kYes); |
Ben Wagner | d4bffed | 2018-08-14 17:51:23 -0400 | [diff] [blame] | 197 | ccbuff->priv().testingOnly_addDrawOp(pool->allocate<DrawCoverageCountOp>(this)); |
Chris Dalton | 8d38a7f | 2018-03-19 14:16:44 -0600 | [diff] [blame] | 198 | |
| 199 | // Visualize coverage count in main canvas. |
| 200 | GrPaint paint; |
| 201 | paint.addColorFragmentProcessor( |
| 202 | GrSimpleTextureEffect::Make(sk_ref_sp(ccbuff->asTextureProxy()), SkMatrix::I())); |
| 203 | paint.addColorFragmentProcessor( |
| 204 | skstd::make_unique<VisualizeCoverageCountFP>()); |
| 205 | paint.setPorterDuffXPFactory(SkBlendMode::kSrcOver); |
| 206 | rtc->drawRect(GrNoClip(), std::move(paint), GrAA::kNo, SkMatrix::I(), |
| 207 | SkRect::MakeIWH(this->width(), this->height())); |
| 208 | |
| 209 | // Add label. |
Chris Dalton | 703b476 | 2018-04-06 16:11:48 -0600 | [diff] [blame] | 210 | caption.appendf("PrimitiveType_%s", |
| 211 | GrCCCoverageProcessor::PrimitiveTypeName(fPrimitiveType)); |
Chris Dalton | 8dfc70f | 2018-03-26 19:15:22 -0600 | [diff] [blame] | 212 | if (PrimitiveType::kCubics == fPrimitiveType) { |
Chris Dalton | be4ffab | 2017-12-08 10:59:58 -0700 | [diff] [blame] | 213 | caption.appendf(" (%s)", SkCubicTypeName(fCubicType)); |
Chris Dalton | 9f2dab0 | 2018-04-18 14:07:03 -0600 | [diff] [blame] | 214 | } else if (PrimitiveType::kConics == fPrimitiveType) { |
| 215 | caption.appendf(" (w=%f)", fConicWeight); |
Chris Dalton | be4ffab | 2017-12-08 10:59:58 -0700 | [diff] [blame] | 216 | } |
Chris Dalton | 09a7bb2 | 2018-08-31 19:53:15 +0800 | [diff] [blame] | 217 | if (fDoStroke) { |
| 218 | caption.appendf(" (stroke_width=%f)", fStrokeWidth); |
| 219 | } |
Chris Dalton | be4ffab | 2017-12-08 10:59:58 -0700 | [diff] [blame] | 220 | } else { |
| 221 | caption = "Use GPU backend to visualize geometry."; |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 222 | } |
| 223 | |
| 224 | SkPaint pointsPaint; |
| 225 | pointsPaint.setColor(SK_ColorBLUE); |
| 226 | pointsPaint.setStrokeWidth(8); |
| 227 | pointsPaint.setAntiAlias(true); |
| 228 | |
Chris Dalton | 8dfc70f | 2018-03-26 19:15:22 -0600 | [diff] [blame] | 229 | if (PrimitiveType::kCubics == fPrimitiveType) { |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 230 | canvas->drawPoints(SkCanvas::kPoints_PointMode, 4, fPoints, pointsPaint); |
Chris Dalton | 09a7bb2 | 2018-08-31 19:53:15 +0800 | [diff] [blame] | 231 | if (!fDoStroke) { |
| 232 | int w = this->width(), h = this->height(); |
| 233 | draw_klm_line(w, h, canvas, &fCubicKLM[0], SK_ColorYELLOW); |
| 234 | draw_klm_line(w, h, canvas, &fCubicKLM[3], SK_ColorBLUE); |
| 235 | draw_klm_line(w, h, canvas, &fCubicKLM[6], SK_ColorRED); |
| 236 | } |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 237 | } else { |
| 238 | canvas->drawPoints(SkCanvas::kPoints_PointMode, 2, fPoints, pointsPaint); |
| 239 | canvas->drawPoints(SkCanvas::kPoints_PointMode, 1, fPoints + 3, pointsPaint); |
| 240 | } |
| 241 | |
Hal Canary | 4484b8f | 2019-01-08 14:00:08 -0500 | [diff] [blame] | 242 | SkFont font(nullptr, 20); |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 243 | SkPaint captionPaint; |
Chris Dalton | 8738cf4 | 2018-03-09 11:57:40 -0700 | [diff] [blame] | 244 | captionPaint.setColor(SK_ColorWHITE); |
Hal Canary | 4484b8f | 2019-01-08 14:00:08 -0500 | [diff] [blame] | 245 | canvas->drawString(caption, 10, 30, font, captionPaint); |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 246 | } |
| 247 | |
| 248 | void CCPRGeometryView::updateGpuData() { |
Chris Dalton | e163969 | 2018-08-20 14:00:30 -0600 | [diff] [blame] | 249 | using Verb = GrCCFillGeometry::Verb; |
Chris Dalton | 84403d7 | 2018-02-13 21:46:17 -0500 | [diff] [blame] | 250 | fTriPointInstances.reset(); |
| 251 | fQuadPointInstances.reset(); |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 252 | |
Chris Dalton | 09a7bb2 | 2018-08-31 19:53:15 +0800 | [diff] [blame] | 253 | fPath.reset(); |
| 254 | fPath.moveTo(fPoints[0]); |
| 255 | |
Chris Dalton | 8dfc70f | 2018-03-26 19:15:22 -0600 | [diff] [blame] | 256 | if (PrimitiveType::kCubics == fPrimitiveType) { |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 257 | double t[2], s[2]; |
Chris Dalton | be4ffab | 2017-12-08 10:59:58 -0700 | [diff] [blame] | 258 | fCubicType = GrPathUtils::getCubicKLM(fPoints, &fCubicKLM, t, s); |
Chris Dalton | e163969 | 2018-08-20 14:00:30 -0600 | [diff] [blame] | 259 | GrCCFillGeometry geometry; |
Chris Dalton | 7f578bf | 2017-09-05 16:46:48 -0600 | [diff] [blame] | 260 | geometry.beginContour(fPoints[0]); |
Chris Dalton | 7ca3b7b | 2018-04-10 00:21:19 -0600 | [diff] [blame] | 261 | geometry.cubicTo(fPoints, kDebugBloat / 2, kDebugBloat / 2); |
Chris Dalton | 7f578bf | 2017-09-05 16:46:48 -0600 | [diff] [blame] | 262 | geometry.endContour(); |
Chris Dalton | 7f578bf | 2017-09-05 16:46:48 -0600 | [diff] [blame] | 263 | int ptsIdx = 0; |
Chris Dalton | e163969 | 2018-08-20 14:00:30 -0600 | [diff] [blame] | 264 | for (Verb verb : geometry.verbs()) { |
Chris Dalton | 7f578bf | 2017-09-05 16:46:48 -0600 | [diff] [blame] | 265 | switch (verb) { |
Chris Dalton | e163969 | 2018-08-20 14:00:30 -0600 | [diff] [blame] | 266 | case Verb::kLineTo: |
Chris Dalton | 7f578bf | 2017-09-05 16:46:48 -0600 | [diff] [blame] | 267 | ++ptsIdx; |
| 268 | continue; |
Chris Dalton | e163969 | 2018-08-20 14:00:30 -0600 | [diff] [blame] | 269 | case Verb::kMonotonicQuadraticTo: |
Chris Dalton | 7f578bf | 2017-09-05 16:46:48 -0600 | [diff] [blame] | 270 | ptsIdx += 2; |
| 271 | continue; |
Chris Dalton | e163969 | 2018-08-20 14:00:30 -0600 | [diff] [blame] | 272 | case Verb::kMonotonicCubicTo: |
Chris Dalton | 84403d7 | 2018-02-13 21:46:17 -0500 | [diff] [blame] | 273 | fQuadPointInstances.push_back().set(&geometry.points()[ptsIdx], 0, 0); |
Chris Dalton | 7f578bf | 2017-09-05 16:46:48 -0600 | [diff] [blame] | 274 | ptsIdx += 3; |
Chris Dalton | 7f578bf | 2017-09-05 16:46:48 -0600 | [diff] [blame] | 275 | continue; |
Chris Dalton | 383a2ef | 2018-01-08 17:21:41 -0500 | [diff] [blame] | 276 | default: |
| 277 | continue; |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 278 | } |
| 279 | } |
Chris Dalton | 09a7bb2 | 2018-08-31 19:53:15 +0800 | [diff] [blame] | 280 | fPath.cubicTo(fPoints[1], fPoints[2], fPoints[3]); |
Chris Dalton | 9f2dab0 | 2018-04-18 14:07:03 -0600 | [diff] [blame] | 281 | } else if (PrimitiveType::kTriangles != fPrimitiveType) { |
Chris Dalton | 7ca3b7b | 2018-04-10 00:21:19 -0600 | [diff] [blame] | 282 | SkPoint P3[3] = {fPoints[0], fPoints[1], fPoints[3]}; |
Chris Dalton | e163969 | 2018-08-20 14:00:30 -0600 | [diff] [blame] | 283 | GrCCFillGeometry geometry; |
Chris Dalton | 7ca3b7b | 2018-04-10 00:21:19 -0600 | [diff] [blame] | 284 | geometry.beginContour(P3[0]); |
Chris Dalton | 9f2dab0 | 2018-04-18 14:07:03 -0600 | [diff] [blame] | 285 | if (PrimitiveType::kQuadratics == fPrimitiveType) { |
| 286 | geometry.quadraticTo(P3); |
Chris Dalton | 09a7bb2 | 2018-08-31 19:53:15 +0800 | [diff] [blame] | 287 | fPath.quadTo(fPoints[1], fPoints[3]); |
Chris Dalton | 9f2dab0 | 2018-04-18 14:07:03 -0600 | [diff] [blame] | 288 | } else { |
| 289 | SkASSERT(PrimitiveType::kConics == fPrimitiveType); |
| 290 | geometry.conicTo(P3, fConicWeight); |
Chris Dalton | 09a7bb2 | 2018-08-31 19:53:15 +0800 | [diff] [blame] | 291 | fPath.conicTo(fPoints[1], fPoints[3], fConicWeight); |
Chris Dalton | 9f2dab0 | 2018-04-18 14:07:03 -0600 | [diff] [blame] | 292 | } |
Chris Dalton | c1e5963 | 2017-09-05 00:30:07 -0600 | [diff] [blame] | 293 | geometry.endContour(); |
Chris Dalton | 9f2dab0 | 2018-04-18 14:07:03 -0600 | [diff] [blame] | 294 | int ptsIdx = 0, conicWeightIdx = 0; |
Chris Dalton | e163969 | 2018-08-20 14:00:30 -0600 | [diff] [blame] | 295 | for (Verb verb : geometry.verbs()) { |
| 296 | if (Verb::kBeginContour == verb || |
| 297 | Verb::kEndOpenContour == verb || |
| 298 | Verb::kEndClosedContour == verb) { |
Chris Dalton | c1e5963 | 2017-09-05 00:30:07 -0600 | [diff] [blame] | 299 | continue; |
| 300 | } |
Chris Dalton | e163969 | 2018-08-20 14:00:30 -0600 | [diff] [blame] | 301 | if (Verb::kLineTo == verb) { |
Chris Dalton | 90e8fb1 | 2017-12-22 02:24:53 -0700 | [diff] [blame] | 302 | ++ptsIdx; |
| 303 | continue; |
| 304 | } |
Chris Dalton | e163969 | 2018-08-20 14:00:30 -0600 | [diff] [blame] | 305 | SkASSERT(Verb::kMonotonicQuadraticTo == verb || Verb::kMonotonicConicTo == verb); |
Chris Dalton | 9f2dab0 | 2018-04-18 14:07:03 -0600 | [diff] [blame] | 306 | if (PrimitiveType::kQuadratics == fPrimitiveType && |
Chris Dalton | e163969 | 2018-08-20 14:00:30 -0600 | [diff] [blame] | 307 | Verb::kMonotonicQuadraticTo == verb) { |
Chris Dalton | 9f2dab0 | 2018-04-18 14:07:03 -0600 | [diff] [blame] | 308 | fTriPointInstances.push_back().set(&geometry.points()[ptsIdx], Sk2f(0, 0)); |
| 309 | } else if (PrimitiveType::kConics == fPrimitiveType && |
Chris Dalton | e163969 | 2018-08-20 14:00:30 -0600 | [diff] [blame] | 310 | Verb::kMonotonicConicTo == verb) { |
Chris Dalton | 9f2dab0 | 2018-04-18 14:07:03 -0600 | [diff] [blame] | 311 | fQuadPointInstances.push_back().setW(&geometry.points()[ptsIdx], Sk2f(0, 0), |
| 312 | geometry.getConicWeight(conicWeightIdx++)); |
| 313 | } |
Chris Dalton | a3e9271 | 2017-12-04 11:45:51 -0700 | [diff] [blame] | 314 | ptsIdx += 2; |
Chris Dalton | b072bb6 | 2017-08-07 09:00:46 -0600 | [diff] [blame] | 315 | } |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 316 | } else { |
Chris Dalton | 84403d7 | 2018-02-13 21:46:17 -0500 | [diff] [blame] | 317 | fTriPointInstances.push_back().set(fPoints[0], fPoints[1], fPoints[3], Sk2f(0, 0)); |
Chris Dalton | 09a7bb2 | 2018-08-31 19:53:15 +0800 | [diff] [blame] | 318 | fPath.lineTo(fPoints[1]); |
| 319 | fPath.lineTo(fPoints[3]); |
| 320 | fPath.close(); |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 321 | } |
| 322 | } |
| 323 | |
Brian Salomon | 588cec7 | 2018-11-14 13:56:37 -0500 | [diff] [blame] | 324 | void CCPRGeometryView::DrawCoverageCountOp::onExecute(GrOpFlushState* state, |
| 325 | const SkRect& chainBounds) { |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 326 | GrResourceProvider* rp = state->resourceProvider(); |
| 327 | GrContext* context = state->gpu()->getContext(); |
Robert Phillips | 4217ea7 | 2019-01-30 13:08:28 -0500 | [diff] [blame] | 328 | GrGLGpu* glGpu = GrBackendApi::kOpenGL == context->backend() |
Chris Dalton | 383a2ef | 2018-01-08 17:21:41 -0500 | [diff] [blame] | 329 | ? static_cast<GrGLGpu*>(state->gpu()) |
| 330 | : nullptr; |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 331 | if (glGpu) { |
| 332 | glGpu->handleDirtyContext(); |
Chris Dalton | 8738cf4 | 2018-03-09 11:57:40 -0700 | [diff] [blame] | 333 | // GR_GL_CALL(glGpu->glInterface(), PolygonMode(GR_GL_FRONT_AND_BACK, GR_GL_LINE)); |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 334 | GR_GL_CALL(glGpu->glInterface(), Enable(GR_GL_LINE_SMOOTH)); |
| 335 | } |
| 336 | |
Greg Daniel | 2c3398d | 2019-06-19 11:58:01 -0400 | [diff] [blame] | 337 | GrPipeline pipeline(GrScissorTest::kDisabled, SkBlendMode::kPlus, |
| 338 | state->drawOpArgs().fOutputSwizzle); |
Chris Dalton | 09a7bb2 | 2018-08-31 19:53:15 +0800 | [diff] [blame] | 339 | |
Chris Dalton | 2c5e011 | 2019-03-29 13:14:18 -0500 | [diff] [blame] | 340 | std::unique_ptr<GrCCCoverageProcessor> proc; |
| 341 | if (state->caps().shaderCaps()->geometryShaderSupport()) { |
| 342 | proc = skstd::make_unique<GrGSCoverageProcessor>(); |
| 343 | } else { |
| 344 | proc = skstd::make_unique<GrVSCoverageProcessor>(); |
| 345 | } |
| 346 | |
Chris Dalton | 09a7bb2 | 2018-08-31 19:53:15 +0800 | [diff] [blame] | 347 | if (!fView->fDoStroke) { |
Chris Dalton | 2c5e011 | 2019-03-29 13:14:18 -0500 | [diff] [blame] | 348 | proc->reset(fView->fPrimitiveType, rp); |
| 349 | SkDEBUGCODE(proc->enableDebugBloat(kDebugBloat)); |
Chris Dalton | 09a7bb2 | 2018-08-31 19:53:15 +0800 | [diff] [blame] | 350 | |
| 351 | SkSTArray<1, GrMesh> mesh; |
| 352 | if (PrimitiveType::kCubics == fView->fPrimitiveType || |
| 353 | PrimitiveType::kConics == fView->fPrimitiveType) { |
Brian Salomon | dbf7072 | 2019-02-07 11:31:24 -0500 | [diff] [blame] | 354 | sk_sp<GrGpuBuffer> instBuff( |
Brian Salomon | ae64c19 | 2019-02-05 09:41:37 -0500 | [diff] [blame] | 355 | rp->createBuffer(fView->fQuadPointInstances.count() * sizeof(QuadPointInstance), |
| 356 | GrGpuBufferType::kVertex, kDynamic_GrAccessPattern, |
Brian Salomon | ae64c19 | 2019-02-05 09:41:37 -0500 | [diff] [blame] | 357 | fView->fQuadPointInstances.begin())); |
Chris Dalton | 09a7bb2 | 2018-08-31 19:53:15 +0800 | [diff] [blame] | 358 | if (!fView->fQuadPointInstances.empty() && instBuff) { |
Chris Dalton | 2c5e011 | 2019-03-29 13:14:18 -0500 | [diff] [blame] | 359 | proc->appendMesh(std::move(instBuff), fView->fQuadPointInstances.count(), 0, &mesh); |
Chris Dalton | 09a7bb2 | 2018-08-31 19:53:15 +0800 | [diff] [blame] | 360 | } |
| 361 | } else { |
Brian Salomon | dbf7072 | 2019-02-07 11:31:24 -0500 | [diff] [blame] | 362 | sk_sp<GrGpuBuffer> instBuff( |
Brian Salomon | ae64c19 | 2019-02-05 09:41:37 -0500 | [diff] [blame] | 363 | rp->createBuffer(fView->fTriPointInstances.count() * sizeof(TriPointInstance), |
| 364 | GrGpuBufferType::kVertex, kDynamic_GrAccessPattern, |
Brian Salomon | ae64c19 | 2019-02-05 09:41:37 -0500 | [diff] [blame] | 365 | fView->fTriPointInstances.begin())); |
Chris Dalton | 09a7bb2 | 2018-08-31 19:53:15 +0800 | [diff] [blame] | 366 | if (!fView->fTriPointInstances.empty() && instBuff) { |
Chris Dalton | 2c5e011 | 2019-03-29 13:14:18 -0500 | [diff] [blame] | 367 | proc->appendMesh(std::move(instBuff), fView->fTriPointInstances.count(), 0, &mesh); |
Chris Dalton | 09a7bb2 | 2018-08-31 19:53:15 +0800 | [diff] [blame] | 368 | } |
| 369 | } |
| 370 | |
| 371 | if (!mesh.empty()) { |
| 372 | SkASSERT(1 == mesh.count()); |
Chris Dalton | 2c5e011 | 2019-03-29 13:14:18 -0500 | [diff] [blame] | 373 | proc->draw(state, pipeline, nullptr, mesh.begin(), 1, this->bounds()); |
Chris Dalton | 09a7bb2 | 2018-08-31 19:53:15 +0800 | [diff] [blame] | 374 | } |
| 375 | } else if (PrimitiveType::kConics != fView->fPrimitiveType) { // No conic stroke support yet. |
| 376 | GrCCStroker stroker(0,0,0); |
| 377 | |
| 378 | SkPaint p; |
| 379 | p.setStyle(SkPaint::kStroke_Style); |
| 380 | p.setStrokeWidth(fView->fStrokeWidth); |
| 381 | p.setStrokeJoin(SkPaint::kMiter_Join); |
| 382 | p.setStrokeMiter(4); |
| 383 | // p.setStrokeCap(SkPaint::kRound_Cap); |
| 384 | stroker.parseDeviceSpaceStroke(fView->fPath, SkPathPriv::PointData(fView->fPath), |
| 385 | SkStrokeRec(p), p.getStrokeWidth(), GrScissorTest::kDisabled, |
| 386 | SkIRect::MakeWH(fView->width(), fView->height()), {0, 0}); |
| 387 | GrCCStroker::BatchID batchID = stroker.closeCurrentBatch(); |
| 388 | |
Robert Phillips | 9da87e0 | 2019-02-04 13:26:26 -0500 | [diff] [blame] | 389 | GrOnFlushResourceProvider onFlushRP(context->priv().drawingManager()); |
Chris Dalton | 09a7bb2 | 2018-08-31 19:53:15 +0800 | [diff] [blame] | 390 | stroker.prepareToDraw(&onFlushRP); |
| 391 | |
| 392 | SkIRect ibounds; |
| 393 | this->bounds().roundOut(&ibounds); |
Chris Dalton | 2c5e011 | 2019-03-29 13:14:18 -0500 | [diff] [blame] | 394 | stroker.drawStrokes(state, proc.get(), batchID, ibounds); |
Chris Dalton | 2326177 | 2017-12-10 16:41:45 -0700 | [diff] [blame] | 395 | } |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 396 | |
| 397 | if (glGpu) { |
| 398 | context->resetContext(kMisc_GrGLBackendState); |
| 399 | } |
| 400 | } |
| 401 | |
Ben Wagner | b2c4ea6 | 2018-08-08 11:36:17 -0400 | [diff] [blame] | 402 | class CCPRGeometryView::Click : public Sample::Click { |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 403 | public: |
Ben Wagner | b2c4ea6 | 2018-08-08 11:36:17 -0400 | [diff] [blame] | 404 | Click(Sample* target, int ptIdx) : Sample::Click(target), fPtIdx(ptIdx) {} |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 405 | |
| 406 | void doClick(SkPoint points[]) { |
| 407 | if (fPtIdx >= 0) { |
| 408 | this->dragPoint(points, fPtIdx); |
| 409 | } else { |
| 410 | for (int i = 0; i < 4; ++i) { |
| 411 | this->dragPoint(points, i); |
| 412 | } |
| 413 | } |
| 414 | } |
| 415 | |
| 416 | private: |
Chris Dalton | 383a2ef | 2018-01-08 17:21:41 -0500 | [diff] [blame] | 417 | void dragPoint(SkPoint points[], int idx) { |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 418 | SkIPoint delta = fICurr - fIPrev; |
| 419 | points[idx] += SkPoint::Make(delta.x(), delta.y()); |
| 420 | } |
| 421 | |
| 422 | int fPtIdx; |
| 423 | }; |
| 424 | |
Ben Wagner | b2c4ea6 | 2018-08-08 11:36:17 -0400 | [diff] [blame] | 425 | Sample::Click* CCPRGeometryView::onFindClickHandler(SkScalar x, SkScalar y, unsigned) { |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 426 | for (int i = 0; i < 4; ++i) { |
Chris Dalton | 8dfc70f | 2018-03-26 19:15:22 -0600 | [diff] [blame] | 427 | if (PrimitiveType::kCubics != fPrimitiveType && 2 == i) { |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 428 | continue; |
| 429 | } |
| 430 | if (fabs(x - fPoints[i].x()) < 20 && fabsf(y - fPoints[i].y()) < 20) { |
| 431 | return new Click(this, i); |
| 432 | } |
| 433 | } |
| 434 | return new Click(this, -1); |
| 435 | } |
| 436 | |
Ben Wagner | b2c4ea6 | 2018-08-08 11:36:17 -0400 | [diff] [blame] | 437 | bool CCPRGeometryView::onClick(Sample::Click* click) { |
Chris Dalton | 383a2ef | 2018-01-08 17:21:41 -0500 | [diff] [blame] | 438 | Click* myClick = (Click*)click; |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 439 | myClick->doClick(fPoints); |
| 440 | this->updateAndInval(); |
| 441 | return true; |
| 442 | } |
| 443 | |
Ben Wagner | b2c4ea6 | 2018-08-08 11:36:17 -0400 | [diff] [blame] | 444 | bool CCPRGeometryView::onQuery(Sample::Event* evt) { |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 445 | SkUnichar unichar; |
Ben Wagner | b2c4ea6 | 2018-08-08 11:36:17 -0400 | [diff] [blame] | 446 | if (Sample::CharQ(*evt, &unichar)) { |
Chris Dalton | 9f2dab0 | 2018-04-18 14:07:03 -0600 | [diff] [blame] | 447 | if (unichar >= '1' && unichar <= '4') { |
Chris Dalton | 8dfc70f | 2018-03-26 19:15:22 -0600 | [diff] [blame] | 448 | fPrimitiveType = PrimitiveType(unichar - '1'); |
Chris Dalton | 703b476 | 2018-04-06 16:11:48 -0600 | [diff] [blame] | 449 | if (fPrimitiveType >= PrimitiveType::kWeightedTriangles) { |
| 450 | fPrimitiveType = (PrimitiveType) ((int)fPrimitiveType + 1); |
| 451 | } |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 452 | this->updateAndInval(); |
| 453 | return true; |
| 454 | } |
Chris Dalton | 09a7bb2 | 2018-08-31 19:53:15 +0800 | [diff] [blame] | 455 | float* valueToScale = nullptr; |
| 456 | if (fDoStroke) { |
| 457 | valueToScale = &fStrokeWidth; |
| 458 | } else if (PrimitiveType::kConics == fPrimitiveType) { |
| 459 | valueToScale = &fConicWeight; |
| 460 | } |
| 461 | if (valueToScale) { |
Chris Dalton | 9f2dab0 | 2018-04-18 14:07:03 -0600 | [diff] [blame] | 462 | if (unichar == '+') { |
Chris Dalton | 09a7bb2 | 2018-08-31 19:53:15 +0800 | [diff] [blame] | 463 | *valueToScale *= 2; |
Chris Dalton | 9f2dab0 | 2018-04-18 14:07:03 -0600 | [diff] [blame] | 464 | this->updateAndInval(); |
| 465 | return true; |
| 466 | } |
| 467 | if (unichar == '+' || unichar == '=') { |
Chris Dalton | 09a7bb2 | 2018-08-31 19:53:15 +0800 | [diff] [blame] | 468 | *valueToScale *= 5/4.f; |
Chris Dalton | 9f2dab0 | 2018-04-18 14:07:03 -0600 | [diff] [blame] | 469 | this->updateAndInval(); |
| 470 | return true; |
| 471 | } |
| 472 | if (unichar == '-') { |
Chris Dalton | 09a7bb2 | 2018-08-31 19:53:15 +0800 | [diff] [blame] | 473 | *valueToScale *= 4/5.f; |
Chris Dalton | 9f2dab0 | 2018-04-18 14:07:03 -0600 | [diff] [blame] | 474 | this->updateAndInval(); |
| 475 | return true; |
| 476 | } |
| 477 | if (unichar == '_') { |
Chris Dalton | 09a7bb2 | 2018-08-31 19:53:15 +0800 | [diff] [blame] | 478 | *valueToScale *= .5f; |
Chris Dalton | 9f2dab0 | 2018-04-18 14:07:03 -0600 | [diff] [blame] | 479 | this->updateAndInval(); |
| 480 | return true; |
| 481 | } |
| 482 | } |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 483 | if (unichar == 'D') { |
| 484 | SkDebugf(" SkPoint fPoints[4] = {\n"); |
Chris Dalton | 7f578bf | 2017-09-05 16:46:48 -0600 | [diff] [blame] | 485 | SkDebugf(" {%ff, %ff},\n", fPoints[0].x(), fPoints[0].y()); |
| 486 | SkDebugf(" {%ff, %ff},\n", fPoints[1].x(), fPoints[1].y()); |
| 487 | SkDebugf(" {%ff, %ff},\n", fPoints[2].x(), fPoints[2].y()); |
| 488 | SkDebugf(" {%ff, %ff}\n", fPoints[3].x(), fPoints[3].y()); |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 489 | SkDebugf(" };\n"); |
| 490 | return true; |
| 491 | } |
Chris Dalton | 09a7bb2 | 2018-08-31 19:53:15 +0800 | [diff] [blame] | 492 | if (unichar == 'S') { |
| 493 | fDoStroke = !fDoStroke; |
| 494 | this->updateAndInval(); |
| 495 | } |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 496 | } |
| 497 | return this->INHERITED::onQuery(evt); |
| 498 | } |
| 499 | |
Chris Dalton | 383a2ef | 2018-01-08 17:21:41 -0500 | [diff] [blame] | 500 | DEF_SAMPLE(return new CCPRGeometryView;) |
Chris Dalton | 1a325d2 | 2017-07-14 15:17:41 -0600 | [diff] [blame] | 501 | |
Chris Dalton | 383a2ef | 2018-01-08 17:21:41 -0500 | [diff] [blame] | 502 | #endif // SK_SUPPORT_GPU |