[canvaskit] Upgrade emscripten to .27

This should have some slightly better, more minified JS and other
bugfixes

Bug: skia:
Change-Id: I7c5367b6650267ec8bafcc5de9e351bd8788392b
Reviewed-on: https://skia-review.googlesource.com/c/193582
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
This commit is contained in:
Kevin Lubick 2019-02-20 15:03:59 -05:00
parent 05ff93c43e
commit 2031f34a77
4 changed files with 20 additions and 18 deletions

View File

@ -13,19 +13,19 @@
function makeWebGLContext(canvas, attrs) {
// These defaults come from the emscripten _emscripten_webgl_create_context
var contextAttributes = {
'alpha': get(attrs, 'alpha', 1),
'depth': get(attrs, 'depth', 1),
'stencil': get(attrs, 'stencil', 0),
'antialias': get(attrs, 'antialias', 1),
'premultipliedAlpha': get(attrs, 'premultipliedAlpha', 1),
'preserveDrawingBuffer': get(attrs, 'preserveDrawingBuffer', 0),
'preferLowPowerToHighPerformance': get(attrs, 'preferLowPowerToHighPerformance', 0),
'failIfMajorPerformanceCaveat': get(attrs, 'failIfMajorPerformanceCaveat', 0),
'majorVersion': get(attrs, 'majorVersion', 1),
'minorVersion': get(attrs, 'minorVersion', 0),
'enableExtensionsByDefault': get(attrs, 'enableExtensionsByDefault', 1),
'explicitSwapControl': get(attrs, 'explicitSwapControl', 0),
'renderViaOffscreenBackBuffer': get(attrs, 'renderViaOffscreenBackBuffer', 0),
alpha: get(attrs, 'alpha', 1),
depth: get(attrs, 'depth', 1),
stencil: get(attrs, 'stencil', 0),
antialias: get(attrs, 'antialias', 1),
premultipliedAlpha: get(attrs, 'premultipliedAlpha', 1),
preserveDrawingBuffer: get(attrs, 'preserveDrawingBuffer', 0),
preferLowPowerToHighPerformance: get(attrs, 'preferLowPowerToHighPerformance', 0),
failIfMajorPerformanceCaveat: get(attrs, 'failIfMajorPerformanceCaveat', 0),
majorVersion: get(attrs, 'majorVersion', 1),
minorVersion: get(attrs, 'minorVersion', 0),
enableExtensionsByDefault: get(attrs, 'enableExtensionsByDefault', 1),
explicitSwapControl: get(attrs, 'explicitSwapControl', 0),
renderViaOffscreenBackBuffer: get(attrs, 'renderViaOffscreenBackBuffer', 0),
};
if (!canvas) {
SkDebug('null canvas passed into makeWebGLContext');
@ -36,6 +36,8 @@
SkDebug('explicitSwapControl is not supported');
return 0;
}
// GL is an enscripten provided helper
// See https://github.com/emscripten-core/emscripten/blob/incoming/src/library_webgl.js
return GL.createContext(canvas, contextAttributes);
}

View File

@ -1,4 +1,4 @@
EMSDK_VERSION=1.38.16_v1
EMSDK_VERSION=1.38.27_v1
# Can check CHROME_VERSION with
# docker run karma-chrome-tests /usr/bin/google-chrome-stable --version

View File

@ -1,7 +1,7 @@
# A Docker image that has the Emscripten SDK installed to /opt/emsdk
# Use this image to compile C/C++ code to WASM.
FROM launcher.gcr.io/google/clang-debian9 AS build
FROM launcher.gcr.io/google/clang-debian9
RUN apt-get update && apt-get upgrade -y && apt-get install -y \
git \
python \
@ -16,9 +16,9 @@ WORKDIR /opt/emsdk
RUN ./emsdk update-tags
# These versions were available and worked on my local desktop as of Nov 6 2018.
RUN ./emsdk install emscripten-1.38.16 node-8.9.1-64bit clang-e1.38.16-64bit
RUN ./emsdk install sdk-1.38.27-64bit
RUN ./emsdk activate emscripten-1.38.16 node-8.9.1-64bit clang-e1.38.16-64bit
RUN ./emsdk activate sdk-1.38.27-64bit
RUN /bin/bash -c "source ./emsdk_env.sh"

View File

@ -226,7 +226,7 @@ JSString EMSCRIPTEN_KEEPALIVE ToSVGString(const SkPath& path) {
// Wrapping it in val automatically turns it into a JS string.
// Not too sure on performance implications, but is is simpler than
// returning a raw pointer to const char * and then using
// Pointer_stringify() on the calling side.
// UTF8ToString() on the calling side.
return emscripten::val(s.c_str());
}