blob: 5d00e7e9f139f3ab46c400797f3260e1dd4c744b [file] [log] [blame]
bsalomon@google.comaeb21602011-08-30 18:13:44 +00001
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
14class GrAAHairLinePathRenderer : public GrPathRenderer {
15public:
16 virtual ~GrAAHairLinePathRenderer();
17
18 static GrPathRenderer* Create(GrContext* context);
bsalomon@google.comaeb21602011-08-30 18:13:44 +000019
joshualitt9853cce2014-11-17 14:22:48 -080020 virtual bool canDrawPath(const GrDrawTarget*,
21 const GrDrawState*,
22 const SkPath&,
23 const SkStrokeRec&,
sugoi@google.com12b4e272012-12-06 20:13:11 +000024 bool antiAlias) const SK_OVERRIDE;
skia.committer@gmail.com74758112013-08-17 07:01:54 +000025
jvanverth@google.com681ccf02013-08-16 14:51:51 +000026 typedef SkTArray<SkPoint, true> PtArray;
27 typedef SkTArray<int, true> IntArray;
28 typedef SkTArray<float, true> FloatArray;
skia.committer@gmail.com74758112013-08-17 07:01:54 +000029
bsalomon@google.comaeb21602011-08-30 18:13:44 +000030protected:
joshualitt9853cce2014-11-17 14:22:48 -080031 virtual bool onDrawPath(GrDrawTarget*,
32 GrDrawState*,
joshualitt2e3b3e32014-12-09 13:31:14 -080033 GrColor,
joshualitt9853cce2014-11-17 14:22:48 -080034 const SkPath&,
35 const SkStrokeRec&,
bsalomon@google.comc2099d22012-03-02 21:26:50 +000036 bool antiAlias) SK_OVERRIDE;
rmistry@google.comd6176b02012-08-23 18:14:13 +000037
bsalomon@google.comaeb21602011-08-30 18:13:44 +000038private:
bsalomon@google.comaeb21602011-08-30 18:13:44 +000039 GrAAHairLinePathRenderer(const GrContext* context,
40 const GrIndexBuffer* fLinesIndexBuffer,
41 const GrIndexBuffer* fQuadsIndexBuffer);
42
joshualitt9853cce2014-11-17 14:22:48 -080043 bool createLineGeom(GrDrawTarget* target,
44 GrDrawState*,
joshualitt2e3b3e32014-12-09 13:31:14 -080045 uint8_t coverage,
jvanverth@google.com681ccf02013-08-16 14:51:51 +000046 GrDrawTarget::AutoReleaseGeometry* arg,
joshualitt9853cce2014-11-17 14:22:48 -080047 SkRect* devBounds,
48 const SkPath& path,
49 const PtArray& lines,
50 int lineCnt);
skia.committer@gmail.com74758112013-08-17 07:01:54 +000051
joshualitt9853cce2014-11-17 14:22:48 -080052 bool createBezierGeom(GrDrawTarget* target,
53 GrDrawState*,
54 GrDrawTarget::AutoReleaseGeometry* arg,
55 SkRect* devBounds,
56 const SkPath& path,
jvanverth@google.com681ccf02013-08-16 14:51:51 +000057 const PtArray& quads,
58 int quadCnt,
59 const PtArray& conics,
60 int conicCnt,
61 const IntArray& qSubdivs,
joshualitt2dd1ae02014-12-03 06:24:10 -080062 const FloatArray& cWeights,
63 size_t vertexStride);
bsalomon@google.comaeb21602011-08-30 18:13:44 +000064
bsalomon@google.comaeb21602011-08-30 18:13:44 +000065 const GrIndexBuffer* fLinesIndexBuffer;
66 const GrIndexBuffer* fQuadsIndexBuffer;
67
bsalomon@google.comaeb21602011-08-30 18:13:44 +000068 typedef GrPathRenderer INHERITED;
69};
70
71
72#endif