aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2017-12-14 10:50:19 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-12-15 18:06:18 +0000
commit1e5d0cab2838384442a0aa828a312e208ec75b58 (patch)
tree92cd95df13d0e2bcea6fca25e85eacee7e1a5c5a /src
parent832415e395997389a82928c6bcdf9aa7bb7f8844 (diff)
Remove fallback in GrRenderTargetContext for using coverage to draw paths with msaa
We don't need to draw correctly when path renderers are disabled. Change-Id: I42d168bc3b5c5b72c79f29dbabe4faaa8055ef7d Reviewed-on: https://skia-review.googlesource.com/85043 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src')
-rw-r--r--src/gpu/GrRenderTargetContext.cpp53
1 files changed, 22 insertions, 31 deletions
diff --git a/src/gpu/GrRenderTargetContext.cpp b/src/gpu/GrRenderTargetContext.cpp
index 70864a0366..6f93a1c190 100644
--- a/src/gpu/GrRenderTargetContext.cpp
+++ b/src/gpu/GrRenderTargetContext.cpp
@@ -1663,44 +1663,35 @@ void GrRenderTargetContext::internalDrawPath(const GrClip& clip,
GrPathRenderer* pr;
static constexpr GrPathRendererChain::DrawType kType = GrPathRendererChain::DrawType::kColor;
- do {
- shape = GrShape(path, style);
- if (shape.isEmpty() && !shape.inverseFilled()) {
- return;
- }
+ shape = GrShape(path, style);
+ if (shape.isEmpty() && !shape.inverseFilled()) {
+ return;
+ }
- canDrawArgs.fAAType = aaType;
+ canDrawArgs.fAAType = aaType;
- // Try a 1st time without applying any of the style to the geometry (and barring sw)
- pr = this->drawingManager()->getPathRenderer(canDrawArgs, false, kType);
- SkScalar styleScale = GrStyle::MatrixToScaleFactor(viewMatrix);
+ // Try a 1st time without applying any of the style to the geometry (and barring sw)
+ pr = this->drawingManager()->getPathRenderer(canDrawArgs, false, kType);
+ SkScalar styleScale = GrStyle::MatrixToScaleFactor(viewMatrix);
- if (!pr && shape.style().pathEffect()) {
- // It didn't work above, so try again with the path effect applied.
- shape = shape.applyStyle(GrStyle::Apply::kPathEffectOnly, styleScale);
+ if (!pr && shape.style().pathEffect()) {
+ // It didn't work above, so try again with the path effect applied.
+ shape = shape.applyStyle(GrStyle::Apply::kPathEffectOnly, styleScale);
+ if (shape.isEmpty()) {
+ return;
+ }
+ pr = this->drawingManager()->getPathRenderer(canDrawArgs, false, kType);
+ }
+ if (!pr) {
+ if (shape.style().applies()) {
+ shape = shape.applyStyle(GrStyle::Apply::kPathEffectAndStrokeRec, styleScale);
if (shape.isEmpty()) {
return;
}
- pr = this->drawingManager()->getPathRenderer(canDrawArgs, false, kType);
}
- if (!pr) {
- if (shape.style().applies()) {
- shape = shape.applyStyle(GrStyle::Apply::kPathEffectAndStrokeRec, styleScale);
- if (shape.isEmpty()) {
- return;
- }
- }
- // This time, allow SW renderer
- pr = this->drawingManager()->getPathRenderer(canDrawArgs, true, kType);
- }
- if (!pr && GrAATypeIsHW(aaType)) {
- // There are exceptional cases where we may wind up falling back to coverage based AA
- // when the target is MSAA (e.g. through disabling path renderers via GrContextOptions).
- aaType = GrAAType::kCoverage;
- } else {
- break;
- }
- } while(true);
+ // This time, allow SW renderer
+ pr = this->drawingManager()->getPathRenderer(canDrawArgs, true, kType);
+ }
if (!pr) {
#ifdef SK_DEBUG