Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenkernel/BKE_geometry_set.hh')
-rw-r--r--source/blender/blenkernel/BKE_geometry_set.hh12
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_geometry_set.hh b/source/blender/blenkernel/BKE_geometry_set.hh
index 0ed6eea7954..9b50a9042eb 100644
--- a/source/blender/blenkernel/BKE_geometry_set.hh
+++ b/source/blender/blenkernel/BKE_geometry_set.hh
@@ -39,6 +39,7 @@ struct Mesh;
struct Object;
struct PointCloud;
struct Volume;
+struct Curve;
class CurveEval;
enum class GeometryOwnershipType {
@@ -406,6 +407,15 @@ class CurveComponent : public GeometryComponent {
CurveEval *curve_ = nullptr;
GeometryOwnershipType ownership_ = GeometryOwnershipType::Owned;
+ /**
+ * Curve data necessary to hold the draw cache for rendering, consistent over multiple redraws.
+ * This is necessary because Blender assumes that objects evaluate to an object data type, and
+ * we use #CurveEval rather than #Curve here. It also allows us to mostly reuse the same
+ * batch cache implementation.
+ */
+ mutable Curve *curve_for_render_ = nullptr;
+ mutable std::mutex curve_for_render_mutex_;
+
public:
CurveComponent();
~CurveComponent();
@@ -430,6 +440,8 @@ class CurveComponent : public GeometryComponent {
bool owns_direct_data() const override;
void ensure_owns_direct_data() override;
+ const Curve *get_curve_for_render() const;
+
static constexpr inline GeometryComponentType static_type = GEO_COMPONENT_TYPE_CURVE;
private: