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" |
(...skipping 17 matching lines...) Expand all Loading... |
28 GrPathRenderer* GrPathRendererChain::addPathRenderer(GrPathRenderer* pr) { | 28 GrPathRenderer* GrPathRendererChain::addPathRenderer(GrPathRenderer* pr) { |
29 fChain.push_back() = pr; | 29 fChain.push_back() = pr; |
30 pr->ref(); | 30 pr->ref(); |
31 return pr; | 31 return pr; |
32 } | 32 } |
33 | 33 |
34 GrPathRenderer* GrPathRendererChain::getPathRenderer(const GrDrawTarget* target, | 34 GrPathRenderer* GrPathRendererChain::getPathRenderer(const GrDrawTarget* target, |
35 const GrPipelineBuilder* pi
pelineBuilder, | 35 const GrPipelineBuilder* pi
pelineBuilder, |
36 const SkMatrix& viewMatrix, | 36 const SkMatrix& viewMatrix, |
37 const SkPath& path, | 37 const SkPath& path, |
38 const SkStrokeRec& stroke, | 38 const GrStrokeInfo& stroke, |
39 DrawType drawType, | 39 DrawType drawType, |
40 StencilSupport* stencilSupp
ort) { | 40 StencilSupport* stencilSupp
ort) { |
41 if (!fInit) { | 41 if (!fInit) { |
42 this->init(); | 42 this->init(); |
43 } | 43 } |
44 bool antiAlias = (kColorAntiAlias_DrawType == drawType || | 44 bool antiAlias = (kColorAntiAlias_DrawType == drawType || |
45 kStencilAndColorAntiAlias_DrawType == drawType); | 45 kStencilAndColorAntiAlias_DrawType == drawType); |
46 | 46 |
47 GR_STATIC_ASSERT(GrPathRenderer::kNoSupport_StencilSupport < | 47 GR_STATIC_ASSERT(GrPathRenderer::kNoSupport_StencilSupport < |
48 GrPathRenderer::kStencilOnly_StencilSupport); | 48 GrPathRenderer::kStencilOnly_StencilSupport); |
(...skipping 30 matching lines...) Expand all Loading... |
79 void GrPathRendererChain::init() { | 79 void GrPathRendererChain::init() { |
80 SkASSERT(!fInit); | 80 SkASSERT(!fInit); |
81 GrGpu* gpu = fOwner->getGpu(); | 81 GrGpu* gpu = fOwner->getGpu(); |
82 bool twoSided = gpu->caps()->twoSidedStencilSupport(); | 82 bool twoSided = gpu->caps()->twoSidedStencilSupport(); |
83 bool wrapOp = gpu->caps()->stencilWrapOpsSupport(); | 83 bool wrapOp = gpu->caps()->stencilWrapOpsSupport(); |
84 GrPathRenderer::AddPathRenderers(fOwner, this); | 84 GrPathRenderer::AddPathRenderers(fOwner, this); |
85 this->addPathRenderer(SkNEW_ARGS(GrDefaultPathRenderer, | 85 this->addPathRenderer(SkNEW_ARGS(GrDefaultPathRenderer, |
86 (twoSided, wrapOp)))->unref(); | 86 (twoSided, wrapOp)))->unref(); |
87 fInit = true; | 87 fInit = true; |
88 } | 88 } |
OLD | NEW |