OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef GrPath_DEFINED | 8 #ifndef GrPath_DEFINED |
9 #define GrPath_DEFINED | 9 #define GrPath_DEFINED |
10 | 10 |
11 #include "GrGpuResource.h" | 11 #include "GrGpuResource.h" |
| 12 #include "GrStrokeInfo.h" |
12 #include "GrPathRendering.h" | 13 #include "GrPathRendering.h" |
13 #include "GrStyle.h" | |
14 #include "SkPath.h" | 14 #include "SkPath.h" |
15 #include "SkRect.h" | 15 #include "SkRect.h" |
16 | 16 |
17 class GrPath : public GrGpuResource { | 17 class GrPath : public GrGpuResource { |
18 public: | 18 public: |
19 /** | 19 /** |
20 * Initialize to a path with a fixed stroke. Stroke must not be hairline. | 20 * Initialize to a path with a fixed stroke. Stroke must not be hairline. |
21 */ | 21 */ |
22 GrPath(GrGpu* gpu, const SkPath& skPath, const GrStyle& style) | 22 GrPath(GrGpu* gpu, const SkPath& skPath, const GrStrokeInfo& stroke) |
23 : INHERITED(gpu) | 23 : INHERITED(gpu) |
24 , fBounds(SkRect::MakeEmpty()) | 24 , fBounds(SkRect::MakeEmpty()) |
25 , fFillType(GrPathRendering::kWinding_FillType) | 25 , fFillType(GrPathRendering::kWinding_FillType) |
26 #ifdef SK_DEBUG | 26 #ifdef SK_DEBUG |
27 , fSkPath(skPath) | 27 , fSkPath(skPath) |
28 , fStyle(style) | 28 , fStroke(stroke) |
29 #endif | 29 #endif |
30 { | 30 { |
31 } | 31 } |
32 | 32 |
33 static void ComputeKey(const SkPath& path, const GrStyle& style, GrUniqueKey
* key, | 33 static void ComputeKey(const SkPath& path, const GrStrokeInfo& stroke, GrUni
queKey* key, |
34 bool* outIsVolatile); | 34 bool* outIsVolatile); |
35 | 35 |
36 const SkRect& getBounds() const { return fBounds; } | 36 const SkRect& getBounds() const { return fBounds; } |
37 | 37 |
38 GrPathRendering::FillType getFillType() const { return fFillType; } | 38 GrPathRendering::FillType getFillType() const { return fFillType; } |
39 #ifdef SK_DEBUG | 39 #ifdef SK_DEBUG |
40 bool isEqualTo(const SkPath& path, const GrStyle& style) const; | 40 bool isEqualTo(const SkPath& path, const GrStrokeInfo& stroke) const; |
41 #endif | 41 #endif |
42 | 42 |
43 protected: | 43 protected: |
44 // Subclass should init these. | 44 // Subclass should init these. |
45 SkRect fBounds; | 45 SkRect fBounds; |
46 GrPathRendering::FillType fFillType; | 46 GrPathRendering::FillType fFillType; |
47 #ifdef SK_DEBUG | 47 #ifdef SK_DEBUG |
48 SkPath fSkPath; | 48 SkPath fSkPath; |
49 GrStyle fStyle; | 49 GrStrokeInfo fStroke; |
50 #endif | 50 #endif |
51 | 51 |
52 private: | 52 private: |
53 typedef GrGpuResource INHERITED; | 53 typedef GrGpuResource INHERITED; |
54 }; | 54 }; |
55 | 55 |
56 #endif | 56 #endif |
OLD | NEW |