| 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" | 14 #include "GrDefaultPathRenderer.h" |
| 15 #include "GrAAConcavePathRenderer.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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 } | 82 } |
| 82 } | 83 } |
| 83 return nullptr; | 84 return nullptr; |
| 84 } | 85 } |
| 85 | 86 |
| 86 void GrPathRendererChain::init() { | 87 void GrPathRendererChain::init() { |
| 87 SkASSERT(!fInit); | 88 SkASSERT(!fInit); |
| 88 const GrCaps* caps = fOwner->caps(); | 89 const GrCaps* caps = fOwner->caps(); |
| 89 bool twoSided = caps->twoSidedStencilSupport(); | 90 bool twoSided = caps->twoSidedStencilSupport(); |
| 90 bool wrapOp = caps->stencilWrapOpsSupport(); | 91 bool wrapOp = caps->stencilWrapOpsSupport(); |
| 92 this->addPathRenderer(new GrAAConcavePathRenderer())->unref(); |
| 91 GrPathRenderer::AddPathRenderers(fOwner, this); | 93 GrPathRenderer::AddPathRenderers(fOwner, this); |
| 92 this->addPathRenderer(new GrDefaultPathRenderer(twoSided, wrapOp))->unref(); | 94 this->addPathRenderer(new GrDefaultPathRenderer(twoSided, wrapOp))->unref(); |
| 93 fInit = true; | 95 fInit = true; |
| 94 } | 96 } |
| OLD | NEW |