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 SkMetaData_DEFINED | 10 #ifndef SkMetaData_DEFINED |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 void* v; | 74 void* v; |
75 return this->findPtr(name, &v) && v == value; | 75 return this->findPtr(name, &v) && v == value; |
76 } | 76 } |
77 bool hasBool(const char name[], bool value) const { | 77 bool hasBool(const char name[], bool value) const { |
78 bool v; | 78 bool v; |
79 return this->findBool(name, &v) && v == value; | 79 return this->findBool(name, &v) && v == value; |
80 } | 80 } |
81 bool hasData(const char name[], const void* data, size_t byteCount) const { | 81 bool hasData(const char name[], const void* data, size_t byteCount) const { |
82 size_t len; | 82 size_t len; |
83 const void* ptr = this->findData(name, &len); | 83 const void* ptr = this->findData(name, &len); |
84 return NULL != ptr && len == byteCount && !memcmp(ptr, data, len); | 84 return ptr && len == byteCount && !memcmp(ptr, data, len); |
85 } | 85 } |
86 | 86 |
87 void setS32(const char name[], int32_t value); | 87 void setS32(const char name[], int32_t value); |
88 void setScalar(const char name[], SkScalar value); | 88 void setScalar(const char name[], SkScalar value); |
89 SkScalar* setScalars(const char name[], int count, const SkScalar values[] =
NULL); | 89 SkScalar* setScalars(const char name[], int count, const SkScalar values[] =
NULL); |
90 void setString(const char name[], const char value[]); | 90 void setString(const char name[], const char value[]); |
91 void setPtr(const char name[], void* value, PtrProc proc = NULL); | 91 void setPtr(const char name[], void* value, PtrProc proc = NULL); |
92 void setBool(const char name[], bool value); | 92 void setBool(const char name[], bool value); |
93 // the data is copied from the input pointer. | 93 // the data is copied from the input pointer. |
94 void setData(const char name[], const void* data, size_t byteCount); | 94 void setData(const char name[], const void* data, size_t byteCount); |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 static void Free(Rec*); | 166 static void Free(Rec*); |
167 }; | 167 }; |
168 Rec* fRec; | 168 Rec* fRec; |
169 | 169 |
170 const Rec* find(const char name[], Type) const; | 170 const Rec* find(const char name[], Type) const; |
171 void* set(const char name[], const void* data, size_t len, Type, int count); | 171 void* set(const char name[], const void* data, size_t len, Type, int count); |
172 bool remove(const char name[], Type); | 172 bool remove(const char name[], Type); |
173 }; | 173 }; |
174 | 174 |
175 #endif | 175 #endif |
OLD | NEW |