OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "GrDashLinePathRenderer.h" | 8 #include "GrDashLinePathRenderer.h" |
9 | 9 |
10 #include "GrGpu.h" | 10 #include "GrGpu.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 // We ignore args.fAntiAlias here and force anti aliasing when using MSA
A. Otherwise, | 31 // We ignore args.fAntiAlias here and force anti aliasing when using MSA
A. Otherwise, |
32 // we can wind up with external edges antialiased and internal edges una
ntialiased. | 32 // we can wind up with external edges antialiased and internal edges una
ntialiased. |
33 aaMode = GrDashingEffect::AAMode::kCoverageWithMSAA; | 33 aaMode = GrDashingEffect::AAMode::kCoverageWithMSAA; |
34 } else if (args.fAntiAlias) { | 34 } else if (args.fAntiAlias) { |
35 aaMode = GrDashingEffect::AAMode::kCoverage; | 35 aaMode = GrDashingEffect::AAMode::kCoverage; |
36 } else { | 36 } else { |
37 aaMode = GrDashingEffect::AAMode::kNone; | 37 aaMode = GrDashingEffect::AAMode::kNone; |
38 } | 38 } |
39 SkPoint pts[2]; | 39 SkPoint pts[2]; |
40 SkAssertResult(args.fShape->asLine(pts, nullptr)); | 40 SkAssertResult(args.fShape->asLine(pts, nullptr)); |
41 SkAutoTUnref<GrDrawBatch> batch(GrDashingEffect::CreateDashLineBatch(args.fC
olor, | 41 SkAutoTUnref<GrDrawBatch> batch(GrDashingEffect::CreateDashLineBatch(args.fP
aint->getColor(), |
42 *args.f
ViewMatrix, | 42 *args.f
ViewMatrix, |
43 pts, | 43 pts, |
44 aaMode, | 44 aaMode, |
45 args.fS
hape->style())); | 45 args.fS
hape->style())); |
46 if (!batch) { | 46 if (!batch) { |
47 return false; | 47 return false; |
48 } | 48 } |
49 | 49 |
50 GrPipelineBuilder pipelineBuilder(*args.fPaint, useHWAA); | 50 GrPipelineBuilder pipelineBuilder(*args.fPaint, useHWAA); |
51 pipelineBuilder.setUserStencil(args.fUserStencilSettings); | 51 pipelineBuilder.setUserStencil(args.fUserStencilSettings); |
52 | 52 |
53 args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, batch); | 53 args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, batch); |
54 return true; | 54 return true; |
55 } | 55 } |
OLD | NEW |