Skip to content

Commit 57151fa

Browse files
authored
Merge branch 'main' into getPostScriptName2
2 parents 18084f1 + 080e31c commit 57151fa

File tree

14 files changed

+119
-36
lines changed

14 files changed

+119
-36
lines changed

.github/workflows/label-with-ai.yml

Lines changed: 45 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,59 @@ name: Apply labels using AI
33
on:
44
issues:
55
types: [opened, reopened]
6+
workflow_dispatch:
7+
inputs:
8+
issue_number:
9+
description: 'Issue number to triage'
10+
required: true
11+
type: number
612

713
jobs:
814
apply-label-and-add-comment:
915
runs-on: ubuntu-latest
1016
permissions:
17+
contents: read
1118
issues: write
19+
models: read
20+
env:
21+
TRIAGE_AI_TOKEN: ${{ secrets.TRIAGE_AI_TOKEN }}
1222
steps:
13-
- uses: mattleibow/dev-tools@action/label-with-ai
14-
name: Apply AREA labels
23+
24+
- name: Checkout
25+
uses: actions/checkout@v4
26+
27+
- name: Determine AREA labels
28+
uses: mattleibow/triage-assistant@v0
1529
with:
16-
label-pattern: '^area/.*'
17-
apply-label: 'false'
18-
add-comment: 'false'
19-
- uses: mattleibow/dev-tools@action/label-with-ai
20-
name: Apply PLATFORM labels
30+
issue: ${{ inputs.issue_number || github.event.issue.number }}
31+
label-prefix: 'area/'
32+
template: 'single-label'
33+
34+
- name: Determine PLATFORM labels
35+
uses: mattleibow/triage-assistant@v0
2136
with:
22-
label-pattern: '^os/.*'
23-
apply-label: 'false'
24-
add-comment: 'false'
25-
- uses: mattleibow/dev-tools@action/label-with-ai
26-
name: Apply BACKEND labels
37+
issue: ${{ inputs.issue_number || github.event.issue.number }}
38+
label-prefix: 'os/'
39+
template: 'multi-label'
40+
41+
- name: Determine BACKEND labels
42+
uses: mattleibow/triage-assistant@v0
2743
with:
28-
label-pattern: '^backend/.*'
29-
apply-label: 'false'
30-
add-comment: 'false'
31-
- uses: mattleibow/dev-tools@action/label-with-ai
32-
name: Apply TENET labels
44+
issue: ${{ inputs.issue_number || github.event.issue.number }}
45+
label-prefix: 'backend/'
46+
template: 'multi-label'
47+
48+
- name: Determine TENET labels
49+
uses: mattleibow/triage-assistant@v0
50+
with:
51+
issue: ${{ inputs.issue_number || github.event.issue.number }}
52+
label-prefix: 'tenet/'
53+
template: 'single-label'
54+
55+
- name: Apply all labels and add comment
56+
uses: mattleibow/triage-assistant@v0
3357
with:
34-
label-pattern: '^tenet/.*'
35-
apply-label: 'false'
36-
add-comment: 'false'
58+
issue: ${{ inputs.issue_number || github.event.issue.number }}
59+
apply-labels: true
60+
apply-comment: true
61+
dry-run: true

binding/SkiaSharp/SKCanvas.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1078,10 +1078,11 @@ public void Dispose ()
10781078
/// </summary>
10791079
public void Restore ()
10801080
{
1081-
if (canvas != null) {
1081+
// canvas can be GC-ed before us
1082+
if (canvas != null && canvas.Handle != IntPtr.Zero) {
10821083
canvas.RestoreToCount (saveCount);
1083-
canvas = null;
10841084
}
1085+
canvas = null;
10851086
}
10861087
}
10871088

scripts/azure-pipelines-complete-internal.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ parameters:
1313
default:
1414
pool:
1515
name: Azure Pipelines
16-
vmImage: ubuntu-20.04
16+
vmImage: ubuntu-22.04
1717
os: windows
1818
- name: buildAgentWindows
1919
displayName: 'The Windows build agent configuration:'
@@ -61,7 +61,7 @@ parameters:
6161
default:
6262
pool:
6363
name: Azure Pipelines
64-
vmImage: ubuntu-20.04
64+
vmImage: ubuntu-22.04
6565
os: linux
6666
- name: buildAgentAndroidTests
6767
displayName: 'The build agent configuration for building the Android tests:'

