bsalomon@google.com | aeb2160 | 2011-08-30 18:13:44 +0000 | [diff] [blame] | 1 | |
| 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 | |
| 14 | class GrAAHairLinePathRenderer : public GrPathRenderer { |
| 15 | public: |
| 16 | virtual ~GrAAHairLinePathRenderer(); |
| 17 | |
| 18 | static GrPathRenderer* Create(GrContext* context); |
bsalomon@google.com | aeb2160 | 2011-08-30 18:13:44 +0000 | [diff] [blame] | 19 | |
bsalomon@google.com | c2099d2 | 2012-03-02 21:26:50 +0000 | [diff] [blame^] | 20 | virtual bool canDrawPath(const SkPath& path, |
| 21 | GrPathFill fill, |
| 22 | const GrDrawTarget* target, |
| 23 | bool antiAlias) const SK_OVERRIDE; |
bsalomon@google.com | aeb2160 | 2011-08-30 18:13:44 +0000 | [diff] [blame] | 24 | protected: |
bsalomon@google.com | c2099d2 | 2012-03-02 21:26:50 +0000 | [diff] [blame^] | 25 | virtual bool onDrawPath(const SkPath& path, |
| 26 | GrPathFill fill, |
| 27 | const GrVec* translate, |
| 28 | GrDrawTarget* target, |
| 29 | GrDrawState::StageMask stageMask, |
| 30 | bool antiAlias) SK_OVERRIDE; |
| 31 | |
bsalomon@google.com | aeb2160 | 2011-08-30 18:13:44 +0000 | [diff] [blame] | 32 | private: |
bsalomon@google.com | aeb2160 | 2011-08-30 18:13:44 +0000 | [diff] [blame] | 33 | |
bsalomon@google.com | aeb2160 | 2011-08-30 18:13:44 +0000 | [diff] [blame] | 34 | GrAAHairLinePathRenderer(const GrContext* context, |
| 35 | const GrIndexBuffer* fLinesIndexBuffer, |
| 36 | const GrIndexBuffer* fQuadsIndexBuffer); |
| 37 | |
bsalomon@google.com | c2099d2 | 2012-03-02 21:26:50 +0000 | [diff] [blame^] | 38 | bool createGeom(const SkPath& path, |
| 39 | const GrVec* translate, |
| 40 | GrDrawTarget* target, |
| 41 | GrDrawState::StageMask stageMask, |
| 42 | int* lineCnt, |
| 43 | int* quadCnt); |
bsalomon@google.com | aeb2160 | 2011-08-30 18:13:44 +0000 | [diff] [blame] | 44 | |
bsalomon@google.com | aeb2160 | 2011-08-30 18:13:44 +0000 | [diff] [blame] | 45 | const GrIndexBuffer* fLinesIndexBuffer; |
| 46 | const GrIndexBuffer* fQuadsIndexBuffer; |
| 47 | |
bsalomon@google.com | aeb2160 | 2011-08-30 18:13:44 +0000 | [diff] [blame] | 48 | typedef GrPathRenderer INHERITED; |
| 49 | }; |
| 50 | |
| 51 | |
| 52 | #endif |
| 53 | |