blob: 351b8eb1e4a7f09cf51be807e0c1904cf6873189 [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"
reed9730f4a2015-06-26 05:06:43 -070012#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"
bsalomon@google.comaeb21602011-08-30 18:13:44 +000018
senorblancod6ed19c2015-02-26 06:58:17 -080019#ifndef GR_TESSELLATING_PATH_RENDERING
senorblanco7ef63c82015-04-13 14:27:37 -070020#define GR_TESSELLATING_PATH_RENDERING 1
senorblancod6ed19c2015-02-26 06:58:17 -080021#endif
22
bsalomon@google.com45a15f52012-12-10 19:10:17 +000023void GrPathRenderer::AddPathRenderers(GrContext* ctx, GrPathRendererChain* chain) {
bsalomon76228632015-05-29 08:02:10 -070024 chain->addPathRenderer(SkNEW(GrDashLinePathRenderer))->unref();
kkinnunen18996512015-04-26 23:18:49 -070025
bsalomon706f08f2015-05-22 07:35:58 -070026 if (GrPathRenderer* pr = GrStencilAndCoverPathRenderer::Create(ctx->resourceProvider(),
bsalomon76228632015-05-29 08:02:10 -070027 *ctx->caps())) {
bsalomon@google.comded4f4b2012-06-28 18:48:06 +000028 chain->addPathRenderer(pr)->unref();
29 }
cdalton0ce02c32015-05-06 13:16:43 -070030#if GR_TESSELLATING_PATH_RENDERING
31 chain->addPathRenderer(new GrTessellatingPathRenderer)->unref();
32#endif
bsalomoned0bcad2015-05-04 10:36:42 -070033 if (GrPathRenderer* pr = GrAAHairLinePathRenderer::Create()) {
bsalomon@google.com45a15f52012-12-10 19:10:17 +000034 chain->addPathRenderer(pr)->unref();
bsalomon@google.comaeb21602011-08-30 18:13:44 +000035 }
reed9730f4a2015-06-26 05:06:43 -070036 chain->addPathRenderer(SkNEW(GrAAConvexPathRenderer))->unref();
jvanverthfa38a302014-10-06 05:59:05 -070037 chain->addPathRenderer(SkNEW_ARGS(GrAADistanceFieldPathRenderer, (ctx)))->unref();
bsalomon@google.comaeb21602011-08-30 18:13:44 +000038}