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

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

Issue 2126083002: Remove fColor from PathRenderer DrawPathArgs struct (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Remove unnecessary GrPaint::setColor calls Created 4 years, 5 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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 SkScalar bloat = viewMatrix.getMaxScale() * SK_ScalarHalf; 135 SkScalar bloat = viewMatrix.getMaxScale() * SK_ScalarHalf;
136 bounds.outset(bloat, bloat); 136 bounds.outset(bloat, bloat);
137 } else { 137 } else {
138 if (!viewMatrix.invert(&invert)) { 138 if (!viewMatrix.invert(&invert)) {
139 return false; 139 return false;
140 } 140 }
141 } 141 }
142 const SkMatrix& viewM = viewMatrix.hasPerspective() ? SkMatrix::I() : vi ewMatrix; 142 const SkMatrix& viewM = viewMatrix.hasPerspective() ? SkMatrix::I() : vi ewMatrix;
143 143
144 SkAutoTUnref<GrDrawBatch> coverBatch( 144 SkAutoTUnref<GrDrawBatch> coverBatch(
145 GrRectBatchFactory::CreateNonAAFill(args.fColor, viewM, bounds, nullptr, 145 GrRectBatchFactory::CreateNonAAFill(args.fPaint->getColor(), vie wM, bounds,
146 &invert)); 146 nullptr, &invert));
147 147
148 { 148 {
149 GrPipelineBuilder pipelineBuilder(*args.fPaint, 149 GrPipelineBuilder pipelineBuilder(*args.fPaint,
150 args.fPaint->isAntiAlias() && 150 args.fPaint->isAntiAlias() &&
151 !args.fDrawContext->hasMixedSample s()); 151 !args.fDrawContext->hasMixedSample s());
152 pipelineBuilder.setUserStencil(&kInvertedCoverPass); 152 pipelineBuilder.setUserStencil(&kInvertedCoverPass);
153 153
154 args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, coverBatc h); 154 args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, coverBatc h);
155 } 155 }
156 } else { 156 } else {
157 static constexpr GrUserStencilSettings kCoverPass( 157 static constexpr GrUserStencilSettings kCoverPass(
158 GrUserStencilSettings::StaticInit< 158 GrUserStencilSettings::StaticInit<
159 0x0000, 159 0x0000,
160 GrUserStencilTest::kNotEqual, 160 GrUserStencilTest::kNotEqual,
161 0xffff, 161 0xffff,
162 GrUserStencilOp::kZero, 162 GrUserStencilOp::kZero,
163 GrUserStencilOp::kKeep, 163 GrUserStencilOp::kKeep,
164 0xffff>() 164 0xffff>()
165 ); 165 );
166 166
167 SkAutoTUnref<GrDrawBatch> batch( 167 SkAutoTUnref<GrDrawBatch> batch(
168 GrDrawPathBatch::Create(viewMatrix, args.fColor, p->getFillType( ), p)); 168 GrDrawPathBatch::Create(viewMatrix, args.fPaint->getColor(), p-> getFillType(), p));
169 169
170 GrPipelineBuilder pipelineBuilder(*args.fPaint, args.fPaint->isAntiAlias ()); 170 GrPipelineBuilder pipelineBuilder(*args.fPaint, args.fPaint->isAntiAlias ());
171 pipelineBuilder.setUserStencil(&kCoverPass); 171 pipelineBuilder.setUserStencil(&kCoverPass);
172 if (args.fAntiAlias) { 172 if (args.fAntiAlias) {
173 SkASSERT(args.fDrawContext->isStencilBufferMultisampled()); 173 SkASSERT(args.fDrawContext->isStencilBufferMultisampled());
174 pipelineBuilder.enableState(GrPipelineBuilder::kHWAntialias_Flag); 174 pipelineBuilder.enableState(GrPipelineBuilder::kHWAntialias_Flag);
175 } 175 }
176 176
177 args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, batch); 177 args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, batch);
178 } 178 }
179 179
180 return true; 180 return true;
181 } 181 }
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