blob: c5f64f5e8f281aeae119770a1e3fef857a62c037 [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*,
33 const SkPath&,
34 const SkStrokeRec&,
bsalomon@google.comc2099d22012-03-02 21:26:50 +000035 bool antiAlias) SK_OVERRIDE;
rmistry@google.comd6176b02012-08-23 18:14:13 +000036
bsalomon@google.comaeb21602011-08-30 18:13:44 +000037private:
bsalomon@google.comaeb21602011-08-30 18:13:44 +000038 GrAAHairLinePathRenderer(const GrContext* context,
39 const GrIndexBuffer* fLinesIndexBuffer,
40 const GrIndexBuffer* fQuadsIndexBuffer);
41
joshualitt9853cce2014-11-17 14:22:48 -080042 bool createLineGeom(GrDrawTarget* target,
43 GrDrawState*,
jvanverth@google.com681ccf02013-08-16 14:51:51 +000044 GrDrawTarget::AutoReleaseGeometry* arg,
joshualitt9853cce2014-11-17 14:22:48 -080045 SkRect* devBounds,
46 const SkPath& path,
47 const PtArray& lines,
48 int lineCnt);
skia.committer@gmail.com74758112013-08-17 07:01:54 +000049
joshualitt9853cce2014-11-17 14:22:48 -080050 bool createBezierGeom(GrDrawTarget* target,
51 GrDrawState*,
52 GrDrawTarget::AutoReleaseGeometry* arg,
53 SkRect* devBounds,
54 const SkPath& path,
jvanverth@google.com681ccf02013-08-16 14:51:51 +000055 const PtArray& quads,
56 int quadCnt,
57 const PtArray& conics,
58 int conicCnt,
59 const IntArray& qSubdivs,
joshualitt9853cce2014-11-17 14:22:48 -080060 const FloatArray& cWeights);
bsalomon@google.comaeb21602011-08-30 18:13:44 +000061
bsalomon@google.comaeb21602011-08-30 18:13:44 +000062 const GrIndexBuffer* fLinesIndexBuffer;
63 const GrIndexBuffer* fQuadsIndexBuffer;
64
bsalomon@google.comaeb21602011-08-30 18:13:44 +000065 typedef GrPathRenderer INHERITED;
66};
67
68
69#endif