scripts/azure-pipelines-complete.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ parameters:
1919
default:
2020
pool:
2121
name: Azure Pipelines
22-
vmImage: ubuntu-20.04
22+
vmImage: ubuntu-22.04
2323
os: windows
2424
- name: buildAgentWindows
2525
displayName: 'The Windows build agent configuration:'
@@ -67,7 +67,7 @@ parameters:
6767
default:
6868
pool:
6969
name: Azure Pipelines
70-
vmImage: ubuntu-20.04
70+
vmImage: ubuntu-22.04
7171
os: linux
7272
- name: buildAgentAndroidTests
7373
displayName: 'The build agent configuration for building the Android tests:'

scripts/azure-pipelines-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ parameters:
99
default:
1010
pool:
1111
name: Azure Pipelines
12-
vmImage: ubuntu-20.04
12+
vmImage: ubuntu-22.04
1313
os: windows
1414
- name: buildAgentWindows
1515
displayName: 'The Windows build agent configuration:'

source/SkiaSharp.Views.Maui/SkiaSharp.Views.Maui.Core/Handlers/SKCanvasView/SKCanvasViewHandler.Apple.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,25 @@ protected override void DisconnectHandler(SKCanvasView platformView)
3636

3737
public static void OnInvalidateSurface(SKCanvasViewHandler handler, ISKCanvasView canvasView, object? args)
3838
{
39+
if (handler?.PlatformView == null)
40+
return;
41+
3942
handler.PlatformView.SetNeedsDisplay();
4043
}
4144

4245
public static void MapIgnorePixelScaling(SKCanvasViewHandler handler, ISKCanvasView canvasView)
4346
{
47+
if (handler?.PlatformView == null)
48+
return;
49+
4450
handler.PlatformView.IgnorePixelScaling = canvasView.IgnorePixelScaling;
4551
}
4652

4753
public static void MapEnableTouchEvents(SKCanvasViewHandler handler, ISKCanvasView canvasView)
4854
{
55+
if (handler?.PlatformView == null)
56+
return;
57+
4958
handler.touchProxy?.UpdateEnableTouchEvents(handler.PlatformView, canvasView.EnableTouchEvents);
5059
}
5160

source/SkiaSharp.Views.Maui/SkiaSharp.Views.Maui.Core/Handlers/SKCanvasView/SKCanvasViewHandler.Tizen.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,25 @@ protected override void DisconnectHandler(SKCanvasView platformView)
3333

3434
public static void OnInvalidateSurface(SKCanvasViewHandler handler, ISKCanvasView canvasView, object? args)
3535
{
36+
if (handler?.PlatformView == null)
37+
return;
38+
3639
handler.PlatformView.Invalidate();
3740
}
3841

3942
public static void MapIgnorePixelScaling(SKCanvasViewHandler handler, ISKCanvasView canvasView)
4043
{
44+
if (handler?.PlatformView == null)
45+
return;
46+
4147
handler.PlatformView.IgnorePixelScaling = canvasView.IgnorePixelScaling;
4248
}
4349

