blob: 22cc876eab82755ab7f843191d7d4b456267f6e8 [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
robertphillips@google.come79f3202014-02-11 16:30:21 +000020 virtual bool canDrawPath(const SkPath& path,
21 const SkStrokeRec& stroke,
sugoi@google.com12b4e272012-12-06 20:13:11 +000022 const GrDrawTarget* target,
23 bool antiAlias) const SK_OVERRIDE;
skia.committer@gmail.com74758112013-08-17 07:01:54 +000024
jvanverth@google.com681ccf02013-08-16 14:51:51 +000025 typedef SkTArray<SkPoint, true> PtArray;
26 typedef SkTArray<int, true> IntArray;
27 typedef SkTArray<float, true> FloatArray;
skia.committer@gmail.com74758112013-08-17 07:01:54 +000028
bsalomon@google.comaeb21602011-08-30 18:13:44 +000029protected:
robertphillips@google.come79f3202014-02-11 16:30:21 +000030 virtual bool onDrawPath(const SkPath& path,
31 const SkStrokeRec& stroke,
bsalomon@google.comc2099d22012-03-02 21:26:50 +000032 GrDrawTarget* target,
bsalomon@google.comc2099d22012-03-02 21:26:50 +000033 bool antiAlias) SK_OVERRIDE;
rmistry@google.comd6176b02012-08-23 18:14:13 +000034
bsalomon@google.comaeb21602011-08-30 18:13:44 +000035private:
bsalomon@google.comaeb21602011-08-30 18:13:44 +000036 GrAAHairLinePathRenderer(const GrContext* context,
37 const GrIndexBuffer* fLinesIndexBuffer,
38 const GrIndexBuffer* fQuadsIndexBuffer);
39
jvanverth@google.com681ccf02013-08-16 14:51:51 +000040 bool createLineGeom(const SkPath& path,
41 GrDrawTarget* target,
42 const PtArray& lines,
43 int lineCnt,
44 GrDrawTarget::AutoReleaseGeometry* arg,
45 SkRect* devBounds);
skia.committer@gmail.com74758112013-08-17 07:01:54 +000046
jvanverth@google.com681ccf02013-08-16 14:51:51 +000047 bool createBezierGeom(const SkPath& path,
48 GrDrawTarget* target,
49 const PtArray& quads,
50 int quadCnt,
51 const PtArray& conics,
52 int conicCnt,
53 const IntArray& qSubdivs,
54 const FloatArray& cWeights,
55 GrDrawTarget::AutoReleaseGeometry* arg,
56 SkRect* devBounds);
bsalomon@google.comaeb21602011-08-30 18:13:44 +000057
bsalomon@google.comaeb21602011-08-30 18:13:44 +000058 const GrIndexBuffer* fLinesIndexBuffer;
59 const GrIndexBuffer* fQuadsIndexBuffer;
60
bsalomon@google.comaeb21602011-08-30 18:13:44 +000061 typedef GrPathRenderer INHERITED;
62};
63
64
65#endif