How to integrated SVG into skia on WASM? - svg

It is normal for me to use modules/svg to render svg in macos, but when I compile the code into wasm, SkSVGDOM is undefined, how to integrate modules/svg into wasm? I found the same problem, is it still not supported?
https://bugs.chromium.org/p/skia/issues/detail?id=14096&q=wasm&can=2

Related

Can I integrate a native app in a web browser?

I need to display a native app (in my case, a video game built on unity) in a web browser page.
Local video and input streaming would be a solution, but video encoding is consuming too much computer resources.
Is there a way to display a native app in a web browser page?
Sure, you need to compile your application for WebAssembly. Or, to be more precise, cross-compile it, since WebAssembly binary code runs on a virtual stack machine.
You take your native code, compile it into a .wasm module, and then load that .wasm module with WebAssembly.instantiateStreaming().
There are many toolchains that can have WebAssembly as the compilation target. I think the 2 most popular ones are Emscripten and wasm-pack.
There is also wabt, but that is rather a set of lower level tools, not quite a toolchain.
And since you mentioned Unity, I have no experience with it, but there is some official documentation on WebAssembly.
Here is a game that was developed in C# and cross-compiled to WebAssembly.

What are uv and v8 in nodeJS

There are 2 directories uv and v8 in deps folder
First question : what is the definition of deps directory?
My second question: What are uv and v8 utilities in Node.js?
To add a bit more detail:
libuv is a library for asynchronous I/O, originally developed for Node.js, and by now also used by a number of other projects. See https://github.com/libuv/libuv.
V8 is the JavaScript engine that powers Google Chrome, other Chromium-derived browsers (Opera, Yandex Browser, the Android versions of Firefox Focus and Microsoft Edge, and a bunch of others), CEF-derived desktop software (GitHub's Atom, Microsoft's Visual Studio Code, Valve's Steam, and others), Node.js, and many other embedding applications. See https://developers.google.com/v8/.
deps or dependencies: that contains things that are built outside of nodejs but are a part of node js.
UV and V8 are C++ dependencies for node JS

node-webkit and WebGL on Linux

Can someone confirm that WebGL works with node-webkit on Linux distros?
I can make WebGL run on Google Chrome after enabling the flag Override software rendering list on chrome://flags/, but I'm getting errors regarding Three.js when trying to execute the same application on node-webkit.
To answer my own question:
It just depends if the system has a video driver installed that supports:
hardware acceleration and
OpenGL ES2.0
(the requirements for WebGL)
Node-WebKit or not, WebGL is gonna run smoothly, if the above requirements are met.

MonoGame throws MonoGameGLException (InvalidEnum) Error When Creating Texture

Running any of the "Sample" projects that come with MonoGame will result in "MonoGameGLException". This occurs in the Texture2D constructor at the following code..
GL.CompressedTexImage2D(TextureTarget.Texture2D, 0, glInternalFormat,
this.width, this.height, 0,
imageSize, IntPtr.Zero);
GraphicsExtensions.CheckGLError(); <-- Error here
The value for "glInternalFormat" is:
OpenTK.Graphics.OpenGL.PixelInternalFormat.CompressedRgbaS3tcDxt3Ext
This occurs on Ubuntu Linux running on an Intel integrated graphics card.
TL;DR
This is an error that is caused because the OpenGL implementation (Mesa) does not contain support for the internal texture format (S3TC). Install the libtxc_dxtn library to add this functionality to Mesa.
The Problem
OpenGL is the graphics API that MonoGame uses to render graphics. Since OpenGL is just an API, you need some implementation of that API in order to have it work on your system. If you had an NVIDIA or ATI card, you could download their proprietary drivers (which include closed-source implementations of the OpenGL API). If you are not using their proprietary drivers (or are using a card like Intel graphics card that has open source drivers), then you are probably running Mesa, which is an open-source implementation of the OpenGL API standard.
OpenGL has a base standard, but it also has many extensions. One of these extensions is EXT_texture_compression_s3tc. This is an extension that allows the user to specify that the textures we are loading into the graphics card should be compressed using a specific algorithm of the S3TC family of algorithms. That is what the "GL.CompressedTexImage2D" line actually does: it requests that we make room for a texture that will be compressed using the DXT3 algorithm.
Mesa does not implement ALL of the OpenGL API and list of extensions. Specifically, they do not implement the S3TC extension (due to legal reasons).
"Invalid Enum" is the error that Mesa is throwing because you are trying to tell Mesa to use an extension (as specified by the enumerated value PixelInternalFormat.CompressedRgbaS3tcDxt3Ext) that Mesa does not support. This is the standard way an OpenGL implementation tells you that you are referring to an unsupported value.
The Solution
So, there are two options to fix this:
First, workaround MonoGame so that it stops using S3TC. This might require changing MonoGame code, or perhaps there is a better way using the ContentPipeline to specify what texture compression algorithm to use.
Second, install the S3TC algorithm. While Mesa does not include S3TC by default, you can include an external library for Mesa. More details on the Mesa Wiki S3TC page. Mesa needed to be built with a specific compiler flag, and then the library needs to be installed. In my Ubuntu install (12.04), I'm assuming that the Mesa package did have this flag enabled when compiling, since installing the library worked well. In Ubuntu, I installed the libtxc-dxtn-s2tc0 package.
sudo apt-get install libtxc-dxtn-s2tc0
After that, all the MonoGame samples were working.

embedded browser using XULRunner

Are there any examples of to use XULRunner to embed the browser control inside a app? (preferably in c or c++ for native win32 apps)
I have tried QT, wxWidgets, Awesomium, chrome embedded, LLmozLib, midori and Embedding/NewApi/Win32
The best one is wxWebConnect (which is part of wxWidgets framework). Why, cause you don't need the whole mozilla code base to build it plus the actual browser control is perfect as in plugins work, everything is rendered correctly (gmail, youtube etc etc)
So what's my problem or question? Well the wxWebConnect uses XULRunner to embed the browser control, my application is native win32 app and not wxWidgets app. I've searched the net to find another example of how use XULRunner to embed the gecko browser in native win32 apps..without luck!
Anyone know of projects/code that just use XULRunner and not require the entire mozilla source tree?
Thanks.
There's a list of XULRunner-based applications at
https://developer.mozilla.org/en/XULRunner_Hall_of_Fame
Whether you use wxWebConnect or embed XULRunner directly you are still going to have as part of your applications deployment the XULRunner engine and it's folder hierarchy. That's the nature of the beast.
Try GeckoFX, if you are okay with using .NET. Looking at the GeckoFX code might also give you enough insights to embed xulrunner in your native C++ Win32 app.

Resources