OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 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 "GrStencilAndCoverPathRenderer.h" | 10 #include "GrStencilAndCoverPathRenderer.h" |
11 #include "GrAAHairLinePathRenderer.h" | 11 #include "GrAAHairLinePathRenderer.h" |
12 #include "GrAAConvexPathRenderer.h" | 12 #include "GrAAConvexPathRenderer.h" |
13 #include "GrAALinearizingConvexPathRenderer.h" | 13 #include "GrAALinearizingConvexPathRenderer.h" |
14 #include "GrAADistanceFieldPathRenderer.h" | 14 #include "GrAADistanceFieldPathRenderer.h" |
15 #include "GrContext.h" | 15 #include "GrContext.h" |
16 #include "GrDashLinePathRenderer.h" | 16 #include "GrDashLinePathRenderer.h" |
17 #include "GrGpu.h" | 17 #include "GrGpu.h" |
18 #include "GrTessellatingPathRenderer.h" | 18 #include "GrTessellatingPathRenderer.h" |
19 | 19 |
20 #ifndef GR_TESSELLATING_PATH_RENDERING | |
21 #define GR_TESSELLATING_PATH_RENDERING 1 | |
22 #endif | |
23 | |
24 void GrPathRenderer::AddPathRenderers(GrContext* ctx, GrPathRendererChain* chain
) { | 20 void GrPathRenderer::AddPathRenderers(GrContext* ctx, GrPathRendererChain* chain
) { |
25 chain->addPathRenderer(SkNEW(GrDashLinePathRenderer))->unref(); | 21 chain->addPathRenderer(SkNEW(GrDashLinePathRenderer))->unref(); |
26 | 22 |
27 if (GrPathRenderer* pr = GrStencilAndCoverPathRenderer::Create(ctx->resource
Provider(), | 23 if (GrPathRenderer* pr = GrStencilAndCoverPathRenderer::Create(ctx->resource
Provider(), |
28 *ctx->caps())
) { | 24 *ctx->caps())
) { |
29 chain->addPathRenderer(pr)->unref(); | 25 chain->addPathRenderer(pr)->unref(); |
30 } | 26 } |
31 #if GR_TESSELLATING_PATH_RENDERING | 27 chain->addPathRenderer(SkNEW(GrTessellatingPathRenderer))->unref(); |
32 chain->addPathRenderer(new GrTessellatingPathRenderer)->unref(); | |
33 #endif | |
34 if (GrPathRenderer* pr = GrAAHairLinePathRenderer::Create()) { | 28 if (GrPathRenderer* pr = GrAAHairLinePathRenderer::Create()) { |
35 chain->addPathRenderer(pr)->unref(); | 29 chain->addPathRenderer(pr)->unref(); |
36 } | 30 } |
37 chain->addPathRenderer(SkNEW(GrAAConvexPathRenderer))->unref(); | 31 chain->addPathRenderer(SkNEW(GrAAConvexPathRenderer))->unref(); |
38 chain->addPathRenderer(SkNEW(GrAALinearizingConvexPathRenderer))->unref(); | 32 chain->addPathRenderer(SkNEW(GrAALinearizingConvexPathRenderer))->unref(); |
39 chain->addPathRenderer(SkNEW(GrAADistanceFieldPathRenderer))->unref(); | 33 chain->addPathRenderer(SkNEW(GrAADistanceFieldPathRenderer))->unref(); |
40 } | 34 } |
OLD | NEW |