| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 | 8 |
| 9 #include "GrPathRendererChain.h" | 9 #include "GrPathRendererChain.h" |
| 10 | 10 |
| 11 #include "GrCaps.h" | 11 #include "GrCaps.h" |
| 12 #include "gl/GrGLCaps.h" | 12 #include "gl/GrGLCaps.h" |
| 13 #include "glsl/GrGLSLCaps.h" | 13 #include "glsl/GrGLSLCaps.h" |
| 14 #include "GrContext.h" | 14 #include "GrContext.h" |
| 15 #include "GrGpu.h" | 15 #include "GrGpu.h" |
| 16 | 16 |
| 17 #include "batches/GrAAConvexPathRenderer.h" | 17 #include "batches/GrAAConvexPathRenderer.h" |
| 18 #include "batches/GrAADistanceFieldPathRenderer.h" | 18 #include "batches/GrAADistanceFieldPathRenderer.h" |
| 19 #include "batches/GrAAHairLinePathRenderer.h" | 19 #include "batches/GrAAHairLinePathRenderer.h" |
| 20 #include "batches/GrAALinearizingConvexPathRenderer.h" | 20 #include "batches/GrAALinearizingConvexPathRenderer.h" |
| 21 #include "batches/GrDashLinePathRenderer.h" | 21 #include "batches/GrDashLinePathRenderer.h" |
| 22 #include "batches/GrDefaultPathRenderer.h" | 22 #include "batches/GrDefaultPathRenderer.h" |
| 23 #include "batches/GrMSAAPathRenderer.h" | |
| 24 #include "batches/GrPLSPathRenderer.h" | |
| 25 #include "batches/GrStencilAndCoverPathRenderer.h" | 23 #include "batches/GrStencilAndCoverPathRenderer.h" |
| 26 #include "batches/GrTessellatingPathRenderer.h" | 24 #include "batches/GrTessellatingPathRenderer.h" |
| 25 #include "batches/GrPLSPathRenderer.h" |
| 27 | 26 |
| 28 GrPathRendererChain::GrPathRendererChain(GrContext* context) { | 27 GrPathRendererChain::GrPathRendererChain(GrContext* context) { |
| 29 const GrCaps& caps = *context->caps(); | 28 const GrCaps& caps = *context->caps(); |
| 30 this->addPathRenderer(new GrDashLinePathRenderer)->unref(); | 29 this->addPathRenderer(new GrDashLinePathRenderer)->unref(); |
| 31 | 30 |
| 32 if (GrPathRenderer* pr = GrStencilAndCoverPathRenderer::Create(context->reso
urceProvider(), | 31 if (GrPathRenderer* pr = GrStencilAndCoverPathRenderer::Create(context->reso
urceProvider(), |
| 33 caps)) { | 32 caps)) { |
| 34 this->addPathRenderer(pr)->unref(); | 33 this->addPathRenderer(pr)->unref(); |
| 35 } | 34 } |
| 36 if (caps.sampleShadingSupport()) { | |
| 37 this->addPathRenderer(new GrMSAAPathRenderer)->unref(); | |
| 38 } | |
| 39 this->addPathRenderer(new GrTessellatingPathRenderer)->unref(); | 35 this->addPathRenderer(new GrTessellatingPathRenderer)->unref(); |
| 40 this->addPathRenderer(new GrAAHairLinePathRenderer)->unref(); | 36 this->addPathRenderer(new GrAAHairLinePathRenderer)->unref(); |
| 41 this->addPathRenderer(new GrAAConvexPathRenderer)->unref(); | 37 this->addPathRenderer(new GrAAConvexPathRenderer)->unref(); |
| 42 this->addPathRenderer(new GrAALinearizingConvexPathRenderer)->unref(); | 38 this->addPathRenderer(new GrAALinearizingConvexPathRenderer)->unref(); |
| 43 if (caps.shaderCaps()->plsPathRenderingSupport()) { | 39 if (caps.shaderCaps()->plsPathRenderingSupport()) { |
| 44 this->addPathRenderer(new GrPLSPathRenderer)->unref(); | 40 this->addPathRenderer(new GrPLSPathRenderer)->unref(); |
| 45 } | 41 } |
| 46 this->addPathRenderer(new GrAADistanceFieldPathRenderer)->unref(); | 42 this->addPathRenderer(new GrAADistanceFieldPathRenderer)->unref(); |
| 47 this->addPathRenderer(new GrDefaultPathRenderer(caps.twoSidedStencilSupport(
), | 43 this->addPathRenderer(new GrDefaultPathRenderer(caps.twoSidedStencilSupport(
), |
| 48 caps.stencilWrapOpsSupport()
))->unref(); | 44 caps.stencilWrapOpsSupport()
))->unref(); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 continue; | 82 continue; |
| 87 } else if (stencilSupport) { | 83 } else if (stencilSupport) { |
| 88 *stencilSupport = support; | 84 *stencilSupport = support; |
| 89 } | 85 } |
| 90 } | 86 } |
| 91 return fChain[i]; | 87 return fChain[i]; |
| 92 } | 88 } |
| 93 } | 89 } |
| 94 return nullptr; | 90 return nullptr; |
| 95 } | 91 } |
| OLD | NEW |