aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrSKSLPrettyPrint.cpp
diff options
context:
space:
mode:
authorGravatar Brian Osman <brianosman@google.com>2017-08-14 14:48:10 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-08-14 21:24:55 +0000
commit93ba0a4fc85f04bc1be9429983df1e57473b49a7 (patch)
tree29b75949fdb9d449b28c000ff5f1e18eec19c42f /src/gpu/GrSKSLPrettyPrint.cpp
parentba8275148ab8b10393b053e2586b852796c4afc2 (diff)
Switch SkSL to std::string
On desktop, this saves just over 5% of the time in the SkSL compiler. As written, the code will now build either way, so it's much easier to switch back (or even have some platforms use SkString, if that's ever required). Bug: skia: Change-Id: I634f26a4f6fcb404e59bda6a5c6a21a9c6d73c0b Reviewed-on: https://skia-review.googlesource.com/34381 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
Diffstat (limited to 'src/gpu/GrSKSLPrettyPrint.cpp')
-rw-r--r--src/gpu/GrSKSLPrettyPrint.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/gpu/GrSKSLPrettyPrint.cpp b/src/gpu/GrSKSLPrettyPrint.cpp
index 65175c9b82..cb2da7589c 100644
--- a/src/gpu/GrSKSLPrettyPrint.cpp
+++ b/src/gpu/GrSKSLPrettyPrint.cpp
@@ -5,6 +5,7 @@
* found in the LICENSE file.
*/
#include "GrSKSLPrettyPrint.h"
+#include "SkSLString.h"
namespace GrSKSLPrettyPrint {
@@ -12,7 +13,7 @@ class GLSLPrettyPrint {
public:
GLSLPrettyPrint() {}
- SkString prettify(const char** strings, int* lengths, int count, bool countlines) {
+ SkSL::String prettify(const char** strings, int* lengths, int count, bool countlines) {
fCountlines = countlines;
fTabs = 0;
fLinecount = 1;
@@ -184,7 +185,7 @@ private:
int fTabs, fLinecount;
size_t fIndex, fLength;
const char* fInput;
- SkString fPretty;
+ SkSL::String fPretty;
// Some helpers for parseUntil when we go over a string length
bool fInParseUntilNewline;
@@ -192,7 +193,7 @@ private:
const char* fInParseUntilToken;
};
-SkString PrettyPrint(const char** strings, int* lengths, int count, bool countlines) {
+SkSL::String PrettyPrint(const char** strings, int* lengths, int count, bool countlines) {
GLSLPrettyPrint pp;
return pp.prettify(strings, lengths, count, countlines);
}