blob: 4f172434dec2eebbe1f3ab4fd019a74bc9a49b64 [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"
sugoi@google.come3453cb2013-01-07 14:26:40 +000013#if GR_STROKE_PATH_RENDERING
14#include "../../experimental/StrokePathRenderer/GrStrokePathRenderer.h"
15#endif
jvanverth@google.com74dda902013-01-09 21:04:52 +000016#if GR_ANDROID_PATH_RENDERING
17#include "../../experimental/AndroidPathRenderer/GrAndroidPathRenderer.h"
18#endif
bsalomon@google.comaeb21602011-08-30 18:13:44 +000019
bsalomon@google.com45a15f52012-12-10 19:10:17 +000020void GrPathRenderer::AddPathRenderers(GrContext* ctx, GrPathRendererChain* chain) {
sugoi@google.come3453cb2013-01-07 14:26:40 +000021#if GR_STROKE_PATH_RENDERING
22 chain->addPathRenderer(SkNEW(GrStrokePathRenderer))->unref();
23#endif
jvanverth@google.com74dda902013-01-09 21:04:52 +000024#if GR_ANDROID_PATH_RENDERING
25 chain->addPathRenderer(SkNEW(GrAndroidPathRenderer))->unref();
26#endif
bsalomon@google.comded4f4b2012-06-28 18:48:06 +000027 if (GrPathRenderer* pr = GrStencilAndCoverPathRenderer::Create(ctx)) {
28 chain->addPathRenderer(pr)->unref();
29 }
bsalomon@google.com45a15f52012-12-10 19:10:17 +000030 if (GrPathRenderer* pr = GrAAHairLinePathRenderer::Create(ctx)) {
31 chain->addPathRenderer(pr)->unref();
bsalomon@google.comaeb21602011-08-30 18:13:44 +000032 }
bsalomon@google.com45a15f52012-12-10 19:10:17 +000033 chain->addPathRenderer(SkNEW(GrAAConvexPathRenderer))->unref();
bsalomon@google.comaeb21602011-08-30 18:13:44 +000034}