skia2/modules/particles/include/SkParticleData.h
Brian Osman 559ffe4a23 Particles: Added particle flags for tracking state (one-time triggers, etc)
Also removed some older effects that weren't interesting, improved others,
cleaned up the unused functions in several, and renamed most of them to
reflect which feature they're demonstrating.

Change-Id: Ib44a00ec3d25e852a1d1661918137ba13d30c86b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/244119
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-09-25 15:58:09 +00:00

45 lines
1014 B
C

/*
* Copyright 2019 Google LLC
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkParticleData_DEFINED
#define SkParticleData_DEFINED
#include "include/private/SkTemplates.h"
#include "include/utils/SkRandom.h"
/*
* Various structs used to communicate particle information among emitters, affectors, etc.
*/
struct SkParticles {
enum Channels {
kAge,
kLifetime, // During spawn, this is actual lifetime. Later, it's inverse lifetime.
kPositionX,
kPositionY,
kHeadingX,
kHeadingY,
kScale,
kVelocityX,
kVelocityY,
kVelocityAngular,
kColorR,
kColorG,
kColorB,
kColorA,
kSpriteFrame,
kFlags, // This is the only non-float data (it's actually uint32_t)
kNumChannels,
};
SkAutoTMalloc<float> fData[kNumChannels];
SkAutoTMalloc<SkRandom> fRandom;
};
#endif // SkParticleData_DEFINED