| 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 | #include "include/utils/SkRandom.h" | 
|---|
| 13 |  | 
|---|
| 14 | /* | 
|---|
| 15 | *  Various structs used to communicate particle information among emitters, affectors, etc. | 
|---|
| 16 | */ | 
|---|
| 17 |  | 
|---|
| 18 | struct SkParticles { | 
|---|
| 19 | enum Channels { | 
|---|
| 20 | kAge, | 
|---|
| 21 | kLifetime,  // During spawn, this is actual lifetime. Later, it's inverse lifetime. | 
|---|
| 22 | kPositionX, | 
|---|
| 23 | kPositionY, | 
|---|
| 24 | kHeadingX, | 
|---|
| 25 | kHeadingY, | 
|---|
| 26 | kScale, | 
|---|
| 27 | kVelocityX, | 
|---|
| 28 | kVelocityY, | 
|---|
| 29 | kVelocityAngular, | 
|---|
| 30 | kColorR, | 
|---|
| 31 | kColorG, | 
|---|
| 32 | kColorB, | 
|---|
| 33 | kColorA, | 
|---|
| 34 | kSpriteFrame, | 
|---|
| 35 | kFlags,       // The last two are non-float data (they're actually uint32_t) | 
|---|
| 36 | kRandom, | 
|---|
| 37 |  | 
|---|
| 38 | kNumChannels, | 
|---|
| 39 | }; | 
|---|
| 40 |  | 
|---|
| 41 | SkAutoTMalloc<float>    fData[kNumChannels]; | 
|---|
| 42 | }; | 
|---|
| 43 |  | 
|---|
| 44 | #endif // SkParticleData_DEFINED | 
|---|
| 45 |  | 
|---|