Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(52)

Side by Side Diff: src/animator/SkMemberInfo.h

Issue 1561683002: Start using <type_traits> and <utility> (C++11). (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix skstd::unique_ptr::compressed_pair. Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « include/private/SkUtility.h ('k') | src/core/SkDraw.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 SkMemberInfo_DEFINED 10 #ifndef SkMemberInfo_DEFINED
11 #define SkMemberInfo_DEFINED 11 #define SkMemberInfo_DEFINED
12 12
13 #if defined SK_BUILD_CONDENSED 13 #if defined SK_BUILD_CONDENSED
14 #define SK_USE_CONDENSED_INFO 0 14 #define SK_USE_CONDENSED_INFO 0
15 #endif 15 #endif
16 16
17 #include "SkDisplayType.h" 17 #include "SkDisplayType.h"
18 #include "SkScript.h" 18 #include "SkScript.h"
19 #include "SkString.h" 19 #include "SkString.h"
20 #include "SkIntArray.h" 20 #include "SkIntArray.h"
21 #include <utility>
21 22
22 class SkAnimateMaker; 23 class SkAnimateMaker;
23 class SkDisplayable; 24 class SkDisplayable;
24 class SkScriptEngine; 25 class SkScriptEngine;
25 26
26 // temporary hacks until name change is more complete 27 // temporary hacks until name change is more complete
27 #define SkFloat SkScalar 28 #define SkFloat SkScalar
28 #define SkInt SkS32 29 #define SkInt SkS32
29 30
30 struct SkMemberInfo { 31 struct SkMemberInfo {
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 // static bool SetValue(void* value, const char* name, SkDisplayTypes , int cou nt); 105 // static bool SetValue(void* value, const char* name, SkDisplayTypes , int cou nt);
105 }; 106 };
106 107
107 #ifndef SK_OFFSETOF 108 #ifndef SK_OFFSETOF
108 // This is offsetof for types which are not standard layout. 109 // This is offsetof for types which are not standard layout.
109 #define SK_OFFSETOF(type, field) (size_t)((char*)&(((type*)1024)->field) - ( char*)1024) 110 #define SK_OFFSETOF(type, field) (size_t)((char*)&(((type*)1024)->field) - ( char*)1024)
110 #endif 111 #endif
111 112
112 #define SK_MEMBER(_member, _type) \ 113 #define SK_MEMBER(_member, _type) \
113 { #_member, SK_OFFSETOF(BASE_CLASS, _member), SkType_##_type, \ 114 { #_member, SK_OFFSETOF(BASE_CLASS, _member), SkType_##_type, \
114 sizeof(skstd::declval<BASE_CLASS>()._member) / sizeof(SkScalar) } 115 sizeof(std::declval<BASE_CLASS>()._member) / sizeof(SkScalar) }
115 116
116 #define SK_MEMBER_ALIAS(_member, _alias, _type) \ 117 #define SK_MEMBER_ALIAS(_member, _alias, _type) \
117 { #_member, SK_OFFSETOF(BASE_CLASS, _alias), SkType_##_type, \ 118 { #_member, SK_OFFSETOF(BASE_CLASS, _alias), SkType_##_type, \
118 sizeof(skstd::declval<BASE_CLASS>()._alias) / sizeof(SkScalar) } 119 sizeof(std::declval<BASE_CLASS>()._alias) / sizeof(SkScalar) }
119 120
120 #define SK_MEMBER_ARRAY(_member, _type) \ 121 #define SK_MEMBER_ARRAY(_member, _type) \
121 { #_member, SK_OFFSETOF(BASE_CLASS, _member), SkType_Array, \ 122 { #_member, SK_OFFSETOF(BASE_CLASS, _member), SkType_Array, \
122 (int) SkType_##_type } 123 (int) SkType_##_type }
123 124
124 #define SK_MEMBER_INHERITED \ 125 #define SK_MEMBER_INHERITED \
125 { (const char*) INHERITED::fInfo, 0, SkType_BaseClassInfo, INHERITED::fInfoC ount } 126 { (const char*) INHERITED::fInfo, 0, SkType_BaseClassInfo, INHERITED::fInfoC ount }
126 127
127 // #define SK_MEMBER_KEY_TYPE(_member, _type) 128 // #define SK_MEMBER_KEY_TYPE(_member, _type)
128 // {#_member, (size_t) -1, SkType_##_type, 0} 129 // {#_member, (size_t) -1, SkType_##_type, 0}
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 #define DECLARE_NO_VIRTUALS_MEMBER_INFO(_type) \ 267 #define DECLARE_NO_VIRTUALS_MEMBER_INFO(_type) \
267 public: \ 268 public: \
268 typedef Sk##_type BASE_CLASS 269 typedef Sk##_type BASE_CLASS
269 270
270 #define DEFINE_GET_MEMBER(_class) 271 #define DEFINE_GET_MEMBER(_class)
271 #define DEFINE_NO_VIRTUALS_GET_MEMBER(_class) 272 #define DEFINE_NO_VIRTUALS_GET_MEMBER(_class)
272 273
273 #endif 274 #endif
274 275
275 #endif // SkMemberInfo_DEFINED 276 #endif // SkMemberInfo_DEFINED
OLDNEW
« no previous file with comments | « include/private/SkUtility.h ('k') | src/core/SkDraw.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698