Home | History | Annotate | Download | only in ops
      1 /*
      2  * Copyright 2011 Google Inc.
      3  *
      4  * Use of this source code is governed by a BSD-style license that can be
      5  * found in the LICENSE file.
      6  */
      7 
      8 #ifndef GrDefaultPathRenderer_DEFINED
      9 #define GrDefaultPathRenderer_DEFINED
     10 
     11 #include "GrPathRenderer.h"
     12 #include "GrPathStencilSettings.h"
     13 #include "SkTypes.h"
     14 
     15 /**
     16  *  Subclass that renders the path using the stencil buffer to resolve fill rules
     17  * (e.g. winding, even-odd)
     18  */
     19 class SK_API GrDefaultPathRenderer : public GrPathRenderer {
     20 public:
     21     GrDefaultPathRenderer(bool separateStencilSupport, bool stencilWrapOpsSupport);
     22 
     23 private:
     24 
     25     StencilSupport onGetStencilSupport(const GrShape&) const override;
     26 
     27     bool onCanDrawPath(const CanDrawPathArgs&) const override;
     28 
     29     bool onDrawPath(const DrawPathArgs&) override;
     30 
     31     void onStencilPath(const StencilPathArgs&) override;
     32 
     33     bool internalDrawPath(GrRenderTargetContext*,
     34                           GrPaint&&,
     35                           GrAAType,
     36                           const GrUserStencilSettings&,
     37                           const GrClip&,
     38                           const SkMatrix& viewMatrix,
     39                           const GrShape&,
     40                           bool stencilOnly);
     41 
     42     bool    fSeparateStencil;
     43     bool    fStencilWrapOps;
     44 
     45     typedef GrPathRenderer INHERITED;
     46 };
     47 
     48 #endif
     49