diff options
author | 2016-07-21 12:04:08 -0700 | |
---|---|---|
committer | 2016-07-21 12:04:08 -0700 | |
commit | 2895eeb11a9f0d9c0018d49dd4bc45f6c6fc062c (patch) | |
tree | 3509c01c16bd72405503e587553820e379b534c5 /src/gpu/GrDrawContext.cpp | |
parent | f25bff95db388554027c78df709f78f8278fffed (diff) |
Retract PipelineBuilder some more
The main part of this CL is widening SkDrawContext::drawBatch's API to accept the userStencilSettings & drawFace
There is some ancillary spookiness related to expanding the should_apply_coverage_aa & mustUseHWAA methods to encompass mixedSamples
Calved off:
https://codereview.chromium.org/2165283002/ (Remove DrawFace enum from GrPipelineBuilder)
https://codereview.chromium.org/2167183002/ (Minor change to Ganesh path renderers)
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2092893003
Review-Url: https://codereview.chromium.org/2092893003
Diffstat (limited to 'src/gpu/GrDrawContext.cpp')
-rw-r--r-- | src/gpu/GrDrawContext.cpp | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/src/gpu/GrDrawContext.cpp b/src/gpu/GrDrawContext.cpp index 40d976869b..52f7fc0a35 100644 --- a/src/gpu/GrDrawContext.cpp +++ b/src/gpu/GrDrawContext.cpp @@ -297,9 +297,9 @@ static bool should_apply_coverage_aa(const GrPaint& paint, GrRenderTarget* rt, return false; } else { if (useHWAA) { - *useHWAA = rt->isUnifiedMultisampled(); + *useHWAA = rt->isUnifiedMultisampled() || rt->hasMixedSamples(); } - return !rt->isUnifiedMultisampled(); + return !rt->isUnifiedMultisampled() && !rt->hasMixedSamples(); } } @@ -621,8 +621,8 @@ void GrDrawContext::fillRectToRect(const GrClip& clip, batch.reset(ir->recordRect(croppedRect, viewMatrix, paint.getColor(), croppedLocalRect, paint.isAntiAlias(), fInstancedPipelineInfo, &useHWAA)); if (batch) { - GrPipelineBuilder pipelineBuilder(paint, useHWAA); - this->getDrawTarget()->drawBatch(pipelineBuilder, this, clip, batch); + SkASSERT(useHWAA == this->mustUseHWAA(paint)); + this->drawBatch(paint, clip, GrUserStencilSettings::kUnused, batch); return; } } @@ -632,15 +632,13 @@ void GrDrawContext::fillRectToRect(const GrClip& clip, batch.reset(GrAAFillRectBatch::CreateWithLocalRect(paint.getColor(), viewMatrix, croppedRect, croppedLocalRect)); if (batch) { - GrPipelineBuilder pipelineBuilder(paint, useHWAA); - this->drawBatch(pipelineBuilder, clip, batch); - return; + SkASSERT(useHWAA == this->mustUseHWAA(paint)); + this->drawBatch(paint, clip, GrUserStencilSettings::kUnused, batch); } } else { this->drawNonAAFilledRect(clip, paint, viewMatrix, croppedRect, &croppedLocalRect, nullptr, nullptr); } - } void GrDrawContext::fillRectWithLocalMatrix(const GrClip& clip, @@ -1240,12 +1238,19 @@ void GrDrawContext::internalDrawPath(const GrClip& clip, pr->drawPath(args); } -void GrDrawContext::drawBatch(const GrPipelineBuilder& pipelineBuilder, const GrClip& clip, - GrDrawBatch* batch) { +void GrDrawContext::drawBatch(const GrPaint& paint, + const GrClip& clip, + const GrUserStencilSettings& userStencilSettings, + GrDrawBatch* batch, + GrDrawFace drawFace) { ASSERT_SINGLE_OWNER RETURN_IF_ABANDONED SkDEBUGCODE(this->validate();) GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawBatch"); + GrPipelineBuilder pipelineBuilder(paint, this->mustUseHWAA(paint)); + pipelineBuilder.setUserStencil(&userStencilSettings); + pipelineBuilder.setDrawFace(drawFace); + this->getDrawTarget()->drawBatch(pipelineBuilder, this, clip, batch); } |