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

Side by Side Diff: src/core/SkString.cpp

Issue 1490113005: Add config options to run different GPU APIs to dm and nanobench (Closed) Base URL: https://skia.googlesource.com/skia.git@commandbuffer-as-api-03-context-factory-glcontext-type
Patch Set: Created 5 years 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
« no previous file with comments | « include/gpu/gl/command_buffer/SkCommandBufferGLContext.h ('k') | src/gpu/GrContextFactory.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #include "SkAtomics.h" 10 #include "SkAtomics.h"
(...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after
617 617
618 SkString SkStringPrintf(const char* format, ...) { 618 SkString SkStringPrintf(const char* format, ...) {
619 SkString formattedOutput; 619 SkString formattedOutput;
620 char buffer[kBufferSize]; 620 char buffer[kBufferSize];
621 SK_UNUSED int length; 621 SK_UNUSED int length;
622 ARGS_TO_BUFFER(format, buffer, kBufferSize, length); 622 ARGS_TO_BUFFER(format, buffer, kBufferSize, length);
623 formattedOutput.set(buffer); 623 formattedOutput.set(buffer);
624 return formattedOutput; 624 return formattedOutput;
625 } 625 }
626 626
627 void SkStrSplit(const char* str, const char* delimiters, SkTArray<SkString>* out ) { 627 void SkStrSplit(const char* str, const char* delimiters, SkStrSplitMode splitMod e,
628 const char* end = str + strlen(str); 628 SkTArray<SkString>* out) {
629 while (str != end) { 629 if (splitMode == kCoalesce_SkStrSplitMode) {
630 // Skip any delimiters.
631 str += strspn(str, delimiters);
632 }
633 if (!*str) {
634 return;
635 }
636
637 while (true) {
630 // Find a token. 638 // Find a token.
631 const size_t len = strcspn(str, delimiters); 639 const size_t len = strcspn(str, delimiters);
632 out->push_back().set(str, len); 640 if (splitMode == kStrict_SkStrSplitMode || len > 0) {
633 str += len; 641 out->push_back().set(str, len);
634 // Skip any delimiters. 642 str += len;
635 str += strspn(str, delimiters); 643 }
644
645 if (!*str) {
646 return;
647 }
648 if (splitMode == kCoalesce_SkStrSplitMode) {
649 // Skip any delimiters.
650 str += strspn(str, delimiters);
651 } else {
652 // Skip one delimiter.
653 str += 1;
654 }
636 } 655 }
637 } 656 }
638 657
639 #undef VSNPRINTF 658 #undef VSNPRINTF
640 #undef SNPRINTF 659 #undef SNPRINTF
OLDNEW
« no previous file with comments | « include/gpu/gl/command_buffer/SkCommandBufferGLContext.h ('k') | src/gpu/GrContextFactory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698