OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #include "GrPathRendererChain.h" | 10 #include "GrPathRendererChain.h" |
11 | 11 |
12 #include "GrCaps.h" | 12 #include "GrCaps.h" |
| 13 #include "gl/GrGLCaps.h" |
| 14 #include "glsl/GrGLSLCaps.h" |
13 #include "GrContext.h" | 15 #include "GrContext.h" |
14 #include "GrGpu.h" | 16 #include "GrGpu.h" |
15 | 17 |
16 #include "batches/GrAAConvexPathRenderer.h" | 18 #include "batches/GrAAConvexPathRenderer.h" |
17 #include "batches/GrAADistanceFieldPathRenderer.h" | 19 #include "batches/GrAADistanceFieldPathRenderer.h" |
18 #include "batches/GrAAHairLinePathRenderer.h" | 20 #include "batches/GrAAHairLinePathRenderer.h" |
19 #include "batches/GrAALinearizingConvexPathRenderer.h" | 21 #include "batches/GrAALinearizingConvexPathRenderer.h" |
20 #include "batches/GrDashLinePathRenderer.h" | 22 #include "batches/GrDashLinePathRenderer.h" |
21 #include "batches/GrDefaultPathRenderer.h" | 23 #include "batches/GrDefaultPathRenderer.h" |
22 #include "batches/GrStencilAndCoverPathRenderer.h" | 24 #include "batches/GrStencilAndCoverPathRenderer.h" |
23 #include "batches/GrTessellatingPathRenderer.h" | 25 #include "batches/GrTessellatingPathRenderer.h" |
| 26 #include "batches/GrPLSPathRenderer.h" |
24 | 27 |
25 GrPathRendererChain::GrPathRendererChain(GrContext* context) { | 28 GrPathRendererChain::GrPathRendererChain(GrContext* context) { |
26 const GrCaps& caps = *context->caps(); | 29 const GrCaps& caps = *context->caps(); |
27 this->addPathRenderer(new GrDashLinePathRenderer)->unref(); | 30 this->addPathRenderer(new GrDashLinePathRenderer)->unref(); |
28 | 31 |
29 if (GrPathRenderer* pr = GrStencilAndCoverPathRenderer::Create(context->reso
urceProvider(), | 32 if (GrPathRenderer* pr = GrStencilAndCoverPathRenderer::Create(context->reso
urceProvider(), |
30 caps)) { | 33 caps)) { |
31 this->addPathRenderer(pr)->unref(); | 34 this->addPathRenderer(pr)->unref(); |
32 } | 35 } |
33 this->addPathRenderer(new GrTessellatingPathRenderer)->unref(); | 36 this->addPathRenderer(new GrTessellatingPathRenderer)->unref(); |
34 this->addPathRenderer(new GrAAHairLinePathRenderer)->unref(); | 37 this->addPathRenderer(new GrAAHairLinePathRenderer)->unref(); |
35 this->addPathRenderer(new GrAAConvexPathRenderer)->unref(); | 38 this->addPathRenderer(new GrAAConvexPathRenderer)->unref(); |
36 this->addPathRenderer(new GrAALinearizingConvexPathRenderer)->unref(); | 39 this->addPathRenderer(new GrAALinearizingConvexPathRenderer)->unref(); |
| 40 if (caps.shaderCaps()->plsPathRenderingSupport()) { |
| 41 this->addPathRenderer(new GrPLSPathRenderer)->unref(); |
| 42 } |
37 this->addPathRenderer(new GrAADistanceFieldPathRenderer)->unref(); | 43 this->addPathRenderer(new GrAADistanceFieldPathRenderer)->unref(); |
38 this->addPathRenderer(new GrDefaultPathRenderer(caps.twoSidedStencilSupport(
), | 44 this->addPathRenderer(new GrDefaultPathRenderer(caps.twoSidedStencilSupport(
), |
39 caps.stencilWrapOpsSupport()
))->unref(); | 45 caps.stencilWrapOpsSupport()
))->unref(); |
40 } | 46 } |
41 | 47 |
42 GrPathRendererChain::~GrPathRendererChain() { | 48 GrPathRendererChain::~GrPathRendererChain() { |
43 for (int i = 0; i < fChain.count(); ++i) { | 49 for (int i = 0; i < fChain.count(); ++i) { |
44 fChain[i]->unref(); | 50 fChain[i]->unref(); |
45 } | 51 } |
46 } | 52 } |
(...skipping 30 matching lines...) Expand all Loading... |
77 continue; | 83 continue; |
78 } else if (stencilSupport) { | 84 } else if (stencilSupport) { |
79 *stencilSupport = support; | 85 *stencilSupport = support; |
80 } | 86 } |
81 } | 87 } |
82 return fChain[i]; | 88 return fChain[i]; |
83 } | 89 } |
84 } | 90 } |
85 return nullptr; | 91 return nullptr; |
86 } | 92 } |
OLD | NEW |