| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 #ifndef GrPathRenderer_DEFINED | 9 #ifndef GrPathRenderer_DEFINED |
| 10 #define GrPathRenderer_DEFINED | 10 #define GrPathRenderer_DEFINED |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 | 23 |
| 24 /** | 24 /** |
| 25 * Base class for drawing paths into a GrDrawTarget. | 25 * Base class for drawing paths into a GrDrawTarget. |
| 26 * | 26 * |
| 27 * Derived classes can use stages GrPaint::kTotalStages through GrPipelineBuild
er::kNumStages-1. | 27 * Derived classes can use stages GrPaint::kTotalStages through GrPipelineBuild
er::kNumStages-1. |
| 28 * The stages before GrPaint::kTotalStages are reserved for setting up the draw
(i.e., textures and | 28 * The stages before GrPaint::kTotalStages are reserved for setting up the draw
(i.e., textures and |
| 29 * filter masks). | 29 * filter masks). |
| 30 */ | 30 */ |
| 31 class SK_API GrPathRenderer : public SkRefCnt { | 31 class SK_API GrPathRenderer : public SkRefCnt { |
| 32 public: | 32 public: |
| 33 | |
| 34 | |
| 35 /** | |
| 36 * This is called to install custom path renderers in every GrContext at cre
ate time. The | |
| 37 * default implementation in GrCreatePathRenderer_none.cpp does not add any
additional | |
| 38 * renderers. Link against another implementation to install your own. The f
irst added is the | |
| 39 * most preferred path renderer, second is second most preferred, etc. | |
| 40 * | |
| 41 * @param context the context that will use the path renderer | |
| 42 * @param prChain the chain to add path renderers to. | |
| 43 */ | |
| 44 static void AddPathRenderers(GrContext* context, GrPathRendererChain* prChai
n); | |
| 45 | |
| 46 | |
| 47 GrPathRenderer(); | 33 GrPathRenderer(); |
| 48 | 34 |
| 49 /** | 35 /** |
| 50 * A caller may wish to use a path renderer to draw a path into the stencil
buffer. However, | 36 * A caller may wish to use a path renderer to draw a path into the stencil
buffer. However, |
| 51 * the path renderer itself may require use of the stencil buffer. Also a pa
th renderer may | 37 * the path renderer itself may require use of the stencil buffer. Also a pa
th renderer may |
| 52 * use a GrProcessor coverage stage that sets coverage to zero to eliminate
pixels that are | 38 * use a GrProcessor coverage stage that sets coverage to zero to eliminate
pixels that are |
| 53 * covered by bounding geometry but outside the path. These exterior pixels
would still be | 39 * covered by bounding geometry but outside the path. These exterior pixels
would still be |
| 54 * rendered into the stencil. | 40 * rendered into the stencil. |
| 55 * | 41 * |
| 56 * A GrPathRenderer can provide three levels of support for stenciling paths
: | 42 * A GrPathRenderer can provide three levels of support for stenciling paths
: |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 drawArgs.fStroke = args.fStroke; | 280 drawArgs.fStroke = args.fStroke; |
| 295 drawArgs.fAntiAlias = false; | 281 drawArgs.fAntiAlias = false; |
| 296 this->drawPath(drawArgs); | 282 this->drawPath(drawArgs); |
| 297 } | 283 } |
| 298 | 284 |
| 299 | 285 |
| 300 typedef SkRefCnt INHERITED; | 286 typedef SkRefCnt INHERITED; |
| 301 }; | 287 }; |
| 302 | 288 |
| 303 #endif | 289 #endif |
| OLD | NEW |