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*, |
| 33 | const SkPath&, |
| 34 | const SkStrokeRec&, |
bsalomon@google.com | c2099d2 | 2012-03-02 21:26:50 +0000 | [diff] [blame] | 35 | bool antiAlias) SK_OVERRIDE; |
rmistry@google.com | d6176b0 | 2012-08-23 18:14:13 +0000 | [diff] [blame] | 36 | |
bsalomon@google.com | aeb2160 | 2011-08-30 18:13:44 +0000 | [diff] [blame] | 37 | private: |
bsalomon@google.com | aeb2160 | 2011-08-30 18:13:44 +0000 | [diff] [blame] | 38 | GrAAHairLinePathRenderer(const GrContext* context, |
| 39 | const GrIndexBuffer* fLinesIndexBuffer, |
| 40 | const GrIndexBuffer* fQuadsIndexBuffer); |
| 41 | |
joshualitt | 9853cce | 2014-11-17 14:22:48 -0800 | [diff] [blame] | 42 | bool createLineGeom(GrDrawTarget* target, |
| 43 | GrDrawState*, |
jvanverth@google.com | 681ccf0 | 2013-08-16 14:51:51 +0000 | [diff] [blame] | 44 | GrDrawTarget::AutoReleaseGeometry* arg, |
joshualitt | 9853cce | 2014-11-17 14:22:48 -0800 | [diff] [blame] | 45 | SkRect* devBounds, |
| 46 | const SkPath& path, |
| 47 | const PtArray& lines, |
| 48 | int lineCnt); |
skia.committer@gmail.com | 7475811 | 2013-08-17 07:01:54 +0000 | [diff] [blame] | 49 | |
joshualitt | 9853cce | 2014-11-17 14:22:48 -0800 | [diff] [blame] | 50 | bool createBezierGeom(GrDrawTarget* target, |
| 51 | GrDrawState*, |
| 52 | GrDrawTarget::AutoReleaseGeometry* arg, |
| 53 | SkRect* devBounds, |
| 54 | const SkPath& path, |
jvanverth@google.com | 681ccf0 | 2013-08-16 14:51:51 +0000 | [diff] [blame] | 55 | const PtArray& quads, |
| 56 | int quadCnt, |
| 57 | const PtArray& conics, |
| 58 | int conicCnt, |
| 59 | const IntArray& qSubdivs, |
joshualitt | 2dd1ae0 | 2014-12-03 06:24:10 -0800 | [diff] [blame^] | 60 | const FloatArray& cWeights, |
| 61 | size_t vertexStride); |
bsalomon@google.com | aeb2160 | 2011-08-30 18:13:44 +0000 | [diff] [blame] | 62 | |
bsalomon@google.com | aeb2160 | 2011-08-30 18:13:44 +0000 | [diff] [blame] | 63 | const GrIndexBuffer* fLinesIndexBuffer; |
| 64 | const GrIndexBuffer* fQuadsIndexBuffer; |
| 65 | |
bsalomon@google.com | aeb2160 | 2011-08-30 18:13:44 +0000 | [diff] [blame] | 66 | typedef GrPathRenderer INHERITED; |
| 67 | }; |
| 68 | |
| 69 | |
| 70 | #endif |