aboutsummaryrefslogtreecommitdiff
path: root/atom/transform/README.md
blob: 601c6a738d122be7d6052117bef10fabdc961daa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# transform
--
    import "android.googlesource.com/platform/tools/gpu/atom/transform"

Package transform provides implementations of the atom Transformer interface.

## Usage

#### type EarlyTerminator

```go
type EarlyTerminator struct {
}
```

EarlyTerminator is an implementation of Transformer that will consume all atoms
(except for the EOS atom) once all the atoms passed to Add have passed through
the transformer.

#### func (*EarlyTerminator) Add

```go
func (t *EarlyTerminator) Add(id atom.ID)
```
Add adds the atom with identifier id to the set of atoms that must be seen
before the EarlyTerminator will consume all atoms (excluding the EOS atom).

#### func (*EarlyTerminator) Flush

```go
func (t *EarlyTerminator) Flush(out atom.Writer)
```

#### func (*EarlyTerminator) Transform

```go
func (t *EarlyTerminator) Transform(id atom.ID, a atom.Atom, out atom.Writer)
```

#### type Injector

```go
type Injector struct {
}
```

Injector is an implementation of Transformer that can inject atoms into the atom
stream.

#### func (*Injector) Flush

```go
func (t *Injector) Flush(out atom.Writer)
```

#### func (*Injector) Inject

```go
func (t *Injector) Inject(after atom.ID, id atom.ID, a atom.Atom)
```
Inject emits the atom a with identifier id after the atom with identifier after.

#### func (*Injector) Transform

```go
func (t *Injector) Transform(id atom.ID, a atom.Atom, out atom.Writer)
```

#### type SkipDrawCalls

```go
type SkipDrawCalls struct {
}
```

SkipDrawCalls is an implementation of Transformer that skips all draw calls that
have not been explicitly requested.

#### func (*SkipDrawCalls) Draw

```go
func (t *SkipDrawCalls) Draw(id atom.ID)
```
Draw adds an exception to allow all draw calls up to and including the atom with
identifier id for the frame holding the atom.

#### func (*SkipDrawCalls) Flush

```go
func (t *SkipDrawCalls) Flush(out atom.Writer)
```

#### func (*SkipDrawCalls) Transform

```go
func (t *SkipDrawCalls) Transform(id atom.ID, a atom.Atom, out atom.Writer)
```

#### type Trace

```go
type Trace struct {
	Logger log.Logger
}
```

Trace is an implementation of Transformer that records each atom id and atom
value that passes through Trace to Logger. Atoms passing through Trace are
written to the output Writer unaltered.

#### func (Trace) Flush

```go
func (t Trace) Flush(out atom.Writer)
```

#### func (Trace) Transform

```go
func (t Trace) Transform(id atom.ID, a atom.Atom, out atom.Writer)
```