Added layer draw cache, and eraser works again
This commit is contained in:
parent
c2abccefc2
commit
7549ad23a1
29 changed files with 484 additions and 1434 deletions
|
|
@ -65,20 +65,20 @@ void CanvasComponentContainer::set_owner_obj_info(const ObjInfoSharedPtr& ownerO
|
|||
}
|
||||
|
||||
void CanvasComponentContainer::commit_update(DrawingProgram& drawP) {
|
||||
//auto lockedObjInfo = objInfo.lock();
|
||||
//if(worldAABB.has_value()) // This is the only point where worldAABB could be nullopt
|
||||
// drawP.preupdate_component(lockedObjInfo);
|
||||
auto lockedObjInfo = objInfo.lock();
|
||||
if(worldAABB.has_value()) // This is the only point where worldAABB could be nullopt
|
||||
drawP.drawCache.preupdate_component(lockedObjInfo);
|
||||
get_comp().initialize_draw_data(drawP);
|
||||
calculate_world_bounds();
|
||||
//drawP.preupdate_component(lockedObjInfo);
|
||||
drawP.drawCache.preupdate_component(lockedObjInfo);
|
||||
}
|
||||
|
||||
void CanvasComponentContainer::commit_transform(DrawingProgram& drawP) {
|
||||
//auto lockedObjInfo = objInfo.lock();
|
||||
//if(worldAABB.has_value()) // This is the only point where worldAABB could be nullopt
|
||||
// drawP.preupdate_component(lockedObjInfo);
|
||||
auto lockedObjInfo = objInfo.lock();
|
||||
if(worldAABB.has_value()) // This is the only point where worldAABB could be nullopt
|
||||
drawP.drawCache.preupdate_component(lockedObjInfo);
|
||||
calculate_world_bounds();
|
||||
//drawP.preupdate_component(lockedObjInfo);
|
||||
drawP.drawCache.preupdate_component(lockedObjInfo);
|
||||
}
|
||||
|
||||
void CanvasComponentContainer::commit_update_dont_invalidate_cache(DrawingProgram& drawP) {
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
|
||||
class DrawingProgram;
|
||||
class DrawingProgramCacheBVHNode;
|
||||
class DrawingProgramLayerListItem;
|
||||
|
||||
class CanvasComponentContainer {
|
||||
public:
|
||||
|
|
@ -44,7 +45,8 @@ class CanvasComponentContainer {
|
|||
void set_owner_obj_info(const ObjInfoSharedPtr& ownerObjInfo);
|
||||
void send_comp_update(DrawingProgram& drawP, bool finalUpdate);
|
||||
|
||||
std::weak_ptr<DrawingProgramCacheBVHNode> parentBvhNode;
|
||||
std::weak_ptr<DrawingProgramCacheBVHNode> parentBvhNode; // Should be removed later, the new cache uses an unordered_map to map objects to their cache node
|
||||
DrawingProgramLayerListItem* parentLayer = nullptr;
|
||||
CoordSpaceHelper coords;
|
||||
private:
|
||||
friend class BrushStrokeCanvasComponent;
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ void ImageCanvasComponent::update(DrawingProgram& drawP) {
|
|||
ResourceDisplay* display = drawP.world.drawData.rMan->get_display_data(d.imageID);
|
||||
if(display) {
|
||||
if(display->update_draw())
|
||||
drawP.invalidate_cache_at_component(compContainer->objInfo.lock());
|
||||
drawP.drawCache.invalidate_cache_at_aabb(compContainer->get_world_bounds());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue