aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkString.h
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-05-06 13:53:47 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-05-06 13:53:47 +0000
commitfc296295257a9300098df56a1e3975580e13d329 (patch)
tree2e12a889f19db25d5bfb8fe865e1a84cac80938c /include/core/SkString.h
parent0292935cd4cdad59d6151acdadb00a77e1945cd9 (diff)
Replace GrStringBuilder with SkString. First step in cleaning up the shader generator. Slight performance hit when creating a new shader (<10% of total shader gen time on my Windows box is spent in building our string before handing it to GL). Much of this can be recovered by better usage pattern of SkString in coming revisions.
Review URL: http://codereview.appspot.com/4465053/ git-svn-id: http://skia.googlecode.com/svn/trunk@1266 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/core/SkString.h')
-rw-r--r--include/core/SkString.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/core/SkString.h b/include/core/SkString.h
index 38604dd375..0295b7536d 100644
--- a/include/core/SkString.h
+++ b/include/core/SkString.h
@@ -99,6 +99,7 @@ public:
// these methods edit the string
SkString& operator=(const SkString&);
+ SkString& operator=(const char text[]);
char* writable_str();
char& operator[](size_t n) { return this->writable_str()[n]; }
@@ -144,6 +145,10 @@ public:
void remove(size_t offset, size_t length);
+ SkString& operator+=(const SkString& s) { this->append(s); return *this; }
+ SkString& operator+=(const char text[]) { this->append(text); return *this; }
+ SkString& operator+=(const char c) { this->append(&c, 1); return *this; }
+
/**
* Swap contents between this and other. This function is guaranteed
* to never fail or throw.