aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
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 /src
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 'src')
-rw-r--r--src/core/SkString.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/core/SkString.cpp b/src/core/SkString.cpp
index 49182ea77c..f461a7a44a 100644
--- a/src/core/SkString.cpp
+++ b/src/core/SkString.cpp
@@ -317,6 +317,15 @@ SkString& SkString::operator=(const SkString& src) {
return *this;
}
+SkString& SkString::operator=(const char text[]) {
+ this->validate();
+
+ SkString tmp(text);
+ this->swap(tmp);
+
+ return *this;
+}
+
void SkString::reset() {
this->validate();