Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(254)

Unified Diff: src/gpu/GrDrawContext.cpp

Issue 2092893003: Retract PipelineBuilder some more (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/gpu/GrDrawContext.h ('k') | src/gpu/GrSWMaskHelper.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « include/gpu/GrDrawContext.h ('k') | src/gpu/GrSWMaskHelper.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698