diff options
author | 2017-09-05 16:46:48 -0600 | |
---|---|---|
committer | 2017-09-05 23:06:42 +0000 | |
commit | 7f578bf07b016778e3105b7655a895728b12d847 (patch) | |
tree | 5bdc64da012a72147750dfe20f0887b388944d49 /src/gpu/ccpr/GrCCPRCoverageProcessor.h | |
parent | c1e59638b4a08f5210f72f671292b1b3759f54c6 (diff) |
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 <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/ccpr/GrCCPRCoverageProcessor.h')
-rw-r--r-- | src/gpu/ccpr/GrCCPRCoverageProcessor.h | 16 |
1 files changed, 6 insertions, 10 deletions
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 |