blob: 32b2a07e2c1910ef9235e3cd04f31ebbb571ef10 [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"
robertphillips@google.com7c2578d2012-05-01 12:19:34 +000013#include "GrSoftwarePathRenderer.h"
bsalomon@google.comaeb21602011-08-30 18:13:44 +000014
15void GrPathRenderer::AddPathRenderers(GrContext* ctx,
16 GrPathRendererChain::UsageFlags flags,
17 GrPathRendererChain* chain) {
bsalomon@google.comded4f4b2012-06-28 18:48:06 +000018 if (GrPathRenderer* pr = GrStencilAndCoverPathRenderer::Create(ctx)) {
19 chain->addPathRenderer(pr)->unref();
20 }
bsalomon@google.comaeb21602011-08-30 18:13:44 +000021 if (!(GrPathRendererChain::kNonAAOnly_UsageFlag & flags)) {
bsalomon@google.com69cc6ad2012-01-17 14:25:10 +000022
bsalomon@google.comaeb21602011-08-30 18:13:44 +000023 if (GrPathRenderer* pr = GrAAHairLinePathRenderer::Create(ctx)) {
24 chain->addPathRenderer(pr)->unref();
25 }
bsalomon@google.com3e5afe72012-01-30 20:25:23 +000026 chain->addPathRenderer(new GrAAConvexPathRenderer())->unref();
bsalomon@google.comaeb21602011-08-30 18:13:44 +000027 }
28}