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

Side by Side Diff: include/core/SkData.h

Issue 15675025: One allocation for an SkData which makes a copy. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | include/core/SkRefCnt.h » ('j') | src/core/SkData.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
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 10
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 */ 126 */
127 static SkData* NewEmpty(); 127 static SkData* NewEmpty();
128 128
129 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkData) 129 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkData)
130 130
131 protected: 131 protected:
132 SkData(SkFlattenableReadBuffer&); 132 SkData(SkFlattenableReadBuffer&);
133 virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE; 133 virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE;
134 134
135 private: 135 private:
136 /** Called when the ref count goes to zero. */
137 virtual void internal_dispose() const SK_OVERRIDE;
138
136 ReleaseProc fReleaseProc; 139 ReleaseProc fReleaseProc;
137 void* fReleaseProcContext; 140 void* fReleaseProcContext;
138 141
139 const void* fPtr; 142 const void* fPtr;
140 size_t fSize; 143 size_t fSize;
141 144
142 SkData(const void* ptr, size_t size, ReleaseProc, void* context); 145 SkData(const void* ptr, size_t size, ReleaseProc, void* context);
143 virtual ~SkData(); 146 virtual ~SkData();
144 147
145 typedef SkFlattenable INHERITED; 148 typedef SkFlattenable INHERITED;
146 }; 149 };
147 150
148 /** Typedef of SkAutoTUnref<SkData> for automatically unref-ing a SkData. */ 151 /** Typedef of SkAutoTUnref<SkData> for automatically unref-ing a SkData. */
149 typedef SkAutoTUnref<SkData> SkAutoDataUnref; 152 typedef SkAutoTUnref<SkData> SkAutoDataUnref;
150 153
151 #endif 154 #endif
OLDNEW
« no previous file with comments | « no previous file | include/core/SkRefCnt.h » ('j') | src/core/SkData.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698