diff options
author | Ethan Nicholas <ethannicholas@google.com> | 2017-03-30 18:42:48 +0000 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-03-30 18:42:59 +0000 |
commit | bcf35f86d50b784b165de703b404998dd4299f6a (patch) | |
tree | 9fcd85326b1a5dbda864da9431a878bb62f65191 /src/sksl/SkSLString.h | |
parent | 7833466da45bfa1e078427c4a6db94d41c5c1535 (diff) |
Revert "skslc can now be compiled with no Skia dependencies, in preparation for"
This reverts commit 7833466da45bfa1e078427c4a6db94d41c5c1535.
Reason for revert: Vulkan assertion failure
Original change's description:
> skslc can now be compiled with no Skia dependencies, in preparation for
> its eventual role in Skia's build process.
>
> Bug: skia:
> Change-Id: Iaa9933f4fc4a64bec60aa897c509a3513f457a78
> Reviewed-on: https://skia-review.googlesource.com/10282
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
> Reviewed-by: Ben Wagner <benjaminwagner@google.com>
>
TBR=egdaniel@google.com,benjaminwagner@google.com,ethannicholas@google.com,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
Change-Id: Ic64cac2395abb406116885ddd725f74a434c8c49
Reviewed-on: https://skia-review.googlesource.com/10758
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Diffstat (limited to 'src/sksl/SkSLString.h')
-rw-r--r-- | src/sksl/SkSLString.h | 105 |
1 files changed, 0 insertions, 105 deletions
diff --git a/src/sksl/SkSLString.h b/src/sksl/SkSLString.h deleted file mode 100644 index 73ba74643e..0000000000 --- a/src/sksl/SkSLString.h +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright 2017 Google Inc. - * - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - -#ifndef SKSL_STRING -#define SKSL_STRING - - -#ifdef SKSL_STANDALONE - #define SKSL_STRING_BASE std::string - #include <string> -#else - #define SKSL_STRING_BASE SkString - #include "SkString.h" -#endif - -namespace SkSL { - -class String : public SKSL_STRING_BASE { -public: - String() = default; - String(const String&) = default; - String(String&&) = default; - String& operator=(const String&) = default; - String& operator=(String&&) = default; - -#ifndef SKSL_STANDALONE - String(const SkString& s) - : INHERITED(s) {} -#endif - - String(const char* s) - : INHERITED(s) {} - - String(const char* s, size_t size) - : INHERITED(s, size) {} - - static String printf(const char* fmt, ...); - -#ifdef SKSL_STANDALONE - void appendf(const char* fmt, ...); -#endif - void vappendf(const char* fmt, va_list va); - - bool startsWith(const char* s) const; - bool endsWith(const char* s) const; - - String operator+(const char* s) const; - String operator+(const String& s) const; - bool operator==(const char* s) const; - bool operator!=(const char* s) const; - bool operator==(const String& s) const; - bool operator!=(const String& s) const; - friend String operator+(const char* s1, const String& s2); - friend bool operator==(const char* s1, const String& s2); - friend bool operator!=(const char* s1, const String& s2); - -private: - typedef SKSL_STRING_BASE INHERITED; -}; - -String operator+(const char* s1, const String& s2); -bool operator!=(const char* s1, const String& s2); - -String to_string(double value); - -String to_string(int32_t value); - -String to_string(uint32_t value); - -String to_string(int64_t value); - -String to_string(uint64_t value); - -int stoi(String s); - -double stod(String s); - -long stol(String s); - -} // namespace - -#ifdef SKSL_STANDALONE -namespace std { - template<> struct hash<SkSL::String> { - size_t operator()(const SkSL::String& s) const { - return hash<std::string>{}(s); - } - }; -} // namespace -#else -#include "SkOpts.h" -namespace std { - template<> struct hash<SkSL::String> { - size_t operator()(const SkSL::String& s) const { - return SkOpts::hash_fn(s.c_str(), s.size(), 0); - } - }; -} // namespace -#endif // SKIA_STANDALONE - -#endif |