diff options
Diffstat (limited to 'experimental/sksg/SkSGNode.h')
-rw-r--r-- | experimental/sksg/SkSGNode.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/experimental/sksg/SkSGNode.h b/experimental/sksg/SkSGNode.h index 6396e4d33e..17619de485 100644 --- a/experimental/sksg/SkSGNode.h +++ b/experimental/sksg/SkSGNode.h @@ -92,7 +92,15 @@ private: if (attr_container == v) return; \ attr_container = v; \ this->invalidate(); \ - } + } + +#define SG_MAPPED_ATTRIBUTE(attr_name, attr_type, attr_container) \ + attr_type get##attr_name() const { return attr_container.get##attr_name(); } \ + void set##attr_name(const attr_type& v) { \ + if (attr_container.get##attr_name() == v) return; \ + attr_container.set##attr_name(v); \ + this->invalidate(); \ + } } // namespace sksg |