| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 | 9 |
| 10 #ifndef SkFlattenable_DEFINED | 10 #ifndef SkFlattenable_DEFINED |
| 11 #define SkFlattenable_DEFINED | 11 #define SkFlattenable_DEFINED |
| 12 | 12 |
| 13 #include "SkRefCnt.h" | 13 #include "SkRefCnt.h" |
| 14 | 14 |
| 15 class SkFlattenableReadBuffer; | 15 class SkFlattenableReadBuffer; |
| 16 class SkFlattenableWriteBuffer; | 16 class SkFlattenableWriteBuffer; |
| 17 | 17 |
| 18 #define SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(flattenable) \ | 18 #define SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(flattenable) \ |
| 19 SkFlattenable::Registrar(#flattenable, flattenable::CreateProc); | 19 SkFlattenable::Registrar(#flattenable, flattenable::CreateProc); |
| 20 | 20 |
| 21 #define SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP() static void InitializeFlattenab
les(); | 21 #define SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP() static void InitializeFlattenab
les(); |
| 22 | 22 |
| 23 #define SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(flattenable) \ | 23 #define SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(flattenable) \ |
| 24 void flattenable::InitializeFlattenables() { | 24 void flattenable::InitializeFlattenables() { |
| 25 | 25 |
| 26 #define SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END \ | 26 #define SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END \ |
| 27 } | 27 } |
| 28 | 28 |
| 29 #define SK_DECLARE_UNFLATTENABLE_OBJECT() \ | 29 #define SK_DECLARE_UNFLATTENABLE_OBJECT() \ |
| 30 virtual Factory getFactory() SK_OVERRIDE { return NULL; }; \ | 30 virtual Factory getFactory() SK_OVERRIDE { return NULL; } |
| 31 | 31 |
| 32 #define SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(flattenable) \ | 32 #define SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(flattenable) \ |
| 33 virtual Factory getFactory() SK_OVERRIDE { return CreateProc; } \ | 33 virtual Factory getFactory() SK_OVERRIDE { return CreateProc; } \ |
| 34 static SkFlattenable* CreateProc(SkFlattenableReadBuffer& buffer) { \ | 34 static SkFlattenable* CreateProc(SkFlattenableReadBuffer& buffer) { \ |
| 35 return SkNEW_ARGS(flattenable, (buffer)); \ | 35 return SkNEW_ARGS(flattenable, (buffer)); \ |
| 36 } | 36 } |
| 37 | 37 |
| 38 /** \class SkFlattenable | 38 /** \class SkFlattenable |
| 39 | 39 |
| 40 SkFlattenable is the base class for objects that need to be flattened | 40 SkFlattenable is the base class for objects that need to be flattened |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 private: | 77 private: |
| 78 static void InitializeFlattenables(); | 78 static void InitializeFlattenables(); |
| 79 | 79 |
| 80 friend class SkGraphics; | 80 friend class SkGraphics; |
| 81 friend class SkFlattenableWriteBuffer; | 81 friend class SkFlattenableWriteBuffer; |
| 82 | 82 |
| 83 typedef SkRefCnt INHERITED; | 83 typedef SkRefCnt INHERITED; |
| 84 }; | 84 }; |
| 85 | 85 |
| 86 #endif | 86 #endif |
| OLD | NEW |