rive_rs/component_dirt.rs
1// Copyright 2021 The Fuchsia Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5use bitflags::bitflags;
6
7bitflags! {
8 #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
9 pub struct ComponentDirt: u16 {
10 const DEPENDENTS = 0b0000000001;
11 /// General flag for components are dirty (if this is up, the update
12 /// cycle runs). It gets automatically applied with any other dirt.
13 const COMPONENTS = 0b0000000010;
14 /// Draw order needs to be re-computed.
15 const DRAW_ORDER = 0b0000000100;
16 /// Path is dirty and needs to be rebuilt.
17 const PATH = 0b0000001000;
18 /// Vertices have changed, re-order cached lists.
19 const VERTICES = 0b0000010000;
20 /// Used by any component that needs to recompute their local transform.
21 /// Usually components that have their transform dirty will also have
22 /// their worldTransform dirty.
23 const TRANSFORM = 0b0000100000;
24 /// Used by any component that needs to update its world transform.
25 const WORLD_TRANSFORM = 0b0001000000;
26 /// Marked when the stored render opacity needs to be updated.
27 const RENDER_OPACITY = 0b0010000000;
28 /// Dirt used to mark some stored paint needs to be rebuilt or that we
29 /// just want to trigger an update cycle so painting occurs.
30 const PAINT = 0b0100000000;
31 /// Used by the gradients track when the stops need to be re-ordered.
32 const STOPS = 0b1000000000;
33 }
34}