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