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

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

Issue 2064753003: Remove style application from GrPathRenderer subclasses (Closed) Base URL: https://chromium.googlesource.com/skia.git@pathshape
Patch Set: Remove random style from DF batch test create, since it now only allows simple fill 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
OLDNEW
1 /* 1 /*
2 * Copyright 2016 Google Inc. 2 * Copyright 2016 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 "GrMSAAPathRenderer.h" 8 #include "GrMSAAPathRenderer.h"
9 9
10 #include "GrAuditTrail.h" 10 #include "GrAuditTrail.h"
(...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after
702 pipelineBuilder.setDisableColorXPFactory(); 702 pipelineBuilder.setDisableColorXPFactory();
703 } 703 }
704 704
705 drawContext->drawBatch(pipelineBuilder, clip, batch); 705 drawContext->drawBatch(pipelineBuilder, clip, batch);
706 } 706 }
707 } 707 }
708 return true; 708 return true;
709 } 709 }
710 710
711 bool GrMSAAPathRenderer::onCanDrawPath(const CanDrawPathArgs& args) const { 711 bool GrMSAAPathRenderer::onCanDrawPath(const CanDrawPathArgs& args) const {
712 // This path renderer does not support hairlines. We defer on anything that could be handled 712 // This path renderer only fills and relies on MSAA for antialiasing. Stroke d shapes are
713 // as a hairline by another path renderer. Also, arbitrary path effects coul d produce 713 // handled by passing on the original shape and letting the caller compute t he stroked shape
714 // a hairline result. 714 // which will have a fill style.
715 return !IsStrokeHairlineOrEquivalent(args.fShape->style(), *args.fViewMatrix , nullptr) && 715 return args.fShape->style().isSimpleFill() && !args.fAntiAlias;
716 !args.fShape->style().couldBeHairline() && !args.fAntiAlias;
717 } 716 }
718 717
719 bool GrMSAAPathRenderer::onDrawPath(const DrawPathArgs& args) { 718 bool GrMSAAPathRenderer::onDrawPath(const DrawPathArgs& args) {
720 GR_AUDIT_TRAIL_AUTO_FRAME(args.fDrawContext->auditTrail(), 719 GR_AUDIT_TRAIL_AUTO_FRAME(args.fDrawContext->auditTrail(),
721 "GrMSAAPathRenderer::onDrawPath"); 720 "GrMSAAPathRenderer::onDrawPath");
722 SkTLazy<GrShape> tmpShape; 721 SkTLazy<GrShape> tmpShape;
723 const GrShape* shape = args.fShape; 722 const GrShape* shape = args.fShape;
724 if (shape->style().applies()) { 723 if (shape->style().applies()) {
725 SkScalar styleScale = GrStyle::MatrixToScaleFactor(*args.fViewMatrix); 724 SkScalar styleScale = GrStyle::MatrixToScaleFactor(*args.fViewMatrix);
726 tmpShape.init(args.fShape->applyStyle(GrStyle::Apply::kPathEffectAndStro keRec, styleScale)); 725 tmpShape.init(args.fShape->applyStyle(GrStyle::Apply::kPathEffectAndStro keRec, styleScale));
(...skipping 17 matching lines...) Expand all
744 743
745 GrPaint paint; 744 GrPaint paint;
746 paint.setXPFactory(GrDisableColorXPFactory::Make()); 745 paint.setXPFactory(GrDisableColorXPFactory::Make());
747 paint.setAntiAlias(args.fIsAA); 746 paint.setAntiAlias(args.fIsAA);
748 747
749 this->internalDrawPath(args.fDrawContext, paint, &GrUserStencilSettings::kUn used, *args.fClip, 748 this->internalDrawPath(args.fDrawContext, paint, &GrUserStencilSettings::kUn used, *args.fClip,
750 GrColor_WHITE, *args.fViewMatrix, *args.fShape, true) ; 749 GrColor_WHITE, *args.fViewMatrix, *args.fShape, true) ;
751 } 750 }
752 751
753 //////////////////////////////////////////////////////////////////////////////// /////////////////// 752 //////////////////////////////////////////////////////////////////////////////// ///////////////////
OLDNEW
« no previous file with comments | « src/gpu/batches/GrDefaultPathRenderer.cpp ('k') | src/gpu/batches/GrStencilAndCoverPathRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698