OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
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 SkFlattenable_DEFINED | 8 #ifndef SkFlattenable_DEFINED |
9 #define SkFlattenable_DEFINED | 9 #define SkFlattenable_DEFINED |
10 | 10 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 | 42 |
43 #define SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(flattenable) \ | 43 #define SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(flattenable) \ |
44 SkFlattenable::Registrar(#flattenable, flattenable::CreateProc, \ | 44 SkFlattenable::Registrar(#flattenable, flattenable::CreateProc, \ |
45 flattenable::GetFlattenableType()); | 45 flattenable::GetFlattenableType()); |
46 | 46 |
47 #define SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(flattenable) \ | 47 #define SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(flattenable) \ |
48 private: \ | 48 private: \ |
49 static SkFlattenable* CreateProc(SkReadBuffer&); \ | 49 static SkFlattenable* CreateProc(SkReadBuffer&); \ |
50 friend class SkPrivateEffectInitializer; \ | 50 friend class SkPrivateEffectInitializer; \ |
51 public: \ | 51 public: \ |
52 virtual Factory getFactory() const SK_OVERRIDE { return CreateProc; } | 52 Factory getFactory() const SK_OVERRIDE { return CreateProc; } |
53 | 53 |
54 /** For SkFlattenable derived objects with a valid type | 54 /** For SkFlattenable derived objects with a valid type |
55 This macro should only be used in base class objects in core | 55 This macro should only be used in base class objects in core |
56 */ | 56 */ |
57 #define SK_DEFINE_FLATTENABLE_TYPE(flattenable) \ | 57 #define SK_DEFINE_FLATTENABLE_TYPE(flattenable) \ |
58 static Type GetFlattenableType() { \ | 58 static Type GetFlattenableType() { \ |
59 return k##flattenable##_Type; \ | 59 return k##flattenable##_Type; \ |
60 } | 60 } |
61 | 61 |
62 /** \class SkFlattenable | 62 /** \class SkFlattenable |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 | 117 |
118 private: | 118 private: |
119 static void InitializeFlattenablesIfNeeded(); | 119 static void InitializeFlattenablesIfNeeded(); |
120 | 120 |
121 friend class SkGraphics; | 121 friend class SkGraphics; |
122 | 122 |
123 typedef SkRefCnt INHERITED; | 123 typedef SkRefCnt INHERITED; |
124 }; | 124 }; |
125 | 125 |
126 #endif | 126 #endif |
OLD | NEW |