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

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

Issue 2127673002: Consolidate handling of infinitely thin primitives and aa bloat handing WRT batch bounds (Closed) Base URL: https://skia.googlesource.com/skia.git@AAStrokeRect
Patch Set: update for instanced rendering 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/GrNonAAStrokeRectBatch.cpp ('k') | src/gpu/batches/GrStencilPathBatch.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 2015 Google Inc. 2 * Copyright 2015 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 "GrPLSPathRenderer.h" 8 #include "GrPLSPathRenderer.h"
9 9
10 #include "SkChunkAlloc.h" 10 #include "SkChunkAlloc.h"
(...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after
786 786
787 class PLSPathBatch : public GrVertexBatch { 787 class PLSPathBatch : public GrVertexBatch {
788 public: 788 public:
789 DEFINE_BATCH_CLASS_ID 789 DEFINE_BATCH_CLASS_ID
790 PLSPathBatch(GrColor color, const SkPath& path, const SkMatrix& viewMatrix) 790 PLSPathBatch(GrColor color, const SkPath& path, const SkMatrix& viewMatrix)
791 : INHERITED(ClassID()) 791 : INHERITED(ClassID())
792 , fColor(color) 792 , fColor(color)
793 , fPath(path) 793 , fPath(path)
794 , fViewMatrix(viewMatrix) { 794 , fViewMatrix(viewMatrix) {
795 // compute bounds 795 // compute bounds
796 fBounds = path.getBounds(); 796 this->setTransformedBounds(path.getBounds(), fViewMatrix, HasAABloat::kY es,
797 fViewMatrix.mapRect(&fBounds); 797 IsZeroArea::kNo);
798 } 798 }
799 799
800 const char* name() const override { return "PLSBatch"; } 800 const char* name() const override { return "PLSBatch"; }
801 801
802 void computePipelineOptimizations(GrInitInvariantOutput* color, 802 void computePipelineOptimizations(GrInitInvariantOutput* color,
803 GrInitInvariantOutput* coverage, 803 GrInitInvariantOutput* coverage,
804 GrBatchToXPOverrides* overrides) const ove rride { 804 GrBatchToXPOverrides* overrides) const ove rride {
805 // When this is called on a batch, there is only one geometry bundle 805 // When this is called on a batch, there is only one geometry bundle
806 color->setKnownFourComponents(fColor); 806 color->setKnownFourComponents(fColor);
807 coverage->setUnknownSingleComponent(); 807 coverage->setUnknownSingleComponent();
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
967 967
968 DRAW_BATCH_TEST_DEFINE(PLSPathBatch) { 968 DRAW_BATCH_TEST_DEFINE(PLSPathBatch) {
969 GrColor color = GrRandomColor(random); 969 GrColor color = GrRandomColor(random);
970 SkMatrix vm = GrTest::TestMatrixInvertible(random); 970 SkMatrix vm = GrTest::TestMatrixInvertible(random);
971 SkPath path = GrTest::TestPathConvex(random); 971 SkPath path = GrTest::TestPathConvex(random);
972 972
973 return new PLSPathBatch(color, path, vm); 973 return new PLSPathBatch(color, path, vm);
974 } 974 }
975 975
976 #endif 976 #endif
OLDNEW
« no previous file with comments | « src/gpu/batches/GrNonAAStrokeRectBatch.cpp ('k') | src/gpu/batches/GrStencilPathBatch.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698