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

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

Issue 188343004: Actually, we wrote only size bytes. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 9 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
« no previous file with comments | « no previous file | 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 /* 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 "SkStream.h" 10 #include "SkStream.h"
(...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after
811 } 811 }
812 812
813 bool SkDebugWStream::write(const void* buffer, size_t size) 813 bool SkDebugWStream::write(const void* buffer, size_t size)
814 { 814 {
815 #if defined(SK_DEBUG) || defined(SK_DEVELOPER) 815 #if defined(SK_DEBUG) || defined(SK_DEVELOPER)
816 char* s = new char[size+1]; 816 char* s = new char[size+1];
817 memcpy(s, buffer, size); 817 memcpy(s, buffer, size);
818 s[size] = 0; 818 s[size] = 0;
819 SkDebugf("%s", s); 819 SkDebugf("%s", s);
820 delete[] s; 820 delete[] s;
821 fBytesWritten += size+1; 821 fBytesWritten += size;
822 #endif 822 #endif
823 return true; 823 return true;
824 } 824 }
825 825
826 /////////////////////////////////////////////////////////////////////////////// 826 ///////////////////////////////////////////////////////////////////////////////
827 /////////////////////////////////////////////////////////////////////////////// 827 ///////////////////////////////////////////////////////////////////////////////
828 828
829 829
830 static SkData* mmap_filename(const char path[]) { 830 static SkData* mmap_filename(const char path[]) {
831 SkFILE* file = sk_fopen(path, kRead_SkFILE_Flag); 831 SkFILE* file = sk_fopen(path, kRead_SkFILE_Flag);
(...skipping 14 matching lines...) Expand all
846 846
847 // If we get here, then our attempt at using mmap failed, so try normal 847 // If we get here, then our attempt at using mmap failed, so try normal
848 // file access. 848 // file access.
849 SkFILEStream* stream = SkNEW_ARGS(SkFILEStream, (path)); 849 SkFILEStream* stream = SkNEW_ARGS(SkFILEStream, (path));
850 if (!stream->isValid()) { 850 if (!stream->isValid()) {
851 stream->unref(); 851 stream->unref();
852 stream = NULL; 852 stream = NULL;
853 } 853 }
854 return stream; 854 return stream;
855 } 855 }
OLDNEW
« 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