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

Unified Diff: third_party/WebKit/Source/platform/graphics/LoggingCanvas.cpp

Issue 2235113002: Use StringView for String::append and ::insert. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix appendHex stuff. Created 4 years, 4 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
Index: third_party/WebKit/Source/platform/graphics/LoggingCanvas.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/LoggingCanvas.cpp b/third_party/WebKit/Source/platform/graphics/LoggingCanvas.cpp
index 1f21f65553a1b84b413e63c4d0f2dfa3160abfcf..da2801801e688735932b30b100799b3e59914b64 100644
--- a/third_party/WebKit/Source/platform/graphics/LoggingCanvas.cpp
+++ b/third_party/WebKit/Source/platform/graphics/LoggingCanvas.cpp
@@ -301,9 +301,11 @@ std::unique_ptr<JSONObject> objectForSkShader(const SkShader& shader)
String stringForSkColor(const SkColor& color)
{
- String colorString = "#";
- appendUnsignedAsHex(color, colorString);
- return colorString;
+ // #AARRGGBB.
+ Vector<LChar, 9> result;
+ result.append('#');
+ appendUnsignedAsHex(color, result);
+ return String(result.data(), result.size());
}
void appendFlagToString(String* flagsString, bool isSet, const String& name)
« no previous file with comments | « third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp ('k') | third_party/WebKit/Source/wtf/text/WTFString.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698