12880df2609eba09b555ca37be04b6ad89290c765Tom Hudson 22880df2609eba09b555ca37be04b6ad89290c765Tom Hudson/* 32880df2609eba09b555ca37be04b6ad89290c765Tom Hudson * Copyright 2012 Google Inc. 42880df2609eba09b555ca37be04b6ad89290c765Tom Hudson * 52880df2609eba09b555ca37be04b6ad89290c765Tom Hudson * Use of this source code is governed by a BSD-style license that can be 62880df2609eba09b555ca37be04b6ad89290c765Tom Hudson * found in the LICENSE file. 72880df2609eba09b555ca37be04b6ad89290c765Tom Hudson */ 82880df2609eba09b555ca37be04b6ad89290c765Tom Hudson 92880df2609eba09b555ca37be04b6ad89290c765Tom Hudson#ifndef GrBuiltInPathRenderer_DEFINED 102880df2609eba09b555ca37be04b6ad89290c765Tom Hudson#define GrBuiltInPathRenderer_DEFINED 112880df2609eba09b555ca37be04b6ad89290c765Tom Hudson 122880df2609eba09b555ca37be04b6ad89290c765Tom Hudson#include "GrPathRenderer.h" 132880df2609eba09b555ca37be04b6ad89290c765Tom Hudson 142880df2609eba09b555ca37be04b6ad89290c765Tom Hudsonclass GrContext; 152880df2609eba09b555ca37be04b6ad89290c765Tom Hudsonclass GrGpu; 162880df2609eba09b555ca37be04b6ad89290c765Tom Hudson 172880df2609eba09b555ca37be04b6ad89290c765Tom Hudson/** 182880df2609eba09b555ca37be04b6ad89290c765Tom Hudson * Uses GrGpu::stencilPath followed by a cover rectangle. This subclass doesn't apply AA; it relies 192880df2609eba09b555ca37be04b6ad89290c765Tom Hudson * on the target having MSAA if AA is desired. 202880df2609eba09b555ca37be04b6ad89290c765Tom Hudson */ 212880df2609eba09b555ca37be04b6ad89290c765Tom Hudsonclass GrStencilAndCoverPathRenderer : public GrPathRenderer { 222880df2609eba09b555ca37be04b6ad89290c765Tom Hudsonpublic: 232880df2609eba09b555ca37be04b6ad89290c765Tom Hudson 242880df2609eba09b555ca37be04b6ad89290c765Tom Hudson static GrPathRenderer* Create(GrResourceProvider*, const GrCaps&); 252880df2609eba09b555ca37be04b6ad89290c765Tom Hudson 262880df2609eba09b555ca37be04b6ad89290c765Tom Hudson 272880df2609eba09b555ca37be04b6ad89290c765Tom Hudsonprivate: 282880df2609eba09b555ca37be04b6ad89290c765Tom Hudson StencilSupport onGetStencilSupport(const SkPath&, const GrStrokeInfo&) const override { 292880df2609eba09b555ca37be04b6ad89290c765Tom Hudson return GrPathRenderer::kStencilOnly_StencilSupport; 302880df2609eba09b555ca37be04b6ad89290c765Tom Hudson } 312880df2609eba09b555ca37be04b6ad89290c765Tom Hudson 322880df2609eba09b555ca37be04b6ad89290c765Tom Hudson bool onCanDrawPath(const CanDrawPathArgs&) const override; 332880df2609eba09b555ca37be04b6ad89290c765Tom Hudson 342880df2609eba09b555ca37be04b6ad89290c765Tom Hudson bool onDrawPath(const DrawPathArgs&) override; 352880df2609eba09b555ca37be04b6ad89290c765Tom Hudson 362880df2609eba09b555ca37be04b6ad89290c765Tom Hudson void onStencilPath(const StencilPathArgs&) override; 372880df2609eba09b555ca37be04b6ad89290c765Tom Hudson 382880df2609eba09b555ca37be04b6ad89290c765Tom Hudson GrStencilAndCoverPathRenderer(GrResourceProvider*); 392880df2609eba09b555ca37be04b6ad89290c765Tom Hudson 402880df2609eba09b555ca37be04b6ad89290c765Tom Hudson GrResourceProvider* fResourceProvider; 412880df2609eba09b555ca37be04b6ad89290c765Tom Hudson 422880df2609eba09b555ca37be04b6ad89290c765Tom Hudson typedef GrPathRenderer INHERITED; 432880df2609eba09b555ca37be04b6ad89290c765Tom Hudson}; 442880df2609eba09b555ca37be04b6ad89290c765Tom Hudson 452880df2609eba09b555ca37be04b6ad89290c765Tom Hudson#endif 46