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 "SkReader32.h" | 8 #include "SkReader32.h" |
9 #include "SkString.h" | 9 #include "SkString.h" |
10 #include "SkWriter32.h" | 10 #include "SkWriter32.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 fCapacity = 4096 + SkTMax(size, fCapacity + (fCapacity / 2)); | 69 fCapacity = 4096 + SkTMax(size, fCapacity + (fCapacity / 2)); |
70 fInternal.realloc(fCapacity); | 70 fInternal.realloc(fCapacity); |
71 fData = fInternal.get(); | 71 fData = fInternal.get(); |
72 | 72 |
73 if (wasExternal) { | 73 if (wasExternal) { |
74 // we were external, so copy in the data | 74 // we were external, so copy in the data |
75 memcpy(fData, fExternal, fUsed); | 75 memcpy(fData, fExternal, fUsed); |
76 } | 76 } |
77 } | 77 } |
78 | 78 |
79 SkData* SkWriter32::snapshotAsData() const { | 79 sk_sp<SkData> SkWriter32::snapshotAsData() const { |
80 return SkData::NewWithCopy(fData, fUsed); | 80 return SkData::MakeWithCopy(fData, fUsed); |
81 } | 81 } |
OLD | NEW |