michael@0: michael@0: /* michael@0: * Copyright 2012 Google Inc. michael@0: * michael@0: * Use of this source code is governed by a BSD-style license that can be michael@0: * found in the LICENSE file. michael@0: */ michael@0: michael@0: #ifndef GrSoftwarePathRenderer_DEFINED michael@0: #define GrSoftwarePathRenderer_DEFINED michael@0: michael@0: #include "GrPathRenderer.h" michael@0: michael@0: class GrContext; michael@0: class GrAutoScratchTexture; michael@0: michael@0: /** michael@0: * This class uses the software side to render a path to an SkBitmap and michael@0: * then uploads the result to the gpu michael@0: */ michael@0: class GrSoftwarePathRenderer : public GrPathRenderer { michael@0: public: michael@0: GrSoftwarePathRenderer(GrContext* context) michael@0: : fContext(context) { michael@0: } michael@0: michael@0: virtual bool canDrawPath(const SkPath&, michael@0: const SkStrokeRec&, michael@0: const GrDrawTarget*, michael@0: bool antiAlias) const SK_OVERRIDE; michael@0: protected: michael@0: virtual StencilSupport onGetStencilSupport(const SkPath&, michael@0: const SkStrokeRec&, michael@0: const GrDrawTarget*) const SK_OVERRIDE; michael@0: michael@0: virtual bool onDrawPath(const SkPath&, michael@0: const SkStrokeRec&, michael@0: GrDrawTarget*, michael@0: bool antiAlias) SK_OVERRIDE; michael@0: michael@0: private: michael@0: GrContext* fContext; michael@0: michael@0: typedef GrPathRenderer INHERITED; michael@0: }; michael@0: michael@0: #endif