4450
public static void MapEnableTouchEvents(SKCanvasViewHandler handler, ISKCanvasView canvasView)
4551
{
52+
if (handler?.PlatformView == null)
53+
return;
54+
4655
handler.touchHandler ??= new SKTouchHandler(
4756
args => canvasView.OnTouch(args),
4857
(x, y) => handler.OnGetScaledCoord(x, y));

source/SkiaSharp.Views.Maui/SkiaSharp.Views.Maui.Core/Handlers/SKCanvasView/SKCanvasViewHandler.Windows.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,23 @@ protected override void DisconnectHandler(SKXamlCanvas platformView)
3333

3434
public static void OnInvalidateSurface(SKCanvasViewHandler handler, ISKCanvasView canvasView, object? args)
3535
{
36+
if (handler?.PlatformView == null)
37+
return;
38+
3639
handler.PlatformView.Invalidate();
3740
}
3841

3942
public static void MapIgnorePixelScaling(SKCanvasViewHandler handler, ISKCanvasView canvasView)
4043
{
44+
if (handler?.PlatformView == null)
45+
return;
46+
4147
handler.PlatformView.IgnorePixelScaling = canvasView.IgnorePixelScaling;
4248
}
4349

4450
public static void MapEnableTouchEvents(SKCanvasViewHandler handler, ISKCanvasView canvasView)
4551
{
46-
if (handler.PlatformView == null)
52+
if (handler?.PlatformView == null)
4753
return;
4854

4955
handler.touchHandler ??= new SKTouchHandler(

source/SkiaSharp.Views.Maui/SkiaSharp.Views.Maui.Core/Handlers/SKGLView/SKGLViewHandler.Android.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,16 @@ protected override void DisconnectHandler(SKGLTextureView platformView)
4242

4343
public static void OnInvalidateSurface(SKGLViewHandler handler, ISKGLView view, object? args)
4444
{
45+
if (handler?.PlatformView == null)
46+
return;
47+
4548
if (handler.PlatformView.RenderMode == Rendermode.WhenDirty)
4649
handler.PlatformView.RequestRender();
4750
}
4851

4952
public static void MapIgnorePixelScaling(SKGLViewHandler handler, ISKGLView view)
5053
{
51-
if (handler.PlatformView is not MauiSKGLTextureView pv)
54+
if (handler?.PlatformView is not MauiSKGLTextureView pv)
5255
return;
5356

5457
pv.IgnorePixelScaling = view.IgnorePixelScaling;
@@ -57,13 +60,19 @@ public static void MapIgnorePixelScaling(SKGLViewHandler handler, ISKGLView view
5760

5861
public static void MapHasRenderLoop(SKGLViewHandler handler, ISKGLView view)
5962
{
63+
if (handler?.PlatformView == null)
64+
return;
65+
6066
handler.PlatformView.RenderMode = view.HasRenderLoop
6167
? Rendermode.Continuously
6268
: Rendermode.WhenDirty;
6369
}
6470

6571
public static void MapEnableTouchEvents(SKGLViewHandler handler, ISKGLView view)
6672
{
73+
if (handler?.PlatformView == null)
74+
return;
75+
6776
handler.touchHandler ??= new SKTouchHandler(
6877
args => view.OnTouch(args),
6978
(x, y) => handler.OnGetScaledCoord(x, y));

source/SkiaSharp.Views.Maui/SkiaSharp.Views.Maui.Core/Handlers/SKGLView/SKGLViewHandler.MacCatalyst.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,16 @@ protected override void DisconnectHandler(SKMetalView platformView)
4242

4343
public static void OnInvalidateSurface(SKGLViewHandler handler, ISKGLView view, object? args)
4444
{
45+
if (handler?.PlatformView == null)
46+
return;
47+
4548
if (handler.PlatformView.Paused && handler.PlatformView.EnableSetNeedsDisplay)
4649
handler.PlatformView.SetNeedsDisplay();
4750
}
4851

4952
public static void MapIgnorePixelScaling(SKGLViewHandler handler, ISKGLView view)
5053
{
51-
if (handler.PlatformView is MauiSKMetalView pv)
54+
if (handler?.PlatformView is MauiSKMetalView pv)
5255
{
5356
pv.IgnorePixelScaling = view.IgnorePixelScaling;
5457
handler.PlatformView.SetNeedsDisplay();
@@ -57,12 +60,18 @@ public static void MapIgnorePixelScaling(SKGLViewHandler handler, ISKGLView view
5760

5861
public static void MapHasRenderLoop(SKGLViewHandler handler, ISKGLView view)
5962
{
63+
if (handler?.PlatformView == null)
64+
return;
65+
6066
handler.PlatformView.Paused = !view.HasRenderLoop;
6167
handler.PlatformView.EnableSetNeedsDisplay = !view.HasRenderLoop;
6268
}
6369

6470
public static void MapEnableTouchEvents(SKGLViewHandler handler, ISKGLView view)
6571
{
72+
if (handler?.PlatformView == null)
73+
return;
74+
6675
handler.touchProxy?.UpdateEnableTouchEvents(handler.PlatformView, view.EnableTouchEvents);
6776
}
6877

0 commit comments

Comments
 (0)