Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/ios-packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- '.github/workflows/ios-packaging.yml'
- 'maven/codenameone-maven-plugin/**'
- 'vm/ByteCodeTranslator/**'
- 'Ports/iOSPort/**'
- 'scripts/build-ios-app.sh'
- 'scripts/run-ios-ui-tests.sh'
- 'scripts/run-ios-native-tests.sh'
Expand All @@ -18,6 +19,7 @@ on:
- '.github/workflows/ios-packaging.yml'
- 'maven/codenameone-maven-plugin/**'
- 'vm/ByteCodeTranslator/**'
- 'Ports/iOSPort/**'
- 'scripts/build-ios-app.sh'
- 'scripts/run-ios-ui-tests.sh'
- 'scripts/run-ios-native-tests.sh'
Expand Down Expand Up @@ -68,7 +70,9 @@ jobs:
id: setup_hash
run: |
set -euo pipefail
echo "hash=$(shasum -a 256 scripts/setup-workspace.sh | awk '{print $1}')" >> "$GITHUB_OUTPUT"
SETUP_HASH=$(shasum -a 256 scripts/setup-workspace.sh | awk '{print $1}')
IOS_PORT_HASH=$(find Ports/iOSPort/src -type f -name '*.java' | sort | xargs shasum -a 256 | shasum -a 256 | awk '{print $1}')
echo "hash=${SETUP_HASH}-${IOS_PORT_HASH}" >> "$GITHUB_OUTPUT"

- name: Set TMPDIR
run: echo "TMPDIR=${{ runner.temp }}" >> $GITHUB_ENV
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
import com.codename1.ui.util.ImageIO;
import com.codename1.util.AsyncResource;
import com.codename1.util.FailureCallback;
import com.codename1.util.Simd;
import com.codename1.util.StringUtil;
import com.codename1.util.SuccessCallback;

Expand Down Expand Up @@ -8397,6 +8398,12 @@ public ImageIO getImageIO() {
return null;
}

/// Creates the SIMD implementation for this platform.
/// Ports may override this to provide accelerated SIMD behavior.
public Simd createSimd() {
return new Simd();
}

/// Workaround for XMLVM bug
public boolean instanceofObjArray(Object o) {
return o instanceof Object[];
Expand Down
6 changes: 6 additions & 0 deletions CodenameOne/src/com/codename1/ui/CN.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import com.codename1.ui.events.WindowEvent;
import com.codename1.ui.geom.Dimension;
import com.codename1.ui.geom.Rectangle;
import com.codename1.util.Simd;
import com.codename1.util.RunnableWithResultSync;

import java.io.IOException;
Expand Down Expand Up @@ -1032,6 +1033,11 @@ public static String getPlatformName() {
return Display.impl.getPlatformName();
}

/// Returns the SIMD API for the current platform.
public static Simd getSimd() {
return Display.getInstance().getSimd();
}


/// Opens the device Dialer application with the given phone number
///
Expand Down
15 changes: 15 additions & 0 deletions CodenameOne/src/com/codename1/ui/Display.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
import com.codename1.ui.util.EventDispatcher;
import com.codename1.ui.util.ImageIO;
import com.codename1.util.AsyncResource;
import com.codename1.util.Simd;
import com.codename1.util.RunnableWithResultSync;
import com.codename1.util.SuccessCallback;

Expand Down Expand Up @@ -216,6 +217,7 @@ public final class Display extends CN1Constants {
long time;
private int transitionDelay = -1;
private String selectedVirtualKeyboard = null;
private Simd simd;
private CrashReport crashReporter;
private EventDispatcher errorHandler;
private boolean inNativeUI;
Expand Down Expand Up @@ -343,6 +345,7 @@ public static void init(Object m) {
commandBehaviour = impl.getCommandBehavior();
}
impl = (CodenameOneImplementation) ImplementationFactory.getInstance().createImplementation();
INSTANCE.simd = null;

impl.setDisplayLock(lock);
impl.initImpl(m);
Expand Down Expand Up @@ -493,6 +496,18 @@ CodenameOneImplementation getImplementation() {
return impl;
}

/// Returns the SIMD API instance bound to the current implementation.
public Simd getSimd() {
if (simd == null) {
Simd created = impl.createSimd();
if (created == null) {
created = new Simd();
}
simd = created;
}
return simd;
}

/// Indicates the maximum frames the API will try to draw every second
/// by default this is set to 10. The advantage of limiting
/// framerate is to allow the CPU to perform other tasks besides drawing.
Expand Down
Loading
Loading