Optimize CPP code generation.

Previously, we were limiting our calls to appendVAList to 512-byte
chunks to avoid a potential buffer overflow. This had two problems:
1 - it did not avoid the buffer overflow :(
    see chromium:1092743
2 - every call to appendVAList is expensive; it incurs a resize of the
    code buffer (alloc new, memcpy, free old)

This CL removes the 512-byte cap as the buffer overflow issue was
resolved at http://review.skia.org/297276

This CL also includes a few more minor improvements.
- `codeAppendf` now uses a raw string so the gencode is easier to read.
- Optimized `SkStringPrintf("%s", foo)` to `SkString(foo)`.
- Optimized `strA = strB` to `strA.swap(strB)` where safe to do so.

Change-Id: Ia0909a68719848dd2ca655066a9bc6929c8fd09f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297358
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
diff --git a/src/gpu/effects/generated/GrMixerEffect.cpp b/src/gpu/effects/generated/GrMixerEffect.cpp
index 0753de6..1dbf8ec 100644
--- a/src/gpu/effects/generated/GrMixerEffect.cpp
+++ b/src/gpu/effects/generated/GrMixerEffect.cpp
@@ -27,21 +27,25 @@
         (void)weight;
         weightVar = args.fUniformHandler->addUniform(&_outer, kFragment_GrShaderFlag,
                                                      kHalf_GrSLType, "weight");
-        SkString _input1278 = SkStringPrintf("%s", args.fInputColor);
+        SkString _input1278(args.fInputColor);
         SkString _sample1278;
         _sample1278 = this->invokeChild(_outer.fp0_index, _input1278.c_str(), args);
-        fragBuilder->codeAppendf("half4 in0 = %s;", _sample1278.c_str());
-        SkString _input1335 = SkStringPrintf("%s", args.fInputColor);
+        fragBuilder->codeAppendf(
+                R"SkSL(half4 in0 = %s;)SkSL", _sample1278.c_str());
+        SkString _input1335(args.fInputColor);
         SkString _sample1335;
         if (_outer.fp1_index >= 0) {
             _sample1335 = this->invokeChild(_outer.fp1_index, _input1335.c_str(), args);
         } else {
-            _sample1335 = _input1335;
+            _sample1335.swap(_input1335);
         }
-        fragBuilder->codeAppendf("\nhalf4 in1 = %s ? %s : %s;\n%s = mix(in0, in1, %s);\n",
-                                 _outer.fp1_index >= 0 ? "true" : "false", _sample1335.c_str(),
-                                 args.fInputColor, args.fOutputColor,
-                                 args.fUniformHandler->getUniformCStr(weightVar));
+        fragBuilder->codeAppendf(
+                R"SkSL(
+half4 in1 = %s ? %s : %s;
+%s = mix(in0, in1, %s);
+)SkSL",
+                _outer.fp1_index >= 0 ? "true" : "false", _sample1335.c_str(), args.fInputColor,
+                args.fOutputColor, args.fUniformHandler->getUniformCStr(weightVar));
     }
 
 private: