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 "GrContext.h" | 13 #include "GrContext.h" |
14 #include "GrGpu.h" | 14 #include "GrGpu.h" |
15 | 15 |
16 #include "batches/GrAAConvexPathRenderer.h" | 16 #include "batches/GrAAConvexPathRenderer.h" |
17 #include "batches/GrAADistanceFieldPathRenderer.h" | 17 #include "batches/GrAADistanceFieldPathRenderer.h" |
18 #include "batches/GrAAHairLinePathRenderer.h" | 18 #include "batches/GrAAHairLinePathRenderer.h" |
19 #include "batches/GrAALinearizingConvexPathRenderer.h" | 19 #include "batches/GrAALinearizingConvexPathRenderer.h" |
20 #include "batches/GrDashLinePathRenderer.h" | 20 #include "batches/GrDashLinePathRenderer.h" |
21 #include "batches/GrDefaultPathRenderer.h" | 21 #include "batches/GrDefaultPathRenderer.h" |
22 #include "batches/GrStencilAndCoverPathRenderer.h" | 22 #include "batches/GrStencilAndCoverPathRenderer.h" |
23 #include "batches/GrTessellatingPathRenderer.h" | 23 #include "batches/GrTessellatingPathRenderer.h" |
24 #include "batches/GrPLSPathRenderer.h" | |
24 | 25 |
25 GrPathRendererChain::GrPathRendererChain(GrContext* context) { | 26 GrPathRendererChain::GrPathRendererChain(GrContext* context) { |
26 const GrCaps& caps = *context->caps(); | 27 const GrCaps& caps = *context->caps(); |
27 this->addPathRenderer(new GrDashLinePathRenderer)->unref(); | 28 this->addPathRenderer(new GrDashLinePathRenderer)->unref(); |
28 | 29 |
29 if (GrPathRenderer* pr = GrStencilAndCoverPathRenderer::Create(context->reso urceProvider(), | 30 if (GrPathRenderer* pr = GrStencilAndCoverPathRenderer::Create(context->reso urceProvider(), |
30 caps)) { | 31 caps)) { |
31 this->addPathRenderer(pr)->unref(); | 32 this->addPathRenderer(pr)->unref(); |
32 } | 33 } |
33 this->addPathRenderer(new GrTessellatingPathRenderer)->unref(); | 34 this->addPathRenderer(new GrTessellatingPathRenderer)->unref(); |
34 this->addPathRenderer(new GrAAHairLinePathRenderer)->unref(); | 35 this->addPathRenderer(new GrAAHairLinePathRenderer)->unref(); |
35 this->addPathRenderer(new GrAAConvexPathRenderer)->unref(); | 36 this->addPathRenderer(new GrAAConvexPathRenderer)->unref(); |
36 this->addPathRenderer(new GrAALinearizingConvexPathRenderer)->unref(); | 37 this->addPathRenderer(new GrAALinearizingConvexPathRenderer)->unref(); |
38 #ifdef ENABLE_PLS | |
bsalomon
2016/01/13 19:15:34
untab
| |
39 if (caps.shaderCaps()->pixelLocalStorageSize() > 0) { | |
40 this->addPathRenderer(new GrPLSPathRenderer)->unref(); | |
41 } | |
42 #endif | |
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 |