Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(141)

Side by Side Diff: src/gpu/GrPathRendererChain.cpp

Issue 1541903002: added support for PLS path rendering (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix for ASAN failure Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/GrPathProcessor.cpp ('k') | src/gpu/GrPrimitiveProcessor.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "gl/GrGLCaps.h"
14 #include "glsl/GrGLSLCaps.h"
13 #include "GrContext.h" 15 #include "GrContext.h"
14 #include "GrGpu.h" 16 #include "GrGpu.h"
15 17
16 #include "batches/GrAAConvexPathRenderer.h" 18 #include "batches/GrAAConvexPathRenderer.h"
17 #include "batches/GrAADistanceFieldPathRenderer.h" 19 #include "batches/GrAADistanceFieldPathRenderer.h"
18 #include "batches/GrAAHairLinePathRenderer.h" 20 #include "batches/GrAAHairLinePathRenderer.h"
19 #include "batches/GrAALinearizingConvexPathRenderer.h" 21 #include "batches/GrAALinearizingConvexPathRenderer.h"
20 #include "batches/GrDashLinePathRenderer.h" 22 #include "batches/GrDashLinePathRenderer.h"
21 #include "batches/GrDefaultPathRenderer.h" 23 #include "batches/GrDefaultPathRenderer.h"
22 #include "batches/GrStencilAndCoverPathRenderer.h" 24 #include "batches/GrStencilAndCoverPathRenderer.h"
23 #include "batches/GrTessellatingPathRenderer.h" 25 #include "batches/GrTessellatingPathRenderer.h"
26 #include "batches/GrPLSPathRenderer.h"
24 27
25 GrPathRendererChain::GrPathRendererChain(GrContext* context) { 28 GrPathRendererChain::GrPathRendererChain(GrContext* context) {
26 const GrCaps& caps = *context->caps(); 29 const GrCaps& caps = *context->caps();
27 this->addPathRenderer(new GrDashLinePathRenderer)->unref(); 30 this->addPathRenderer(new GrDashLinePathRenderer)->unref();
28 31
29 if (GrPathRenderer* pr = GrStencilAndCoverPathRenderer::Create(context->reso urceProvider(), 32 if (GrPathRenderer* pr = GrStencilAndCoverPathRenderer::Create(context->reso urceProvider(),
30 caps)) { 33 caps)) {
31 this->addPathRenderer(pr)->unref(); 34 this->addPathRenderer(pr)->unref();
32 } 35 }
33 this->addPathRenderer(new GrTessellatingPathRenderer)->unref(); 36 this->addPathRenderer(new GrTessellatingPathRenderer)->unref();
34 this->addPathRenderer(new GrAAHairLinePathRenderer)->unref(); 37 this->addPathRenderer(new GrAAHairLinePathRenderer)->unref();
35 this->addPathRenderer(new GrAAConvexPathRenderer)->unref(); 38 this->addPathRenderer(new GrAAConvexPathRenderer)->unref();
36 this->addPathRenderer(new GrAALinearizingConvexPathRenderer)->unref(); 39 this->addPathRenderer(new GrAALinearizingConvexPathRenderer)->unref();
40 if (caps.shaderCaps()->plsPathRenderingSupport()) {
41 this->addPathRenderer(new GrPLSPathRenderer)->unref();
42 }
37 this->addPathRenderer(new GrAADistanceFieldPathRenderer)->unref(); 43 this->addPathRenderer(new GrAADistanceFieldPathRenderer)->unref();
38 this->addPathRenderer(new GrDefaultPathRenderer(caps.twoSidedStencilSupport( ), 44 this->addPathRenderer(new GrDefaultPathRenderer(caps.twoSidedStencilSupport( ),
39 caps.stencilWrapOpsSupport() ))->unref(); 45 caps.stencilWrapOpsSupport() ))->unref();
40 } 46 }
41 47
42 GrPathRendererChain::~GrPathRendererChain() { 48 GrPathRendererChain::~GrPathRendererChain() {
43 for (int i = 0; i < fChain.count(); ++i) { 49 for (int i = 0; i < fChain.count(); ++i) {
44 fChain[i]->unref(); 50 fChain[i]->unref();
45 } 51 }
46 } 52 }
(...skipping 30 matching lines...) Expand all
77 continue; 83 continue;
78 } else if (stencilSupport) { 84 } else if (stencilSupport) {
79 *stencilSupport = support; 85 *stencilSupport = support;
80 } 86 }
81 } 87 }
82 return fChain[i]; 88 return fChain[i];
83 } 89 }
84 } 90 }
85 return nullptr; 91 return nullptr;
86 } 92 }
OLDNEW
« no previous file with comments | « src/gpu/GrPathProcessor.cpp ('k') | src/gpu/GrPrimitiveProcessor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698