Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Member Functions | List of all members
LimitedRewindingStream Class Reference
Inheritance diagram for LimitedRewindingStream:
SkStream

Public Member Functions

size_t read (void *buffer, size_t size) override
 
bool isAtEnd () const override
 
bool rewind () override
 
- Public Member Functions inherited from SkStream
virtual ~SkStream ()
 
 SkStream ()
 
virtual size_t read (void *buffer, size_t size)=0
 
size_t skip (size_t size)
 
virtual size_t peek (void *, size_t) const
 
virtual bool isAtEnd () const =0
 
bool readS8 (int8_t *)
 
bool readS16 (int16_t *)
 
bool readS32 (int32_t *)
 
bool readU8 (uint8_t *i)
 
bool readU16 (uint16_t *i)
 
bool readU32 (uint32_t *i)
 
bool readBool (bool *b)
 
bool readScalar (SkScalar *)
 
bool readPackedUInt (size_t *)
 
virtual bool rewind ()
 
std::unique_ptr< SkStreamduplicate () const
 
std::unique_ptr< SkStreamfork () const
 
virtual bool hasPosition () const
 
virtual size_t getPosition () const
 
virtual bool seek (size_t)
 
virtual bool move (long)
 
virtual bool hasLength () const
 
virtual size_t getLength () const
 
virtual const void * getMemoryBase ()
 
virtual sk_sp< SkDatagetData () const
 

Static Public Member Functions

static std::unique_ptr< SkStreamMake (const char path[], size_t limit)
 
- Static Public Member Functions inherited from SkStream
static std::unique_ptr< SkStreamAssetMakeFromFile (const char path[])
 

Detailed Description

Definition at line 1297 of file CodecTest.cpp.

Member Function Documentation

◆ isAtEnd()

bool LimitedRewindingStream::isAtEnd ( ) const
inlineoverridevirtual

Returns true when all the bytes in the stream have been read. As SkStream represents synchronous I/O, isAtEnd returns false when the final stream length isn't known yet, even when all the bytes available so far have been read. This may return true early (when there are no more bytes to be read) or late (after the first unsuccessful read).

Implements SkStream.

Definition at line 1313 of file CodecTest.cpp.

1313 {
1314 return fStream->isAtEnd();
1315 }

◆ Make()

static std::unique_ptr< SkStream > LimitedRewindingStream::Make ( const char  path[],
size_t  limit 
)
inlinestatic

Definition at line 1299 of file CodecTest.cpp.

1299 {
1301 if (!stream) {
1302 return nullptr;
1303 }
1304 return std::unique_ptr<SkStream>(new LimitedRewindingStream(std::move(stream), limit));
1305 }
std::unique_ptr< SkStreamAsset > GetResourceAsStream(const char *resource, bool useFileStream)
Definition: Resources.cpp:31
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
Definition: switches.h:57

◆ read()

size_t LimitedRewindingStream::read ( void *  buffer,
size_t  size 
)
inlineoverridevirtual

Reads or skips size number of bytes. If buffer == NULL, skip size bytes, return how many were skipped. If buffer != NULL, copy size bytes into buffer, return how many were copied.

Parameters
bufferwhen NULL skip size bytes, otherwise copy size bytes into buffer
sizethe number of bytes to skip or copy
Returns
the number of bytes actually read.

Implements SkStream.

Definition at line 1307 of file CodecTest.cpp.

1307 {
1308 const size_t bytes = fStream->read(buffer, size);
1309 fPosition += bytes;
1310 return bytes;
1311 }
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
Definition: switches.h:126
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
Definition: switches.h:259

◆ rewind()

bool LimitedRewindingStream::rewind ( )
inlineoverridevirtual

Rewinds to the beginning of the stream. Returns true if the stream is known to be at the beginning after this call returns.

Reimplemented from SkStream.

Definition at line 1317 of file CodecTest.cpp.

1317 {
1318 if (fPosition <= fLimit && fStream->rewind()) {
1319 fPosition = 0;
1320 return true;
1321 }
1322
1323 return false;
1324 }
bool rewind() override
Definition: CodecTest.cpp:1317

The documentation for this class was generated from the following file: