aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/utils
diff options
context:
space:
mode:
authorGravatar humper@google.com <humper@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-01-14 20:11:00 +0000
committerGravatar humper@google.com <humper@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-01-14 20:11:00 +0000
commit810ae48f82f82d6e7fc4cf78d7a5a69e3cf9f2ed (patch)
treedb1d62ee4a35c990f6c63095a42aa8ab504b108c /include/utils
parent18a48c3c1c1aa183a1b1ab033be34329685199f6 (diff)
move template specializations to inline functions in the header to make windows happy again
BUG= Review URL: https://codereview.appspot.com/7099053 git-svn-id: http://skia.googlecode.com/svn/trunk@7164 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/utils')
-rw-r--r--include/utils/SkRTConf.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/include/utils/SkRTConf.h b/include/utils/SkRTConf.h
index efbd3c5dd3..a02979fef4 100644
--- a/include/utils/SkRTConf.h
+++ b/include/utils/SkRTConf.h
@@ -122,6 +122,42 @@ void SkRTConf<T>::doPrint(char *s) const {
sprintf(s, "%-30.30s", "How do I print myself??");
}
+template<> inline void SkRTConf<bool>::doPrint(char *s) const {
+ char tmp[30];
+ sprintf(tmp, "%s # [%s]", fValue ? "true" : "false", fDefault ? "true" : "false");
+ sprintf(s, "%-30.30s", tmp);
+}
+
+template<> inline void SkRTConf<int>::doPrint(char *s) const {
+ char tmp[30];
+ sprintf(tmp, "%d # [%d]", fValue, fDefault);
+ sprintf(s, "%-30.30s", tmp);
+}
+
+template<> inline void SkRTConf<unsigned int>::doPrint(char *s) const {
+ char tmp[30];
+ sprintf(tmp, "%u # [%u]", fValue, fDefault);
+ sprintf(s, "%-30.30s", tmp);
+}
+
+template<> inline void SkRTConf<float>::doPrint(char *s) const {
+ char tmp[30];
+ sprintf(tmp, "%6.6f # [%6.6f]", fValue, fDefault);
+ sprintf(s, "%-30.30s", tmp);
+}
+
+template<> inline void SkRTConf<double>::doPrint(char *s) const {
+ char tmp[30];
+ sprintf(tmp, "%6.6f # [%6.6f]", fValue, fDefault);
+ sprintf(s, "%-30.30s", tmp);
+}
+
+template<> inline void SkRTConf<const char *>::doPrint(char *s) const {
+ char tmp[30];
+ sprintf(tmp, "%s # [%s]", fValue, fDefault);
+ sprintf(s, "%-30.30s", tmp);
+}
+
template<typename T>
bool SkRTConf<T>::equals(const SkRTConfBase *conf) const {
// static_cast here is okay because there's only one kind of child class.