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

Side by Side 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 { 294 {
295 std::unique_ptr<JSONObject> shaderItem = JSONObject::create(); 295 std::unique_ptr<JSONObject> shaderItem = JSONObject::create();
296 const SkMatrix localMatrix = shader.getLocalMatrix(); 296 const SkMatrix localMatrix = shader.getLocalMatrix();
297 if (!localMatrix.isIdentity()) 297 if (!localMatrix.isIdentity())
298 shaderItem->setArray("localMatrix", arrayForSkMatrix(localMatrix)); 298 shaderItem->setArray("localMatrix", arrayForSkMatrix(localMatrix));
299 return shaderItem; 299 return shaderItem;
300 } 300 }
301 301
302 String stringForSkColor(const SkColor& color) 302 String stringForSkColor(const SkColor& color)
303 { 303 {
304 String colorString = "#"; 304 // #AARRGGBB.
305 appendUnsignedAsHex(color, colorString); 305 Vector<LChar, 9> result;
306 return colorString; 306 result.append('#');
307 appendUnsignedAsHex(color, result);
308 return String(result.data(), result.size());
307 } 309 }
308 310
309 void appendFlagToString(String* flagsString, bool isSet, const String& name) 311 void appendFlagToString(String* flagsString, bool isSet, const String& name)
310 { 312 {
311 if (!isSet) 313 if (!isSet)
312 return; 314 return;
313 if (flagsString->length()) 315 if (flagsString->length())
314 flagsString->append("|"); 316 flagsString->append("|");
315 flagsString->append(name); 317 flagsString->append(name);
316 } 318 }
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after
858 return pictureAsJSON->toPrettyJSONString(); 860 return pictureAsJSON->toPrettyJSONString();
859 } 861 }
860 862
861 void showSkPicture(const SkPicture* picture) 863 void showSkPicture(const SkPicture* picture)
862 { 864 {
863 WTFLogAlways("%s\n", pictureAsDebugString(picture).utf8().data()); 865 WTFLogAlways("%s\n", pictureAsDebugString(picture).utf8().data());
864 } 866 }
865 #endif 867 #endif
866 868
867 } // namespace blink 869 } // namespace blink
OLDNEW
« 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