Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 #include "GrBatchTest.h" | 8 #include "GrBatchTest.h" |
| 9 #include "GrColor.h" | 9 #include "GrColor.h" |
| 10 #include "GrDrawContext.h" | 10 #include "GrDrawContext.h" |
| (...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 404 GrPathRendering::FillType fill) { | 404 GrPathRendering::FillType fill) { |
| 405 fDrawContext->getDrawTarget()->stencilPath(pipelineBuilder, fDrawContext, | 405 fDrawContext->getDrawTarget()->stencilPath(pipelineBuilder, fDrawContext, |
| 406 clip, viewMatrix, path, fill); | 406 clip, viewMatrix, path, fill); |
| 407 } | 407 } |
| 408 | 408 |
| 409 void GrDrawContextPriv::stencilRect(const GrFixedClip& clip, | 409 void GrDrawContextPriv::stencilRect(const GrFixedClip& clip, |
| 410 const GrUserStencilSettings* ss, | 410 const GrUserStencilSettings* ss, |
| 411 bool doAA, | 411 bool doAA, |
| 412 const SkMatrix& viewMatrix, | 412 const SkMatrix& viewMatrix, |
| 413 const SkRect& rect) { | 413 const SkRect& rect) { |
| 414 ASSERT_SINGLE_OWNER_PRIV | 414 ASSERT_SINGLE_OWNER_PRIV |
|
bsalomon
2016/06/10 00:21:13
Should we assert or fail if doAA is true and the R
csmartdalton
2016/06/10 02:43:38
Done. Went with useHWAA to match GrPB and the othe
| |
| 415 RETURN_IF_ABANDONED_PRIV | 415 RETURN_IF_ABANDONED_PRIV |
| 416 SkDEBUGCODE(fDrawContext->validate();) | 416 SkDEBUGCODE(fDrawContext->validate();) |
| 417 GR_AUDIT_TRAIL_AUTO_FRAME(fDrawContext->fAuditTrail, "GrDrawContext::stencil Rect"); | 417 GR_AUDIT_TRAIL_AUTO_FRAME(fDrawContext->fAuditTrail, "GrDrawContext::stencil Rect"); |
| 418 | 418 |
| 419 AutoCheckFlush acf(fDrawContext->fDrawingManager); | 419 AutoCheckFlush acf(fDrawContext->fDrawingManager); |
| 420 | 420 |
| 421 GrPaint paint; | 421 GrPaint paint; |
| 422 paint.setAntiAlias(doAA); | 422 paint.setAntiAlias(doAA); |
| 423 paint.setXPFactory(GrDisableColorXPFactory::Make()); | 423 paint.setXPFactory(GrDisableColorXPFactory::Make()); |
| 424 | 424 |
| 425 bool useHWAA; | 425 GrPipelineBuilder pipelineBuilder(paint, doAA && fDrawContext->isStencilBuff erMultisampled()); |
| 426 pipelineBuilder.setUserStencil(ss); | |
| 427 | |
| 426 SkAutoTUnref<GrDrawBatch> batch( | 428 SkAutoTUnref<GrDrawBatch> batch( |
| 427 fDrawContext->getFillRectBatch(paint, viewMatrix, rect, &useHWAA)); | 429 GrRectBatchFactory::CreateNonAAFill(SK_ColorWHITE, viewMatrix, rect, nul lptr, nullptr)); |
| 428 SkASSERT(batch); | |
| 429 | |
| 430 GrPipelineBuilder pipelineBuilder(paint, useHWAA); | |
| 431 pipelineBuilder.setUserStencil(ss); | |
| 432 | 430 |
| 433 fDrawContext->getDrawTarget()->drawBatch(pipelineBuilder, fDrawContext, clip , batch); | 431 fDrawContext->getDrawTarget()->drawBatch(pipelineBuilder, fDrawContext, clip , batch); |
| 434 } | 432 } |
| 435 | 433 |
| 436 bool GrDrawContextPriv::drawAndStencilRect(const GrFixedClip& clip, | 434 bool GrDrawContextPriv::drawAndStencilRect(const GrFixedClip& clip, |
| 437 const GrUserStencilSettings* ss, | 435 const GrUserStencilSettings* ss, |
| 438 SkRegion::Op op, | 436 SkRegion::Op op, |
| 439 bool invert, | 437 bool invert, |
| 440 bool doAA, | 438 bool doAA, |
| 441 const SkMatrix& viewMatrix, | 439 const SkMatrix& viewMatrix, |
| (...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1064 | 1062 |
| 1065 void GrDrawContext::drawBatch(const GrPipelineBuilder& pipelineBuilder, const Gr Clip& clip, | 1063 void GrDrawContext::drawBatch(const GrPipelineBuilder& pipelineBuilder, const Gr Clip& clip, |
| 1066 GrDrawBatch* batch) { | 1064 GrDrawBatch* batch) { |
| 1067 ASSERT_SINGLE_OWNER | 1065 ASSERT_SINGLE_OWNER |
| 1068 RETURN_IF_ABANDONED | 1066 RETURN_IF_ABANDONED |
| 1069 SkDEBUGCODE(this->validate();) | 1067 SkDEBUGCODE(this->validate();) |
| 1070 GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawBatch"); | 1068 GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawBatch"); |
| 1071 | 1069 |
| 1072 this->getDrawTarget()->drawBatch(pipelineBuilder, this, clip, batch); | 1070 this->getDrawTarget()->drawBatch(pipelineBuilder, this, clip, batch); |
| 1073 } | 1071 } |
| OLD | NEW |