blob: 963bbb946333dcfdb8ecb95d30e87d92806ac88f [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"
ethannicholas4f3ad292015-07-08 13:19:51 -070012#include "GrAAConvexPathRenderer.h"
fmalitabd5d7e72015-06-26 07:18:24 -070013#include "GrAALinearizingConvexPathRenderer.h"
jvanverthfa38a302014-10-06 05:59:05 -070014#include "GrAADistanceFieldPathRenderer.h"
bsalomon706f08f2015-05-22 07:35:58 -070015#include "GrContext.h"
kkinnunen18996512015-04-26 23:18:49 -070016#include "GrDashLinePathRenderer.h"
bsalomon706f08f2015-05-22 07:35:58 -070017#include "GrGpu.h"
senorblancod6ed19c2015-02-26 06:58:17 -080018#include "GrTessellatingPathRenderer.h"
bsalomon@google.comaeb21602011-08-30 18:13:44 +000019
senorblancod6ed19c2015-02-26 06:58:17 -080020#ifndef GR_TESSELLATING_PATH_RENDERING
senorblanco7ef63c82015-04-13 14:27:37 -070021#define GR_TESSELLATING_PATH_RENDERING 1
senorblancod6ed19c2015-02-26 06:58:17 -080022#endif
23
bsalomon@google.com45a15f52012-12-10 19:10:17 +000024void GrPathRenderer::AddPathRenderers(GrContext* ctx, GrPathRendererChain* chain) {
bsalomon76228632015-05-29 08:02:10 -070025 chain->addPathRenderer(SkNEW(GrDashLinePathRenderer))->unref();
kkinnunen18996512015-04-26 23:18:49 -070026
bsalomon706f08f2015-05-22 07:35:58 -070027 if (GrPathRenderer* pr = GrStencilAndCoverPathRenderer::Create(ctx->resourceProvider(),
bsalomon76228632015-05-29 08:02:10 -070028 *ctx->caps())) {
bsalomon@google.comded4f4b2012-06-28 18:48:06 +000029 chain->addPathRenderer(pr)->unref();
30 }
cdalton0ce02c32015-05-06 13:16:43 -070031#if GR_TESSELLATING_PATH_RENDERING
32 chain->addPathRenderer(new GrTessellatingPathRenderer)->unref();
33#endif
bsalomoned0bcad2015-05-04 10:36:42 -070034 if (GrPathRenderer* pr = GrAAHairLinePathRenderer::Create()) {
bsalomon@google.com45a15f52012-12-10 19:10:17 +000035 chain->addPathRenderer(pr)->unref();
bsalomon@google.comaeb21602011-08-30 18:13:44 +000036 }
ethannicholas4f3ad292015-07-08 13:19:51 -070037 chain->addPathRenderer(SkNEW(GrAAConvexPathRenderer))->unref();
ethannicholasb031fcf2015-07-13 08:51:36 -070038 chain->addPathRenderer(SkNEW(GrAALinearizingConvexPathRenderer))->unref();
jvanverthfa38a302014-10-06 05:59:05 -070039 chain->addPathRenderer(SkNEW_ARGS(GrAADistanceFieldPathRenderer, (ctx)))->unref();
bsalomon@google.comaeb21602011-08-30 18:13:44 +000040}