Skip to content

Commit 50697ff

Browse files
committed
Merge branch 'CanvasTest' of https://github.com/BabylonJS/BabylonNative into BNCanvasCompositeBlur
2 parents d514391 + dfb0a8b commit 50697ff

File tree

21 files changed

+452
-807
lines changed

21 files changed

+452
-807
lines changed

.github/jobs/cmake.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,9 @@ steps:
2929
sudo apt-get install ninja-build
3030
cmake --version
3131
condition: contains('${{ parameters.vmImage }}', 'ubuntu')
32-
displayName: 'CMake version'
32+
displayName: 'CMake version'
33+
34+
- powershell: |
35+
choco install cmake --version=$(CMAKE_VERSION) -y --allow-downgrade
36+
condition: contains('${{ parameters.vmImage }}', 'windows')
37+
displayName: 'CMake version'

.github/jobs/test_install_win32.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,12 @@ jobs:
3535
solutionName: 'Win32_${{ parameters.platform }}${{variables.napiSuffix}}'
3636

3737
steps:
38+
- template: cmake.yml
39+
parameters:
40+
vmImage: ${{ parameters.vmImage }}
41+
42+
# BGFX_CONFIG_MAX_FRAME_BUFFERS is set so enough Framebuffers are available before V8 starts disposing unused ones
3843
- script: |
39-
# BGFX_CONFIG_MAX_FRAME_BUFFERS is set so enough Framebuffers are available before V8 starts disposing unused ones
4044
cmake -B build${{ variables.solutionName }} -A ${{ parameters.platform }} ${{ variables.jsEngineDefine }} -D BX_CONFIG_DEBUG=ON -D GRAPHICS_API=${{ parameters.graphics_api }} -D CMAKE_UNITY_BUILD=$(UNITY_BUILD) -D BGFX_CONFIG_MAX_FRAME_BUFFERS=256 -D BABYLON_DEBUG_TRACE=ON
4145
displayName: 'Generate ${{ variables.solutionName }} solution'
4246

.github/jobs/uwp.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ jobs:
2727
solutionName: 'UWP_${{ parameters.platform }}${{variables.napiSuffix}}'
2828

2929
steps:
30+
- template: cmake.yml
31+
parameters:
32+
vmImage: ${{ parameters.vmImage }}
33+
3034
- script: |
3135
cmake -B build${{ variables.solutionName }} -D CMAKE_SYSTEM_NAME=WindowsStore -D CMAKE_SYSTEM_VERSION=10.0 ${{ variables.jsEngineDefine }} -A ${{ parameters.platform }} -D CMAKE_UNITY_BUILD=$(UNITY_BUILD) -D BABYLON_DEBUG_TRACE=ON
3236
displayName: 'Generate ${{ variables.solutionName }} solution'

.github/jobs/win32.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,12 @@ jobs:
3434
solutionName: 'Win32_${{ parameters.platform }}${{variables.napiSuffix}}'
3535

3636
steps:
37+
- template: cmake.yml
38+
parameters:
39+
vmImage: ${{ parameters.vmImage }}
40+
41+
# BGFX_CONFIG_MAX_FRAME_BUFFERS is set so enough Framebuffers are available before V8 starts disposing unused ones
3742
- script: |
38-
# BGFX_CONFIG_MAX_FRAME_BUFFERS is set so enough Framebuffers are available before V8 starts disposing unused ones
3943
cmake -B build${{ variables.solutionName }} -A ${{ parameters.platform }} ${{ variables.jsEngineDefine }} -D BX_CONFIG_DEBUG=ON -D GRAPHICS_API=${{ parameters.graphics_api }} -D CMAKE_UNITY_BUILD=$(UNITY_BUILD) -D BGFX_CONFIG_MAX_FRAME_BUFFERS=256 -D BABYLON_DEBUG_TRACE=ON
4044
displayName: 'Generate ${{ variables.solutionName }} solution'
4145

.github/workflows/nightly.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ jobs:
1818
run: Get-ChildItem -Path .\Apps\node_modules -Recurse
1919
- name: Make Solution
2020
run: |
21+
choco install cmake --version=3.26.3 -y --allow-downgrade
2122
cmake -A x64 -B buildWin32_x64 -D BX_CONFIG_DEBUG=ON
2223
- name: NPM download nightly
2324
run: npm run getNightly

Apps/Playground/Scripts/validation_native.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@
131131
done(false);
132132
}
133133
});
134-
});
134+
}, true);
135135
}
136136

137137
function loadPlayground(test, done, referenceImage, compareFunction) {

Apps/UnitTests/Scripts/tests.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,20 @@ describe("RequestFile", function () {
1515
});
1616
});
1717

18+
describe("CanvasAndContext", function () {
19+
const engine = new BABYLON.NativeEngine();
20+
const scene = new BABYLON.Scene(engine);
21+
22+
const texSize = 512;
23+
const dynamicTexture = new BABYLON.DynamicTexture("dynamic texture", texSize, scene);
24+
const context = dynamicTexture.getContext();
25+
const otherContext = dynamicTexture.getContext();
26+
27+
expect(context).to.equal(context.canvas.getContext());
28+
expect(context).to.equal(otherContext);
29+
expect(context).to.equal(otherContext.canvas.getContext());
30+
});
31+
1832
describe("ColorParsing", function () {
1933
expect(_native.Canvas.parseColor("")).to.equal(0);
2034
expect(_native.Canvas.parseColor("transparent")).to.equal(0);

0 commit comments

Comments
 (0)