Parallelize eraser

This commit is contained in:
Yousef Khadadeh 2026-05-29 23:14:56 +03:00
parent 4363fe9f9d
commit 4c4c767eef
5 changed files with 36 additions and 13 deletions

View file

@ -150,8 +150,8 @@ void CanvasComponentContainer::commit_transform_dont_invalidate_cache() {
// camCoordsScaleToCheckAgainst is different from camCoords.inverseScale if we locked the eraser's scale.
CanvasComponentEraseDetailResult CanvasComponentContainer::collides_with_erase_detail(const CoordSpaceHelper& camCoords, const WorldScalar& camCoordsScaleToCheckAgainst, const SkPath& checkAgainstCam) const {
constexpr static int COMP_MAX_SHIFT_BEFORE_STOP_ERASE = 3;
constexpr static int COMP_COMPLETE_ERASE_SHIFT = 13;
constexpr static int COMP_MAX_SHIFT_BEFORE_STOP_ERASE = 1;
constexpr static int COMP_COMPLETE_ERASE_SHIFT = 14;
if(!worldAABB.has_value())
return CanvasComponentEraseDetailResult::NO_CHANGE;
if((camCoordsScaleToCheckAgainst << COMP_MAX_SHIFT_BEFORE_STOP_ERASE) < coords.inverseScale) // Object is too large, just dismiss the collision

View file

@ -292,7 +292,7 @@ std::vector<CanvasComponentContainer*> MeshCanvasComponent::attempt_split(Drawin
if(clippingSubjects.size() <= 1)
return {};
ClipperD clipper;
ClipperD clipper(4);
PolyTreeD solutionTree;
clipper.AddSubject(clippingSubjects);