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 DefaultPathRenderer_DEFINED 9#define DefaultPathRenderer_DEFINED 10 11#include "src/gpu/v1/PathRenderer.h" 12 13namespace skgpu::v1 { 14 15/** 16 * Subclass that renders the path using the stencil buffer to resolve fill rules 17 * (e.g. winding, even-odd) 18 */ 19class DefaultPathRenderer final : public PathRenderer { 20public: 21 DefaultPathRenderer() = default; 22 23 const char* name() const override { return "Default"; } 24 25private: 26 StencilSupport onGetStencilSupport(const GrStyledShape&) const override; 27 28 CanDrawPath onCanDrawPath(const CanDrawPathArgs&) const override; 29 30 bool onDrawPath(const DrawPathArgs&) override; 31 32 void onStencilPath(const StencilPathArgs&) override; 33 34 bool internalDrawPath(SurfaceDrawContext*, 35 GrPaint&&, 36 GrAAType, 37 const GrUserStencilSettings&, 38 const GrClip*, 39 const SkMatrix& viewMatrix, 40 const GrStyledShape&, 41 bool stencilOnly); 42}; 43 44} // namespace skgpu::v1 45 46#endif // DefaultPathRenderer_DEFINED 47