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