| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 // This test only works with the GPU backend. | 8 // This test only works with the GPU backend. |
| 9 | 9 |
| 10 #include "gm.h" | 10 #include "gm.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 } | 27 } |
| 28 | 28 |
| 29 namespace skiagm { | 29 namespace skiagm { |
| 30 | 30 |
| 31 class BezierCubicOrConicTestBatch : public GrTestBatch { | 31 class BezierCubicOrConicTestBatch : public GrTestBatch { |
| 32 public: | 32 public: |
| 33 DEFINE_BATCH_CLASS_ID | 33 DEFINE_BATCH_CLASS_ID |
| 34 | 34 |
| 35 const char* name() const override { return "BezierCubicOrConicTestBatch"; } | 35 const char* name() const override { return "BezierCubicOrConicTestBatch"; } |
| 36 | 36 |
| 37 BezierCubicOrConicTestBatch(const GrGeometryProcessor* gp, const SkRect& bou
nds, | 37 BezierCubicOrConicTestBatch(sk_sp<GrGeometryProcessor> gp, const SkRect& bou
nds, |
| 38 GrColor color, const SkScalar klmEqs[9], SkScala
r sign) | 38 GrColor color, const SkScalar klmEqs[9], SkScala
r sign) |
| 39 : INHERITED(ClassID(), bounds, color) | 39 : INHERITED(ClassID(), bounds, color) |
| 40 , fGeometryProcessor(SkRef(gp)) { | 40 , fGeometryProcessor(std::move(gp)) { |
| 41 for (int i = 0; i < 9; i++) { | 41 for (int i = 0; i < 9; i++) { |
| 42 fKlmEqs[i] = klmEqs[i]; | 42 fKlmEqs[i] = klmEqs[i]; |
| 43 } | 43 } |
| 44 fSign = sign; | 44 fSign = sign; |
| 45 } | 45 } |
| 46 | 46 |
| 47 private: | 47 private: |
| 48 | 48 |
| 49 struct Vertex { | 49 struct Vertex { |
| 50 SkPoint fPosition; | 50 SkPoint fPosition; |
| 51 float fKLM[4]; // The last value is ignored. The effect expects a vec4
f. | 51 float fKLM[4]; // The last value is ignored. The effect expects a vec4
f. |
| 52 }; | 52 }; |
| 53 | 53 |
| 54 void onPrepareDraws(Target* target) const override { | 54 void onPrepareDraws(Target* target) const override { |
| 55 QuadHelper helper; | 55 QuadHelper helper; |
| 56 size_t vertexStride = fGeometryProcessor->getVertexStride(); | 56 size_t vertexStride = fGeometryProcessor->getVertexStride(); |
| 57 SkASSERT(vertexStride == sizeof(Vertex)); | 57 SkASSERT(vertexStride == sizeof(Vertex)); |
| 58 Vertex* verts = reinterpret_cast<Vertex*>(helper.init(target, vertexStri
de, 1)); | 58 Vertex* verts = reinterpret_cast<Vertex*>(helper.init(target, vertexStri
de, 1)); |
| 59 if (!verts) { | 59 if (!verts) { |
| 60 return; | 60 return; |
| 61 } | 61 } |
| 62 const SkRect& bounds = this->bounds(); | 62 const SkRect& bounds = this->bounds(); |
| 63 verts[0].fPosition.setRectFan(bounds.fLeft, bounds.fTop, bounds.fRight,
bounds.fBottom, | 63 verts[0].fPosition.setRectFan(bounds.fLeft, bounds.fTop, bounds.fRight,
bounds.fBottom, |
| 64 sizeof(Vertex)); | 64 sizeof(Vertex)); |
| 65 for (int v = 0; v < 4; ++v) { | 65 for (int v = 0; v < 4; ++v) { |
| 66 verts[v].fKLM[0] = eval_line(verts[v].fPosition, fKlmEqs + 0, fSign)
; | 66 verts[v].fKLM[0] = eval_line(verts[v].fPosition, fKlmEqs + 0, fSign)
; |
| 67 verts[v].fKLM[1] = eval_line(verts[v].fPosition, fKlmEqs + 3, fSign)
; | 67 verts[v].fKLM[1] = eval_line(verts[v].fPosition, fKlmEqs + 3, fSign)
; |
| 68 verts[v].fKLM[2] = eval_line(verts[v].fPosition, fKlmEqs + 6, 1.f); | 68 verts[v].fKLM[2] = eval_line(verts[v].fPosition, fKlmEqs + 6, 1.f); |
| 69 } | 69 } |
| 70 helper.recordDraw(target, fGeometryProcessor); | 70 helper.recordDraw(target, fGeometryProcessor.get()); |
| 71 } | 71 } |
| 72 | 72 |
| 73 SkScalar fKlmEqs[9]; | 73 SkScalar fKlmEqs[9]; |
| 74 SkScalar fSign; | 74 SkScalar fSign; |
| 75 SkAutoTUnref<const GrGeometryProcessor> fGeometryProcessor; | 75 sk_sp<GrGeometryProcessor> fGeometryProcessor; |
| 76 | 76 |
| 77 static const int kVertsPerCubic = 4; | 77 static const int kVertsPerCubic = 4; |
| 78 static const int kIndicesPerCubic = 6; | 78 static const int kIndicesPerCubic = 6; |
| 79 | 79 |
| 80 typedef GrTestBatch INHERITED; | 80 typedef GrTestBatch INHERITED; |
| 81 }; | 81 }; |
| 82 | 82 |
| 83 /** | 83 /** |
| 84 * This GM directly exercises effects that draw Bezier curves in the GPU backend
. | 84 * This GM directly exercises effects that draw Bezier curves in the GPU backend
. |
| 85 */ | 85 */ |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 static const GrColor color = 0xff000000; | 128 static const GrColor color = 0xff000000; |
| 129 | 129 |
| 130 for (int i = 0; i < kNumCubics; ++i) { | 130 for (int i = 0; i < kNumCubics; ++i) { |
| 131 SkPoint baseControlPts[] = { | 131 SkPoint baseControlPts[] = { |
| 132 {rand.nextRangeF(0.f, w), rand.nextRangeF(0.f, h)}, | 132 {rand.nextRangeF(0.f, w), rand.nextRangeF(0.f, h)}, |
| 133 {rand.nextRangeF(0.f, w), rand.nextRangeF(0.f, h)}, | 133 {rand.nextRangeF(0.f, w), rand.nextRangeF(0.f, h)}, |
| 134 {rand.nextRangeF(0.f, w), rand.nextRangeF(0.f, h)}, | 134 {rand.nextRangeF(0.f, w), rand.nextRangeF(0.f, h)}, |
| 135 {rand.nextRangeF(0.f, w), rand.nextRangeF(0.f, h)} | 135 {rand.nextRangeF(0.f, w), rand.nextRangeF(0.f, h)} |
| 136 }; | 136 }; |
| 137 for(int edgeType = 0; edgeType < kGrProcessorEdgeTypeCnt; ++edgeType
) { | 137 for(int edgeType = 0; edgeType < kGrProcessorEdgeTypeCnt; ++edgeType
) { |
| 138 SkAutoTUnref<GrGeometryProcessor> gp; | 138 sk_sp<GrGeometryProcessor> gp; |
| 139 GrPrimitiveEdgeType et = (GrPrimitiveEdgeType)edgeType; | 139 GrPrimitiveEdgeType et = (GrPrimitiveEdgeType)edgeType; |
| 140 gp.reset(GrCubicEffect::Create(color, SkMatrix::I(), et, | 140 gp = GrCubicEffect::Make(color, SkMatrix::I(), et, *context->cap
s()); |
| 141 *context->caps())); | |
| 142 if (!gp) { | 141 if (!gp) { |
| 143 continue; | 142 continue; |
| 144 } | 143 } |
| 145 SkScalar x = SkScalarMul(col, w); | 144 SkScalar x = SkScalarMul(col, w); |
| 146 SkScalar y = SkScalarMul(row, h); | 145 SkScalar y = SkScalarMul(row, h); |
| 147 SkPoint controlPts[] = { | 146 SkPoint controlPts[] = { |
| 148 {x + baseControlPts[0].fX, y + baseControlPts[0].fY}, | 147 {x + baseControlPts[0].fX, y + baseControlPts[0].fY}, |
| 149 {x + baseControlPts[1].fX, y + baseControlPts[1].fY}, | 148 {x + baseControlPts[1].fX, y + baseControlPts[1].fY}, |
| 150 {x + baseControlPts[2].fX, y + baseControlPts[2].fY}, | 149 {x + baseControlPts[2].fX, y + baseControlPts[2].fY}, |
| 151 {x + baseControlPts[3].fX, y + baseControlPts[3].fY} | 150 {x + baseControlPts[3].fX, y + baseControlPts[3].fY} |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 bounds.set(pts, 4); | 183 bounds.set(pts, 4); |
| 185 | 184 |
| 186 SkPaint boundsPaint; | 185 SkPaint boundsPaint; |
| 187 boundsPaint.setColor(0xff808080); | 186 boundsPaint.setColor(0xff808080); |
| 188 boundsPaint.setStrokeWidth(0); | 187 boundsPaint.setStrokeWidth(0); |
| 189 boundsPaint.setStyle(SkPaint::kStroke_Style); | 188 boundsPaint.setStyle(SkPaint::kStroke_Style); |
| 190 canvas->drawRect(bounds, boundsPaint); | 189 canvas->drawRect(bounds, boundsPaint); |
| 191 | 190 |
| 192 GrPipelineBuilder pipelineBuilder; | 191 GrPipelineBuilder pipelineBuilder; |
| 193 pipelineBuilder.setXPFactory( | 192 pipelineBuilder.setXPFactory( |
| 194 GrPorterDuffXPFactory::Create(SkXfermode::kSrc_Mode))->u
nref(); | 193 GrPorterDuffXPFactory::Make(SkXfermode::kSrc_Mode)); |
| 195 | 194 |
| 196 SkAutoTUnref<GrDrawBatch> batch( | 195 SkAutoTUnref<GrDrawBatch> batch( |
| 197 new BezierCubicOrConicTestBatch(gp, bounds, color, klmEq
s, klmSigns[c])); | 196 new BezierCubicOrConicTestBatch(gp, bounds, color, klmEq
s, klmSigns[c])); |
| 198 | 197 |
| 199 drawContext->drawContextPriv().testingOnly_drawBatch(pipelin
eBuilder, batch); | 198 drawContext->drawContextPriv().testingOnly_drawBatch(pipelin
eBuilder, batch); |
| 200 } | 199 } |
| 201 ++col; | 200 ++col; |
| 202 if (numCols == col) { | 201 if (numCols == col) { |
| 203 col = 0; | 202 col = 0; |
| 204 ++row; | 203 ++row; |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 static const GrColor color = 0xff000000; | 261 static const GrColor color = 0xff000000; |
| 263 | 262 |
| 264 for (int i = 0; i < kNumConics; ++i) { | 263 for (int i = 0; i < kNumConics; ++i) { |
| 265 SkPoint baseControlPts[] = { | 264 SkPoint baseControlPts[] = { |
| 266 {rand.nextRangeF(0.f, w), rand.nextRangeF(0.f, h)}, | 265 {rand.nextRangeF(0.f, w), rand.nextRangeF(0.f, h)}, |
| 267 {rand.nextRangeF(0.f, w), rand.nextRangeF(0.f, h)}, | 266 {rand.nextRangeF(0.f, w), rand.nextRangeF(0.f, h)}, |
| 268 {rand.nextRangeF(0.f, w), rand.nextRangeF(0.f, h)} | 267 {rand.nextRangeF(0.f, w), rand.nextRangeF(0.f, h)} |
| 269 }; | 268 }; |
| 270 SkScalar weight = rand.nextRangeF(0.f, 2.f); | 269 SkScalar weight = rand.nextRangeF(0.f, 2.f); |
| 271 for(int edgeType = 0; edgeType < kGrProcessorEdgeTypeCnt; ++edgeType
) { | 270 for(int edgeType = 0; edgeType < kGrProcessorEdgeTypeCnt; ++edgeType
) { |
| 272 SkAutoTUnref<GrGeometryProcessor> gp; | 271 sk_sp<GrGeometryProcessor> gp; |
| 273 GrPrimitiveEdgeType et = (GrPrimitiveEdgeType)edgeType; | 272 GrPrimitiveEdgeType et = (GrPrimitiveEdgeType)edgeType; |
| 274 gp.reset(GrConicEffect::Create(color, SkMatrix::I(), et, | 273 gp = GrConicEffect::Make(color, SkMatrix::I(), et, |
| 275 *context->caps(), SkMatrix::I(),
false)); | 274 *context->caps(), SkMatrix::I(), false)
; |
| 276 if (!gp) { | 275 if (!gp) { |
| 277 continue; | 276 continue; |
| 278 } | 277 } |
| 279 | 278 |
| 280 SkScalar x = SkScalarMul(col, w); | 279 SkScalar x = SkScalarMul(col, w); |
| 281 SkScalar y = SkScalarMul(row, h); | 280 SkScalar y = SkScalarMul(row, h); |
| 282 SkPoint controlPts[] = { | 281 SkPoint controlPts[] = { |
| 283 {x + baseControlPts[0].fX, y + baseControlPts[0].fY}, | 282 {x + baseControlPts[0].fX, y + baseControlPts[0].fY}, |
| 284 {x + baseControlPts[1].fX, y + baseControlPts[1].fY}, | 283 {x + baseControlPts[1].fX, y + baseControlPts[1].fY}, |
| 285 {x + baseControlPts[2].fX, y + baseControlPts[2].fY} | 284 {x + baseControlPts[2].fX, y + baseControlPts[2].fY} |
| (...skipping 30 matching lines...) Expand all Loading... |
| 316 bounds.set(pts, 3); | 315 bounds.set(pts, 3); |
| 317 | 316 |
| 318 SkPaint boundsPaint; | 317 SkPaint boundsPaint; |
| 319 boundsPaint.setColor(0xff808080); | 318 boundsPaint.setColor(0xff808080); |
| 320 boundsPaint.setStrokeWidth(0); | 319 boundsPaint.setStrokeWidth(0); |
| 321 boundsPaint.setStyle(SkPaint::kStroke_Style); | 320 boundsPaint.setStyle(SkPaint::kStroke_Style); |
| 322 canvas->drawRect(bounds, boundsPaint); | 321 canvas->drawRect(bounds, boundsPaint); |
| 323 | 322 |
| 324 GrPipelineBuilder pipelineBuilder; | 323 GrPipelineBuilder pipelineBuilder; |
| 325 pipelineBuilder.setXPFactory( | 324 pipelineBuilder.setXPFactory( |
| 326 GrPorterDuffXPFactory::Create(SkXfermode::kSrc_Mode))->u
nref(); | 325 GrPorterDuffXPFactory::Make(SkXfermode::kSrc_Mode)); |
| 327 | 326 |
| 328 SkAutoTUnref<GrDrawBatch> batch( | 327 SkAutoTUnref<GrDrawBatch> batch( |
| 329 new BezierCubicOrConicTestBatch(gp, bounds, color, klmEq
s, 1.f)); | 328 new BezierCubicOrConicTestBatch(gp, bounds, color, klmEq
s, 1.f)); |
| 330 | 329 |
| 331 drawContext->drawContextPriv().testingOnly_drawBatch(pipelin
eBuilder, batch); | 330 drawContext->drawContextPriv().testingOnly_drawBatch(pipelin
eBuilder, batch); |
| 332 } | 331 } |
| 333 ++col; | 332 ++col; |
| 334 if (numCols == col) { | 333 if (numCols == col) { |
| 335 col = 0; | 334 col = 0; |
| 336 ++row; | 335 ++row; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 typedef GM INHERITED; | 379 typedef GM INHERITED; |
| 381 }; | 380 }; |
| 382 | 381 |
| 383 ////////////////////////////////////////////////////////////////////////////// | 382 ////////////////////////////////////////////////////////////////////////////// |
| 384 | 383 |
| 385 class BezierQuadTestBatch : public GrTestBatch { | 384 class BezierQuadTestBatch : public GrTestBatch { |
| 386 public: | 385 public: |
| 387 DEFINE_BATCH_CLASS_ID | 386 DEFINE_BATCH_CLASS_ID |
| 388 const char* name() const override { return "BezierQuadTestBatch"; } | 387 const char* name() const override { return "BezierQuadTestBatch"; } |
| 389 | 388 |
| 390 BezierQuadTestBatch(const GrGeometryProcessor* gp, const SkRect& bounds, GrC
olor color, | 389 BezierQuadTestBatch(sk_sp<GrGeometryProcessor> gp, const SkRect& bounds, GrC
olor color, |
| 391 const GrPathUtils::QuadUVMatrix& devToUV) | 390 const GrPathUtils::QuadUVMatrix& devToUV) |
| 392 : INHERITED(ClassID(), bounds, color) | 391 : INHERITED(ClassID(), bounds, color) |
| 393 , fDevToUV(devToUV) | 392 , fDevToUV(devToUV) |
| 394 , fGeometryProcessor(SkRef(gp)) { | 393 , fGeometryProcessor(std::move(gp)) { |
| 395 } | 394 } |
| 396 | 395 |
| 397 private: | 396 private: |
| 398 | 397 |
| 399 struct Vertex { | 398 struct Vertex { |
| 400 SkPoint fPosition; | 399 SkPoint fPosition; |
| 401 float fKLM[4]; // The last value is ignored. The effect expects a vec4
f. | 400 float fKLM[4]; // The last value is ignored. The effect expects a vec4
f. |
| 402 }; | 401 }; |
| 403 | 402 |
| 404 void onPrepareDraws(Target* target) const override { | 403 void onPrepareDraws(Target* target) const override { |
| 405 QuadHelper helper; | 404 QuadHelper helper; |
| 406 size_t vertexStride = fGeometryProcessor->getVertexStride(); | 405 size_t vertexStride = fGeometryProcessor->getVertexStride(); |
| 407 SkASSERT(vertexStride == sizeof(Vertex)); | 406 SkASSERT(vertexStride == sizeof(Vertex)); |
| 408 Vertex* verts = reinterpret_cast<Vertex*>(helper.init(target, vertexStri
de, 1)); | 407 Vertex* verts = reinterpret_cast<Vertex*>(helper.init(target, vertexStri
de, 1)); |
| 409 if (!verts) { | 408 if (!verts) { |
| 410 return; | 409 return; |
| 411 } | 410 } |
| 412 const SkRect& bounds = this->bounds(); | 411 const SkRect& bounds = this->bounds(); |
| 413 verts[0].fPosition.setRectFan(bounds.fLeft, bounds.fTop, bounds.fRight,
bounds.fBottom, | 412 verts[0].fPosition.setRectFan(bounds.fLeft, bounds.fTop, bounds.fRight,
bounds.fBottom, |
| 414 sizeof(Vertex)); | 413 sizeof(Vertex)); |
| 415 fDevToUV.apply<4, sizeof(Vertex), sizeof(SkPoint)>(verts); | 414 fDevToUV.apply<4, sizeof(Vertex), sizeof(SkPoint)>(verts); |
| 416 helper.recordDraw(target, fGeometryProcessor); | 415 helper.recordDraw(target, fGeometryProcessor.get()); |
| 417 } | 416 } |
| 418 | 417 |
| 419 GrPathUtils::QuadUVMatrix fDevToUV; | 418 GrPathUtils::QuadUVMatrix fDevToUV; |
| 420 SkAutoTUnref<const GrGeometryProcessor> fGeometryProcessor; | 419 sk_sp<GrGeometryProcessor> fGeometryProcessor; |
| 421 | 420 |
| 422 static const int kVertsPerCubic = 4; | 421 static const int kVertsPerCubic = 4; |
| 423 static const int kIndicesPerCubic = 6; | 422 static const int kIndicesPerCubic = 6; |
| 424 | 423 |
| 425 typedef GrTestBatch INHERITED; | 424 typedef GrTestBatch INHERITED; |
| 426 }; | 425 }; |
| 427 | 426 |
| 428 /** | 427 /** |
| 429 * This GM directly exercises effects that draw Bezier quad curves in the GPU ba
ckend. | 428 * This GM directly exercises effects that draw Bezier quad curves in the GPU ba
ckend. |
| 430 */ | 429 */ |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 472 int col = 0; | 471 int col = 0; |
| 473 static const GrColor color = 0xff000000; | 472 static const GrColor color = 0xff000000; |
| 474 | 473 |
| 475 for (int i = 0; i < kNumQuads; ++i) { | 474 for (int i = 0; i < kNumQuads; ++i) { |
| 476 SkPoint baseControlPts[] = { | 475 SkPoint baseControlPts[] = { |
| 477 {rand.nextRangeF(0.f, w), rand.nextRangeF(0.f, h)}, | 476 {rand.nextRangeF(0.f, w), rand.nextRangeF(0.f, h)}, |
| 478 {rand.nextRangeF(0.f, w), rand.nextRangeF(0.f, h)}, | 477 {rand.nextRangeF(0.f, w), rand.nextRangeF(0.f, h)}, |
| 479 {rand.nextRangeF(0.f, w), rand.nextRangeF(0.f, h)} | 478 {rand.nextRangeF(0.f, w), rand.nextRangeF(0.f, h)} |
| 480 }; | 479 }; |
| 481 for(int edgeType = 0; edgeType < kGrProcessorEdgeTypeCnt; ++edgeType
) { | 480 for(int edgeType = 0; edgeType < kGrProcessorEdgeTypeCnt; ++edgeType
) { |
| 482 SkAutoTUnref<GrGeometryProcessor> gp; | 481 sk_sp<GrGeometryProcessor> gp; |
| 483 GrPrimitiveEdgeType et = (GrPrimitiveEdgeType)edgeType; | 482 GrPrimitiveEdgeType et = (GrPrimitiveEdgeType)edgeType; |
| 484 gp.reset(GrQuadEffect::Create(color, SkMatrix::I(), et, | 483 gp = GrQuadEffect::Make(color, SkMatrix::I(), et, |
| 485 *context->caps(), SkMatrix::I(), f
alse)); | 484 *context->caps(), SkMatrix::I(), false); |
| 486 if (!gp) { | 485 if (!gp) { |
| 487 continue; | 486 continue; |
| 488 } | 487 } |
| 489 | 488 |
| 490 SkScalar x = SkScalarMul(col, w); | 489 SkScalar x = SkScalarMul(col, w); |
| 491 SkScalar y = SkScalarMul(row, h); | 490 SkScalar y = SkScalarMul(row, h); |
| 492 SkPoint controlPts[] = { | 491 SkPoint controlPts[] = { |
| 493 {x + baseControlPts[0].fX, y + baseControlPts[0].fY}, | 492 {x + baseControlPts[0].fX, y + baseControlPts[0].fY}, |
| 494 {x + baseControlPts[1].fX, y + baseControlPts[1].fY}, | 493 {x + baseControlPts[1].fX, y + baseControlPts[1].fY}, |
| 495 {x + baseControlPts[2].fX, y + baseControlPts[2].fY} | 494 {x + baseControlPts[2].fX, y + baseControlPts[2].fY} |
| (...skipping 27 matching lines...) Expand all Loading... |
| 523 bounds.set(pts, 3); | 522 bounds.set(pts, 3); |
| 524 | 523 |
| 525 SkPaint boundsPaint; | 524 SkPaint boundsPaint; |
| 526 boundsPaint.setColor(0xff808080); | 525 boundsPaint.setColor(0xff808080); |
| 527 boundsPaint.setStrokeWidth(0); | 526 boundsPaint.setStrokeWidth(0); |
| 528 boundsPaint.setStyle(SkPaint::kStroke_Style); | 527 boundsPaint.setStyle(SkPaint::kStroke_Style); |
| 529 canvas->drawRect(bounds, boundsPaint); | 528 canvas->drawRect(bounds, boundsPaint); |
| 530 | 529 |
| 531 GrPipelineBuilder pipelineBuilder; | 530 GrPipelineBuilder pipelineBuilder; |
| 532 pipelineBuilder.setXPFactory( | 531 pipelineBuilder.setXPFactory( |
| 533 GrPorterDuffXPFactory::Create(SkXfermode::kSrc_Mode))->u
nref(); | 532 GrPorterDuffXPFactory::Make(SkXfermode::kSrc_Mode)); |
| 534 | 533 |
| 535 GrPathUtils::QuadUVMatrix DevToUV(pts); | 534 GrPathUtils::QuadUVMatrix DevToUV(pts); |
| 536 | 535 |
| 537 SkAutoTUnref<GrDrawBatch> batch( | 536 SkAutoTUnref<GrDrawBatch> batch( |
| 538 new BezierQuadTestBatch(gp, bounds, color, DevToUV)); | 537 new BezierQuadTestBatch(gp, bounds, color, DevToUV)); |
| 539 | 538 |
| 540 drawContext->drawContextPriv().testingOnly_drawBatch(pipelin
eBuilder, batch); | 539 drawContext->drawContextPriv().testingOnly_drawBatch(pipelin
eBuilder, batch); |
| 541 } | 540 } |
| 542 ++col; | 541 ++col; |
| 543 if (numCols == col) { | 542 if (numCols == col) { |
| 544 col = 0; | 543 col = 0; |
| 545 ++row; | 544 ++row; |
| 546 } | 545 } |
| 547 } | 546 } |
| 548 } | 547 } |
| 549 } | 548 } |
| 550 | 549 |
| 551 private: | 550 private: |
| 552 typedef GM INHERITED; | 551 typedef GM INHERITED; |
| 553 }; | 552 }; |
| 554 | 553 |
| 555 DEF_GM(return new BezierCubicEffects;) | 554 DEF_GM(return new BezierCubicEffects;) |
| 556 DEF_GM(return new BezierConicEffects;) | 555 DEF_GM(return new BezierConicEffects;) |
| 557 DEF_GM(return new BezierQuadEffects;) | 556 DEF_GM(return new BezierQuadEffects;) |
| 558 } | 557 } |
| 559 | 558 |
| 560 #endif | 559 #endif |
| OLD | NEW |