optimize glShaderSource string concatenation This optimizes for both memory usage and time. Before this change, we had a redundant copy of the shader source fragments in memory: - The user application - The ostringstream buffer - The final concatenated string The second one can be avoided by not using ostringstream. The second issue is that ostringstream will reallocate as we fill it, and depending on the number of input strings (and their size), it may reallocate several times. Since we aren't doing anything particularly fancy with the ostringstream, we can just preallocate the appropriately sized string and fill it with the input strings all at once. If we don't mind taking an additional dependency on abseil-cpp, this could also be implemented with absl::StrJoin, but it seems like a heavy dependency for something relatively simple. Tests run: GLSLTest.*ShaderLength* Bug: angleproject:8219 Change-Id: Idba277e7860116f858e7a86f4b03420dd383a52f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4627282 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>