blob: f06856a6502100a14c5dbb8ccb50658efd70a126 [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"
bsalomon706f08f2015-05-22 07:35:58 -070014#include "GrContext.h"
kkinnunen18996512015-04-26 23:18:49 -070015#include "GrDashLinePathRenderer.h"
bsalomon706f08f2015-05-22 07:35:58 -070016#include "GrGpu.h"
senorblancod6ed19c2015-02-26 06:58:17 -080017#include "GrTessellatingPathRenderer.h"
sugoi@google.come3453cb2013-01-07 14:26:40 +000018#if GR_STROKE_PATH_RENDERING
19#include "../../experimental/StrokePathRenderer/GrStrokePathRenderer.h"
20#endif
jvanverth@google.com74dda902013-01-09 21:04:52 +000021#if GR_ANDROID_PATH_RENDERING
22#include "../../experimental/AndroidPathRenderer/GrAndroidPathRenderer.h"
23#endif
bsalomon@google.comaeb21602011-08-30 18:13:44 +000024
senorblancod6ed19c2015-02-26 06:58:17 -080025#ifndef GR_TESSELLATING_PATH_RENDERING
senorblanco7ef63c82015-04-13 14:27:37 -070026#define GR_TESSELLATING_PATH_RENDERING 1
senorblancod6ed19c2015-02-26 06:58:17 -080027#endif
28
bsalomon@google.com45a15f52012-12-10 19:10:17 +000029void GrPathRenderer::AddPathRenderers(GrContext* ctx, GrPathRendererChain* chain) {
kkinnunen18996512015-04-26 23:18:49 -070030 chain->addPathRenderer(SkNEW_ARGS(GrDashLinePathRenderer, (ctx)))->unref();
31
sugoi@google.come3453cb2013-01-07 14:26:40 +000032#if GR_STROKE_PATH_RENDERING
33 chain->addPathRenderer(SkNEW(GrStrokePathRenderer))->unref();
34#endif
jvanverth@google.com74dda902013-01-09 21:04:52 +000035#if GR_ANDROID_PATH_RENDERING
36 chain->addPathRenderer(SkNEW(GrAndroidPathRenderer))->unref();
37#endif
bsalomon706f08f2015-05-22 07:35:58 -070038 if (GrPathRenderer* pr = GrStencilAndCoverPathRenderer::Create(ctx->resourceProvider(),
39 *ctx->getGpu()->caps())) {
bsalomon@google.comded4f4b2012-06-28 18:48:06 +000040 chain->addPathRenderer(pr)->unref();
41 }
cdalton0ce02c32015-05-06 13:16:43 -070042#if GR_TESSELLATING_PATH_RENDERING
43 chain->addPathRenderer(new GrTessellatingPathRenderer)->unref();
44#endif
bsalomoned0bcad2015-05-04 10:36:42 -070045 if (GrPathRenderer* pr = GrAAHairLinePathRenderer::Create()) {
bsalomon@google.com45a15f52012-12-10 19:10:17 +000046 chain->addPathRenderer(pr)->unref();
bsalomon@google.comaeb21602011-08-30 18:13:44 +000047 }
bsalomon@google.com45a15f52012-12-10 19:10:17 +000048 chain->addPathRenderer(SkNEW(GrAAConvexPathRenderer))->unref();
jvanverthfa38a302014-10-06 05:59:05 -070049 chain->addPathRenderer(SkNEW_ARGS(GrAADistanceFieldPathRenderer, (ctx)))->unref();
bsalomon@google.comaeb21602011-08-30 18:13:44 +000050}