blob: 6e18b5907cc4185a4d56ef712d5e73a4b100067e [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:
23 GrSoftwarePathRenderer(GrContext* context)
24 : fContext(context) {
25 }
26
27 virtual bool canDrawPath(const SkPath& path,
28 GrPathFill fill,
29 const GrDrawTarget* target,
30 bool antiAlias) const SK_OVERRIDE;
31protected:
32 virtual bool onDrawPath(const SkPath& path,
33 GrPathFill fill,
34 const GrVec* translate,
35 GrDrawTarget* target,
robertphillips@google.comf4c2c522012-04-27 12:08:47 +000036 bool antiAlias) SK_OVERRIDE;
37
38private:
39 GrContext* fContext;
40
41 typedef GrPathRenderer INHERITED;
42};
43
44#endif