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 "GrContext.h" | 12 #include "GrContext.h" |
13 #include "GrDefaultPathRenderer.h" | 13 #include "GrDefaultPathRenderer.h" |
14 #include "GrDrawTargetCaps.h" | 14 #include "GrDrawTargetCaps.h" |
15 #include "GrGpu.h" | 15 #include "GrGpu.h" |
16 | 16 |
17 SK_DEFINE_INST_COUNT(GrPathRendererChain) | |
18 | |
19 GrPathRendererChain::GrPathRendererChain(GrContext* context) | 17 GrPathRendererChain::GrPathRendererChain(GrContext* context) |
20 : fInit(false) | 18 : fInit(false) |
21 , fOwner(context) { | 19 , fOwner(context) { |
22 } | 20 } |
23 | 21 |
24 GrPathRendererChain::~GrPathRendererChain() { | 22 GrPathRendererChain::~GrPathRendererChain() { |
25 for (int i = 0; i < fChain.count(); ++i) { | 23 for (int i = 0; i < fChain.count(); ++i) { |
26 fChain[i]->unref(); | 24 fChain[i]->unref(); |
27 } | 25 } |
28 } | 26 } |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 void GrPathRendererChain::init() { | 78 void GrPathRendererChain::init() { |
81 SkASSERT(!fInit); | 79 SkASSERT(!fInit); |
82 GrGpu* gpu = fOwner->getGpu(); | 80 GrGpu* gpu = fOwner->getGpu(); |
83 bool twoSided = gpu->caps()->twoSidedStencilSupport(); | 81 bool twoSided = gpu->caps()->twoSidedStencilSupport(); |
84 bool wrapOp = gpu->caps()->stencilWrapOpsSupport(); | 82 bool wrapOp = gpu->caps()->stencilWrapOpsSupport(); |
85 GrPathRenderer::AddPathRenderers(fOwner, this); | 83 GrPathRenderer::AddPathRenderers(fOwner, this); |
86 this->addPathRenderer(SkNEW_ARGS(GrDefaultPathRenderer, | 84 this->addPathRenderer(SkNEW_ARGS(GrDefaultPathRenderer, |
87 (twoSided, wrapOp)))->unref(); | 85 (twoSided, wrapOp)))->unref(); |
88 fInit = true; | 86 fInit = true; |
89 } | 87 } |
OLD | NEW |