Flutter Engine
The Flutter Engine
third_party
skia
client_utils
android
FrontBufferedStream.h
Go to the documentation of this file.
1
/*
2
* Copyright 2013 Google Inc.
3
*
4
* Use of this source code is governed by a BSD-style license that can be
5
* found in the LICENSE file.
6
*/
7
8
#ifndef FrontBufferedStream_DEFINED
9
#define FrontBufferedStream_DEFINED
10
11
#include "
include/core/SkStream.h
"
12
13
namespace
android
{
14
namespace
skia
{
15
/**
16
* Specialized stream that buffers the first X bytes of a stream,
17
* where X is passed in by the user. Note that unlike some buffered
18
* stream APIs, once more bytes than can fit in the buffer are read,
19
* no more buffering is done. This stream is designed for a use case
20
* where the caller knows that rewind will only be called from within
21
* X bytes (inclusive), and the wrapped stream is not necessarily
22
* able to rewind at all.
23
*/
24
class
SK_API
FrontBufferedStream
{
25
public
:
26
/**
27
* Creates a new stream that wraps and buffers an SkStream.
28
* @param stream SkStream to buffer. If stream is NULL, NULL is
29
* returned. When this call succeeds (i.e. returns non NULL),
30
* FrontBufferedStream is expected to be the only owner of
31
* stream, so it should no be longer used directly.
32
* FrontBufferedStream will delete stream upon deletion.
33
* @param minBufferSize Minimum size of buffer required.
34
* @return An SkStream that can buffer at least minBufferSize, or
35
* NULL on failure. The caller is required to delete when finished with
36
* this object.
37
*/
38
static
std::unique_ptr<SkStreamRewindable>
Make
(std::unique_ptr<SkStream>
stream
,
39
size_t
minBufferSize);
40
};
41
}
// namespace skia
42
}
// namespace android
43
#endif
// FrontBufferedStream_DEFINED
SK_API
#define SK_API
Definition:
SkAPI.h:35
SkStream.h
android::skia::FrontBufferedStream
Definition:
FrontBufferedStream.h:24
SkMultiPictureDocument::Make
SK_API sk_sp< SkDocument > Make(SkWStream *dst, const SkSerialProcs *=nullptr, std::function< void(const SkPicture *)> onEndPage=nullptr)
Definition:
SkMultiPictureDocument.cpp:150
android
Definition:
BitmapRegionDecoder.cpp:14
dart_profiler_symbols.stream
stream
Definition:
dart_profiler_symbols.py:81
skia
Definition:
DartTypes.h:13
Generated on Sun Jun 23 2024 21:55:54 for Flutter Engine by
1.9.4