From be7d38e47424c29c8d8a0410d34f22623edc96f7 Mon Sep 17 00:00:00 2001 From: Nick Kovalsky Date: Wed, 26 Jun 2024 22:16:57 +0300 Subject: [PATCH] 1.2.3.2 --- README.md | 22 ++++++++++++++++++++-- dev/uploadnugets.bat | 4 ++-- src/Directory.Build.props | 2 +- src/DrawnUi.Maui.sln | 2 ++ src/Engine/Draw/SkiaControl.cs | 21 ++++++++++++--------- 5 files changed, 37 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index ec30d03..e33ced3 100644 --- a/README.md +++ b/README.md @@ -16,9 +16,10 @@ https://github.com/taublast/DrawnUi.Maui/assets/25801194/3b360229-ce3b-4d33-a85b ## What's new -* New: SvgSpan for SkiaLabel -* Critical fix for release builds native crash while using ImageDoubleBuffered cache +* New: SvgSpan for SkiaLabel. +* Critical fix for Release builds native crash while using ImageDoubleBuffered cache. * Fixes for: gestures, SkiaMarkdownLabel, SkiaDrawer, SkiaLayout, Canvas and more. +* Added real published apps in the repo Readme. ## Demo Apps @@ -26,6 +27,7 @@ https://github.com/taublast/DrawnUi.Maui/assets/25801194/3b360229-ce3b-4d33-a85b * More creating custom controls examples inside the [Engine Demo](https://github.com/taublast/AppoMobi.Maui.DrawnUi.Demo) 🤩 __Updated with latest nuget!__ * A [dynamic arcade game](https://github.com/taublast/AppoMobi.Maui.DrawnUi.SpaceShooter) drawn with this engine, uses preview nuget with SkiaSharp v3. * A [drawn CollectionView demo](https://github.com/taublast/SurfAppCompareDrawn) where you could see how simple and profitable it is to convert an existing recycled cells list into a drawn one +* For real published apps scroll below Features! [ShaderEffect.webm](https://github.com/taublast/DrawnUi.Maui/assets/25801194/47c97290-e16b-4928-bfa4-8b29fb0ff8e1) @@ -96,6 +98,22 @@ ___Please star ⭐ if you like it!___ * Perspective1 * Perspective2 +## Published Apps powered by DrawnUI For .Net MAUI + +### Bug ID: Insect Identifier AI + +_Totally drawn with just one root view `Canvas` and `SkiaShell` for navigation. First ever drawn MAUI app!_ + +GooglePlay: https://play.google.com/store/apps/details?id=com.niroapps.insects + +### Racebox + +_MAUI pages with canvases, custom navigation. All scrolls, cells collections, maps, buttons, labels and custom controls are drawn._ + +iOS: https://apps.apple.com/us/app/racebox-vehicle-dynamics/id6444165250 +GooglePlay: https://play.google.com/store/apps/details?id=com.raceboxcompanion.app + + ## Development Notes * All files to be consumed (images etc) must be placed inside the MAUI app Resources/Raw folder, subfolders allowed. If you need to load from the native app folder use prefix "file://". diff --git a/dev/uploadnugets.bat b/dev/uploadnugets.bat index fae0066..43c840c 100644 --- a/dev/uploadnugets.bat +++ b/dev/uploadnugets.bat @@ -13,8 +13,8 @@ REM Define the source directory for the packages set "source_dir=E:\Nugets" REM Define the file mask for the packages -REM set "file_mask=DrawnUi.Maui*.1.2.2.626*.nupkg" -set "file_mask=AppoMobi.Maui.DrawnUi.1.2.2.626*.*nupkg" +set "file_mask=DrawnUi.Maui*.1.2.3.2*.nupkg" +REM set "file_mask=AppoMobi.Maui.DrawnUi.1.2.3.2*.*nupkg" REM Loop through each package file in the source directory for %%f in ("%source_dir%\%file_mask%") do ( diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 0f0c227..1731884 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -5,7 +5,7 @@ Using SkiaSharp 2.xx. Checkout the DrawnUi Sandbox project for usage example. - 1.2.3.1 + 1.2.3.2 diff --git a/src/DrawnUi.Maui.sln b/src/DrawnUi.Maui.sln index e1e7f63..3dd2027 100644 --- a/src/DrawnUi.Maui.sln +++ b/src/DrawnUi.Maui.sln @@ -6,8 +6,10 @@ MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{3EEA7F62-9878-451E-A506-28AB7C5DEEB8}" ProjectSection(SolutionItems) = preProject Directory.Build.props = Directory.Build.props + ..\dev\movenugets.bat = ..\dev\movenugets.bat ..\README.md = ..\README.md ToDo.txt = ToDo.txt + ..\dev\uploadnugets.bat = ..\dev\uploadnugets.bat EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DrawnUi.Maui", "Engine\DrawnUi.Maui.csproj", "{D76B6239-94A0-482C-A0FF-A764017B7393}" diff --git a/src/Engine/Draw/SkiaControl.cs b/src/Engine/Draw/SkiaControl.cs index 9238606..2cd60e0 100644 --- a/src/Engine/Draw/SkiaControl.cs +++ b/src/Engine/Draw/SkiaControl.cs @@ -5011,12 +5011,12 @@ protected virtual bool UseRenderingObject(SkiaDrawingContext context, SKRect rec { DisposeObject(RenderObjectPrevious); RenderObjectPrevious = null; + RenderObjectPreviousNeedsUpdate = false; } - RenderObjectPreviousNeedsUpdate = false; if (cache != null) { - if (!CheckCachedObjectValid(cache, context)) + if (!CheckCachedObjectValid(cache, recordArea, context)) { return false; } @@ -5028,11 +5028,11 @@ protected virtual bool UseRenderingObject(SkiaDrawingContext context, SKRect rec Monitor.PulseAll(LockDraw); } - if (UsingCacheType != SkiaCacheType.ImageDoubleBuffered || !NeedUpdateFrontCache) + if (cacheType != SkiaCacheType.ImageDoubleBuffered || !NeedUpdateFrontCache) return true; } - if (UsingCacheType == SkiaCacheType.ImageDoubleBuffered) + if (cacheType == SkiaCacheType.ImageDoubleBuffered) { lock (LockDraw) { @@ -5267,10 +5267,13 @@ public void DestroyRenderingObject() RenderObject = null; } - protected virtual bool CheckCachedObjectValid(CachedObject cache, SkiaDrawingContext context) + protected virtual bool CheckCachedObjectValid(CachedObject cache, SKRect recordingArea, SkiaDrawingContext context) { if (cache != null) { + if (cache.Bounds.Size != recordingArea.Size) + return false; + //check hardware context maybe changed if (UsingCacheType == SkiaCacheType.GPU && cache.Surface != null && cache.Surface.Context != null && @@ -5331,7 +5334,7 @@ public virtual SkiaCacheType UsingCacheType var width = (int)recordArea.Width; var height = (int)recordArea.Height; - bool needCreateSurface = !CheckCachedObjectValid(reuseSurfaceFrom, context) || usingCacheType == SkiaCacheType.GPU; + bool needCreateSurface = !CheckCachedObjectValid(reuseSurfaceFrom, recordingArea, context) || usingCacheType == SkiaCacheType.GPU; //never reuse GPU surfaces SKSurface surface = null; @@ -5532,13 +5535,13 @@ void draw(SkiaDrawingContext context) var usingCacheType = UsingCacheType; - CachedObject oldObject = null; + CachedObject oldObject = null; //reusing this if (usingCacheType == SkiaCacheType.ImageDoubleBuffered) { oldObject = RenderObject; } - else if (usingCacheType == SkiaCacheType.Image - || usingCacheType == SkiaCacheType.ImageComposite) + else + if (usingCacheType == SkiaCacheType.Image || usingCacheType == SkiaCacheType.ImageComposite) { oldObject = RenderObjectPrevious; }