blob: 627474abdba0b871d21688392206a82605174736 [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.com3e0c64a2014-02-10 16:46:23 +000020 virtual bool canDrawPath(const SkStrokeRec& stroke,
sugoi@google.com12b4e272012-12-06 20:13:11 +000021 const GrDrawTarget* target,
22 bool antiAlias) const SK_OVERRIDE;
skia.committer@gmail.com74758112013-08-17 07:01:54 +000023
jvanverth@google.com681ccf02013-08-16 14:51:51 +000024 typedef SkTArray<SkPoint, true> PtArray;
25 typedef SkTArray<int, true> IntArray;
26 typedef SkTArray<float, true> FloatArray;
skia.committer@gmail.com74758112013-08-17 07:01:54 +000027
bsalomon@google.comaeb21602011-08-30 18:13:44 +000028protected:
robertphillips@google.com3e0c64a2014-02-10 16:46:23 +000029 virtual bool onDrawPath(const SkStrokeRec& stroke,
bsalomon@google.comc2099d22012-03-02 21:26:50 +000030 GrDrawTarget* target,
bsalomon@google.comc2099d22012-03-02 21:26:50 +000031 bool antiAlias) SK_OVERRIDE;
rmistry@google.comd6176b02012-08-23 18:14:13 +000032
bsalomon@google.comaeb21602011-08-30 18:13:44 +000033private:
bsalomon@google.comaeb21602011-08-30 18:13:44 +000034 GrAAHairLinePathRenderer(const GrContext* context,
35 const GrIndexBuffer* fLinesIndexBuffer,
36 const GrIndexBuffer* fQuadsIndexBuffer);
37
jvanverth@google.com681ccf02013-08-16 14:51:51 +000038 bool createLineGeom(const SkPath& path,
39 GrDrawTarget* target,
40 const PtArray& lines,
41 int lineCnt,
42 GrDrawTarget::AutoReleaseGeometry* arg,
43 SkRect* devBounds);
skia.committer@gmail.com74758112013-08-17 07:01:54 +000044
jvanverth@google.com681ccf02013-08-16 14:51:51 +000045 bool createBezierGeom(const SkPath& path,
46 GrDrawTarget* target,
47 const PtArray& quads,
48 int quadCnt,
49 const PtArray& conics,
50 int conicCnt,
51 const IntArray& qSubdivs,
52 const FloatArray& cWeights,
53 GrDrawTarget::AutoReleaseGeometry* arg,
54 SkRect* devBounds);
bsalomon@google.comaeb21602011-08-30 18:13:44 +000055
bsalomon@google.comaeb21602011-08-30 18:13:44 +000056 const GrIndexBuffer* fLinesIndexBuffer;
57 const GrIndexBuffer* fQuadsIndexBuffer;
58
bsalomon@google.comaeb21602011-08-30 18:13:44 +000059 typedef GrPathRenderer INHERITED;
60};
61
62
63#endif