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

Unified Diff: include/core/SkString.h

Issue 1288723002: Added mangleString member and onBefore*, onAfter* functions to GrGLFragmentShaderBuilder (Closed) Base URL: https://skia.googlesource.com/skia@cs3_flatten
Patch Set: Added a missing brace Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/gpu/GrProcessor.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkString.h
diff --git a/include/core/SkString.h b/include/core/SkString.h
index e0a51c6515a59ffb511747e0c16be64f81a74054..ea73e0982389eba2e2fcf050b2485f608ea3c9a9 100644
--- a/include/core/SkString.h
+++ b/include/core/SkString.h
@@ -39,6 +39,12 @@ static int SkStrFind(const char string[], const char substring[]) {
return SkToS32(first - &string[0]);
}
+static int SkStrFindLastOf(const char string[], const char subchar) {
+ const char* last = strrchr(string, subchar);
+ if (NULL == last) return -1;
+ return SkToS32(last - &string[0]);
+}
+
static bool SkStrContains(const char string[], const char substring[]) {
SkASSERT(string);
SkASSERT(substring);
@@ -152,6 +158,9 @@ public:
int find(const char substring[]) const {
return SkStrFind(fRec->data(), substring);
}
+ int findLastOf(const char subchar) const {
+ return SkStrFindLastOf(fRec->data(), subchar);
+ }
friend bool operator==(const SkString& a, const SkString& b) {
return a.equals(b);
« no previous file with comments | « no previous file | src/gpu/GrProcessor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698