blob: 064fc18c92aa8ec24ed65f20c320d249ffb87a41 [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;
jvanverth@google.com5e2d2702013-08-14 14:29:29 +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 GrAAHairLinePathRenderer(const GrContext* context,
33 const GrIndexBuffer* fLinesIndexBuffer,
34 const GrIndexBuffer* fQuadsIndexBuffer);
35
jvanverth@google.com5e2d2702013-08-14 14:29:29 +000036 bool createGeom(const SkPath& path,
37 GrDrawTarget* target,
38 int* lineCnt,
39 int* quadCnt,
40 int* conicCnt,
41 GrDrawTarget::AutoReleaseGeometry* arg,
42 SkRect* devBounds );
bsalomon@google.comaeb21602011-08-30 18:13:44 +000043
bsalomon@google.comaeb21602011-08-30 18:13:44 +000044 const GrIndexBuffer* fLinesIndexBuffer;
45 const GrIndexBuffer* fQuadsIndexBuffer;
46
bsalomon@google.comaeb21602011-08-30 18:13:44 +000047 typedef GrPathRenderer INHERITED;
48};
49
50
51#endif