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

Side by Side Diff: src/core/SkValue.h

Issue 1605093003: SkValue: improve SkFromValue<T> implementation (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: hal 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 | « no previous file | src/core/SkValue.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 * Copyright 2016 Google Inc. 2 * Copyright 2016 Google Inc.
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 SkValue_DEFINED 8 #ifndef SkValue_DEFINED
9 #define SkValue_DEFINED 9 #define SkValue_DEFINED
10 10
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 uint32_t u32() const; 66 uint32_t u32() const;
67 float f32() const; 67 float f32() const;
68 SkData* bytes() const; 68 SkData* bytes() const;
69 69
70 const uint16_t* u16s(int* count) const; 70 const uint16_t* u16s(int* count) const;
71 const uint32_t* u32s(int* count) const; 71 const uint32_t* u32s(int* count) const;
72 const float* f32s(int* count) const; 72 const float* f32s(int* count) const;
73 73
74 // Object 74 // Object
75 void set(Key, SkValue); 75 void set(Key, SkValue);
76 const SkValue* get(Key) const;
76 void foreach(std::function<void(Key, const SkValue&)>) const; 77 void foreach(std::function<void(Key, const SkValue&)>) const;
77 78
78 // Array 79 // Array
79 size_t length() const; 80 size_t length() const;
80 const SkValue& at(size_t) const; 81 const SkValue& at(size_t) const;
81 void append(SkValue); 82 void append(SkValue);
82 83
83 private: 84 private:
84 class Obj; 85 class Obj;
85 class Arr; 86 class Arr;
(...skipping 21 matching lines...) Expand all
107 template <typename T> const T* asTs(SkValue::Type, int*) const; 108 template <typename T> const T* asTs(SkValue::Type, int*) const;
108 }; 109 };
109 110
110 template <typename T> 111 template <typename T>
111 SkValue SkToValue(const T&); 112 SkValue SkToValue(const T&);
112 113
113 template <typename T> 114 template <typename T>
114 bool SkFromValue(const SkValue&, T*); 115 bool SkFromValue(const SkValue&, T*);
115 116
116 #endif // SkValue_DEFINED 117 #endif // SkValue_DEFINED
OLDNEW
« no previous file with comments | « no previous file | src/core/SkValue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698