1 /*
2 * Copyright 2019 Google LLC
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 SkParticleData_DEFINED
9 #define SkParticleData_DEFINED
10 
11 #include "include/private/SkTemplates.h"
12 
13 /*
14  *  Various structs used to communicate particle information among emitters, affectors, etc.
15  */
16 
17 struct SkParticles {
18     enum Channels {
19         kAge,
20         kLifetime,  // During spawn, this is actual lifetime. Later, it's inverse lifetime.
21         kPositionX,
22         kPositionY,
23         kHeadingX,
24         kHeadingY,
25         kScale,
26         kVelocityX,
27         kVelocityY,
28         kVelocityAngular,
29         kColorR,
30         kColorG,
31         kColorB,
32         kColorA,
33         kSpriteFrame,
34         kRandom,
35 
36         kNumChannels,
37     };
38 
39     SkAutoTMalloc<float>    fData[kNumChannels];
40 };
41 
42 #endif // SkParticleData_DEFINED
43