Chromium Code Reviews| 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 "GrTessellatingPathRenderer.h" | |
| 15 #include "GrGpu.h" | 16 #include "GrGpu.h" |
| 16 | 17 |
| 17 GrPathRendererChain::GrPathRendererChain(GrContext* context) | 18 GrPathRendererChain::GrPathRendererChain(GrContext* context) |
| 18 : fInit(false) | 19 : fInit(false) |
| 19 , fOwner(context) { | 20 , fOwner(context) { |
| 20 } | 21 } |
| 21 | 22 |
| 22 GrPathRendererChain::~GrPathRendererChain() { | 23 GrPathRendererChain::~GrPathRendererChain() { |
| 23 for (int i = 0; i < fChain.count(); ++i) { | 24 for (int i = 0; i < fChain.count(); ++i) { |
| 24 fChain[i]->unref(); | 25 fChain[i]->unref(); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 71 } | 72 } |
| 72 } | 73 } |
| 73 return fChain[i]; | 74 return fChain[i]; |
| 74 } | 75 } |
| 75 } | 76 } |
| 76 return NULL; | 77 return NULL; |
| 77 } | 78 } |
| 78 | 79 |
| 79 void GrPathRendererChain::init() { | 80 void GrPathRendererChain::init() { |
| 80 SkASSERT(!fInit); | 81 SkASSERT(!fInit); |
| 82 this->addPathRenderer(SkNEW(GrTessellatingPathRenderer))->unref(); | |
|
jvanverth1
2015/01/26 21:49:45
Why not add this to GrPathRenderer::AddPathRendere
Stephen White
2015/01/27 15:26:29
Done.
| |
| 81 GrGpu* gpu = fOwner->getGpu(); | 83 GrGpu* gpu = fOwner->getGpu(); |
| 82 bool twoSided = gpu->caps()->twoSidedStencilSupport(); | 84 bool twoSided = gpu->caps()->twoSidedStencilSupport(); |
| 83 bool wrapOp = gpu->caps()->stencilWrapOpsSupport(); | 85 bool wrapOp = gpu->caps()->stencilWrapOpsSupport(); |
| 84 GrPathRenderer::AddPathRenderers(fOwner, this); | 86 GrPathRenderer::AddPathRenderers(fOwner, this); |
| 85 this->addPathRenderer(SkNEW_ARGS(GrDefaultPathRenderer, | 87 this->addPathRenderer(SkNEW_ARGS(GrDefaultPathRenderer, |
| 86 (twoSided, wrapOp)))->unref(); | 88 (twoSided, wrapOp)))->unref(); |
| 87 fInit = true; | 89 fInit = true; |
| 88 } | 90 } |
| OLD | NEW |