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

Side by Side Diff: include/core/SkString.h

Issue 117053002: remove SK_SCALAR_IS_[FLOAT,FIXED] and assume floats (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years 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 | Annotate | Revision Log
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 SkString_DEFINED 10 #ifndef SkString_DEFINED
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 */ 79 */
80 #define SkStrAppendScalar_MaxSize 15 80 #define SkStrAppendScalar_MaxSize 15
81 81
82 /** 82 /**
83 * Write the scaler in decimal format into buffer, and return a pointer to 83 * Write the scaler in decimal format into buffer, and return a pointer to
84 * the next char after the last one written. Note: a terminating 0 is not 84 * the next char after the last one written. Note: a terminating 0 is not
85 * written into buffer, which must be at least SkStrAppendScalar_MaxSize. 85 * written into buffer, which must be at least SkStrAppendScalar_MaxSize.
86 * Thus if the caller wants to add a 0 at the end, buffer must be at least 86 * Thus if the caller wants to add a 0 at the end, buffer must be at least
87 * SkStrAppendScalar_MaxSize + 1 bytes large. 87 * SkStrAppendScalar_MaxSize + 1 bytes large.
88 */ 88 */
89 #ifdef SK_SCALAR_IS_FLOAT 89 #define SkStrAppendScalar SkStrAppendFloat
90 #define SkStrAppendScalar SkStrAppendFloat
91 #else
92 #define SkStrAppendScalar SkStrAppendFixed
93 #endif
94 90
95 char* SkStrAppendFloat(char buffer[], float); 91 char* SkStrAppendFloat(char buffer[], float);
96 char* SkStrAppendFixed(char buffer[], SkFixed); 92 char* SkStrAppendFixed(char buffer[], SkFixed);
97 93
98 /** \class SkString 94 /** \class SkString
99 95
100 Light weight class for managing strings. Uses reference 96 Light weight class for managing strings. Uses reference
101 counting to make string assignments and copies very fast 97 counting to make string assignments and copies very fast
102 with no extra RAM cost. Assumes UTF8 encoding. 98 with no extra RAM cost. Assumes UTF8 encoding.
103 */ 99 */
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 // Specialized to take advantage of SkString's fast swap path. The unspecialized function is 238 // Specialized to take advantage of SkString's fast swap path. The unspecialized function is
243 // declared in SkTypes.h and called by SkTSort. 239 // declared in SkTypes.h and called by SkTSort.
244 template <> inline void SkTSwap(SkString& a, SkString& b) { 240 template <> inline void SkTSwap(SkString& a, SkString& b) {
245 a.swap(b); 241 a.swap(b);
246 } 242 }
247 243
248 // Split str on any characters in delimiters into out. (Think, strtok with a sa ne API.) 244 // Split str on any characters in delimiters into out. (Think, strtok with a sa ne API.)
249 void SkStrSplit(const char* str, const char* delimiters, SkTArray<SkString>* out ); 245 void SkStrSplit(const char* str, const char* delimiters, SkTArray<SkString>* out );
250 246
251 #endif 247 #endif
OLDNEW
« no previous file with comments | « include/core/SkScalar.h ('k') | include/utils/SkCamera.h » ('j') | src/core/SkCanvas.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698