blob: c04d0626cadc5ad28a7474b3da1b1752c9c8dba1 [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,
21 GrPathFill fill,
22 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,
27 GrPathFill fill,
28 const GrVec* translate,
29 GrDrawTarget* target,
bsalomon@google.comc2099d22012-03-02 21:26:50 +000030 bool antiAlias) SK_OVERRIDE;
rmistry@google.comd6176b02012-08-23 18:14:13 +000031
bsalomon@google.comaeb21602011-08-30 18:13:44 +000032private:
bsalomon@google.comaeb21602011-08-30 18:13:44 +000033
bsalomon@google.comaeb21602011-08-30 18:13:44 +000034 GrAAHairLinePathRenderer(const GrContext* context,
35 const GrIndexBuffer* fLinesIndexBuffer,
36 const GrIndexBuffer* fQuadsIndexBuffer);
37
bsalomon@google.comc2099d22012-03-02 21:26:50 +000038 bool createGeom(const SkPath& path,
39 const GrVec* translate,
40 GrDrawTarget* target,
bsalomon@google.comc2099d22012-03-02 21:26:50 +000041 int* lineCnt,
bsalomon@google.comb3729422012-03-07 19:13:28 +000042 int* quadCnt,
43 GrDrawTarget::AutoReleaseGeometry* arg);
bsalomon@google.comaeb21602011-08-30 18:13:44 +000044
bsalomon@google.comaeb21602011-08-30 18:13:44 +000045 const GrIndexBuffer* fLinesIndexBuffer;
46 const GrIndexBuffer* fQuadsIndexBuffer;
47
bsalomon@google.comaeb21602011-08-30 18:13:44 +000048 typedef GrPathRenderer INHERITED;
49};
50
51
52#endif
53