Index: src/gpu/GrDrawContext.cpp |
diff --git a/src/gpu/GrDrawContext.cpp b/src/gpu/GrDrawContext.cpp |
index 40d976869bd8c11d136ae6611729af0dc34bb0de..52f7fc0a35e21ab45c581da0a943db0665b4f9e2 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); |
} |