blob: 1b5f0854b72a8ba292a2c87c4450223113cc08a0 [file] [log] [blame]
bsalomon@google.comaeb21602011-08-30 18:13:44 +00001
2/*
bsalomon@google.com69cc6ad2012-01-17 14:25:10 +00003 * Copyright 2012 Google Inc.
bsalomon@google.comaeb21602011-08-30 18:13:44 +00004 *
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
7 */
8
bsalomon@google.comded4f4b2012-06-28 18:48:06 +00009
10#include "GrStencilAndCoverPathRenderer.h"
bsalomon@google.comaeb21602011-08-30 18:13:44 +000011#include "GrAAHairLinePathRenderer.h"
bsalomon@google.com69cc6ad2012-01-17 14:25:10 +000012#include "GrAAConvexPathRenderer.h"
jvanverthfa38a302014-10-06 05:59:05 -070013#include "GrAADistanceFieldPathRenderer.h"
sugoi@google.come3453cb2013-01-07 14:26:40 +000014#if GR_STROKE_PATH_RENDERING
15#include "../../experimental/StrokePathRenderer/GrStrokePathRenderer.h"
16#endif
jvanverth@google.com74dda902013-01-09 21:04:52 +000017#if GR_ANDROID_PATH_RENDERING
18#include "../../experimental/AndroidPathRenderer/GrAndroidPathRenderer.h"
19#endif
bsalomon@google.comaeb21602011-08-30 18:13:44 +000020
bsalomon@google.com45a15f52012-12-10 19:10:17 +000021void GrPathRenderer::AddPathRenderers(GrContext* ctx, GrPathRendererChain* chain) {
sugoi@google.come3453cb2013-01-07 14:26:40 +000022#if GR_STROKE_PATH_RENDERING
23 chain->addPathRenderer(SkNEW(GrStrokePathRenderer))->unref();
24#endif
jvanverth@google.com74dda902013-01-09 21:04:52 +000025#if GR_ANDROID_PATH_RENDERING
26 chain->addPathRenderer(SkNEW(GrAndroidPathRenderer))->unref();
27#endif
bsalomon@google.comded4f4b2012-06-28 18:48:06 +000028 if (GrPathRenderer* pr = GrStencilAndCoverPathRenderer::Create(ctx)) {
29 chain->addPathRenderer(pr)->unref();
30 }
bsalomon@google.com45a15f52012-12-10 19:10:17 +000031 if (GrPathRenderer* pr = GrAAHairLinePathRenderer::Create(ctx)) {
32 chain->addPathRenderer(pr)->unref();
bsalomon@google.comaeb21602011-08-30 18:13:44 +000033 }
bsalomon@google.com45a15f52012-12-10 19:10:17 +000034 chain->addPathRenderer(SkNEW(GrAAConvexPathRenderer))->unref();
jvanverthfa38a302014-10-06 05:59:05 -070035#ifndef SK_LEGACY_NO_DISTANCE_FIELD_PATHS
36 chain->addPathRenderer(SkNEW_ARGS(GrAADistanceFieldPathRenderer, (ctx)))->unref();
37#endif
bsalomon@google.comaeb21602011-08-30 18:13:44 +000038}