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

Side by Side Diff: src/animator/SkGetCondensedInfo.cpp

Issue 1316233002: Style Change: NULL->nullptr (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-27 (Thursday) 10:25:06 EDT Created 5 years, 3 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 | « src/animator/SkDump.cpp ('k') | src/animator/SkMatrixParts.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 #include "SkMemberInfo.h" 10 #include "SkMemberInfo.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 hi = mid; 46 hi = mid;
47 } 47 }
48 if (gTypeIDs[hi] != type) 48 if (gTypeIDs[hi] != type)
49 return -1; 49 return -1;
50 return hi; 50 return hi;
51 } 51 }
52 52
53 const SkMemberInfo* SkDisplayType::GetMembers(SkAnimateMaker* , SkDisplayTypes t ype, int* infoCountPtr) { 53 const SkMemberInfo* SkDisplayType::GetMembers(SkAnimateMaker* , SkDisplayTypes t ype, int* infoCountPtr) {
54 int lookup = _searchByType(type); 54 int lookup = _searchByType(type);
55 if (lookup < 0) 55 if (lookup < 0)
56 return NULL; 56 return nullptr;
57 if (infoCountPtr) 57 if (infoCountPtr)
58 *infoCountPtr = gInfoCounts[lookup]; 58 *infoCountPtr = gInfoCounts[lookup];
59 return gInfoTables[lookup]; 59 return gInfoTables[lookup];
60 } 60 }
61 61
62 // !!! replace with inline 62 // !!! replace with inline
63 const SkMemberInfo* SkDisplayType::GetMember(SkAnimateMaker* , SkDisplayTypes ty pe, const char** matchPtr ) { 63 const SkMemberInfo* SkDisplayType::GetMember(SkAnimateMaker* , SkDisplayTypes ty pe, const char** matchPtr ) {
64 const SkMemberInfo* info = SkMemberInfo::Find(type, matchPtr); 64 const SkMemberInfo* info = SkMemberInfo::Find(type, matchPtr);
65 SkASSERT(info); 65 SkASSERT(info);
66 return info; 66 return info;
67 } 67 }
68 68
69 static const SkMemberInfo* _lookup(int lookup, const char** matchPtr) { 69 static const SkMemberInfo* _lookup(int lookup, const char** matchPtr) {
70 int count = gInfoCounts[lookup]; 70 int count = gInfoCounts[lookup];
71 const SkMemberInfo* info = gInfoTables[lookup]; 71 const SkMemberInfo* info = gInfoTables[lookup];
72 if (info->fType == SkType_BaseClassInfo) { 72 if (info->fType == SkType_BaseClassInfo) {
73 int baseTypeLookup = info->fOffset; 73 int baseTypeLookup = info->fOffset;
74 const SkMemberInfo* result = _lookup(baseTypeLookup, matchPtr); 74 const SkMemberInfo* result = _lookup(baseTypeLookup, matchPtr);
75 if (result != NULL) 75 if (result != nullptr)
76 return result; 76 return result;
77 if (--count == 0) 77 if (--count == 0)
78 return NULL; 78 return nullptr;
79 info++; 79 info++;
80 } 80 }
81 SkASSERT(info->fType != SkType_BaseClassInfo); 81 SkASSERT(info->fType != SkType_BaseClassInfo);
82 const char* match = *matchPtr; 82 const char* match = *matchPtr;
83 const char* strings = gInfoNames[lookup]; 83 const char* strings = gInfoNames[lookup];
84 int index = _searchByName(&info->fName, count, strings, match); 84 int index = _searchByName(&info->fName, count, strings, match);
85 if (index < 0) 85 if (index < 0)
86 return NULL; 86 return nullptr;
87 return &info[index]; 87 return &info[index];
88 } 88 }
89 89
90 const SkMemberInfo* SkMemberInfo::Find(SkDisplayTypes type, int* index) { 90 const SkMemberInfo* SkMemberInfo::Find(SkDisplayTypes type, int* index) {
91 int count = gInfoCounts[lookup]; 91 int count = gInfoCounts[lookup];
92 const SkMemberInfo* info = gInfoTables[lookup]; 92 const SkMemberInfo* info = gInfoTables[lookup];
93 if (info->fType == SkType_BaseClassInfo) { 93 if (info->fType == SkType_BaseClassInfo) {
94 int baseTypeLookup = info->fOffset; 94 int baseTypeLookup = info->fOffset;
95 const SkMemberInfo* result = Find(baseTypeLookup, index); 95 const SkMemberInfo* result = Find(baseTypeLookup, index);
96 if (result != NULL) 96 if (result != nullptr)
97 return result; 97 return result;
98 if (--count == 0) 98 if (--count == 0)
99 return NULL; 99 return nullptr;
100 info++; 100 info++;
101 } 101 }
102 SkASSERT(info->fType != SkType_BaseClassInfo); 102 SkASSERT(info->fType != SkType_BaseClassInfo);
103 if (*index >= count) { 103 if (*index >= count) {
104 *index -= count; 104 *index -= count;
105 return NULL; 105 return nullptr;
106 } 106 }
107 return &info[index]; 107 return &info[index];
108 } 108 }
109 109
110 const SkMemberInfo* SkMemberInfo::Find(SkDisplayTypes type, const char** matchPt r) { 110 const SkMemberInfo* SkMemberInfo::Find(SkDisplayTypes type, const char** matchPt r) {
111 int lookup = _searchByType(type); 111 int lookup = _searchByType(type);
112 SkASSERT(lookup >= 0); 112 SkASSERT(lookup >= 0);
113 return _lookup(lookup, matchPtr); 113 return _lookup(lookup, matchPtr);
114 } 114 }
115 115
116 const SkMemberInfo* SkMemberInfo::getInherited() const { 116 const SkMemberInfo* SkMemberInfo::getInherited() const {
117 int baseTypeLookup = fOffset; 117 int baseTypeLookup = fOffset;
118 return gInfoTables[baseTypeLookup]; 118 return gInfoTables[baseTypeLookup];
119 } 119 }
120 120
121 #endif 121 #endif
OLDNEW
« no previous file with comments | « src/animator/SkDump.cpp ('k') | src/animator/SkMatrixParts.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698