blob: f5d69348f326a019cf241689c5dcdf36d3447ca1 [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"
senorblancod6ed19c2015-02-26 06:58:17 -080014#include "GrTessellatingPathRenderer.h"
sugoi@google.come3453cb2013-01-07 14:26:40 +000015#if GR_STROKE_PATH_RENDERING
16#include "../../experimental/StrokePathRenderer/GrStrokePathRenderer.h"
17#endif
jvanverth@google.com74dda902013-01-09 21:04:52 +000018#if GR_ANDROID_PATH_RENDERING
19#include "../../experimental/AndroidPathRenderer/GrAndroidPathRenderer.h"
20#endif
bsalomon@google.comaeb21602011-08-30 18:13:44 +000021
senorblancod6ed19c2015-02-26 06:58:17 -080022#ifndef GR_TESSELLATING_PATH_RENDERING
23#define GR_TESSELLATING_PATH_RENDERING 0
24#endif
25
bsalomon@google.com45a15f52012-12-10 19:10:17 +000026void GrPathRenderer::AddPathRenderers(GrContext* ctx, GrPathRendererChain* chain) {
sugoi@google.come3453cb2013-01-07 14:26:40 +000027#if GR_STROKE_PATH_RENDERING
28 chain->addPathRenderer(SkNEW(GrStrokePathRenderer))->unref();
29#endif
jvanverth@google.com74dda902013-01-09 21:04:52 +000030#if GR_ANDROID_PATH_RENDERING
31 chain->addPathRenderer(SkNEW(GrAndroidPathRenderer))->unref();
32#endif
senorblancod6ed19c2015-02-26 06:58:17 -080033#if GR_TESSELLATING_PATH_RENDERING
34 chain->addPathRenderer(new GrTessellatingPathRenderer)->unref();
35#endif
bsalomon@google.comded4f4b2012-06-28 18:48:06 +000036 if (GrPathRenderer* pr = GrStencilAndCoverPathRenderer::Create(ctx)) {
37 chain->addPathRenderer(pr)->unref();
38 }
bsalomon@google.com45a15f52012-12-10 19:10:17 +000039 if (GrPathRenderer* pr = GrAAHairLinePathRenderer::Create(ctx)) {
40 chain->addPathRenderer(pr)->unref();
bsalomon@google.comaeb21602011-08-30 18:13:44 +000041 }
bsalomon@google.com45a15f52012-12-10 19:10:17 +000042 chain->addPathRenderer(SkNEW(GrAAConvexPathRenderer))->unref();
jvanverthfa38a302014-10-06 05:59:05 -070043 chain->addPathRenderer(SkNEW_ARGS(GrAADistanceFieldPathRenderer, (ctx)))->unref();
bsalomon@google.comaeb21602011-08-30 18:13:44 +000044}