blob: 20be69674586d16117df3d28b9a13466a00855ca [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
bsalomon@google.comc2099d22012-03-02 21:26:50 +000020 virtual bool canDrawPath(const SkPath& path,
sugoi@google.com5f74cf82012-12-17 21:16:45 +000021 const SkStrokeRec& stroke,
sugoi@google.com12b4e272012-12-06 20:13:11 +000022 const GrDrawTarget* target,
23 bool antiAlias) const SK_OVERRIDE;
robertphillips@google.comfa662942012-05-17 12:20:22 +000024
bsalomon@google.comaeb21602011-08-30 18:13:44 +000025protected:
bsalomon@google.comc2099d22012-03-02 21:26:50 +000026 virtual bool onDrawPath(const SkPath& path,
sugoi@google.com5f74cf82012-12-17 21:16:45 +000027 const SkStrokeRec& stroke,
bsalomon@google.comc2099d22012-03-02 21:26:50 +000028 GrDrawTarget* target,
bsalomon@google.comc2099d22012-03-02 21:26:50 +000029 bool antiAlias) SK_OVERRIDE;
rmistry@google.comd6176b02012-08-23 18:14:13 +000030
bsalomon@google.comaeb21602011-08-30 18:13:44 +000031private:
bsalomon@google.comaeb21602011-08-30 18:13:44 +000032
bsalomon@google.comaeb21602011-08-30 18:13:44 +000033 GrAAHairLinePathRenderer(const GrContext* context,
34 const GrIndexBuffer* fLinesIndexBuffer,
35 const GrIndexBuffer* fQuadsIndexBuffer);
36
bsalomon@google.comc2099d22012-03-02 21:26:50 +000037 bool createGeom(const SkPath& path,
bsalomon@google.comc2099d22012-03-02 21:26:50 +000038 GrDrawTarget* target,
bsalomon@google.comc2099d22012-03-02 21:26:50 +000039 int* lineCnt,
bsalomon@google.comb3729422012-03-07 19:13:28 +000040 int* quadCnt,
41 GrDrawTarget::AutoReleaseGeometry* arg);
bsalomon@google.comaeb21602011-08-30 18:13:44 +000042
bsalomon@google.comaeb21602011-08-30 18:13:44 +000043 const GrIndexBuffer* fLinesIndexBuffer;
44 const GrIndexBuffer* fQuadsIndexBuffer;
45
bsalomon@google.comaeb21602011-08-30 18:13:44 +000046 typedef GrPathRenderer INHERITED;
47};
48
49
50#endif
51