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

Unified Diff: Source/core/html/canvas/WebGLRenderingContext.cpp

Issue 129673002: Use StringBuilder::append instead of String::append (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@touch_icon
Patch Set: Created 6 years, 11 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/canvas/WebGLRenderingContext.cpp
diff --git a/Source/core/html/canvas/WebGLRenderingContext.cpp b/Source/core/html/canvas/WebGLRenderingContext.cpp
index 0ce2dae23a2f48913281fdb63c9cf7476b175f69..4ab9f298b72ded6ed6e751ea2ef4a0352be8a185 100644
--- a/Source/core/html/canvas/WebGLRenderingContext.cpp
+++ b/Source/core/html/canvas/WebGLRenderingContext.cpp
@@ -2702,19 +2702,21 @@ WebGLGetInfo WebGLRenderingContext::getUniform(WebGLProgram* program, const WebG
if (!m_context->getActiveUniform(objectOrZero(program), i, info))
return WebGLGetInfo();
String name = info.name;
+ StringBuilder nameBuilder;
// Strip "[0]" from the name if it's an array.
if (info.size > 1 && name.endsWith("[0]"))
info.name = name.left(name.length() - 3);
// If it's an array, we need to iterate through each element, appending "[index]" to the name.
for (GLint index = 0; index < info.size; ++index) {
- name = info.name;
+ nameBuilder.clear();
+ nameBuilder.append(info.name);
if (info.size > 1 && index >= 1) {
- name.append('[');
- name.append(String::number(index));
- name.append(']');
+ nameBuilder.append('[');
+ nameBuilder.append(String::number(index));
+ nameBuilder.append(']');
}
// Now need to look this up by name again to find its location
- GLint loc = m_context->getUniformLocation(objectOrZero(program), name.utf8().data());
+ GLint loc = m_context->getUniformLocation(objectOrZero(program), nameBuilder.toString().utf8().data());
if (loc == location) {
// Found it. Use the type in the ActiveInfo to determine the return type.
GLenum baseType;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698