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

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

Issue 1844343004: SkWStream::writeText inlined. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 8 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
« include/core/SkStream.h ('K') | « include/core/SkStream.h ('k') | no next file » | 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 * Copyright 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 8
9 #include "SkStream.h" 9 #include "SkStream.h"
10 #include "SkStreamPriv.h" 10 #include "SkStreamPriv.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 71
72 void SkWStream::newline() 72 void SkWStream::newline()
73 { 73 {
74 this->write("\n", 1); 74 this->write("\n", 1);
75 } 75 }
76 76
77 void SkWStream::flush() 77 void SkWStream::flush()
78 { 78 {
79 } 79 }
80 80
81 bool SkWStream::writeText(const char text[])
82 {
83 SkASSERT(text);
84 return this->write(text, strlen(text));
85 }
86
87 bool SkWStream::writeDecAsText(int32_t dec) 81 bool SkWStream::writeDecAsText(int32_t dec)
88 { 82 {
89 char buffer[SkStrAppendS32_MaxSize]; 83 char buffer[SkStrAppendS32_MaxSize];
90 char* stop = SkStrAppendS32(buffer, dec); 84 char* stop = SkStrAppendS32(buffer, dec);
91 return this->write(buffer, stop - buffer); 85 return this->write(buffer, stop - buffer);
92 } 86 }
93 87
94 bool SkWStream::writeBigDecAsText(int64_t dec, int minDigits) 88 bool SkWStream::writeBigDecAsText(int64_t dec, int minDigits)
95 { 89 {
96 char buffer[SkStrAppendU64_MaxSize]; 90 char buffer[SkStrAppendU64_MaxSize];
(...skipping 808 matching lines...) Expand 10 before | Expand all | Expand 10 after
905 while (true) { 899 while (true) {
906 count = input->read(scratch, sizeof(scratch)); 900 count = input->read(scratch, sizeof(scratch));
907 if (0 == count) { 901 if (0 == count) {
908 return true; 902 return true;
909 } 903 }
910 if (!out->write(scratch, count)) { 904 if (!out->write(scratch, count)) {
911 return false; 905 return false;
912 } 906 }
913 } 907 }
914 } 908 }
OLDNEW
« include/core/SkStream.h ('K') | « include/core/SkStream.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698