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

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

Issue 1950893002: Make GrPathRenderer only support fills for path stenciling (Closed) Base URL: https://skia.googlesource.com/skia.git@styleiface
Patch Set: Set draw params to fill in default impl of GrPR::onStencilPath 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/batches/GrDefaultPathRenderer.h ('k') | src/gpu/batches/GrMSAAPathRenderer.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 #include "GrDefaultPathRenderer.h" 8 #include "GrDefaultPathRenderer.h"
9 9
10 #include "GrBatchFlushState.h" 10 #include "GrBatchFlushState.h"
(...skipping 28 matching lines...) Expand all
39 return true; 39 return true;
40 #else 40 #else
41 if (!stroke.isHairlineStyle() && !path.isInverseFillType()) { 41 if (!stroke.isHairlineStyle() && !path.isInverseFillType()) {
42 return path.isConvex(); 42 return path.isConvex();
43 } 43 }
44 return false; 44 return false;
45 #endif 45 #endif
46 } 46 }
47 47
48 GrPathRenderer::StencilSupport 48 GrPathRenderer::StencilSupport
49 GrDefaultPathRenderer::onGetStencilSupport(const SkPath& path, const GrStrokeInf o& stroke) const { 49 GrDefaultPathRenderer::onGetStencilSupport(const SkPath& path) const {
50 if (single_pass_path(path, stroke)) { 50 if (single_pass_path(path, SkStrokeRec(SkStrokeRec::kFill_InitStyle))) {
51 return GrPathRenderer::kNoRestriction_StencilSupport; 51 return GrPathRenderer::kNoRestriction_StencilSupport;
52 } else { 52 } else {
53 return GrPathRenderer::kStencilOnly_StencilSupport; 53 return GrPathRenderer::kStencilOnly_StencilSupport;
54 } 54 }
55 } 55 }
56 56
57 static inline void append_countour_edge_indices(bool hairLine, 57 static inline void append_countour_edge_indices(bool hairLine,
58 uint16_t fanCenterIdx, 58 uint16_t fanCenterIdx,
59 uint16_t edgeV0Idx, 59 uint16_t edgeV0Idx,
60 uint16_t** indices) { 60 uint16_t** indices) {
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after
611 *args.fPath, 611 *args.fPath,
612 *args.fStroke, 612 *args.fStroke,
613 false); 613 false);
614 } 614 }
615 615
616 void GrDefaultPathRenderer::onStencilPath(const StencilPathArgs& args) { 616 void GrDefaultPathRenderer::onStencilPath(const StencilPathArgs& args) {
617 GR_AUDIT_TRAIL_AUTO_FRAME(args.fTarget->getAuditTrail(),"GrDefaultPathRender er::onStencilPath"); 617 GR_AUDIT_TRAIL_AUTO_FRAME(args.fTarget->getAuditTrail(),"GrDefaultPathRender er::onStencilPath");
618 SkASSERT(SkPath::kInverseEvenOdd_FillType != args.fPath->getFillType()); 618 SkASSERT(SkPath::kInverseEvenOdd_FillType != args.fPath->getFillType());
619 SkASSERT(SkPath::kInverseWinding_FillType != args.fPath->getFillType()); 619 SkASSERT(SkPath::kInverseWinding_FillType != args.fPath->getFillType());
620 this->internalDrawPath(args.fTarget, args.fPipelineBuilder, GrColor_WHITE, * args.fViewMatrix, 620 this->internalDrawPath(args.fTarget, args.fPipelineBuilder, GrColor_WHITE, * args.fViewMatrix,
621 *args.fPath, *args.fStroke, true); 621 *args.fPath, GrStrokeInfo::FillInfo(), true);
622 } 622 }
623 623
624 //////////////////////////////////////////////////////////////////////////////// /////////////////// 624 //////////////////////////////////////////////////////////////////////////////// ///////////////////
625 625
626 #ifdef GR_TEST_UTILS 626 #ifdef GR_TEST_UTILS
627 627
628 DRAW_BATCH_TEST_DEFINE(DefaultPathBatch) { 628 DRAW_BATCH_TEST_DEFINE(DefaultPathBatch) {
629 GrColor color = GrRandomColor(random); 629 GrColor color = GrRandomColor(random);
630 SkMatrix viewMatrix = GrTest::TestMatrix(random); 630 SkMatrix viewMatrix = GrTest::TestMatrix(random);
631 631
(...skipping 11 matching lines...) Expand all
643 geometry.fColor = color; 643 geometry.fColor = color;
644 geometry.fPath = path; 644 geometry.fPath = path;
645 geometry.fTolerance = srcSpaceTol; 645 geometry.fTolerance = srcSpaceTol;
646 646
647 viewMatrix.mapRect(&bounds); 647 viewMatrix.mapRect(&bounds);
648 uint8_t coverage = GrRandomCoverage(random); 648 uint8_t coverage = GrRandomCoverage(random);
649 return DefaultPathBatch::Create(geometry, coverage, viewMatrix, true, bounds ); 649 return DefaultPathBatch::Create(geometry, coverage, viewMatrix, true, bounds );
650 } 650 }
651 651
652 #endif 652 #endif
OLDNEW
« no previous file with comments | « src/gpu/batches/GrDefaultPathRenderer.h ('k') | src/gpu/batches/GrMSAAPathRenderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698