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 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 const GrClip& clip, | 401 const GrClip& clip, |
402 const SkMatrix& viewMatrix, | 402 const SkMatrix& viewMatrix, |
403 const GrPath* path, | 403 const GrPath* path, |
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 useHWAA, |
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 |
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(useHWAA); |
423 paint.setXPFactory(GrDisableColorXPFactory::Make()); | 423 paint.setXPFactory(GrDisableColorXPFactory::Make()); |
424 | 424 |
425 bool useHWAA; | 425 SkASSERT(!useHWAA || fDrawContext->isStencilBufferMultisampled()); |
426 SkAutoTUnref<GrDrawBatch> batch( | |
427 fDrawContext->getFillRectBatch(paint, viewMatrix, rect, &useHWAA)); | |
428 SkASSERT(batch); | |
429 | 426 |
430 GrPipelineBuilder pipelineBuilder(paint, useHWAA); | 427 GrPipelineBuilder pipelineBuilder(paint, useHWAA); |
431 pipelineBuilder.setUserStencil(ss); | 428 pipelineBuilder.setUserStencil(ss); |
432 | 429 |
| 430 SkAutoTUnref<GrDrawBatch> batch( |
| 431 GrRectBatchFactory::CreateNonAAFill(SK_ColorWHITE, viewMatrix, rect, nul
lptr, nullptr)); |
| 432 |
433 fDrawContext->getDrawTarget()->drawBatch(pipelineBuilder, fDrawContext, clip
, batch); | 433 fDrawContext->getDrawTarget()->drawBatch(pipelineBuilder, fDrawContext, clip
, batch); |
434 } | 434 } |
435 | 435 |
436 bool GrDrawContextPriv::drawAndStencilRect(const GrFixedClip& clip, | 436 bool GrDrawContextPriv::drawAndStencilRect(const GrFixedClip& clip, |
437 const GrUserStencilSettings* ss, | 437 const GrUserStencilSettings* ss, |
438 SkRegion::Op op, | 438 SkRegion::Op op, |
439 bool invert, | 439 bool invert, |
440 bool doAA, | 440 bool doAA, |
441 const SkMatrix& viewMatrix, | 441 const SkMatrix& viewMatrix, |
442 const SkRect& rect) { | 442 const SkRect& rect) { |
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1064 | 1064 |
1065 void GrDrawContext::drawBatch(const GrPipelineBuilder& pipelineBuilder, const Gr
Clip& clip, | 1065 void GrDrawContext::drawBatch(const GrPipelineBuilder& pipelineBuilder, const Gr
Clip& clip, |
1066 GrDrawBatch* batch) { | 1066 GrDrawBatch* batch) { |
1067 ASSERT_SINGLE_OWNER | 1067 ASSERT_SINGLE_OWNER |
1068 RETURN_IF_ABANDONED | 1068 RETURN_IF_ABANDONED |
1069 SkDEBUGCODE(this->validate();) | 1069 SkDEBUGCODE(this->validate();) |
1070 GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawBatch"); | 1070 GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawBatch"); |
1071 | 1071 |
1072 this->getDrawTarget()->drawBatch(pipelineBuilder, this, clip, batch); | 1072 this->getDrawTarget()->drawBatch(pipelineBuilder, this, clip, batch); |
1073 } | 1073 } |
OLD | NEW |