blob: 8bc3e3e804b0cd212e99c2fba9fd56543f18fbe4 [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*,
joshualitt8059eb92014-12-29 15:10:07 -080022 const SkMatrix& viewMatrix,
joshualitt9853cce2014-11-17 14:22:48 -080023 const SkPath&,
24 const SkStrokeRec&,
sugoi@google.com12b4e272012-12-06 20:13:11 +000025 bool antiAlias) const SK_OVERRIDE;
skia.committer@gmail.com74758112013-08-17 07:01:54 +000026
jvanverth@google.com681ccf02013-08-16 14:51:51 +000027 typedef SkTArray<SkPoint, true> PtArray;
28 typedef SkTArray<int, true> IntArray;
29 typedef SkTArray<float, true> FloatArray;
skia.committer@gmail.com74758112013-08-17 07:01:54 +000030
bsalomon@google.comaeb21602011-08-30 18:13:44 +000031protected:
joshualitt9853cce2014-11-17 14:22:48 -080032 virtual bool onDrawPath(GrDrawTarget*,
33 GrDrawState*,
joshualitt2e3b3e32014-12-09 13:31:14 -080034 GrColor,
joshualitt8059eb92014-12-29 15:10:07 -080035 const SkMatrix& viewMatrix,
joshualitt9853cce2014-11-17 14:22:48 -080036 const SkPath&,
37 const SkStrokeRec&,
bsalomon@google.comc2099d22012-03-02 21:26:50 +000038 bool antiAlias) SK_OVERRIDE;
rmistry@google.comd6176b02012-08-23 18:14:13 +000039
bsalomon@google.comaeb21602011-08-30 18:13:44 +000040private:
bsalomon@google.comaeb21602011-08-30 18:13:44 +000041 GrAAHairLinePathRenderer(const GrContext* context,
42 const GrIndexBuffer* fLinesIndexBuffer,
43 const GrIndexBuffer* fQuadsIndexBuffer);
44
joshualitt9853cce2014-11-17 14:22:48 -080045 bool createLineGeom(GrDrawTarget* target,
46 GrDrawState*,
joshualitt8059eb92014-12-29 15:10:07 -080047 const SkMatrix& viewMatrix,
joshualitt2e3b3e32014-12-09 13:31:14 -080048 uint8_t coverage,
joshualitt56995b52014-12-11 15:44:02 -080049 size_t vertexStride,
jvanverth@google.com681ccf02013-08-16 14:51:51 +000050 GrDrawTarget::AutoReleaseGeometry* arg,
joshualitt9853cce2014-11-17 14:22:48 -080051 SkRect* devBounds,
52 const SkPath& path,
53 const PtArray& lines,
54 int lineCnt);
skia.committer@gmail.com74758112013-08-17 07:01:54 +000055
joshualitt9853cce2014-11-17 14:22:48 -080056 bool createBezierGeom(GrDrawTarget* target,
57 GrDrawState*,
joshualitt8059eb92014-12-29 15:10:07 -080058 const SkMatrix& viewMatrix,
joshualitt9853cce2014-11-17 14:22:48 -080059 GrDrawTarget::AutoReleaseGeometry* arg,
60 SkRect* devBounds,
61 const SkPath& path,
jvanverth@google.com681ccf02013-08-16 14:51:51 +000062 const PtArray& quads,
63 int quadCnt,
64 const PtArray& conics,
65 int conicCnt,
66 const IntArray& qSubdivs,
joshualitt2dd1ae02014-12-03 06:24:10 -080067 const FloatArray& cWeights,
68 size_t vertexStride);
bsalomon@google.comaeb21602011-08-30 18:13:44 +000069
bsalomon@google.comaeb21602011-08-30 18:13:44 +000070 const GrIndexBuffer* fLinesIndexBuffer;
71 const GrIndexBuffer* fQuadsIndexBuffer;
72
bsalomon@google.comaeb21602011-08-30 18:13:44 +000073 typedef GrPathRenderer INHERITED;
74};
75
76
77#endif