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

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

Issue 2343933002: Revert of SkFontData to use smart pointers. (Closed)
Patch Set: Created 4 years, 3 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 | « dm/DMSrcSink.cpp ('k') | include/core/SkTypeface.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 * Copyright 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
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 #ifndef SkStream_DEFINED 8 #ifndef SkStream_DEFINED
9 #define SkStream_DEFINED 9 #define SkStream_DEFINED
10 10
(...skipping 22 matching lines...) Expand all
33 * always return all N bytes of the request if possible. If they return fewer 33 * always return all N bytes of the request if possible. If they return fewer
34 * (the read() call returns the number of bytes read) then that means there is 34 * (the read() call returns the number of bytes read) then that means there is
35 * no more data (at EOF or hit an error). The caller should *not* call again 35 * no more data (at EOF or hit an error). The caller should *not* call again
36 * in hopes of fulfilling more of the request. 36 * in hopes of fulfilling more of the request.
37 */ 37 */
38 class SK_API SkStream : public SkNoncopyable { 38 class SK_API SkStream : public SkNoncopyable {
39 public: 39 public:
40 virtual ~SkStream() {} 40 virtual ~SkStream() {}
41 41
42 /** 42 /**
43 * Attempts to open the specified file as a stream, returns nullptr on fail ure. 43 * Attempts to open the specified file, and return a stream to it (using
44 * mmap if available). On success, the caller is responsible for deleting.
45 * On failure, returns NULL.
44 */ 46 */
45 static std::unique_ptr<SkStreamAsset> MakeFromFile(const char path[]); 47 static SkStreamAsset* NewFromFile(const char path[]);
46 48
47 /** Reads or skips size number of bytes. 49 /** Reads or skips size number of bytes.
48 * If buffer == NULL, skip size bytes, return how many were skipped. 50 * If buffer == NULL, skip size bytes, return how many were skipped.
49 * If buffer != NULL, copy size bytes into buffer, return how many were cop ied. 51 * If buffer != NULL, copy size bytes into buffer, return how many were cop ied.
50 * @param buffer when NULL skip size bytes, otherwise copy size bytes into buffer 52 * @param buffer when NULL skip size bytes, otherwise copy size bytes into buffer
51 * @param size the number of bytes to skip or copy 53 * @param size the number of bytes to skip or copy
52 * @return the number of bytes actually read. 54 * @return the number of bytes actually read.
53 */ 55 */
54 virtual size_t read(void* buffer, size_t size) = 0; 56 virtual size_t read(void* buffer, size_t size) = 0;
55 57
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 460
459 private: 461 private:
460 size_t fBytesWritten; 462 size_t fBytesWritten;
461 typedef SkWStream INHERITED; 463 typedef SkWStream INHERITED;
462 }; 464 };
463 465
464 // for now 466 // for now
465 typedef SkFILEStream SkURLStream; 467 typedef SkFILEStream SkURLStream;
466 468
467 #endif 469 #endif
OLDNEW
« no previous file with comments | « dm/DMSrcSink.cpp ('k') | include/core/SkTypeface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698