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

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

Issue 15941025: Add SkData::NewFromFD. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Remove an indentation level. 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/SkOSFile.h » ('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 /* 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 86
87 /** 87 /**
88 * Create a new dataref from a pointer allocated by malloc. The Data object 88 * Create a new dataref from a pointer allocated by malloc. The Data object
89 * takes ownership of that allocation, and will handling calling sk_free. 89 * takes ownership of that allocation, and will handling calling sk_free.
90 */ 90 */
91 static SkData* NewFromMalloc(const void* data, size_t length); 91 static SkData* NewFromMalloc(const void* data, size_t length);
92 92
93 /** 93 /**
94 * Create a new dataref from a SkFILE. 94 * Create a new dataref from a SkFILE.
95 * This does not take ownership of the SkFILE, nor close it. 95 * This does not take ownership of the SkFILE, nor close it.
96 * The caller is free to close the SkFILE at its convenience.
96 * The SkFILE must be open for reading only. 97 * The SkFILE must be open for reading only.
97 * Returns NULL on failure. 98 * Returns NULL on failure.
98 */ 99 */
99 static SkData* NewFromFILE(SkFILE* f); 100 static SkData* NewFromFILE(SkFILE* f);
100 101
101 /** 102 /**
103 * Create a new dataref from a file descriptor.
104 * This does not take ownership of the file descriptor, nor close it.
105 * The caller is free to close the file descriptor at its convenience.
106 * The file descriptor must be open for reading only.
107 * Returns NULL on failure.
108 */
109 static SkData* NewFromFD(int fd);
110
111 /**
102 * Create a new dataref using a subset of the data in the specified 112 * Create a new dataref using a subset of the data in the specified
103 * src dataref. 113 * src dataref.
104 */ 114 */
105 static SkData* NewSubset(const SkData* src, size_t offset, size_t length); 115 static SkData* NewSubset(const SkData* src, size_t offset, size_t length);
106 116
107 /** 117 /**
108 * Returns a new empty dataref (or a reference to a shared empty dataref). 118 * Returns a new empty dataref (or a reference to a shared empty dataref).
109 * New or shared, the caller must see that unref() is eventually called. 119 * New or shared, the caller must see that unref() is eventually called.
110 */ 120 */
111 static SkData* NewEmpty(); 121 static SkData* NewEmpty();
(...skipping 14 matching lines...) Expand all
126 SkData(const void* ptr, size_t size, ReleaseProc, void* context); 136 SkData(const void* ptr, size_t size, ReleaseProc, void* context);
127 virtual ~SkData(); 137 virtual ~SkData();
128 138
129 typedef SkFlattenable INHERITED; 139 typedef SkFlattenable INHERITED;
130 }; 140 };
131 141
132 /** Typedef of SkAutoTUnref<SkData> for automatically unref-ing a SkData. */ 142 /** Typedef of SkAutoTUnref<SkData> for automatically unref-ing a SkData. */
133 typedef SkAutoTUnref<SkData> SkAutoDataUnref; 143 typedef SkAutoTUnref<SkData> SkAutoDataUnref;
134 144
135 #endif 145 #endif
OLDNEW
« no previous file with comments | « no previous file | include/core/SkOSFile.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698