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; |
| 15 | class GrAutoScratchTexture; |
| 16 | |
| 17 | /** |
robertphillips@google.com | b4f06d7 | 2012-05-15 12:10:05 +0000 | [diff] [blame] | 18 | * 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.com | f4c2c52 | 2012-04-27 12:08:47 +0000 | [diff] [blame] | 21 | class GrSoftwarePathRenderer : public GrPathRenderer { |
| 22 | public: |
rmistry@google.com | d6176b0 | 2012-08-23 18:14:13 +0000 | [diff] [blame] | 23 | GrSoftwarePathRenderer(GrContext* context) |
robertphillips@google.com | f4c2c52 | 2012-04-27 12:08:47 +0000 | [diff] [blame] | 24 | : fContext(context) { |
| 25 | } |
| 26 | |
bsalomon@google.com | 45a15f5 | 2012-12-10 19:10:17 +0000 | [diff] [blame] | 27 | virtual bool canDrawPath(const SkPath&, |
sugoi@google.com | 5f74cf8 | 2012-12-17 21:16:45 +0000 | [diff] [blame^] | 28 | const SkStrokeRec&, |
bsalomon@google.com | 45a15f5 | 2012-12-10 19:10:17 +0000 | [diff] [blame] | 29 | const GrDrawTarget*, |
sugoi@google.com | 12b4e27 | 2012-12-06 20:13:11 +0000 | [diff] [blame] | 30 | bool antiAlias) const SK_OVERRIDE; |
robertphillips@google.com | f4c2c52 | 2012-04-27 12:08:47 +0000 | [diff] [blame] | 31 | protected: |
bsalomon@google.com | 45a15f5 | 2012-12-10 19:10:17 +0000 | [diff] [blame] | 32 | virtual StencilSupport onGetStencilSupport(const SkPath&, |
sugoi@google.com | 5f74cf8 | 2012-12-17 21:16:45 +0000 | [diff] [blame^] | 33 | const SkStrokeRec&, |
bsalomon@google.com | 45a15f5 | 2012-12-10 19:10:17 +0000 | [diff] [blame] | 34 | const GrDrawTarget*) const SK_OVERRIDE; |
| 35 | |
| 36 | virtual bool onDrawPath(const SkPath&, |
sugoi@google.com | 5f74cf8 | 2012-12-17 21:16:45 +0000 | [diff] [blame^] | 37 | const SkStrokeRec&, |
bsalomon@google.com | 45a15f5 | 2012-12-10 19:10:17 +0000 | [diff] [blame] | 38 | GrDrawTarget*, |
robertphillips@google.com | f4c2c52 | 2012-04-27 12:08:47 +0000 | [diff] [blame] | 39 | bool antiAlias) SK_OVERRIDE; |
rmistry@google.com | d6176b0 | 2012-08-23 18:14:13 +0000 | [diff] [blame] | 40 | |
robertphillips@google.com | f4c2c52 | 2012-04-27 12:08:47 +0000 | [diff] [blame] | 41 | private: |
| 42 | GrContext* fContext; |
| 43 | |
| 44 | typedef GrPathRenderer INHERITED; |
| 45 | }; |
| 46 | |
| 47 | #endif |