OLD | NEW |
---|---|
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #include "GrPathRendererChain.h" | 10 #include "GrPathRendererChain.h" |
11 | 11 |
12 #include "GrCaps.h" | 12 #include "GrCaps.h" |
13 #include "GrContext.h" | 13 #include "GrContext.h" |
14 #include "GrDefaultPathRenderer.h" | |
15 #include "GrGpu.h" | 14 #include "GrGpu.h" |
16 | 15 |
16 #include "batches/GrAAConvexPathRenderer.h" | |
17 #include "batches/GrAAHairLinePathRenderer.h" | |
18 #include "batches/GrAALinearizingConvexPathRenderer.h" | |
robertphillips
2015/09/02 15:19:45
GrAAD before GrAAL and GrAAH ?
| |
19 #include "batches/GrAADistanceFieldPathRenderer.h" | |
20 #include "batches/GrDashLinePathRenderer.h" | |
21 #include "batches/GrDefaultPathRenderer.h" | |
22 #include "batches/GrStencilAndCoverPathRenderer.h" | |
23 #include "batches/GrTessellatingPathRenderer.h" | |
24 | |
17 GrPathRendererChain::GrPathRendererChain(GrContext* context) | 25 GrPathRendererChain::GrPathRendererChain(GrContext* context) |
18 : fInit(false) | 26 : fInit(false) |
19 , fOwner(context) { | 27 , fOwner(context) { |
20 } | 28 } |
21 | 29 |
22 GrPathRendererChain::~GrPathRendererChain() { | 30 GrPathRendererChain::~GrPathRendererChain() { |
23 for (int i = 0; i < fChain.count(); ++i) { | 31 for (int i = 0; i < fChain.count(); ++i) { |
24 fChain[i]->unref(); | 32 fChain[i]->unref(); |
25 } | 33 } |
26 } | 34 } |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
78 } | 86 } |
79 } | 87 } |
80 return fChain[i]; | 88 return fChain[i]; |
81 } | 89 } |
82 } | 90 } |
83 return nullptr; | 91 return nullptr; |
84 } | 92 } |
85 | 93 |
86 void GrPathRendererChain::init() { | 94 void GrPathRendererChain::init() { |
87 SkASSERT(!fInit); | 95 SkASSERT(!fInit); |
88 const GrCaps* caps = fOwner->caps(); | 96 const GrCaps& caps = *fOwner->caps(); |
89 bool twoSided = caps->twoSidedStencilSupport(); | 97 this->addPathRenderer(new GrDashLinePathRenderer)->unref(); |
90 bool wrapOp = caps->stencilWrapOpsSupport(); | 98 |
91 GrPathRenderer::AddPathRenderers(fOwner, this); | 99 if (GrPathRenderer* pr = GrStencilAndCoverPathRenderer::Create(fOwner->resou rceProvider(), |
92 this->addPathRenderer(new GrDefaultPathRenderer(twoSided, wrapOp))->unref(); | 100 caps)) { |
101 this->addPathRenderer(pr)->unref(); | |
102 } | |
103 this->addPathRenderer(new GrTessellatingPathRenderer)->unref(); | |
104 this->addPathRenderer(new GrAAHairLinePathRenderer)->unref(); | |
105 this->addPathRenderer(new GrAAConvexPathRenderer)->unref(); | |
106 this->addPathRenderer(new GrAALinearizingConvexPathRenderer)->unref(); | |
107 this->addPathRenderer(new GrAADistanceFieldPathRenderer)->unref(); | |
108 this->addPathRenderer(new GrDefaultPathRenderer(caps.twoSidedStencilSupport( ), | |
109 caps.stencilWrapOpsSupport() ))->unref(); | |
93 fInit = true; | 110 fInit = true; |
94 } | 111 } |
OLD | NEW |