mirror of
https://github.com/HQarroum/docker-android.git
synced 2026-07-15 06:47:07 +02:00
Refactoring the GPU acceleration implementation
This commit is contained in:
+1
-1
@@ -38,7 +38,7 @@ ARG IMG_TYPE=google_apis
|
|||||||
ARG ARCHITECTURE=x86_64
|
ARG ARCHITECTURE=x86_64
|
||||||
ARG CMD_LINE_VERSION=9477386_latest
|
ARG CMD_LINE_VERSION=9477386_latest
|
||||||
ARG DEVICE_ID=pixel
|
ARG DEVICE_ID=pixel
|
||||||
ARG GPU_ACCELERATED=false
|
ARG GPU_ACCELERATED=true
|
||||||
|
|
||||||
# Environment variables.
|
# Environment variables.
|
||||||
ENV ANDROID_SDK_ROOT=/opt/android \
|
ENV ANDROID_SDK_ROOT=/opt/android \
|
||||||
|
|||||||
@@ -28,9 +28,9 @@ echo no | avdmanager create avd -f -n android --abi "$ABI" -k "$PACKAGE_PATH" --
|
|||||||
# If GPU acceleration is enabled, we create a virtual framebuffer
|
# If GPU acceleration is enabled, we create a virtual framebuffer
|
||||||
# to be used by the emulator when running with GPU acceleration.
|
# to be used by the emulator when running with GPU acceleration.
|
||||||
if [ "$GPU_ACCELERATED" == "true" ]; then
|
if [ "$GPU_ACCELERATED" == "true" ]; then
|
||||||
echo "Running with GPU acceleration enabled"
|
echo "Running with GPU acceleration enabled";
|
||||||
export DISPLAY=":0.0"
|
export DISPLAY=":0.0";
|
||||||
export GPU_MODE="host"
|
export GPU_MODE="host";
|
||||||
Xvfb "$DISPLAY" -screen 0 1920x1080x16 -nolisten tcp &;
|
Xvfb "$DISPLAY" -screen 0 1920x1080x16 -nolisten tcp &;
|
||||||
else
|
else
|
||||||
export GPU_MODE="auto"
|
export GPU_MODE="auto"
|
||||||
|
|||||||
Reference in New Issue
Block a user