From 7f578bf07b016778e3105b7655a895728b12d847 Mon Sep 17 00:00:00 2001 From: Chris Dalton Date: Tue, 5 Sep 2017 16:46:48 -0600 Subject: CCPR: Remove cubic insets and MSAA borders Avoids the need for MSAA cubic borders by chopping up the cubic geometry and crossing the inflections points and loop intersections with lines and quadratic(s) instead. This allows us to render the remaining cubic segments with simple hulls and analytic AA, giving better image quality and performance. Bug: skia: Change-Id: If371229f575ee0286c325c230a116d602a9d38ce Reviewed-on: https://skia-review.googlesource.com/41883 Commit-Queue: Chris Dalton Reviewed-by: Brian Salomon --- src/gpu/ccpr/GrCCPRCoverageProcessor.h | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'src/gpu/ccpr/GrCCPRCoverageProcessor.h') diff --git a/src/gpu/ccpr/GrCCPRCoverageProcessor.h b/src/gpu/ccpr/GrCCPRCoverageProcessor.h index d0b20cf686..2835cc5a5f 100644 --- a/src/gpu/ccpr/GrCCPRCoverageProcessor.h +++ b/src/gpu/ccpr/GrCCPRCoverageProcessor.h @@ -68,10 +68,10 @@ public: kQuadraticCorners, // Cubics. - kSerpentineInsets, - kSerpentineBorders, - kLoopInsets, - kLoopBorders + kSerpentineHulls, + kLoopHulls, + kSerpentineCorners, + kLoopCorners }; static constexpr GrVertexAttribType InstanceArrayFormat(Mode mode) { return mode < Mode::kQuadraticHulls ? kVec4i_GrVertexAttribType : kVec2i_GrVertexAttribType; @@ -92,9 +92,8 @@ public: void getGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override; GrGLSLPrimitiveProcessor* createGLSLInstance(const GrShaderCaps&) const override; -#ifdef SK_DEBUG static constexpr float kDebugBloat = 50; - +#ifdef SK_DEBUG // Increases the 1/2 pixel AA bloat by a factor of kDebugBloat and outputs color instead of // coverage (coverage=+1 -> green, coverage=0 -> black, coverage=-1 -> red). void enableDebugVisualizations() { fDebugVisualizations = true; } @@ -188,14 +187,11 @@ protected: // Logically, the conservative raster hull is equivalent to the convex hull of pixel-size boxes // centered on the vertices. // - // If an optional inset polygon is provided, then this emits a border from the inset to the - // hull, rather than the entire hull. - // // Geometry shader must be configured to output triangle strips. // // Returns the maximum number of vertices that will be emitted. int emitHullGeometry(GrGLSLGeometryBuilder*, const char* emitVertexFn, const char* polygonPts, - int numSides, const char* wedgeIdx, const char* insetPts = nullptr) const; + int numSides, const char* wedgeIdx, const char* midpoint = nullptr) const; // Emits the conservative raster of an edge (i.e. convex hull of two pixel-size boxes centered // on the endpoints). Coverage is -1 on the outside border of the edge geometry and 0 on the -- cgit v1.2.3