skia2/modules/particles/include/SkParticleData.h
Brian Osman e11c43804b Remove use of uint from particle random system
uint (and bitwise operations) aren't supported by our minimum spec, and
they're going to be removed from public SkSL. For now, convert the
random generator to a good-enough chaotic sequence of high-frequency
sine waves.

If/when the interpreter (and particles) are converted to the newer skvm
backend, it will be straightforward to support custom intrinsics that
emit skvm instructions directly into the builder, and re-introduce a
better integer-based PRNG, without requiring SkSL language support.

Bug: skia:11093
Change-Id: I885b15a51a9e5c12b4274b5938d8deb77219d41b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/347036
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-12-23 16:21:17 +00:00

43 lines
876 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"
/*
* 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,
kRandom,
kNumChannels,
};
SkAutoTMalloc<float> fData[kNumChannels];
};
#endif // SkParticleData_DEFINED