blob: ed897cceaf830d762d2ff8e40ce7b41f5bbbb084 [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;
robertphillips@google.comb4f06d72012-05-15 12:10:05 +000015
16/**
robertphillips@google.comb4f06d72012-05-15 12:10:05 +000017 * This class uses the software side to render a path to an SkBitmap and
18 * then uploads the result to the gpu
19 */
robertphillips@google.comf4c2c522012-04-27 12:08:47 +000020class GrSoftwarePathRenderer : public GrPathRenderer {
21public:
rmistry@google.comd6176b02012-08-23 18:14:13 +000022 GrSoftwarePathRenderer(GrContext* context)
robertphillips@google.comf4c2c522012-04-27 12:08:47 +000023 : fContext(context) {
24 }
25
joshualitt9853cce2014-11-17 14:22:48 -080026 virtual bool canDrawPath(const GrDrawTarget*,
egdaniel8dd688b2015-01-22 10:16:09 -080027 const GrPipelineBuilder*,
joshualitt8059eb92014-12-29 15:10:07 -080028 const SkMatrix& viewMatrix,
joshualitt9853cce2014-11-17 14:22:48 -080029 const SkPath&,
robertphillips@google.come79f3202014-02-11 16:30:21 +000030 const SkStrokeRec&,
sugoi@google.com12b4e272012-12-06 20:13:11 +000031 bool antiAlias) const SK_OVERRIDE;
robertphillips@google.comf4c2c522012-04-27 12:08:47 +000032protected:
joshualitt9853cce2014-11-17 14:22:48 -080033 virtual StencilSupport onGetStencilSupport(const GrDrawTarget*,
egdaniel8dd688b2015-01-22 10:16:09 -080034 const GrPipelineBuilder*,
joshualitt9853cce2014-11-17 14:22:48 -080035 const SkPath&,
36 const SkStrokeRec&) const SK_OVERRIDE;
bsalomon@google.com45a15f52012-12-10 19:10:17 +000037
joshualitt9853cce2014-11-17 14:22:48 -080038 virtual bool onDrawPath(GrDrawTarget*,
egdaniel8dd688b2015-01-22 10:16:09 -080039 GrPipelineBuilder*,
joshualitt2e3b3e32014-12-09 13:31:14 -080040 GrColor,
joshualitt8059eb92014-12-29 15:10:07 -080041 const SkMatrix& viewMatrix,
joshualitt9853cce2014-11-17 14:22:48 -080042 const SkPath&,
robertphillips@google.come79f3202014-02-11 16:30:21 +000043 const SkStrokeRec&,
robertphillips@google.comf4c2c522012-04-27 12:08:47 +000044 bool antiAlias) SK_OVERRIDE;
rmistry@google.comd6176b02012-08-23 18:14:13 +000045
robertphillips@google.comf4c2c522012-04-27 12:08:47 +000046private:
47 GrContext* fContext;
48
49 typedef GrPathRenderer INHERITED;
50};
51
52#endif