commit-bot@chromium.org | 78a1078 | 2013-08-21 19:27:48 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2013 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 | // This test only works with the GPU backend. |
| 9 | |
| 10 | #include "gm.h" |
| 11 | |
commit-bot@chromium.org | 53a0b6c | 2013-08-23 18:05:01 +0000 | [diff] [blame] | 12 | #if SK_SUPPORT_GPU |
commit-bot@chromium.org | 78a1078 | 2013-08-21 19:27:48 +0000 | [diff] [blame] | 13 | |
robertphillips | 391395d | 2016-03-02 09:26:36 -0800 | [diff] [blame] | 14 | #include "GrDrawContextPriv.h" |
commit-bot@chromium.org | 78a1078 | 2013-08-21 19:27:48 +0000 | [diff] [blame] | 15 | #include "GrContext.h" |
| 16 | #include "GrPathUtils.h" |
| 17 | #include "GrTest.h" |
| 18 | #include "SkColorPriv.h" |
| 19 | #include "SkDevice.h" |
commit-bot@chromium.org | 53a0b6c | 2013-08-23 18:05:01 +0000 | [diff] [blame] | 20 | #include "SkGeometry.h" |
| 21 | |
joshualitt | 2771b56 | 2015-08-07 12:46:26 -0700 | [diff] [blame] | 22 | #include "batches/GrTestBatch.h" |
| 23 | |
commit-bot@chromium.org | 53a0b6c | 2013-08-23 18:05:01 +0000 | [diff] [blame] | 24 | #include "effects/GrBezierEffect.h" |
commit-bot@chromium.org | 78a1078 | 2013-08-21 19:27:48 +0000 | [diff] [blame] | 25 | |
commit-bot@chromium.org | 78a1078 | 2013-08-21 19:27:48 +0000 | [diff] [blame] | 26 | static inline SkScalar eval_line(const SkPoint& p, const SkScalar lineEq[3], SkScalar sign) { |
| 27 | return sign * (lineEq[0] * p.fX + lineEq[1] * p.fY + lineEq[2]); |
| 28 | } |
| 29 | |
| 30 | namespace skiagm { |
joshualitt | 95964c6 | 2015-02-11 13:45:50 -0800 | [diff] [blame] | 31 | |
| 32 | class BezierCubicOrConicTestBatch : public GrTestBatch { |
| 33 | public: |
reed | 1b55a96 | 2015-09-17 20:16:13 -0700 | [diff] [blame] | 34 | DEFINE_BATCH_CLASS_ID |
joshualitt | 95964c6 | 2015-02-11 13:45:50 -0800 | [diff] [blame] | 35 | struct Geometry : public GrTestBatch::Geometry { |
| 36 | SkRect fBounds; |
| 37 | }; |
| 38 | |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 39 | const char* name() const override { return "BezierCubicOrConicTestBatch"; } |
joshualitt | 95964c6 | 2015-02-11 13:45:50 -0800 | [diff] [blame] | 40 | |
bsalomon | abd30f5 | 2015-08-13 13:34:48 -0700 | [diff] [blame] | 41 | static GrDrawBatch* Create(const GrGeometryProcessor* gp, const Geometry& geo, |
| 42 | const SkScalar klmEqs[9], SkScalar sign) { |
halcanary | 385fe4d | 2015-08-26 13:07:48 -0700 | [diff] [blame] | 43 | return new BezierCubicOrConicTestBatch(gp, geo, klmEqs, sign); |
joshualitt | 95964c6 | 2015-02-11 13:45:50 -0800 | [diff] [blame] | 44 | } |
| 45 | |
| 46 | private: |
| 47 | BezierCubicOrConicTestBatch(const GrGeometryProcessor* gp, const Geometry& geo, |
| 48 | const SkScalar klmEqs[9], SkScalar sign) |
reed | 1b55a96 | 2015-09-17 20:16:13 -0700 | [diff] [blame] | 49 | : INHERITED(ClassID(), gp, geo.fBounds) { |
joshualitt | 95964c6 | 2015-02-11 13:45:50 -0800 | [diff] [blame] | 50 | for (int i = 0; i < 9; i++) { |
| 51 | fKlmEqs[i] = klmEqs[i]; |
| 52 | } |
| 53 | |
| 54 | fGeometry = geo; |
| 55 | fSign = sign; |
| 56 | } |
| 57 | |
| 58 | struct Vertex { |
| 59 | SkPoint fPosition; |
| 60 | float fKLM[4]; // The last value is ignored. The effect expects a vec4f. |
| 61 | }; |
| 62 | |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 63 | Geometry* geoData(int index) override { |
joshualitt | 95964c6 | 2015-02-11 13:45:50 -0800 | [diff] [blame] | 64 | SkASSERT(0 == index); |
| 65 | return &fGeometry; |
| 66 | } |
| 67 | |
joshualitt | 88c23fc | 2015-05-13 14:18:07 -0700 | [diff] [blame] | 68 | const Geometry* geoData(int index) const override { |
| 69 | SkASSERT(0 == index); |
| 70 | return &fGeometry; |
| 71 | } |
| 72 | |
joshualitt | 144c3c8 | 2015-11-30 12:30:13 -0800 | [diff] [blame] | 73 | void generateGeometry(Target* target) const override { |
bsalomon | b5238a7 | 2015-05-05 07:49:49 -0700 | [diff] [blame] | 74 | QuadHelper helper; |
bsalomon | ed0bcad | 2015-05-04 10:36:42 -0700 | [diff] [blame] | 75 | size_t vertexStride = this->geometryProcessor()->getVertexStride(); |
bsalomon | b5238a7 | 2015-05-05 07:49:49 -0700 | [diff] [blame] | 76 | SkASSERT(vertexStride == sizeof(Vertex)); |
bsalomon | 7539856 | 2015-08-17 12:55:38 -0700 | [diff] [blame] | 77 | Vertex* verts = reinterpret_cast<Vertex*>(helper.init(target, vertexStride, 1)); |
bsalomon | b5238a7 | 2015-05-05 07:49:49 -0700 | [diff] [blame] | 78 | if (!verts) { |
joshualitt | 4b31de8 | 2015-03-05 14:33:41 -0800 | [diff] [blame] | 79 | return; |
| 80 | } |
| 81 | |
joshualitt | 95964c6 | 2015-02-11 13:45:50 -0800 | [diff] [blame] | 82 | verts[0].fPosition.setRectFan(fGeometry.fBounds.fLeft, fGeometry.fBounds.fTop, |
| 83 | fGeometry.fBounds.fRight, fGeometry.fBounds.fBottom, |
| 84 | sizeof(Vertex)); |
| 85 | for (int v = 0; v < 4; ++v) { |
| 86 | verts[v].fKLM[0] = eval_line(verts[v].fPosition, fKlmEqs + 0, fSign); |
| 87 | verts[v].fKLM[1] = eval_line(verts[v].fPosition, fKlmEqs + 3, fSign); |
| 88 | verts[v].fKLM[2] = eval_line(verts[v].fPosition, fKlmEqs + 6, 1.f); |
| 89 | } |
bsalomon | 7539856 | 2015-08-17 12:55:38 -0700 | [diff] [blame] | 90 | helper.recordDraw(target); |
joshualitt | 95964c6 | 2015-02-11 13:45:50 -0800 | [diff] [blame] | 91 | } |
| 92 | |
| 93 | Geometry fGeometry; |
| 94 | SkScalar fKlmEqs[9]; |
| 95 | SkScalar fSign; |
| 96 | |
| 97 | static const int kVertsPerCubic = 4; |
| 98 | static const int kIndicesPerCubic = 6; |
| 99 | |
| 100 | typedef GrTestBatch INHERITED; |
| 101 | }; |
| 102 | |
commit-bot@chromium.org | 78a1078 | 2013-08-21 19:27:48 +0000 | [diff] [blame] | 103 | /** |
| 104 | * This GM directly exercises effects that draw Bezier curves in the GPU backend. |
| 105 | */ |
commit-bot@chromium.org | 53a0b6c | 2013-08-23 18:05:01 +0000 | [diff] [blame] | 106 | class BezierCubicEffects : public GM { |
commit-bot@chromium.org | 78a1078 | 2013-08-21 19:27:48 +0000 | [diff] [blame] | 107 | public: |
commit-bot@chromium.org | 53a0b6c | 2013-08-23 18:05:01 +0000 | [diff] [blame] | 108 | BezierCubicEffects() { |
commit-bot@chromium.org | 78a1078 | 2013-08-21 19:27:48 +0000 | [diff] [blame] | 109 | this->setBGColor(0xFFFFFFFF); |
| 110 | } |
| 111 | |
| 112 | protected: |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 113 | SkString onShortName() override { |
commit-bot@chromium.org | 53a0b6c | 2013-08-23 18:05:01 +0000 | [diff] [blame] | 114 | return SkString("bezier_cubic_effects"); |
commit-bot@chromium.org | 78a1078 | 2013-08-21 19:27:48 +0000 | [diff] [blame] | 115 | } |
| 116 | |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 117 | SkISize onISize() override { |
tfarina | f539318 | 2014-06-09 23:59:03 -0700 | [diff] [blame] | 118 | return SkISize::Make(800, 800); |
commit-bot@chromium.org | 78a1078 | 2013-08-21 19:27:48 +0000 | [diff] [blame] | 119 | } |
| 120 | |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 121 | void onDraw(SkCanvas* canvas) override { |
reed@google.com | 9c135db | 2014-03-12 18:28:35 +0000 | [diff] [blame] | 122 | GrRenderTarget* rt = canvas->internal_private_accessTopLayerRenderTarget(); |
halcanary | 96fcdcc | 2015-08-27 07:41:13 -0700 | [diff] [blame] | 123 | if (nullptr == rt) { |
halcanary | 2a24338 | 2015-09-09 08:16:41 -0700 | [diff] [blame] | 124 | skiagm::GM::DrawGpuOnlyMessage(canvas); |
commit-bot@chromium.org | 78a1078 | 2013-08-21 19:27:48 +0000 | [diff] [blame] | 125 | return; |
| 126 | } |
| 127 | GrContext* context = rt->getContext(); |
halcanary | 96fcdcc | 2015-08-27 07:41:13 -0700 | [diff] [blame] | 128 | if (nullptr == context) { |
commit-bot@chromium.org | 78a1078 | 2013-08-21 19:27:48 +0000 | [diff] [blame] | 129 | return; |
| 130 | } |
| 131 | |
joshualitt | f5883a6 | 2016-01-13 07:47:38 -0800 | [diff] [blame] | 132 | SkAutoTUnref<GrDrawContext> drawContext(context->drawContext(rt)); |
| 133 | if (!drawContext) { |
| 134 | return; |
| 135 | } |
| 136 | |
commit-bot@chromium.org | 78a1078 | 2013-08-21 19:27:48 +0000 | [diff] [blame] | 137 | struct Vertex { |
| 138 | SkPoint fPosition; |
| 139 | float fKLM[4]; // The last value is ignored. The effect expects a vec4f. |
| 140 | }; |
| 141 | |
commit-bot@chromium.org | 53a0b6c | 2013-08-23 18:05:01 +0000 | [diff] [blame] | 142 | static const int kNumCubics = 15; |
commit-bot@chromium.org | e0e7cfe | 2013-09-09 20:09:12 +0000 | [diff] [blame] | 143 | SkRandom rand; |
commit-bot@chromium.org | 78a1078 | 2013-08-21 19:27:48 +0000 | [diff] [blame] | 144 | |
commit-bot@chromium.org | 53a0b6c | 2013-08-23 18:05:01 +0000 | [diff] [blame] | 145 | // Mult by 3 for each edge effect type |
| 146 | int numCols = SkScalarCeilToInt(SkScalarSqrt(SkIntToScalar(kNumCubics*3))); |
| 147 | int numRows = SkScalarCeilToInt(SkIntToScalar(kNumCubics*3) / numCols); |
commit-bot@chromium.org | 78a1078 | 2013-08-21 19:27:48 +0000 | [diff] [blame] | 148 | SkScalar w = SkIntToScalar(rt->width()) / numCols; |
| 149 | SkScalar h = SkIntToScalar(rt->height()) / numRows; |
| 150 | int row = 0; |
| 151 | int col = 0; |
joshualitt | 88c23fc | 2015-05-13 14:18:07 -0700 | [diff] [blame] | 152 | static const GrColor color = 0xff000000; |
commit-bot@chromium.org | 78a1078 | 2013-08-21 19:27:48 +0000 | [diff] [blame] | 153 | |
| 154 | for (int i = 0; i < kNumCubics; ++i) { |
commit-bot@chromium.org | 53a0b6c | 2013-08-23 18:05:01 +0000 | [diff] [blame] | 155 | SkPoint baseControlPts[] = { |
| 156 | {rand.nextRangeF(0.f, w), rand.nextRangeF(0.f, h)}, |
| 157 | {rand.nextRangeF(0.f, w), rand.nextRangeF(0.f, h)}, |
| 158 | {rand.nextRangeF(0.f, w), rand.nextRangeF(0.f, h)}, |
| 159 | {rand.nextRangeF(0.f, w), rand.nextRangeF(0.f, h)} |
commit-bot@chromium.org | 78a1078 | 2013-08-21 19:27:48 +0000 | [diff] [blame] | 160 | }; |
joshualitt | b0a8a37 | 2014-09-23 09:50:21 -0700 | [diff] [blame] | 161 | for(int edgeType = 0; edgeType < kGrProcessorEdgeTypeCnt; ++edgeType) { |
| 162 | SkAutoTUnref<GrGeometryProcessor> gp; |
joshualitt | f5883a6 | 2016-01-13 07:47:38 -0800 | [diff] [blame] | 163 | GrPrimitiveEdgeType et = (GrPrimitiveEdgeType)edgeType; |
| 164 | gp.reset(GrCubicEffect::Create(color, SkMatrix::I(), et, |
| 165 | *context->caps())); |
| 166 | if (!gp) { |
| 167 | continue; |
commit-bot@chromium.org | cabf4b2 | 2014-03-05 18:27:43 +0000 | [diff] [blame] | 168 | } |
commit-bot@chromium.org | 53a0b6c | 2013-08-23 18:05:01 +0000 | [diff] [blame] | 169 | SkScalar x = SkScalarMul(col, w); |
| 170 | SkScalar y = SkScalarMul(row, h); |
| 171 | SkPoint controlPts[] = { |
| 172 | {x + baseControlPts[0].fX, y + baseControlPts[0].fY}, |
| 173 | {x + baseControlPts[1].fX, y + baseControlPts[1].fY}, |
| 174 | {x + baseControlPts[2].fX, y + baseControlPts[2].fY}, |
| 175 | {x + baseControlPts[3].fX, y + baseControlPts[3].fY} |
| 176 | }; |
| 177 | SkPoint chopped[10]; |
| 178 | SkScalar klmEqs[9]; |
| 179 | SkScalar klmSigns[3]; |
| 180 | int cnt = GrPathUtils::chopCubicAtLoopIntersection(controlPts, |
| 181 | chopped, |
| 182 | klmEqs, |
| 183 | klmSigns); |
commit-bot@chromium.org | 78a1078 | 2013-08-21 19:27:48 +0000 | [diff] [blame] | 184 | |
commit-bot@chromium.org | 53a0b6c | 2013-08-23 18:05:01 +0000 | [diff] [blame] | 185 | SkPaint ctrlPtPaint; |
| 186 | ctrlPtPaint.setColor(rand.nextU() | 0xFF000000); |
commit-bot@chromium.org | 78a1078 | 2013-08-21 19:27:48 +0000 | [diff] [blame] | 187 | for (int i = 0; i < 4; ++i) { |
commit-bot@chromium.org | 53a0b6c | 2013-08-23 18:05:01 +0000 | [diff] [blame] | 188 | canvas->drawCircle(controlPts[i].fX, controlPts[i].fY, 6.f, ctrlPtPaint); |
commit-bot@chromium.org | 78a1078 | 2013-08-21 19:27:48 +0000 | [diff] [blame] | 189 | } |
| 190 | |
commit-bot@chromium.org | 53a0b6c | 2013-08-23 18:05:01 +0000 | [diff] [blame] | 191 | SkPaint polyPaint; |
| 192 | polyPaint.setColor(0xffA0A0A0); |
| 193 | polyPaint.setStrokeWidth(0); |
| 194 | polyPaint.setStyle(SkPaint::kStroke_Style); |
| 195 | canvas->drawPoints(SkCanvas::kPolygon_PointMode, 4, controlPts, polyPaint); |
commit-bot@chromium.org | 78a1078 | 2013-08-21 19:27:48 +0000 | [diff] [blame] | 196 | |
commit-bot@chromium.org | 53a0b6c | 2013-08-23 18:05:01 +0000 | [diff] [blame] | 197 | SkPaint choppedPtPaint; |
| 198 | choppedPtPaint.setColor(~ctrlPtPaint.getColor() | 0xFF000000); |
commit-bot@chromium.org | 78a1078 | 2013-08-21 19:27:48 +0000 | [diff] [blame] | 199 | |
commit-bot@chromium.org | 53a0b6c | 2013-08-23 18:05:01 +0000 | [diff] [blame] | 200 | for (int c = 0; c < cnt; ++c) { |
| 201 | SkPoint* pts = chopped + 3 * c; |
| 202 | |
| 203 | for (int i = 0; i < 4; ++i) { |
| 204 | canvas->drawCircle(pts[i].fX, pts[i].fY, 3.f, choppedPtPaint); |
| 205 | } |
| 206 | |
| 207 | SkRect bounds; |
| 208 | bounds.set(pts, 4); |
| 209 | |
| 210 | SkPaint boundsPaint; |
| 211 | boundsPaint.setColor(0xff808080); |
| 212 | boundsPaint.setStrokeWidth(0); |
| 213 | boundsPaint.setStyle(SkPaint::kStroke_Style); |
| 214 | canvas->drawRect(bounds, boundsPaint); |
| 215 | |
egdaniel | 8dd688b | 2015-01-22 10:16:09 -0800 | [diff] [blame] | 216 | GrPipelineBuilder pipelineBuilder; |
egdaniel | c4b7272 | 2015-11-23 13:20:41 -0800 | [diff] [blame] | 217 | pipelineBuilder.setXPFactory( |
| 218 | GrPorterDuffXPFactory::Create(SkXfermode::kSrc_Mode))->unref(); |
egdaniel | 8dd688b | 2015-01-22 10:16:09 -0800 | [diff] [blame] | 219 | pipelineBuilder.setRenderTarget(rt); |
commit-bot@chromium.org | 53a0b6c | 2013-08-23 18:05:01 +0000 | [diff] [blame] | 220 | |
joshualitt | 95964c6 | 2015-02-11 13:45:50 -0800 | [diff] [blame] | 221 | BezierCubicOrConicTestBatch::Geometry geometry; |
joshualitt | 88c23fc | 2015-05-13 14:18:07 -0700 | [diff] [blame] | 222 | geometry.fColor = color; |
joshualitt | 95964c6 | 2015-02-11 13:45:50 -0800 | [diff] [blame] | 223 | geometry.fBounds = bounds; |
| 224 | |
bsalomon | abd30f5 | 2015-08-13 13:34:48 -0700 | [diff] [blame] | 225 | SkAutoTUnref<GrDrawBatch> batch( |
joshualitt | 44701df | 2015-02-23 14:44:57 -0800 | [diff] [blame] | 226 | BezierCubicOrConicTestBatch::Create(gp, geometry, klmEqs, klmSigns[c])); |
joshualitt | 95964c6 | 2015-02-11 13:45:50 -0800 | [diff] [blame] | 227 | |
robertphillips | 391395d | 2016-03-02 09:26:36 -0800 | [diff] [blame] | 228 | drawContext->drawContextPriv().testingOnly_drawBatch(pipelineBuilder, batch); |
commit-bot@chromium.org | 78a1078 | 2013-08-21 19:27:48 +0000 | [diff] [blame] | 229 | } |
commit-bot@chromium.org | 53a0b6c | 2013-08-23 18:05:01 +0000 | [diff] [blame] | 230 | ++col; |
| 231 | if (numCols == col) { |
| 232 | col = 0; |
| 233 | ++row; |
commit-bot@chromium.org | 78a1078 | 2013-08-21 19:27:48 +0000 | [diff] [blame] | 234 | } |
commit-bot@chromium.org | 78a1078 | 2013-08-21 19:27:48 +0000 | [diff] [blame] | 235 | } |
| 236 | } |
| 237 | } |
| 238 | |
| 239 | private: |
| 240 | typedef GM INHERITED; |
| 241 | }; |
| 242 | |
| 243 | ////////////////////////////////////////////////////////////////////////////// |
| 244 | |
commit-bot@chromium.org | 53a0b6c | 2013-08-23 18:05:01 +0000 | [diff] [blame] | 245 | /** |
| 246 | * This GM directly exercises effects that draw Bezier curves in the GPU backend. |
| 247 | */ |
| 248 | class BezierConicEffects : public GM { |
| 249 | public: |
| 250 | BezierConicEffects() { |
| 251 | this->setBGColor(0xFFFFFFFF); |
| 252 | } |
| 253 | |
| 254 | protected: |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 255 | SkString onShortName() override { |
commit-bot@chromium.org | 53a0b6c | 2013-08-23 18:05:01 +0000 | [diff] [blame] | 256 | return SkString("bezier_conic_effects"); |
| 257 | } |
| 258 | |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 259 | SkISize onISize() override { |
tfarina | f539318 | 2014-06-09 23:59:03 -0700 | [diff] [blame] | 260 | return SkISize::Make(800, 800); |
commit-bot@chromium.org | 53a0b6c | 2013-08-23 18:05:01 +0000 | [diff] [blame] | 261 | } |
| 262 | |
commit-bot@chromium.org | 53a0b6c | 2013-08-23 18:05:01 +0000 | [diff] [blame] | 263 | |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 264 | void onDraw(SkCanvas* canvas) override { |
reed@google.com | 9c135db | 2014-03-12 18:28:35 +0000 | [diff] [blame] | 265 | GrRenderTarget* rt = canvas->internal_private_accessTopLayerRenderTarget(); |
halcanary | 96fcdcc | 2015-08-27 07:41:13 -0700 | [diff] [blame] | 266 | if (nullptr == rt) { |
halcanary | 2a24338 | 2015-09-09 08:16:41 -0700 | [diff] [blame] | 267 | skiagm::GM::DrawGpuOnlyMessage(canvas); |
commit-bot@chromium.org | 53a0b6c | 2013-08-23 18:05:01 +0000 | [diff] [blame] | 268 | return; |
| 269 | } |
| 270 | GrContext* context = rt->getContext(); |
halcanary | 96fcdcc | 2015-08-27 07:41:13 -0700 | [diff] [blame] | 271 | if (nullptr == context) { |
commit-bot@chromium.org | 53a0b6c | 2013-08-23 18:05:01 +0000 | [diff] [blame] | 272 | return; |
| 273 | } |
| 274 | |
joshualitt | f5883a6 | 2016-01-13 07:47:38 -0800 | [diff] [blame] | 275 | SkAutoTUnref<GrDrawContext> drawContext(context->drawContext(rt)); |
| 276 | if (!drawContext) { |
| 277 | return; |
| 278 | } |
| 279 | |
commit-bot@chromium.org | 53a0b6c | 2013-08-23 18:05:01 +0000 | [diff] [blame] | 280 | struct Vertex { |
| 281 | SkPoint fPosition; |
| 282 | float fKLM[4]; // The last value is ignored. The effect expects a vec4f. |
| 283 | }; |
| 284 | |
| 285 | static const int kNumConics = 10; |
commit-bot@chromium.org | e0e7cfe | 2013-09-09 20:09:12 +0000 | [diff] [blame] | 286 | SkRandom rand; |
commit-bot@chromium.org | 53a0b6c | 2013-08-23 18:05:01 +0000 | [diff] [blame] | 287 | |
| 288 | // Mult by 3 for each edge effect type |
| 289 | int numCols = SkScalarCeilToInt(SkScalarSqrt(SkIntToScalar(kNumConics*3))); |
| 290 | int numRows = SkScalarCeilToInt(SkIntToScalar(kNumConics*3) / numCols); |
| 291 | SkScalar w = SkIntToScalar(rt->width()) / numCols; |
| 292 | SkScalar h = SkIntToScalar(rt->height()) / numRows; |
| 293 | int row = 0; |
| 294 | int col = 0; |
joshualitt | 88c23fc | 2015-05-13 14:18:07 -0700 | [diff] [blame] | 295 | static const GrColor color = 0xff000000; |
commit-bot@chromium.org | 53a0b6c | 2013-08-23 18:05:01 +0000 | [diff] [blame] | 296 | |
| 297 | for (int i = 0; i < kNumConics; ++i) { |
| 298 | SkPoint baseControlPts[] = { |
| 299 | {rand.nextRangeF(0.f, w), rand.nextRangeF(0.f, h)}, |
| 300 | {rand.nextRangeF(0.f, w), rand.nextRangeF(0.f, h)}, |
| 301 | {rand.nextRangeF(0.f, w), rand.nextRangeF(0.f, h)} |
| 302 | }; |
| 303 | SkScalar weight = rand.nextRangeF(0.f, 2.f); |
joshualitt | b0a8a37 | 2014-09-23 09:50:21 -0700 | [diff] [blame] | 304 | for(int edgeType = 0; edgeType < kGrProcessorEdgeTypeCnt; ++edgeType) { |
| 305 | SkAutoTUnref<GrGeometryProcessor> gp; |
joshualitt | f5883a6 | 2016-01-13 07:47:38 -0800 | [diff] [blame] | 306 | GrPrimitiveEdgeType et = (GrPrimitiveEdgeType)edgeType; |
| 307 | gp.reset(GrConicEffect::Create(color, SkMatrix::I(), et, |
| 308 | *context->caps(), SkMatrix::I(), false)); |
| 309 | if (!gp) { |
| 310 | continue; |
commit-bot@chromium.org | cabf4b2 | 2014-03-05 18:27:43 +0000 | [diff] [blame] | 311 | } |
| 312 | |
commit-bot@chromium.org | 53a0b6c | 2013-08-23 18:05:01 +0000 | [diff] [blame] | 313 | SkScalar x = SkScalarMul(col, w); |
| 314 | SkScalar y = SkScalarMul(row, h); |
| 315 | SkPoint controlPts[] = { |
| 316 | {x + baseControlPts[0].fX, y + baseControlPts[0].fY}, |
| 317 | {x + baseControlPts[1].fX, y + baseControlPts[1].fY}, |
| 318 | {x + baseControlPts[2].fX, y + baseControlPts[2].fY} |
| 319 | }; |
| 320 | SkConic dst[4]; |
| 321 | SkScalar klmEqs[9]; |
| 322 | int cnt = chop_conic(controlPts, dst, weight); |
| 323 | GrPathUtils::getConicKLM(controlPts, weight, klmEqs); |
| 324 | |
| 325 | SkPaint ctrlPtPaint; |
| 326 | ctrlPtPaint.setColor(rand.nextU() | 0xFF000000); |
| 327 | for (int i = 0; i < 3; ++i) { |
| 328 | canvas->drawCircle(controlPts[i].fX, controlPts[i].fY, 6.f, ctrlPtPaint); |
| 329 | } |
| 330 | |
| 331 | SkPaint polyPaint; |
| 332 | polyPaint.setColor(0xffA0A0A0); |
| 333 | polyPaint.setStrokeWidth(0); |
| 334 | polyPaint.setStyle(SkPaint::kStroke_Style); |
| 335 | canvas->drawPoints(SkCanvas::kPolygon_PointMode, 3, controlPts, polyPaint); |
| 336 | |
| 337 | SkPaint choppedPtPaint; |
| 338 | choppedPtPaint.setColor(~ctrlPtPaint.getColor() | 0xFF000000); |
| 339 | |
| 340 | for (int c = 0; c < cnt; ++c) { |
| 341 | SkPoint* pts = dst[c].fPts; |
| 342 | for (int i = 0; i < 3; ++i) { |
| 343 | canvas->drawCircle(pts[i].fX, pts[i].fY, 3.f, choppedPtPaint); |
| 344 | } |
| 345 | |
| 346 | SkRect bounds; |
| 347 | //SkPoint bPts[] = {{0.f, 0.f}, {800.f, 800.f}}; |
| 348 | //bounds.set(bPts, 2); |
| 349 | bounds.set(pts, 3); |
| 350 | |
| 351 | SkPaint boundsPaint; |
| 352 | boundsPaint.setColor(0xff808080); |
| 353 | boundsPaint.setStrokeWidth(0); |
| 354 | boundsPaint.setStyle(SkPaint::kStroke_Style); |
| 355 | canvas->drawRect(bounds, boundsPaint); |
| 356 | |
egdaniel | 8dd688b | 2015-01-22 10:16:09 -0800 | [diff] [blame] | 357 | GrPipelineBuilder pipelineBuilder; |
egdaniel | c4b7272 | 2015-11-23 13:20:41 -0800 | [diff] [blame] | 358 | pipelineBuilder.setXPFactory( |
| 359 | GrPorterDuffXPFactory::Create(SkXfermode::kSrc_Mode))->unref(); |
egdaniel | 8dd688b | 2015-01-22 10:16:09 -0800 | [diff] [blame] | 360 | pipelineBuilder.setRenderTarget(rt); |
commit-bot@chromium.org | 53a0b6c | 2013-08-23 18:05:01 +0000 | [diff] [blame] | 361 | |
joshualitt | 95964c6 | 2015-02-11 13:45:50 -0800 | [diff] [blame] | 362 | BezierCubicOrConicTestBatch::Geometry geometry; |
joshualitt | 88c23fc | 2015-05-13 14:18:07 -0700 | [diff] [blame] | 363 | geometry.fColor = color; |
joshualitt | 95964c6 | 2015-02-11 13:45:50 -0800 | [diff] [blame] | 364 | geometry.fBounds = bounds; |
| 365 | |
bsalomon | abd30f5 | 2015-08-13 13:34:48 -0700 | [diff] [blame] | 366 | SkAutoTUnref<GrDrawBatch> batch( |
joshualitt | 44701df | 2015-02-23 14:44:57 -0800 | [diff] [blame] | 367 | BezierCubicOrConicTestBatch::Create(gp, geometry, klmEqs, 1.f)); |
joshualitt | 95964c6 | 2015-02-11 13:45:50 -0800 | [diff] [blame] | 368 | |
robertphillips | 391395d | 2016-03-02 09:26:36 -0800 | [diff] [blame] | 369 | drawContext->drawContextPriv().testingOnly_drawBatch(pipelineBuilder, batch); |
commit-bot@chromium.org | 53a0b6c | 2013-08-23 18:05:01 +0000 | [diff] [blame] | 370 | } |
| 371 | ++col; |
| 372 | if (numCols == col) { |
| 373 | col = 0; |
| 374 | ++row; |
| 375 | } |
| 376 | } |
| 377 | } |
| 378 | } |
| 379 | |
| 380 | private: |
| 381 | // Uses the max curvature function for quads to estimate |
| 382 | // where to chop the conic. If the max curvature is not |
| 383 | // found along the curve segment it will return 1 and |
| 384 | // dst[0] is the original conic. If it returns 2 the dst[0] |
| 385 | // and dst[1] are the two new conics. |
| 386 | int split_conic(const SkPoint src[3], SkConic dst[2], const SkScalar weight) { |
| 387 | SkScalar t = SkFindQuadMaxCurvature(src); |
| 388 | if (t == 0) { |
| 389 | if (dst) { |
| 390 | dst[0].set(src, weight); |
| 391 | } |
| 392 | return 1; |
| 393 | } else { |
| 394 | if (dst) { |
| 395 | SkConic conic; |
| 396 | conic.set(src, weight); |
| 397 | conic.chopAt(t, dst); |
| 398 | } |
| 399 | return 2; |
| 400 | } |
| 401 | } |
| 402 | |
| 403 | // Calls split_conic on the entire conic and then once more on each subsection. |
| 404 | // Most cases will result in either 1 conic (chop point is not within t range) |
| 405 | // or 3 points (split once and then one subsection is split again). |
| 406 | int chop_conic(const SkPoint src[3], SkConic dst[4], const SkScalar weight) { |
| 407 | SkConic dstTemp[2]; |
| 408 | int conicCnt = split_conic(src, dstTemp, weight); |
| 409 | if (2 == conicCnt) { |
| 410 | int conicCnt2 = split_conic(dstTemp[0].fPts, dst, dstTemp[0].fW); |
| 411 | conicCnt = conicCnt2 + split_conic(dstTemp[1].fPts, &dst[conicCnt2], dstTemp[1].fW); |
| 412 | } else { |
| 413 | dst[0] = dstTemp[0]; |
| 414 | } |
| 415 | return conicCnt; |
| 416 | } |
| 417 | |
| 418 | typedef GM INHERITED; |
| 419 | }; |
| 420 | |
| 421 | ////////////////////////////////////////////////////////////////////////////// |
joshualitt | 95964c6 | 2015-02-11 13:45:50 -0800 | [diff] [blame] | 422 | |
| 423 | class BezierQuadTestBatch : public GrTestBatch { |
| 424 | public: |
reed | 1b55a96 | 2015-09-17 20:16:13 -0700 | [diff] [blame] | 425 | DEFINE_BATCH_CLASS_ID |
joshualitt | 95964c6 | 2015-02-11 13:45:50 -0800 | [diff] [blame] | 426 | struct Geometry : public GrTestBatch::Geometry { |
| 427 | SkRect fBounds; |
| 428 | }; |
| 429 | |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 430 | const char* name() const override { return "BezierQuadTestBatch"; } |
joshualitt | 95964c6 | 2015-02-11 13:45:50 -0800 | [diff] [blame] | 431 | |
bsalomon | abd30f5 | 2015-08-13 13:34:48 -0700 | [diff] [blame] | 432 | static GrDrawBatch* Create(const GrGeometryProcessor* gp, const Geometry& geo, |
| 433 | const GrPathUtils::QuadUVMatrix& devToUV) { |
halcanary | 385fe4d | 2015-08-26 13:07:48 -0700 | [diff] [blame] | 434 | return new BezierQuadTestBatch(gp, geo, devToUV); |
joshualitt | 95964c6 | 2015-02-11 13:45:50 -0800 | [diff] [blame] | 435 | } |
| 436 | |
| 437 | private: |
| 438 | BezierQuadTestBatch(const GrGeometryProcessor* gp, const Geometry& geo, |
| 439 | const GrPathUtils::QuadUVMatrix& devToUV) |
reed | 1b55a96 | 2015-09-17 20:16:13 -0700 | [diff] [blame] | 440 | : INHERITED(ClassID(), gp, geo.fBounds) |
joshualitt | 95964c6 | 2015-02-11 13:45:50 -0800 | [diff] [blame] | 441 | , fGeometry(geo) |
| 442 | , fDevToUV(devToUV) { |
| 443 | } |
| 444 | |
| 445 | struct Vertex { |
| 446 | SkPoint fPosition; |
| 447 | float fKLM[4]; // The last value is ignored. The effect expects a vec4f. |
| 448 | }; |
| 449 | |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 450 | Geometry* geoData(int index) override { |
joshualitt | 95964c6 | 2015-02-11 13:45:50 -0800 | [diff] [blame] | 451 | SkASSERT(0 == index); |
| 452 | return &fGeometry; |
| 453 | } |
| 454 | |
joshualitt | 88c23fc | 2015-05-13 14:18:07 -0700 | [diff] [blame] | 455 | const Geometry* geoData(int index) const override { |
| 456 | SkASSERT(0 == index); |
| 457 | return &fGeometry; |
| 458 | } |
| 459 | |
joshualitt | 144c3c8 | 2015-11-30 12:30:13 -0800 | [diff] [blame] | 460 | void generateGeometry(Target* target) const override { |
bsalomon | b5238a7 | 2015-05-05 07:49:49 -0700 | [diff] [blame] | 461 | QuadHelper helper; |
bsalomon | ed0bcad | 2015-05-04 10:36:42 -0700 | [diff] [blame] | 462 | size_t vertexStride = this->geometryProcessor()->getVertexStride(); |
bsalomon | b5238a7 | 2015-05-05 07:49:49 -0700 | [diff] [blame] | 463 | SkASSERT(vertexStride == sizeof(Vertex)); |
bsalomon | 7539856 | 2015-08-17 12:55:38 -0700 | [diff] [blame] | 464 | Vertex* verts = reinterpret_cast<Vertex*>(helper.init(target, vertexStride, 1)); |
bsalomon | b5238a7 | 2015-05-05 07:49:49 -0700 | [diff] [blame] | 465 | if (!verts) { |
joshualitt | 4b31de8 | 2015-03-05 14:33:41 -0800 | [diff] [blame] | 466 | return; |
| 467 | } |
joshualitt | 95964c6 | 2015-02-11 13:45:50 -0800 | [diff] [blame] | 468 | verts[0].fPosition.setRectFan(fGeometry.fBounds.fLeft, fGeometry.fBounds.fTop, |
| 469 | fGeometry.fBounds.fRight, fGeometry.fBounds.fBottom, |
| 470 | sizeof(Vertex)); |
joshualitt | 95964c6 | 2015-02-11 13:45:50 -0800 | [diff] [blame] | 471 | fDevToUV.apply<4, sizeof(Vertex), sizeof(SkPoint)>(verts); |
bsalomon | 7539856 | 2015-08-17 12:55:38 -0700 | [diff] [blame] | 472 | helper.recordDraw(target); |
joshualitt | 95964c6 | 2015-02-11 13:45:50 -0800 | [diff] [blame] | 473 | } |
| 474 | |
| 475 | Geometry fGeometry; |
| 476 | GrPathUtils::QuadUVMatrix fDevToUV; |
| 477 | |
| 478 | static const int kVertsPerCubic = 4; |
| 479 | static const int kIndicesPerCubic = 6; |
| 480 | |
| 481 | typedef GrTestBatch INHERITED; |
| 482 | }; |
| 483 | |
commit-bot@chromium.org | 53a0b6c | 2013-08-23 18:05:01 +0000 | [diff] [blame] | 484 | /** |
| 485 | * This GM directly exercises effects that draw Bezier quad curves in the GPU backend. |
| 486 | */ |
| 487 | class BezierQuadEffects : public GM { |
| 488 | public: |
| 489 | BezierQuadEffects() { |
| 490 | this->setBGColor(0xFFFFFFFF); |
| 491 | } |
| 492 | |
| 493 | protected: |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 494 | SkString onShortName() override { |
commit-bot@chromium.org | 53a0b6c | 2013-08-23 18:05:01 +0000 | [diff] [blame] | 495 | return SkString("bezier_quad_effects"); |
| 496 | } |
| 497 | |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 498 | SkISize onISize() override { |
tfarina | f539318 | 2014-06-09 23:59:03 -0700 | [diff] [blame] | 499 | return SkISize::Make(800, 800); |
commit-bot@chromium.org | 53a0b6c | 2013-08-23 18:05:01 +0000 | [diff] [blame] | 500 | } |
| 501 | |
commit-bot@chromium.org | 53a0b6c | 2013-08-23 18:05:01 +0000 | [diff] [blame] | 502 | |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 503 | void onDraw(SkCanvas* canvas) override { |
reed@google.com | 9c135db | 2014-03-12 18:28:35 +0000 | [diff] [blame] | 504 | GrRenderTarget* rt = canvas->internal_private_accessTopLayerRenderTarget(); |
halcanary | 96fcdcc | 2015-08-27 07:41:13 -0700 | [diff] [blame] | 505 | if (nullptr == rt) { |
halcanary | 2a24338 | 2015-09-09 08:16:41 -0700 | [diff] [blame] | 506 | skiagm::GM::DrawGpuOnlyMessage(canvas); |
commit-bot@chromium.org | 53a0b6c | 2013-08-23 18:05:01 +0000 | [diff] [blame] | 507 | return; |
| 508 | } |
| 509 | GrContext* context = rt->getContext(); |
halcanary | 96fcdcc | 2015-08-27 07:41:13 -0700 | [diff] [blame] | 510 | if (nullptr == context) { |
commit-bot@chromium.org | 53a0b6c | 2013-08-23 18:05:01 +0000 | [diff] [blame] | 511 | return; |
| 512 | } |
| 513 | |
joshualitt | f5883a6 | 2016-01-13 07:47:38 -0800 | [diff] [blame] | 514 | SkAutoTUnref<GrDrawContext> drawContext(context->drawContext(rt)); |
| 515 | if (!drawContext) { |
| 516 | return; |
| 517 | } |
| 518 | |
commit-bot@chromium.org | 53a0b6c | 2013-08-23 18:05:01 +0000 | [diff] [blame] | 519 | struct Vertex { |
| 520 | SkPoint fPosition; |
| 521 | float fUV[4]; // The last two values are ignored. The effect expects a vec4f. |
| 522 | }; |
| 523 | |
| 524 | static const int kNumQuads = 5; |
commit-bot@chromium.org | e0e7cfe | 2013-09-09 20:09:12 +0000 | [diff] [blame] | 525 | SkRandom rand; |
commit-bot@chromium.org | 53a0b6c | 2013-08-23 18:05:01 +0000 | [diff] [blame] | 526 | |
| 527 | int numCols = SkScalarCeilToInt(SkScalarSqrt(SkIntToScalar(kNumQuads*3))); |
| 528 | int numRows = SkScalarCeilToInt(SkIntToScalar(kNumQuads*3) / numCols); |
| 529 | SkScalar w = SkIntToScalar(rt->width()) / numCols; |
| 530 | SkScalar h = SkIntToScalar(rt->height()) / numRows; |
| 531 | int row = 0; |
| 532 | int col = 0; |
joshualitt | 88c23fc | 2015-05-13 14:18:07 -0700 | [diff] [blame] | 533 | static const GrColor color = 0xff000000; |
commit-bot@chromium.org | 53a0b6c | 2013-08-23 18:05:01 +0000 | [diff] [blame] | 534 | |
| 535 | for (int i = 0; i < kNumQuads; ++i) { |
| 536 | SkPoint baseControlPts[] = { |
| 537 | {rand.nextRangeF(0.f, w), rand.nextRangeF(0.f, h)}, |
| 538 | {rand.nextRangeF(0.f, w), rand.nextRangeF(0.f, h)}, |
| 539 | {rand.nextRangeF(0.f, w), rand.nextRangeF(0.f, h)} |
| 540 | }; |
joshualitt | b0a8a37 | 2014-09-23 09:50:21 -0700 | [diff] [blame] | 541 | for(int edgeType = 0; edgeType < kGrProcessorEdgeTypeCnt; ++edgeType) { |
| 542 | SkAutoTUnref<GrGeometryProcessor> gp; |
joshualitt | f5883a6 | 2016-01-13 07:47:38 -0800 | [diff] [blame] | 543 | GrPrimitiveEdgeType et = (GrPrimitiveEdgeType)edgeType; |
| 544 | gp.reset(GrQuadEffect::Create(color, SkMatrix::I(), et, |
| 545 | *context->caps(), SkMatrix::I(), false)); |
| 546 | if (!gp) { |
| 547 | continue; |
commit-bot@chromium.org | cabf4b2 | 2014-03-05 18:27:43 +0000 | [diff] [blame] | 548 | } |
| 549 | |
commit-bot@chromium.org | 53a0b6c | 2013-08-23 18:05:01 +0000 | [diff] [blame] | 550 | SkScalar x = SkScalarMul(col, w); |
| 551 | SkScalar y = SkScalarMul(row, h); |
| 552 | SkPoint controlPts[] = { |
| 553 | {x + baseControlPts[0].fX, y + baseControlPts[0].fY}, |
| 554 | {x + baseControlPts[1].fX, y + baseControlPts[1].fY}, |
| 555 | {x + baseControlPts[2].fX, y + baseControlPts[2].fY} |
| 556 | }; |
| 557 | SkPoint chopped[5]; |
| 558 | int cnt = SkChopQuadAtMaxCurvature(controlPts, chopped); |
| 559 | |
| 560 | SkPaint ctrlPtPaint; |
| 561 | ctrlPtPaint.setColor(rand.nextU() | 0xFF000000); |
| 562 | for (int i = 0; i < 3; ++i) { |
| 563 | canvas->drawCircle(controlPts[i].fX, controlPts[i].fY, 6.f, ctrlPtPaint); |
| 564 | } |
| 565 | |
| 566 | SkPaint polyPaint; |
| 567 | polyPaint.setColor(0xffA0A0A0); |
| 568 | polyPaint.setStrokeWidth(0); |
| 569 | polyPaint.setStyle(SkPaint::kStroke_Style); |
| 570 | canvas->drawPoints(SkCanvas::kPolygon_PointMode, 3, controlPts, polyPaint); |
| 571 | |
| 572 | SkPaint choppedPtPaint; |
| 573 | choppedPtPaint.setColor(~ctrlPtPaint.getColor() | 0xFF000000); |
| 574 | |
| 575 | for (int c = 0; c < cnt; ++c) { |
| 576 | SkPoint* pts = chopped + 2 * c; |
| 577 | |
| 578 | for (int i = 0; i < 3; ++i) { |
| 579 | canvas->drawCircle(pts[i].fX, pts[i].fY, 3.f, choppedPtPaint); |
| 580 | } |
| 581 | |
| 582 | SkRect bounds; |
| 583 | bounds.set(pts, 3); |
| 584 | |
| 585 | SkPaint boundsPaint; |
| 586 | boundsPaint.setColor(0xff808080); |
| 587 | boundsPaint.setStrokeWidth(0); |
| 588 | boundsPaint.setStyle(SkPaint::kStroke_Style); |
| 589 | canvas->drawRect(bounds, boundsPaint); |
| 590 | |
egdaniel | 8dd688b | 2015-01-22 10:16:09 -0800 | [diff] [blame] | 591 | GrPipelineBuilder pipelineBuilder; |
egdaniel | c4b7272 | 2015-11-23 13:20:41 -0800 | [diff] [blame] | 592 | pipelineBuilder.setXPFactory( |
| 593 | GrPorterDuffXPFactory::Create(SkXfermode::kSrc_Mode))->unref(); |
joshualitt | 94dff15 | 2015-02-11 13:03:15 -0800 | [diff] [blame] | 594 | pipelineBuilder.setRenderTarget(rt); |
joshualitt | 3f284d7 | 2015-02-11 11:34:58 -0800 | [diff] [blame] | 595 | |
joshualitt | 95964c6 | 2015-02-11 13:45:50 -0800 | [diff] [blame] | 596 | GrPathUtils::QuadUVMatrix DevToUV(pts); |
| 597 | |
| 598 | BezierQuadTestBatch::Geometry geometry; |
joshualitt | 88c23fc | 2015-05-13 14:18:07 -0700 | [diff] [blame] | 599 | geometry.fColor = color; |
joshualitt | 95964c6 | 2015-02-11 13:45:50 -0800 | [diff] [blame] | 600 | geometry.fBounds = bounds; |
| 601 | |
bsalomon | abd30f5 | 2015-08-13 13:34:48 -0700 | [diff] [blame] | 602 | SkAutoTUnref<GrDrawBatch> batch(BezierQuadTestBatch::Create(gp, geometry, |
| 603 | DevToUV)); |
joshualitt | 95964c6 | 2015-02-11 13:45:50 -0800 | [diff] [blame] | 604 | |
robertphillips | 391395d | 2016-03-02 09:26:36 -0800 | [diff] [blame] | 605 | drawContext->drawContextPriv().testingOnly_drawBatch(pipelineBuilder, batch); |
commit-bot@chromium.org | 53a0b6c | 2013-08-23 18:05:01 +0000 | [diff] [blame] | 606 | } |
| 607 | ++col; |
| 608 | if (numCols == col) { |
| 609 | col = 0; |
| 610 | ++row; |
| 611 | } |
| 612 | } |
| 613 | } |
| 614 | } |
| 615 | |
| 616 | private: |
| 617 | typedef GM INHERITED; |
| 618 | }; |
| 619 | |
halcanary | 385fe4d | 2015-08-26 13:07:48 -0700 | [diff] [blame] | 620 | DEF_GM(return new BezierCubicEffects;) |
| 621 | DEF_GM(return new BezierConicEffects;) |
| 622 | DEF_GM(return new BezierQuadEffects;) |
commit-bot@chromium.org | 78a1078 | 2013-08-21 19:27:48 +0000 | [diff] [blame] | 623 | } |
| 624 | |
| 625 | #endif |