Flutter Engine
The Flutter Engine
SkSLOutputStream.h
Go to the documentation of this file.
1/*
2 * Copyright 2017 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 SKSL_OUTPUTSTREAM
9#define SKSL_OUTPUTSTREAM
10
12
13#include <cstdarg>
14#include <cstddef>
15#include <cstdint>
16#include <string>
17
18namespace SkSL {
19
21public:
22 virtual bool isValid() const {
23 return true;
24 }
25
26 virtual void write8(uint8_t b) = 0;
27
28 void write16(uint16_t i) {
29 this->write8((uint8_t) i);
30 this->write8((uint8_t) (i >> 8));
31 }
32
33 void write32(uint32_t i) {
34 this->write8((uint8_t) i);
35 this->write8((uint8_t) (i >> 8));
36 this->write8((uint8_t) (i >> 16));
37 this->write8((uint8_t) (i >> 24));
38 }
39
40 virtual void writeText(const char* s) = 0;
41
42 virtual void write(const void* s, size_t size) = 0;
43
44 void writeString(const std::string& s);
45
46 void printf(const char format[], ...) SK_PRINTF_LIKE(2, 3);
47
48 void appendVAList(const char format[], va_list args) SK_PRINTF_LIKE(2, 0);
49
50 virtual ~OutputStream() {}
51
52private:
53 static const int kBufferSize = 1024;
54};
55
56} // namespace SkSL
57
58#endif
#define SK_PRINTF_LIKE(A, B)
Definition: SkAttributes.h:52
void write16(uint16_t i)
void writeString(const std::string &s)
virtual void write(const void *s, size_t size)=0
void printf(const char format[],...) SK_PRINTF_LIKE(2
virtual void writeText(const char *s)=0
void void appendVAList(const char format[], va_list args) SK_PRINTF_LIKE(2
virtual void write8(uint8_t b)=0
virtual bool isValid() const
void write32(uint32_t i)
static bool b
struct MyStruct s
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
uint32_t uint32_t * format
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