blob: f8c5620f49a4d2f73e96ec4f8559486ce29f49d6 [file] [log] [blame]
robertphillips@google.comf4c2c522012-04-27 12:08:47 +00001
2/*
3 * Copyright 2012 Google Inc.
4 *
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
7 */
8
9#ifndef GrSoftwarePathRenderer_DEFINED
10#define GrSoftwarePathRenderer_DEFINED
11
12#include "GrPathRenderer.h"
13
robertphillips@google.comb4f06d72012-05-15 12:10:05 +000014class GrContext;
15class GrAutoScratchTexture;
16
17/**
robertphillips@google.comb4f06d72012-05-15 12:10:05 +000018 * This class uses the software side to render a path to an SkBitmap and
19 * then uploads the result to the gpu
20 */
robertphillips@google.comf4c2c522012-04-27 12:08:47 +000021class GrSoftwarePathRenderer : public GrPathRenderer {
22public:
rmistry@google.comd6176b02012-08-23 18:14:13 +000023 GrSoftwarePathRenderer(GrContext* context)
robertphillips@google.comf4c2c522012-04-27 12:08:47 +000024 : fContext(context) {
25 }
26
robertphillips@google.come79f3202014-02-11 16:30:21 +000027 virtual bool canDrawPath(const SkPath&,
28 const SkStrokeRec&,
bsalomon@google.com45a15f52012-12-10 19:10:17 +000029 const GrDrawTarget*,
sugoi@google.com12b4e272012-12-06 20:13:11 +000030 bool antiAlias) const SK_OVERRIDE;
robertphillips@google.comf4c2c522012-04-27 12:08:47 +000031protected:
robertphillips@google.come79f3202014-02-11 16:30:21 +000032 virtual StencilSupport onGetStencilSupport(const SkPath&,
33 const SkStrokeRec&,
bsalomon@google.com45a15f52012-12-10 19:10:17 +000034 const GrDrawTarget*) const SK_OVERRIDE;
35
robertphillips@google.come79f3202014-02-11 16:30:21 +000036 virtual bool onDrawPath(const SkPath&,
37 const SkStrokeRec&,
bsalomon@google.com45a15f52012-12-10 19:10:17 +000038 GrDrawTarget*,
robertphillips@google.comf4c2c522012-04-27 12:08:47 +000039 bool antiAlias) SK_OVERRIDE;
rmistry@google.comd6176b02012-08-23 18:14:13 +000040
robertphillips@google.comf4c2c522012-04-27 12:08:47 +000041private:
42 GrContext* fContext;
43
44 typedef GrPathRenderer INHERITED;
45};
46
47#endif