抱歉,该网页目前还不存在中文版本,请继续浏览其他网页!

Crosswalk Project 14 Beta: Shared Mode, Chromium 43, WebCL, SIMD for asm.js

Crosswalk 14 is in beta! Starting from this release, Crosswalk is available in the Google Play Store and applications can be configured to download it on demand. Also, this release comes with the usual update to Chromium (M43)and introduces the WebCL API for devices that support OpenCL. Finally, we have added SIMD support for code written in asm.js.

Shared Crosswalk runtime available in the Google Play Store

You can now package your application in “shared mode”. This means that your application’s APK won’t include the Crosswalk runtime, which will be downloaded from the Play Store when the application is first started. From that point on, the Crosswalk runtime will be shared with any other Crosswalk application that is also packaged in shared mode. The advantage is that your APK doesn’t need to include the Crosswalk library, making it a lot smaller. A few things to notice:

  • The user will be directed to the Play Store and will need to accept the installation of Crosswalk
  • There will be only one version of Crosswalk at any given time and it will be updated automatically
  • Shared mode is not yet supported by the Crosswalk Cordova WebView plugin. To use it with Cordova applications you’ll need to use our fork of Cordova Android 3.6
  • This feature is currently in Beta and backwards compatibility won’t be guaranteed until it’s promoted to stable. If you use it in your published applications, be prepared to release an update

To package the application in shared mode with make_apk use the option:

./make_apk.py --mode=shared ...

To create a cordova project in shared mode, use the option:

./bin/create --xwalk-shared-library ...

Chromium 43

Chromium 43 introduces Web MIDI support, new features to improve security and compatibility and a number of small changes to enable developers to build more powerful web applications. For more information see the announcement in the Chromium Developers blog.

WebCL

WebCL defines a JavaScript binding to the Khronos OpenCL standard for heterogeneous parallel computing. WebCL enables web applications to harness GPU and multi-core CPU parallel processing and achieve significant acceleration. The WebCL API first landed in Crosswalk Canary (version 13.41.304.0) as an experimental feature, and is now enabled by default on Android.

Because WebCL feature depends on the OpenCL library, before you try it, please make sure that “libPVROCL.so” or “libOpenCL.so” are present under “/system/vendor/lib” folder on the device. The WebCL feature was verified on a Asus MemoPad8 and Xiaomi3. You can also check the OpenCL support with an application like OpenCL Info.

SIMD.js and ASM.js optimizations in V8 Turbo Fan

asm.js is a highly optimizable, low-level subset of JavaScript. With the newly introduced TurboFan engine, V8 is able to recognize asm.js module (“use asm” directive) and emits very efficient machine code. Crosswalk 14 adds the SIMD.js support to the TurboFan engine. It allows web developers to utilize SIMD.js API in asm.js code or cross-compile C/C++ code with SSE intrinsics to asm.js with SIMD.js via emscripten.

Embedding API Updates

The Crosswalk XwalkView class has a new method to control whether its surface is placed on top of its window. Note that this only works when XWalkPreferences.ANIMATABLE_XWALK_VIEW is false.

public void setZOrderOnTop (boolean onTop);

Notable bug fixes

The --disk-cache-size command line switch now behaves as expected (bug XWALK-3821)

Get more hybrid app secrets

Build powerful hybrid apps for Android or Cordova / PhoneGap more reliably with tips from the Intel Crosswalk team.