summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2019-09-16 13:38:25 -0700
committerVito Caputo <vcaputo@pengaru.com>2019-09-16 13:40:43 -0700
commit242c72aef4d280f69cfd60c0edaa0f87a9d451e5 (patch)
tree599246728d01c492bcedd32681bc43295b98318b
parenta62cecf9bb1acad6acd2cdf6b3265272cbf87538 (diff)
libstage: set initial dirty state via stage_conf_t
Particularly in cached stages it's often needed to start out dirty, by copying from the stage_conf_t passed to stage_new() it still defaults to the common clean/0 case but eliminates the need for a separate stage_dirty() call in the caching case.
-rw-r--r--src/stage.c1
-rw-r--r--src/stage.h1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/stage.c b/src/stage.c
index bffd67f..4d18486 100644
--- a/src/stage.c
+++ b/src/stage.c
@@ -108,6 +108,7 @@ stage_t * stage_new(const stage_conf_t *conf, const stage_ops_t *ops, void *obje
stage->alpha = conf->alpha;
stage->active = conf->active;
stage->locked = conf->locked;
+ stage->dirty = conf->dirty;
return stage;
}
diff --git a/src/stage.h b/src/stage.h
index 20a03d8..d1c8e69 100644
--- a/src/stage.h
+++ b/src/stage.h
@@ -39,6 +39,7 @@ typedef struct stage_conf_t {
float alpha;
unsigned active:1;
unsigned locked:1;
+ unsigned dirty:1;
} stage_conf_t;
stage_t * stage_new(const stage_conf_t *conf, const stage_ops_t *ops, void *object);
© All Rights Reserved