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

Side by Side Diff: src/gpu/batches/GrStencilAndCoverPathRenderer.cpp

Issue 1988923002: Remove GrRenderTarget from GrPipelineBuilder (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update to ToT Created 4 years, 6 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/batches/GrPLSPathRenderer.cpp ('k') | src/gpu/batches/GrTessellatingPathRenderer.cpp » ('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 * Copyright 2012 Google Inc. 2 * Copyright 2012 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 8
9 #include "GrStencilAndCoverPathRenderer.h" 9 #include "GrStencilAndCoverPathRenderer.h"
10 #include "GrCaps.h" 10 #include "GrCaps.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 } 67 }
68 68
69 void GrStencilAndCoverPathRenderer::onStencilPath(const StencilPathArgs& args) { 69 void GrStencilAndCoverPathRenderer::onStencilPath(const StencilPathArgs& args) {
70 GR_AUDIT_TRAIL_AUTO_FRAME(args.fDrawContext->auditTrail(), 70 GR_AUDIT_TRAIL_AUTO_FRAME(args.fDrawContext->auditTrail(),
71 "GrStencilAndCoverPathRenderer::onStencilPath"); 71 "GrStencilAndCoverPathRenderer::onStencilPath");
72 72
73 GrPaint paint; 73 GrPaint paint;
74 SkSafeUnref(paint.setXPFactory(GrDisableColorXPFactory::Create())); 74 SkSafeUnref(paint.setXPFactory(GrDisableColorXPFactory::Create()));
75 paint.setAntiAlias(args.fIsAA); 75 paint.setAntiAlias(args.fIsAA);
76 76
77 GrPipelineBuilder pipelineBuilder(paint, args.fDrawContext->isUnifiedMultisa mpled()); 77 const GrPipelineBuilder pipelineBuilder(paint, args.fDrawContext->isUnifiedM ultisampled());
78 pipelineBuilder.setRenderTarget(args.fDrawContext->accessRenderTarget());
79 78
80 SkASSERT(!args.fPath->isInverseFillType()); 79 SkASSERT(!args.fPath->isInverseFillType());
81 SkAutoTUnref<GrPath> path(get_gr_path(fResourceProvider, *args.fPath, GrStyl e::SimpleFill())); 80 SkAutoTUnref<GrPath> path(get_gr_path(fResourceProvider, *args.fPath, GrStyl e::SimpleFill()));
82 args.fDrawContext->drawContextPriv().stencilPath(pipelineBuilder, 81 args.fDrawContext->drawContextPriv().stencilPath(pipelineBuilder,
83 *args.fClip, 82 *args.fClip,
84 *args.fViewMatrix, 83 *args.fViewMatrix,
85 path, 84 path,
86 path->getFillType()); 85 path->getFillType());
87 } 86 }
88 87
(...skipping 17 matching lines...) Expand all
106 0xffff, 105 0xffff,
107 GrUserStencilOp::kKeep, 106 GrUserStencilOp::kKeep,
108 GrUserStencilOp::kZero, 107 GrUserStencilOp::kZero,
109 0xffff>() 108 0xffff>()
110 ); 109 );
111 110
112 // fake inverse with a stencil and cover 111 // fake inverse with a stencil and cover
113 { 112 {
114 GrPipelineBuilder pipelineBuilder(*args.fPaint, 113 GrPipelineBuilder pipelineBuilder(*args.fPaint,
115 args.fDrawContext->isUnifiedMultis ampled()); 114 args.fDrawContext->isUnifiedMultis ampled());
116 pipelineBuilder.setRenderTarget(args.fDrawContext->accessRenderTarge t());
117 pipelineBuilder.setUserStencil(&kInvertedCoverPass); 115 pipelineBuilder.setUserStencil(&kInvertedCoverPass);
118 if (args.fAntiAlias) { 116 if (args.fAntiAlias) {
119 SkASSERT(args.fDrawContext->isStencilBufferMultisampled()); 117 SkASSERT(args.fDrawContext->isStencilBufferMultisampled());
120 pipelineBuilder.enableState(GrPipelineBuilder::kHWAntialias_Flag ); 118 pipelineBuilder.enableState(GrPipelineBuilder::kHWAntialias_Flag );
121 } 119 }
122 120
123 args.fDrawContext->drawContextPriv().stencilPath(pipelineBuilder, *a rgs.fClip, 121 args.fDrawContext->drawContextPriv().stencilPath(pipelineBuilder, *a rgs.fClip,
124 viewMatrix, p, p->g etFillType()); 122 viewMatrix, p, p->g etFillType());
125 } 123 }
126 124
(...skipping 17 matching lines...) Expand all
144 } 142 }
145 const SkMatrix& viewM = viewMatrix.hasPerspective() ? SkMatrix::I() : vi ewMatrix; 143 const SkMatrix& viewM = viewMatrix.hasPerspective() ? SkMatrix::I() : vi ewMatrix;
146 144
147 SkAutoTUnref<GrDrawBatch> batch( 145 SkAutoTUnref<GrDrawBatch> batch(
148 GrRectBatchFactory::CreateNonAAFill(args.fColor, viewM, bounds, nullptr, 146 GrRectBatchFactory::CreateNonAAFill(args.fColor, viewM, bounds, nullptr,
149 &invert)); 147 &invert));
150 148
151 { 149 {
152 GrPipelineBuilder pipelineBuilder(*args.fPaint, 150 GrPipelineBuilder pipelineBuilder(*args.fPaint,
153 args.fDrawContext->isUnifiedMultis ampled()); 151 args.fDrawContext->isUnifiedMultis ampled());
154 pipelineBuilder.setRenderTarget(args.fDrawContext->accessRenderTarge t());
155 pipelineBuilder.setUserStencil(&kInvertedCoverPass); 152 pipelineBuilder.setUserStencil(&kInvertedCoverPass);
156 if (args.fAntiAlias) { 153 if (args.fAntiAlias) {
157 SkASSERT(args.fDrawContext->isStencilBufferMultisampled()); 154 SkASSERT(args.fDrawContext->isStencilBufferMultisampled());
158 pipelineBuilder.enableState(GrPipelineBuilder::kHWAntialias_Flag ); 155 pipelineBuilder.enableState(GrPipelineBuilder::kHWAntialias_Flag );
159 } 156 }
160 if (args.fDrawContext->hasMixedSamples()) { 157 if (args.fDrawContext->hasMixedSamples()) {
161 pipelineBuilder.disableState(GrPipelineBuilder::kHWAntialias_Fla g); 158 pipelineBuilder.disableState(GrPipelineBuilder::kHWAntialias_Fla g);
162 } 159 }
163 160
164 args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, batch); 161 args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, batch);
165 } 162 }
166 } else { 163 } else {
167 static constexpr GrUserStencilSettings kCoverPass( 164 static constexpr GrUserStencilSettings kCoverPass(
168 GrUserStencilSettings::StaticInit< 165 GrUserStencilSettings::StaticInit<
169 0x0000, 166 0x0000,
170 GrUserStencilTest::kNotEqual, 167 GrUserStencilTest::kNotEqual,
171 0xffff, 168 0xffff,
172 GrUserStencilOp::kZero, 169 GrUserStencilOp::kZero,
173 GrUserStencilOp::kKeep, 170 GrUserStencilOp::kKeep,
174 0xffff>() 171 0xffff>()
175 ); 172 );
176 173
177 SkAutoTUnref<GrDrawBatch> batch( 174 SkAutoTUnref<GrDrawBatch> batch(
178 GrDrawPathBatch::Create(viewMatrix, args.fColor, p->getFillType( ), p)); 175 GrDrawPathBatch::Create(viewMatrix, args.fColor, p->getFillType( ), p));
179 176
180 GrPipelineBuilder pipelineBuilder(*args.fPaint, 177 GrPipelineBuilder pipelineBuilder(*args.fPaint,
181 args.fDrawContext->isUnifiedMultisampl ed()); 178 args.fDrawContext->isUnifiedMultisampl ed());
182 pipelineBuilder.setRenderTarget(args.fDrawContext->accessRenderTarget()) ;
183 pipelineBuilder.setUserStencil(&kCoverPass); 179 pipelineBuilder.setUserStencil(&kCoverPass);
184 if (args.fAntiAlias) { 180 if (args.fAntiAlias) {
185 SkASSERT(args.fDrawContext->isStencilBufferMultisampled()); 181 SkASSERT(args.fDrawContext->isStencilBufferMultisampled());
186 pipelineBuilder.enableState(GrPipelineBuilder::kHWAntialias_Flag); 182 pipelineBuilder.enableState(GrPipelineBuilder::kHWAntialias_Flag);
187 } 183 }
188 184
189 args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, batch); 185 args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, batch);
190 } 186 }
191 187
192 return true; 188 return true;
193 } 189 }
OLDNEW
« no previous file with comments | « src/gpu/batches/GrPLSPathRenderer.cpp ('k') | src/gpu/batches/GrTessellatingPathRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698