blob: 72a95152e29bd1460a88394477381c9050b8ba5b [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 }
bsalomon0aff2fa2015-07-31 06:48:27 -070025private:
robertphillipse7d4b2f2015-08-13 07:57:10 -070026 StencilSupport onGetStencilSupport(const SkPath&, const GrStrokeInfo&) const override {
27 return GrPathRenderer::kNoSupport_StencilSupport;
28 }
bsalomon0aff2fa2015-07-31 06:48:27 -070029
30 bool onCanDrawPath(const CanDrawPathArgs&) const override;
bsalomon@google.com45a15f52012-12-10 19:10:17 +000031
bsalomon0aff2fa2015-07-31 06:48:27 -070032 bool onDrawPath(const DrawPathArgs&) override;
rmistry@google.comd6176b02012-08-23 18:14:13 +000033
robertphillips@google.comf4c2c522012-04-27 12:08:47 +000034private:
35 GrContext* fContext;
36
37 typedef GrPathRenderer INHERITED;
38};
39
40#endif