Flutter Engine
The Flutter Engine
SkStreamPriv.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 SkStreamPriv_DEFINED
9#define SkStreamPriv_DEFINED
10
13#include "src/base/SkEndian.h"
14
15#include <cstdint>
16
17class SkData;
18
19/**
20 * Copy the provided stream to an SkData variable.
21 *
22 * Note: Assumes the stream is at the beginning. If it has a length,
23 * but is not at the beginning, this call will fail (return NULL).
24 *
25 * @param stream SkStream to be copied into data.
26 * @return The resulting SkData after the copy, nullptr on failure.
27 */
29
30/**
31 * Copies the input stream from the current position to the end.
32 * Does not rewind the input stream.
33 */
34bool SkStreamCopy(SkWStream* out, SkStream* input);
35
36/** A SkWStream that writes all output to SkDebugf, for debugging purposes. */
37class SkDebugfStream final : public SkWStream {
38public:
39 bool write(const void* buffer, size_t size) override;
40 size_t bytesWritten() const override;
41
42private:
43 size_t fBytesWritten = 0;
44};
45
46/**
47 * Helper functions to write big-endian values to a stream.
48 */
49inline bool SkWStreamWriteU16BE(SkWStream* s, uint16_t value) {
51 return s->write(&value, sizeof(value));
52}
53
54inline bool SkWStreamWriteU32BE(SkWStream* s, uint32_t value) {
56 return s->write(&value, sizeof(value));
57}
58
59inline bool SkWStreamWriteS32BE(SkWStream* s, int32_t value) {
61 return s->write(&value, sizeof(value));
62}
63
64// If the stream supports identifying the current position and total length, this returns
65// true if there are not enough bytes in the stream to fulfill a read of the given length.
66// Otherwise, it returns false.
67// False does *not* mean a read will succeed of the given length, but true means we are
68// certain it will fail.
70
71#endif // SkStreamPriv_DEFINED
#define SkEndian_SwapBE32(n)
Definition: SkEndian.h:136
#define SkEndian_SwapBE16(n)
Definition: SkEndian.h:135
bool SkWStreamWriteU32BE(SkWStream *s, uint32_t value)
Definition: SkStreamPriv.h:54
bool SkWStreamWriteS32BE(SkWStream *s, int32_t value)
Definition: SkStreamPriv.h:59
bool StreamRemainingLengthIsBelow(SkStream *stream, size_t len)
Definition: SkStream.cpp:976
bool SkWStreamWriteU16BE(SkWStream *s, uint16_t value)
Definition: SkStreamPriv.h:49
bool SkStreamCopy(SkWStream *out, SkStream *input)
Definition: SkStream.cpp:954
sk_sp< SkData > SkCopyStreamToData(SkStream *stream)
Definition: SkStream.cpp:937
Definition: SkData.h:25
size_t bytesWritten() const override
Definition: SkStream.cpp:904
bool write(const void *buffer, size_t size) override
Definition: SkStream.cpp:898
struct MyStruct s
uint8_t value
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