OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
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 #include "SkData.h" | 8 #include "SkData.h" |
9 #include "SkFlattenableBuffers.h" | 9 #include "SkReadBuffer.h" |
| 10 #include "SkWriteBuffer.h" |
10 #include "SkOSFile.h" | 11 #include "SkOSFile.h" |
11 #include "SkOnce.h" | 12 #include "SkOnce.h" |
12 | 13 |
13 SkData::SkData(const void* ptr, size_t size, ReleaseProc proc, void* context) { | 14 SkData::SkData(const void* ptr, size_t size, ReleaseProc proc, void* context) { |
14 fPtr = ptr; | 15 fPtr = ptr; |
15 fSize = size; | 16 fSize = size; |
16 fReleaseProc = proc; | 17 fReleaseProc = proc; |
17 fReleaseProcContext = context; | 18 fReleaseProcContext = context; |
18 } | 19 } |
19 | 20 |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 SkData* SkData::NewWithCString(const char cstr[]) { | 153 SkData* SkData::NewWithCString(const char cstr[]) { |
153 size_t size; | 154 size_t size; |
154 if (NULL == cstr) { | 155 if (NULL == cstr) { |
155 cstr = ""; | 156 cstr = ""; |
156 size = 1; | 157 size = 1; |
157 } else { | 158 } else { |
158 size = strlen(cstr) + 1; | 159 size = strlen(cstr) + 1; |
159 } | 160 } |
160 return NewWithCopy(cstr, size); | 161 return NewWithCopy(cstr, size); |
161 } | 162 } |
OLD | NEW |