aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/batches/GrDashLinePathRenderer.cpp
diff options
context:
space:
mode:
authorGravatar robertphillips <robertphillips@google.com>2016-07-21 12:04:08 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-07-21 12:04:08 -0700
commit2895eeb11a9f0d9c0018d49dd4bc45f6c6fc062c (patch)
tree3509c01c16bd72405503e587553820e379b534c5 /src/gpu/batches/GrDashLinePathRenderer.cpp
parentf25bff95db388554027c78df709f78f8278fffed (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/batches/GrDashLinePathRenderer.cpp')
-rw-r--r--src/gpu/batches/GrDashLinePathRenderer.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/gpu/batches/GrDashLinePathRenderer.cpp b/src/gpu/batches/GrDashLinePathRenderer.cpp
index f2b75be108..b948fbcd94 100644
--- a/src/gpu/batches/GrDashLinePathRenderer.cpp
+++ b/src/gpu/batches/GrDashLinePathRenderer.cpp
@@ -9,7 +9,6 @@
#include "GrAuditTrail.h"
#include "GrGpu.h"
-#include "GrPipelineBuilder.h"
#include "effects/GrDashingEffect.h"
bool GrDashLinePathRenderer::onCanDrawPath(const CanDrawPathArgs& args) const {
@@ -26,9 +25,15 @@ bool GrDashLinePathRenderer::onCanDrawPath(const CanDrawPathArgs& args) const {
bool GrDashLinePathRenderer::onDrawPath(const DrawPathArgs& args) {
GR_AUDIT_TRAIL_AUTO_FRAME(args.fDrawContext->auditTrail(),
"GrDashLinePathRenderer::onDrawPath");
+
+ SkTCopyOnFirstWrite<GrPaint> paint(*args.fPaint);
+
bool useHWAA = args.fDrawContext->isUnifiedMultisampled();
GrDashingEffect::AAMode aaMode;
if (useHWAA) {
+ if (!paint->isAntiAlias()) {
+ paint.writable()->setAntiAlias(true);
+ }
// We ignore args.fAntiAlias here and force anti aliasing when using MSAA. Otherwise,
// we can wind up with external edges antialiased and internal edges unantialiased.
aaMode = GrDashingEffect::AAMode::kCoverageWithMSAA;
@@ -48,9 +53,7 @@ bool GrDashLinePathRenderer::onDrawPath(const DrawPathArgs& args) {
return false;
}
- GrPipelineBuilder pipelineBuilder(*args.fPaint, useHWAA);
- pipelineBuilder.setUserStencil(args.fUserStencilSettings);
-
- args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, batch);
+ SkASSERT(args.fDrawContext->mustUseHWAA(*paint) == useHWAA);
+ args.fDrawContext->drawBatch(*paint, *args.fClip, *args.fUserStencilSettings, batch);
return true;
}