blob: 77a26d317183bcc468b88bfdb71140b1c4015064 [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
bsalomon@google.com45a15f52012-12-10 19:10:17 +000020void GrPathRenderer::AddPathRenderers(GrContext* ctx, GrPathRendererChain* chain) {
bsalomon76228632015-05-29 08:02:10 -070021 chain->addPathRenderer(SkNEW(GrDashLinePathRenderer))->unref();
kkinnunen18996512015-04-26 23:18:49 -070022
bsalomon706f08f2015-05-22 07:35:58 -070023 if (GrPathRenderer* pr = GrStencilAndCoverPathRenderer::Create(ctx->resourceProvider(),
bsalomon76228632015-05-29 08:02:10 -070024 *ctx->caps())) {
bsalomon@google.comded4f4b2012-06-28 18:48:06 +000025 chain->addPathRenderer(pr)->unref();
26 }
senorblancoebe06c02015-08-06 06:52:10 -070027 chain->addPathRenderer(SkNEW(GrTessellatingPathRenderer))->unref();
bsalomoned0bcad2015-05-04 10:36:42 -070028 if (GrPathRenderer* pr = GrAAHairLinePathRenderer::Create()) {
bsalomon@google.com45a15f52012-12-10 19:10:17 +000029 chain->addPathRenderer(pr)->unref();
bsalomon@google.comaeb21602011-08-30 18:13:44 +000030 }
ethannicholas4f3ad292015-07-08 13:19:51 -070031 chain->addPathRenderer(SkNEW(GrAAConvexPathRenderer))->unref();
ethannicholasb031fcf2015-07-13 08:51:36 -070032 chain->addPathRenderer(SkNEW(GrAALinearizingConvexPathRenderer))->unref();
bsalomon0aff2fa2015-07-31 06:48:27 -070033 chain->addPathRenderer(SkNEW(GrAADistanceFieldPathRenderer))->unref();
bsalomon@google.comaeb21602011-08-30 18:13:44 +000034}