[PR #26] [MERGED] Optimize canvas loading time #49

Closed
opened 2025-12-29 05:19:17 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/dscyrescotti/Memola/pull/26
Author: @dscyrescotti
Created: 5/15/2024
Status: Merged
Merged: 5/15/2024
Merged by: @dscyrescotti

Base: mainHead: feature/canvas-loading


📝 Commits (6)

  • 8ee010b feat: load only visible strokes
  • 42eb3e6 feat: add intersection check on canvas view bounds
  • 9d2b633 feat: wait until vertex generation is completed
  • c0c039e feat: smooth out stroke
  • 3ad8075 feat: update canvas zoom scale
  • 5748fe6 feat: load quads using new background context

📊 Changes

15 files changed (+145 additions, -41 deletions)

View changed files

📝 Memola/Canvas/Contexts/GraphicContext.swift (+35 -7)
📝 Memola/Canvas/Core/Canvas.swift (+12 -4)
📝 Memola/Canvas/Geometries/Stroke/Generators/SolidPointStrokeGenerator.swift (+17 -20)
📝 Memola/Canvas/Geometries/Stroke/Stroke.swift (+29 -0)
📝 Memola/Canvas/RenderPasses/GraphicRenderPass.swift (+1 -0)
📝 Memola/Canvas/RenderPasses/StrokeRenderPass.swift (+1 -0)
📝 Memola/Canvas/Tool/Pen/PenStyles/EraserPenStyle.swift (+1 -1)
📝 Memola/Canvas/Tool/Pen/PenStyles/MarkerPenStyle.swift (+1 -1)
📝 Memola/Canvas/View/Bridge/ViewController/CanvasViewController.swift (+21 -5)
📝 Memola/Canvas/View/Bridge/Views/DrawingView.swift (+1 -1)
📝 Memola/Extensions/CGRect++.swift (+4 -0)
📝 Memola/Features/Memos/MemosView.swift (+2 -2)
📝 Memola/Persistence/Core/Persistence.swift (+18 -0)
📝 Memola/Persistence/Objects/StrokeObject.swift (+1 -0)
📝 Memola/Resources/Models/MemolaModel.xcdatamodeld/MemolaModel.xcdatamodel/contents (+1 -0)

📄 Description

Description

This PR adds the optimization to canvas loading time when opening the memo. The issue is resolved by loading visible strokes at the initial and generating vertices using compute kernel.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/dscyrescotti/Memola/pull/26 **Author:** [@dscyrescotti](https://github.com/dscyrescotti) **Created:** 5/15/2024 **Status:** ✅ Merged **Merged:** 5/15/2024 **Merged by:** [@dscyrescotti](https://github.com/dscyrescotti) **Base:** `main` ← **Head:** `feature/canvas-loading` --- ### 📝 Commits (6) - [`8ee010b`](https://github.com/dscyrescotti/Memola/commit/8ee010b77a844a21c3d8086a9aeb6d7939f666bc) feat: load only visible strokes - [`42eb3e6`](https://github.com/dscyrescotti/Memola/commit/42eb3e661e8d3ef10dc51a93e5e8d655de3b9fe3) feat: add intersection check on canvas view bounds - [`9d2b633`](https://github.com/dscyrescotti/Memola/commit/9d2b633f868219c3e29b98fa97cbd06acc2c234f) feat: wait until vertex generation is completed - [`c0c039e`](https://github.com/dscyrescotti/Memola/commit/c0c039ebfe3a640da9b4a2e4932da181664f2699) feat: smooth out stroke - [`3ad8075`](https://github.com/dscyrescotti/Memola/commit/3ad8075a286341083e8ef20fd85adbfbf4db082b) feat: update canvas zoom scale - [`5748fe6`](https://github.com/dscyrescotti/Memola/commit/5748fe685deb5598c035877e3e333ad303b45201) feat: load quads using new background context ### 📊 Changes **15 files changed** (+145 additions, -41 deletions) <details> <summary>View changed files</summary> 📝 `Memola/Canvas/Contexts/GraphicContext.swift` (+35 -7) 📝 `Memola/Canvas/Core/Canvas.swift` (+12 -4) 📝 `Memola/Canvas/Geometries/Stroke/Generators/SolidPointStrokeGenerator.swift` (+17 -20) 📝 `Memola/Canvas/Geometries/Stroke/Stroke.swift` (+29 -0) 📝 `Memola/Canvas/RenderPasses/GraphicRenderPass.swift` (+1 -0) 📝 `Memola/Canvas/RenderPasses/StrokeRenderPass.swift` (+1 -0) 📝 `Memola/Canvas/Tool/Pen/PenStyles/EraserPenStyle.swift` (+1 -1) 📝 `Memola/Canvas/Tool/Pen/PenStyles/MarkerPenStyle.swift` (+1 -1) 📝 `Memola/Canvas/View/Bridge/ViewController/CanvasViewController.swift` (+21 -5) 📝 `Memola/Canvas/View/Bridge/Views/DrawingView.swift` (+1 -1) 📝 `Memola/Extensions/CGRect++.swift` (+4 -0) 📝 `Memola/Features/Memos/MemosView.swift` (+2 -2) 📝 `Memola/Persistence/Core/Persistence.swift` (+18 -0) 📝 `Memola/Persistence/Objects/StrokeObject.swift` (+1 -0) 📝 `Memola/Resources/Models/MemolaModel.xcdatamodeld/MemolaModel.xcdatamodel/contents` (+1 -0) </details> ### 📄 Description ### Description This PR adds the optimization to canvas loading time when opening the memo. The issue is resolved by loading visible strokes at the initial and generating vertices using compute kernel. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 05:19:17 +01:00
adam closed this issue 2025-12-29 05:19:17 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Memola#49