bsalomon@google.com | aeb2160 | 2011-08-30 18:13:44 +0000 | [diff] [blame] | 1 | |
| 2 | /* |
| 3 | * Copyright 2011 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 GrAAHairLinePathRenderer_DEFINED |
| 10 | #define GrAAHairLinePathRenderer_DEFINED |
| 11 | |
| 12 | #include "GrPathRenderer.h" |
| 13 | |
| 14 | class GrAAHairLinePathRenderer : public GrPathRenderer { |
| 15 | public: |
| 16 | virtual ~GrAAHairLinePathRenderer(); |
| 17 | |
| 18 | static GrPathRenderer* Create(GrContext* context); |
bsalomon@google.com | aeb2160 | 2011-08-30 18:13:44 +0000 | [diff] [blame] | 19 | |
joshualitt | 9853cce | 2014-11-17 14:22:48 -0800 | [diff] [blame] | 20 | virtual bool canDrawPath(const GrDrawTarget*, |
| 21 | const GrDrawState*, |
| 22 | const SkPath&, |
| 23 | const SkStrokeRec&, |
sugoi@google.com | 12b4e27 | 2012-12-06 20:13:11 +0000 | [diff] [blame] | 24 | bool antiAlias) const SK_OVERRIDE; |
skia.committer@gmail.com | 7475811 | 2013-08-17 07:01:54 +0000 | [diff] [blame] | 25 | |
jvanverth@google.com | 681ccf0 | 2013-08-16 14:51:51 +0000 | [diff] [blame] | 26 | typedef SkTArray<SkPoint, true> PtArray; |
| 27 | typedef SkTArray<int, true> IntArray; |
| 28 | typedef SkTArray<float, true> FloatArray; |
skia.committer@gmail.com | 7475811 | 2013-08-17 07:01:54 +0000 | [diff] [blame] | 29 | |
bsalomon@google.com | aeb2160 | 2011-08-30 18:13:44 +0000 | [diff] [blame] | 30 | protected: |
joshualitt | 9853cce | 2014-11-17 14:22:48 -0800 | [diff] [blame] | 31 | virtual bool onDrawPath(GrDrawTarget*, |
| 32 | GrDrawState*, |
joshualitt | 2e3b3e3 | 2014-12-09 13:31:14 -0800 | [diff] [blame] | 33 | GrColor, |
joshualitt | 9853cce | 2014-11-17 14:22:48 -0800 | [diff] [blame] | 34 | const SkPath&, |
| 35 | const SkStrokeRec&, |
bsalomon@google.com | c2099d2 | 2012-03-02 21:26:50 +0000 | [diff] [blame] | 36 | bool antiAlias) SK_OVERRIDE; |
rmistry@google.com | d6176b0 | 2012-08-23 18:14:13 +0000 | [diff] [blame] | 37 | |
bsalomon@google.com | aeb2160 | 2011-08-30 18:13:44 +0000 | [diff] [blame] | 38 | private: |
bsalomon@google.com | aeb2160 | 2011-08-30 18:13:44 +0000 | [diff] [blame] | 39 | GrAAHairLinePathRenderer(const GrContext* context, |
| 40 | const GrIndexBuffer* fLinesIndexBuffer, |
| 41 | const GrIndexBuffer* fQuadsIndexBuffer); |
| 42 | |
joshualitt | 9853cce | 2014-11-17 14:22:48 -0800 | [diff] [blame] | 43 | bool createLineGeom(GrDrawTarget* target, |
| 44 | GrDrawState*, |
joshualitt | 2e3b3e3 | 2014-12-09 13:31:14 -0800 | [diff] [blame] | 45 | uint8_t coverage, |
joshualitt | 56995b5 | 2014-12-11 15:44:02 -0800 | [diff] [blame] | 46 | size_t vertexStride, |
jvanverth@google.com | 681ccf0 | 2013-08-16 14:51:51 +0000 | [diff] [blame] | 47 | GrDrawTarget::AutoReleaseGeometry* arg, |
joshualitt | 9853cce | 2014-11-17 14:22:48 -0800 | [diff] [blame] | 48 | SkRect* devBounds, |
| 49 | const SkPath& path, |
| 50 | const PtArray& lines, |
| 51 | int lineCnt); |
skia.committer@gmail.com | 7475811 | 2013-08-17 07:01:54 +0000 | [diff] [blame] | 52 | |
joshualitt | 9853cce | 2014-11-17 14:22:48 -0800 | [diff] [blame] | 53 | bool createBezierGeom(GrDrawTarget* target, |
| 54 | GrDrawState*, |
| 55 | GrDrawTarget::AutoReleaseGeometry* arg, |
| 56 | SkRect* devBounds, |
| 57 | const SkPath& path, |
jvanverth@google.com | 681ccf0 | 2013-08-16 14:51:51 +0000 | [diff] [blame] | 58 | const PtArray& quads, |
| 59 | int quadCnt, |
| 60 | const PtArray& conics, |
| 61 | int conicCnt, |
| 62 | const IntArray& qSubdivs, |
joshualitt | 2dd1ae0 | 2014-12-03 06:24:10 -0800 | [diff] [blame] | 63 | const FloatArray& cWeights, |
| 64 | size_t vertexStride); |
bsalomon@google.com | aeb2160 | 2011-08-30 18:13:44 +0000 | [diff] [blame] | 65 | |
bsalomon@google.com | aeb2160 | 2011-08-30 18:13:44 +0000 | [diff] [blame] | 66 | const GrIndexBuffer* fLinesIndexBuffer; |
| 67 | const GrIndexBuffer* fQuadsIndexBuffer; |
| 68 | |
bsalomon@google.com | aeb2160 | 2011-08-30 18:13:44 +0000 | [diff] [blame] | 69 | typedef GrPathRenderer INHERITED; |
| 70 | }; |
| 71 | |
| 72 | |
| 73 | #endif |