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

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

Issue 1779263003: Make sp variants for SkData (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 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 | « src/core/SkStreamPriv.h ('k') | src/effects/SkColorCubeFilter.cpp » ('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 * 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
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 }
OLDNEW
« no previous file with comments | « src/core/SkStreamPriv.h ('k') | src/effects/SkColorCubeFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698