blob: e45fa351fb343ca00f7a42cbe1c3a59d19562fe9 [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
25 static bool staticCanDrawPath(const SkPath& path,
26 GrPathFill fill,
27 const GrDrawTarget* target,
28 bool antiAlias);
29
bsalomon@google.comaeb21602011-08-30 18:13:44 +000030protected:
bsalomon@google.comc2099d22012-03-02 21:26:50 +000031 virtual bool onDrawPath(const SkPath& path,
32 GrPathFill fill,
33 const GrVec* translate,
34 GrDrawTarget* target,
35 GrDrawState::StageMask stageMask,
36 bool antiAlias) SK_OVERRIDE;
37
bsalomon@google.comaeb21602011-08-30 18:13:44 +000038private:
bsalomon@google.comaeb21602011-08-30 18:13:44 +000039
bsalomon@google.comaeb21602011-08-30 18:13:44 +000040 GrAAHairLinePathRenderer(const GrContext* context,
41 const GrIndexBuffer* fLinesIndexBuffer,
42 const GrIndexBuffer* fQuadsIndexBuffer);
43
bsalomon@google.comc2099d22012-03-02 21:26:50 +000044 bool createGeom(const SkPath& path,
45 const GrVec* translate,
46 GrDrawTarget* target,
47 GrDrawState::StageMask stageMask,
48 int* lineCnt,
bsalomon@google.comb3729422012-03-07 19:13:28 +000049 int* quadCnt,
50 GrDrawTarget::AutoReleaseGeometry* arg);
bsalomon@google.comaeb21602011-08-30 18:13:44 +000051
bsalomon@google.comaeb21602011-08-30 18:13:44 +000052 const GrIndexBuffer* fLinesIndexBuffer;
53 const GrIndexBuffer* fQuadsIndexBuffer;
54
bsalomon@google.comaeb21602011-08-30 18:13:44 +000055 typedef GrPathRenderer INHERITED;
56};
57
58
59#endif
60