blob: 06e98a98cfb3cc81bf0065d310cf6f6aa10f3931 [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"
kkinnunen18996512015-04-26 23:18:49 -070014#include "GrDashLinePathRenderer.h"
senorblancod6ed19c2015-02-26 06:58:17 -080015#include "GrTessellatingPathRenderer.h"
sugoi@google.come3453cb2013-01-07 14:26:40 +000016#if GR_STROKE_PATH_RENDERING
17#include "../../experimental/StrokePathRenderer/GrStrokePathRenderer.h"
18#endif
jvanverth@google.com74dda902013-01-09 21:04:52 +000019#if GR_ANDROID_PATH_RENDERING
20#include "../../experimental/AndroidPathRenderer/GrAndroidPathRenderer.h"
21#endif
bsalomon@google.comaeb21602011-08-30 18:13:44 +000022
senorblancod6ed19c2015-02-26 06:58:17 -080023#ifndef GR_TESSELLATING_PATH_RENDERING
senorblanco7ef63c82015-04-13 14:27:37 -070024#define GR_TESSELLATING_PATH_RENDERING 1
senorblancod6ed19c2015-02-26 06:58:17 -080025#endif
26
bsalomon@google.com45a15f52012-12-10 19:10:17 +000027void GrPathRenderer::AddPathRenderers(GrContext* ctx, GrPathRendererChain* chain) {
kkinnunen18996512015-04-26 23:18:49 -070028 chain->addPathRenderer(SkNEW_ARGS(GrDashLinePathRenderer, (ctx)))->unref();
29
sugoi@google.come3453cb2013-01-07 14:26:40 +000030#if GR_STROKE_PATH_RENDERING
31 chain->addPathRenderer(SkNEW(GrStrokePathRenderer))->unref();
32#endif
jvanverth@google.com74dda902013-01-09 21:04:52 +000033#if GR_ANDROID_PATH_RENDERING
34 chain->addPathRenderer(SkNEW(GrAndroidPathRenderer))->unref();
35#endif
senorblancod6ed19c2015-02-26 06:58:17 -080036#if GR_TESSELLATING_PATH_RENDERING
37 chain->addPathRenderer(new GrTessellatingPathRenderer)->unref();
38#endif
bsalomon@google.comded4f4b2012-06-28 18:48:06 +000039 if (GrPathRenderer* pr = GrStencilAndCoverPathRenderer::Create(ctx)) {
40 chain->addPathRenderer(pr)->unref();
41 }
bsalomon@google.com45a15f52012-12-10 19:10:17 +000042 if (GrPathRenderer* pr = GrAAHairLinePathRenderer::Create(ctx)) {
43 chain->addPathRenderer(pr)->unref();
bsalomon@google.comaeb21602011-08-30 18:13:44 +000044 }
bsalomon@google.com45a15f52012-12-10 19:10:17 +000045 chain->addPathRenderer(SkNEW(GrAAConvexPathRenderer))->unref();
jvanverthfa38a302014-10-06 05:59:05 -070046 chain->addPathRenderer(SkNEW_ARGS(GrAADistanceFieldPathRenderer, (ctx)))->unref();
bsalomon@google.comaeb21602011-08-30 18:13:44 +000047}