It helps to improve performance by avoiding copy job from writing COW data.
Change-Id: I72d1c7106fc4fe53fa6db05e7ed8c74f1b70fe95
// 3. compute the final path with parentMatrix
if ((flag & DirtyFlagBit::Matrix) || mPathChanged) {
- mFinalPath = tempPath;
+ mFinalPath.clone(tempPath);
mFinalPath.transform(parentMatrix);
mPathChanged = true;
}
float length() const;
const std::vector<VPath::Element> &elements() const;
const std::vector<VPointF> & points() const;
+ void clone(const VPath &srcPath);
private:
struct VPathData {
return d->points();
}
+inline void VPath::clone(const VPath &srcPath)
+{
+ d.write() = srcPath.d.read();
+}
+
V_END_NAMESPACE
#endif // VPATH_H