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

Side by Side Diff: src/gpu/GrPathRenderer.h

Issue 1933053002: Use constexpr constructors of GrStencilSettings rather than hacky macro system (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address comment Created 4 years, 7 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/GrDrawTarget.cpp ('k') | src/gpu/GrStencil.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 * Copyright 2011 Google Inc. 2 * Copyright 2011 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 #ifndef GrPathRenderer_DEFINED 8 #ifndef GrPathRenderer_DEFINED
9 #define GrPathRenderer_DEFINED 9 #define GrPathRenderer_DEFINED
10 10
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 /** 258 /**
259 * Subclass implementation of canDrawPath() 259 * Subclass implementation of canDrawPath()
260 */ 260 */
261 virtual bool onCanDrawPath(const CanDrawPathArgs& args) const = 0; 261 virtual bool onCanDrawPath(const CanDrawPathArgs& args) const = 0;
262 262
263 /** 263 /**
264 * Subclass implementation of stencilPath(). Subclass must override iff it e ver returns 264 * Subclass implementation of stencilPath(). Subclass must override iff it e ver returns
265 * kStencilOnly in onGetStencilSupport(). 265 * kStencilOnly in onGetStencilSupport().
266 */ 266 */
267 virtual void onStencilPath(const StencilPathArgs& args) { 267 virtual void onStencilPath(const StencilPathArgs& args) {
268 GR_STATIC_CONST_SAME_STENCIL(kIncrementStencil, 268 static constexpr GrStencilSettings kIncrementStencil(
269 kReplace_StencilOp, 269 kReplace_StencilOp,
270 kReplace_StencilOp, 270 kReplace_StencilOp,
271 kAlways_StencilFunc, 271 kAlways_StencilFunc,
272 0xffff, 272 0xffff,
273 0xffff, 273 0xffff,
274 0xffff); 274 0xffff);
275 args.fPipelineBuilder->setStencil(kIncrementStencil); 275 args.fPipelineBuilder->setStencil(kIncrementStencil);
276 args.fPipelineBuilder->setDisableColorXPFactory(); 276 args.fPipelineBuilder->setDisableColorXPFactory();
277 DrawPathArgs drawArgs; 277 DrawPathArgs drawArgs;
278 drawArgs.fTarget = args.fTarget; 278 drawArgs.fTarget = args.fTarget;
279 drawArgs.fResourceProvider = args.fResourceProvider; 279 drawArgs.fResourceProvider = args.fResourceProvider;
280 drawArgs.fPipelineBuilder = args.fPipelineBuilder; 280 drawArgs.fPipelineBuilder = args.fPipelineBuilder;
281 drawArgs.fColor = 0xFFFFFFFF; 281 drawArgs.fColor = 0xFFFFFFFF;
282 drawArgs.fViewMatrix = args.fViewMatrix; 282 drawArgs.fViewMatrix = args.fViewMatrix;
283 drawArgs.fPath = args.fPath; 283 drawArgs.fPath = args.fPath;
284 drawArgs.fStroke = args.fStroke; 284 drawArgs.fStroke = args.fStroke;
285 drawArgs.fAntiAlias = false; 285 drawArgs.fAntiAlias = false;
286 drawArgs.fGammaCorrect = false; 286 drawArgs.fGammaCorrect = false;
287 this->drawPath(drawArgs); 287 this->drawPath(drawArgs);
288 } 288 }
289 289
290 290
291 typedef SkRefCnt INHERITED; 291 typedef SkRefCnt INHERITED;
292 }; 292 };
293 293
294 #endif 294 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrDrawTarget.cpp ('k') | src/gpu/GrStencil.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698