| 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 GrAADistanceFieldPathRenderer_DEFINED | 8 #ifndef GrAADistanceFieldPathRenderer_DEFINED |
| 9 #define GrAADistanceFieldPathRenderer_DEFINED | 9 #define GrAADistanceFieldPathRenderer_DEFINED |
| 10 | 10 |
| 11 #include "GrBatchAtlas.h" | 11 #include "GrBatchAtlas.h" |
| 12 #include "GrPathRenderer.h" | 12 #include "GrPathRenderer.h" |
| 13 #include "GrRect.h" | 13 #include "GrRect.h" |
| 14 #include "GrShape.h" | 14 #include "GrShape.h" |
| 15 | 15 |
| 16 #include "SkChecksum.h" | 16 #include "SkOpts.h" |
| 17 #include "SkTDynamicHash.h" | 17 #include "SkTDynamicHash.h" |
| 18 | 18 |
| 19 class GrContext; | 19 class GrContext; |
| 20 | 20 |
| 21 class GrAADistanceFieldPathRenderer : public GrPathRenderer { | 21 class GrAADistanceFieldPathRenderer : public GrPathRenderer { |
| 22 public: | 22 public: |
| 23 GrAADistanceFieldPathRenderer(); | 23 GrAADistanceFieldPathRenderer(); |
| 24 virtual ~GrAADistanceFieldPathRenderer(); | 24 virtual ~GrAADistanceFieldPathRenderer(); |
| 25 | 25 |
| 26 private: | 26 private: |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 GrBatchAtlas::AtlasID fID; | 74 GrBatchAtlas::AtlasID fID; |
| 75 SkRect fBounds; | 75 SkRect fBounds; |
| 76 SkIPoint16 fAtlasLocation; | 76 SkIPoint16 fAtlasLocation; |
| 77 SK_DECLARE_INTERNAL_LLIST_INTERFACE(ShapeData); | 77 SK_DECLARE_INTERNAL_LLIST_INTERFACE(ShapeData); |
| 78 | 78 |
| 79 static inline const Key& GetKey(const ShapeData& data) { | 79 static inline const Key& GetKey(const ShapeData& data) { |
| 80 return data.fKey; | 80 return data.fKey; |
| 81 } | 81 } |
| 82 | 82 |
| 83 static inline uint32_t Hash(Key key) { | 83 static inline uint32_t Hash(Key key) { |
| 84 return SkChecksum::Murmur3(key.data(), sizeof(uint32_t) * key.count3
2()); | 84 return SkOpts::hash(key.data(), sizeof(uint32_t) * key.count32()); |
| 85 } | 85 } |
| 86 }; | 86 }; |
| 87 | 87 |
| 88 static void HandleEviction(GrBatchAtlas::AtlasID, void*); | 88 static void HandleEviction(GrBatchAtlas::AtlasID, void*); |
| 89 | 89 |
| 90 typedef SkTDynamicHash<ShapeData, ShapeData::Key> ShapeCache; | 90 typedef SkTDynamicHash<ShapeData, ShapeData::Key> ShapeCache; |
| 91 typedef SkTInternalLList<ShapeData> ShapeDataList; | 91 typedef SkTInternalLList<ShapeData> ShapeDataList; |
| 92 | 92 |
| 93 GrBatchAtlas* fAtlas; | 93 GrBatchAtlas* fAtlas; |
| 94 ShapeCache fShapeCache; | 94 ShapeCache fShapeCache; |
| 95 ShapeDataList fShapeList; | 95 ShapeDataList fShapeList; |
| 96 | 96 |
| 97 typedef GrPathRenderer INHERITED; | 97 typedef GrPathRenderer INHERITED; |
| 98 | 98 |
| 99 friend class AADistanceFieldPathBatch; | 99 friend class AADistanceFieldPathBatch; |
| 100 friend struct PathTestStruct; | 100 friend struct PathTestStruct; |
| 101 }; | 101 }; |
| 102 | 102 |
| 103 #endif | 103 #endif |
| OLD | NEW |