robertphillips@google.com | f4c2c52 | 2012-04-27 12:08:47 +0000 | [diff] [blame] | 1 | |
| 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.com | b4f06d7 | 2012-05-15 12:10:05 +0000 | [diff] [blame] | 14 | class GrContext; |
robertphillips@google.com | b4f06d7 | 2012-05-15 12:10:05 +0000 | [diff] [blame] | 15 | |
| 16 | /** |
robertphillips@google.com | b4f06d7 | 2012-05-15 12:10:05 +0000 | [diff] [blame] | 17 | * 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.com | f4c2c52 | 2012-04-27 12:08:47 +0000 | [diff] [blame] | 20 | class GrSoftwarePathRenderer : public GrPathRenderer { |
| 21 | public: |
rmistry@google.com | d6176b0 | 2012-08-23 18:14:13 +0000 | [diff] [blame] | 22 | GrSoftwarePathRenderer(GrContext* context) |
robertphillips@google.com | f4c2c52 | 2012-04-27 12:08:47 +0000 | [diff] [blame] | 23 | : fContext(context) { |
| 24 | } |
bsalomon | 0aff2fa | 2015-07-31 06:48:27 -0700 | [diff] [blame] | 25 | private: |
robertphillips | e7d4b2f | 2015-08-13 07:57:10 -0700 | [diff] [blame] | 26 | StencilSupport onGetStencilSupport(const SkPath&, const GrStrokeInfo&) const override { |
| 27 | return GrPathRenderer::kNoSupport_StencilSupport; |
| 28 | } |
bsalomon | 0aff2fa | 2015-07-31 06:48:27 -0700 | [diff] [blame] | 29 | |
| 30 | bool onCanDrawPath(const CanDrawPathArgs&) const override; |
bsalomon@google.com | 45a15f5 | 2012-12-10 19:10:17 +0000 | [diff] [blame] | 31 | |
bsalomon | 0aff2fa | 2015-07-31 06:48:27 -0700 | [diff] [blame] | 32 | bool onDrawPath(const DrawPathArgs&) override; |
rmistry@google.com | d6176b0 | 2012-08-23 18:14:13 +0000 | [diff] [blame] | 33 | |
robertphillips@google.com | f4c2c52 | 2012-04-27 12:08:47 +0000 | [diff] [blame] | 34 | private: |
| 35 | GrContext* fContext; |
| 36 | |
| 37 | typedef GrPathRenderer INHERITED; |
| 38 | }; |
| 39 | |
| 40 | #endif |