OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 GrPathRange_DEFINED | 8 #ifndef GrPathRange_DEFINED |
9 #define GrPathRange_DEFINED | 9 #define GrPathRange_DEFINED |
10 | 10 |
11 #include "GrGpuResource.h" | 11 #include "GrGpuResource.h" |
12 #include "SkRefCnt.h" | 12 #include "SkRefCnt.h" |
13 #include "SkStrokeRec.h" | 13 #include "SkStrokeRec.h" |
14 #include "SkTArray.h" | 14 #include "SkTArray.h" |
15 | 15 |
16 class SkPath; | 16 class SkPath; |
17 class SkDescriptor; | 17 class SkDescriptor; |
18 | 18 |
19 /** | 19 /** |
20 * Represents a contiguous range of GPU path objects, all with a common stroke. | 20 * Represents a contiguous range of GPU path objects, all with a common stroke. |
21 * This object is immutable with the exception that individual paths may be | 21 * This object is immutable with the exception that individual paths may be |
22 * initialized lazily. | 22 * initialized lazily. |
23 */ | 23 */ |
24 | 24 |
25 class GrPathRange : public GrGpuResource { | 25 class GrPathRange : public GrGpuResource { |
26 public: | 26 public: |
27 SK_DECLARE_INST_COUNT(GrPathRange); | 27 SK_DECLARE_INST_COUNT(GrPathRange); |
28 | 28 |
29 static const bool kIsWrapped = false; | |
30 | |
31 enum PathIndexType { | 29 enum PathIndexType { |
32 kU8_PathIndexType, //!< uint8_t | 30 kU8_PathIndexType, //!< uint8_t |
33 kU16_PathIndexType, //!< uint16_t | 31 kU16_PathIndexType, //!< uint16_t |
34 kU32_PathIndexType, //!< uint32_t | 32 kU32_PathIndexType, //!< uint32_t |
35 | 33 |
36 kLast_PathIndexType = kU32_PathIndexType | 34 kLast_PathIndexType = kU32_PathIndexType |
37 }; | 35 }; |
38 | 36 |
39 static inline int PathIndexSizeInBytes(PathIndexType type) { | 37 static inline int PathIndexSizeInBytes(PathIndexType type) { |
40 GR_STATIC_ASSERT(0 == kU8_PathIndexType); | 38 GR_STATIC_ASSERT(0 == kU8_PathIndexType); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 | 88 |
91 mutable SkAutoTUnref<PathGenerator> fPathGenerator; | 89 mutable SkAutoTUnref<PathGenerator> fPathGenerator; |
92 mutable SkTArray<uint8_t, true /*MEM_COPY*/> fGeneratedPaths; | 90 mutable SkTArray<uint8_t, true /*MEM_COPY*/> fGeneratedPaths; |
93 const int fNumPaths; | 91 const int fNumPaths; |
94 const SkStrokeRec fStroke; | 92 const SkStrokeRec fStroke; |
95 | 93 |
96 typedef GrGpuResource INHERITED; | 94 typedef GrGpuResource INHERITED; |
97 }; | 95 }; |
98 | 96 |
99 #endif | 97 #endif |
OLD | NEW |