diff options
author | Chris Dalton <csmartdalton@google.com> | 2018-05-07 19:19:06 -0600 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-05-08 15:39:04 +0000 |
commit | d925f2d38dff377b5ef8e3f71410237de80811aa (patch) | |
tree | 77e7ec17f38b8adee98342006671b43ead437b74 /src/gpu/ccpr/GrCCPathProcessor.h | |
parent | 75ce242a4662d7d7b724f55806508106349b9180 (diff) |
Add a drawPaths method to GrCCPathProcessor
Bug: skia:
Change-Id: I5d3762203cbe1d823ea3f3967240bcab76651f2c
Reviewed-on: https://skia-review.googlesource.com/126662
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Diffstat (limited to 'src/gpu/ccpr/GrCCPathProcessor.h')
-rw-r--r-- | src/gpu/ccpr/GrCCPathProcessor.h | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/gpu/ccpr/GrCCPathProcessor.h b/src/gpu/ccpr/GrCCPathProcessor.h index 644fbbab2d..40b16a4e9d 100644 --- a/src/gpu/ccpr/GrCCPathProcessor.h +++ b/src/gpu/ccpr/GrCCPathProcessor.h @@ -14,6 +14,8 @@ #include <array> class GrOnFlushResourceProvider; +class GrOpFlushState; +class GrPipeline; /** * This class draws AA paths using the coverage count masks produced by GrCCCoverageProcessor. @@ -21,8 +23,9 @@ class GrOnFlushResourceProvider; * Paths are drawn as bloated octagons, and coverage is derived from the coverage count mask and * fill rule. * - * The caller must set up an instance buffer as detailed below, then draw indexed-instanced - * meshes using the buffers and parameters provided by this class. + * To draw paths, the caller must set up an instance buffer as detailed below, then call drawPaths() + * providing its own instance buffer alongside the buffers found by calling FindIndexBuffer/ + * FindVertexBuffer. */ class GrCCPathProcessor : public GrGeometryProcessor { public: @@ -50,13 +53,8 @@ public: GR_STATIC_ASSERT(4 * 16 == sizeof(Instance)); - static GrPrimitiveType MeshPrimitiveType(const GrCaps& caps) { - return caps.usePrimitiveRestart() ? GrPrimitiveType::kTriangleStrip - : GrPrimitiveType::kTriangles; - } static sk_sp<const GrBuffer> FindVertexBuffer(GrOnFlushResourceProvider*); static sk_sp<const GrBuffer> FindIndexBuffer(GrOnFlushResourceProvider*); - static int NumIndicesPerInstance(const GrCaps&); GrCCPathProcessor(GrResourceProvider*, sk_sp<GrTextureProxy> atlas, SkPath::FillType); @@ -79,6 +77,10 @@ public: void getGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override; GrGLSLPrimitiveProcessor* createGLSLInstance(const GrShaderCaps&) const override; + void drawPaths(GrOpFlushState*, const GrPipeline&, const GrBuffer* indexBuffer, + const GrBuffer* vertexBuffer, GrBuffer* instanceBuffer, int baseInstance, + int endInstance, const SkRect& bounds) const; + private: const SkPath::FillType fFillType; const TextureSampler fAtlasAccess; |