diff --git a/.github/jobs/test_install_win32.yml b/.github/jobs/test_install_win32.yml index a35f63a4b..07037d7ad 100644 --- a/.github/jobs/test_install_win32.yml +++ b/.github/jobs/test_install_win32.yml @@ -41,7 +41,6 @@ jobs: # BGFX_CONFIG_MAX_FRAME_BUFFERS is set so enough Framebuffers are available before V8 starts disposing unused ones - script: | - # BGFX_CONFIG_MAX_FRAME_BUFFERS is set so enough Framebuffers are available before V8 starts disposing unused ones cmake -B build${{ variables.solutionName }} -A ${{ parameters.platform }} ${{ variables.jsEngineDefine }} -D BX_CONFIG_DEBUG=ON -D GRAPHICS_API=${{ parameters.graphics_api }} -D CMAKE_UNITY_BUILD=$(UNITY_BUILD) -D BGFX_CONFIG_MAX_FRAME_BUFFERS=256 -D BABYLON_DEBUG_TRACE=ON displayName: 'Generate ${{ variables.solutionName }} solution' diff --git a/Apps/Playground/Scripts/experience.js b/Apps/Playground/Scripts/experience.js index aaa0b47bc..0a3fc2ad5 100644 --- a/Apps/Playground/Scripts/experience.js +++ b/Apps/Playground/Scripts/experience.js @@ -21,7 +21,7 @@ const imageTracking = false; const readPixels = false; function CreateBoxAsync(scene) { - BABYLON.Mesh.CreateBox("box1", 0.2, scene); + //BABYLON.Mesh.CreateBox("box1", 0.2, scene); return Promise.resolve(); } @@ -64,6 +64,202 @@ CreateBoxAsync(scene).then(function () { //BABYLON.SceneLoader.AppendAsync("https://raw.githubusercontent.com/KhronosGroup/glTF-Sample-Models/master/2.0/ClearCoatTest/glTF/ClearCoatTest.gltf").then(function () { BABYLON.Tools.Log("Loaded"); + var textureGround; + + BABYLON.Tools.LoadFile("https://raw.githubusercontent.com/CedricGuillemet/dump/master/droidsans.ttf", (data) => { + _native.Canvas.loadTTFAsync("droidsans", data).then(function () { + var ground = BABYLON.MeshBuilder.CreateGround("ground1", { width: 0.5, height: 0.5, subdivisions: 2 }, scene); + ground.rotation.x = -Math.PI * 0.5; + ground.rotation.y = Math.PI; + + var texSize = 512; + var dynamicTexture = new BABYLON.DynamicTexture("dynamic texture", texSize, scene); + + var materialGround = new BABYLON.StandardMaterial("Mat", scene); + materialGround.diffuseTexture = dynamicTexture; + ground.material = materialGround; + materialGround.backFaceCulling = false; + dynamicTexture.clear(); + var context = dynamicTexture.getContext(); + + // Text with gradient + const gradientText = context.createLinearGradient(0, 0, 256, 0); + gradientText.addColorStop(0, "magenta"); + gradientText.addColorStop(0.5, "blue"); + gradientText.addColorStop(1.0, "red"); + + // gradient + let gradient = context.createLinearGradient(0, 0, 200, 0); + gradient.addColorStop(0, "green"); + gradient.addColorStop(0.7, "white"); + gradient.addColorStop(1, "pink"); + + var t = 0; + scene.onBeforeRenderObservable.add(() => { + // animated shape + context.save(); + context.fillStyle = "DarkRed"; + context.fillRect(0, 0, texSize, texSize); + const left = 0; + const top = texSize - (texSize * 0.25); + const width = 0.25 * texSize; + const height = 0.25 * texSize; + const offsetU = ((Math.sin(t) * 0.5) + 0.5) * (texSize - (texSize * 0.25)); + const offsetV = ((Math.sin(t) * 0.5) + 0.5) * (-texSize + (texSize * 0.25)); + const rectangleU = width * 0.5 + left; + const rectangleV = height * 0.5 + top; + context.translate(rectangleU + offsetU, rectangleV + offsetV); + context.rotate(t); + context.fillStyle = "DarkOrange"; + context.transform(1, t, 0.8, 1, 0, 0); + context.fillRect(-width * 0.5, -height * 0.5, width, height); + context.restore(); + + // curve + context.beginPath(); + context.moveTo(75 * 2, 25 * 2); + context.quadraticCurveTo(25 * 2, 25 * 2, 25 * 2, 62.5 * 2); + context.quadraticCurveTo(25 * 2, 100 * 2, 50 * 2, 100 * 2); + context.quadraticCurveTo(50 * 2, 120 * 2, 30 * 2, 125 * 2); + context.quadraticCurveTo(60 * 2, 120 * 2, 65 * 2, 100 * 2); + context.quadraticCurveTo(125 * 2, 100 * 2, 125 * 2, 62.5 * 2); + context.quadraticCurveTo(125 * 2, 25 * 2, 75 * 2, 25 * 2); + context.fillStyle = "blue"; + context.fill(); + + // text + var scale = Math.sin(t) * 0.5 + 0.54; + context.save(); + context.translate(Math.cos(t) * 100, 246); + context.font = `bold ${scale * 200}px monospace`; + context.strokeStyle = "Green"; + context.lineWidth = scale * 16; + context.strokeText("BabylonNative", 0, 0); + context.fillStyle = "White"; + context.fillText("BabylonNative", 0, 0); + context.restore(); + + // Draw guides + context.strokeStyle = "#09f"; + context.beginPath(); + context.moveTo(10, 10); + context.lineTo(140, 10); + context.moveTo(10, 140); + context.lineTo(140, 140); + context.stroke(); + + // filter blur text + context.filter = "blur(2.5px)"; + context.fillStyle = "White"; + context.font = `bold ${50}px monospace`; + context.fillText("BLUR TEST BLUR TEST", 100, 246); + context.filter = "none"; + + // Draw lines + context.strokeStyle = "black"; + ["butt", "round", "square"].forEach((lineCap, i) => { + context.lineWidth = 15; + context.lineCap = lineCap; + context.beginPath(); + context.moveTo(25 + i * 50, 10); + context.lineTo(25 + i * 50, 140); + context.stroke(); + }); + + // line join + context.lineWidth = 10; + var offset = 200; + ["round", "bevel", "miter"].forEach((join, i) => { + context.lineJoin = join; + context.beginPath(); + context.moveTo(-5 + offset, 15 + i * 40); + context.lineTo(35 + offset, 55 + i * 40); + context.lineTo(75 + offset, 15 + i * 40); + context.lineTo(115 + offset, 55 + i * 40); + context.lineTo(155 + offset, 15 + i * 40); + context.stroke(); + }); + + // rect with gradient + context.fillStyle = gradient; + context.fillRect(10, 310, 400, 60); + + // Fill with gradient + context.fillStyle = gradientText; + context.font = "bold 60px monospace"; + context.fillText("Gradient Text!", 10, 420); + + context.lineWidth = 5; + // Rounded rectangle with zero radius (specified as a number) + context.strokeStyle = "red"; + context.beginPath(); + context.roundRect(10, 220, 150, 100, 0); + context.stroke(); + + // Rounded rectangle with 40px radius (single element list) + context.strokeStyle = "blue"; + context.beginPath(); + context.roundRect(10, 220, 150, 100, [40]); + context.stroke(); + + // Rounded rectangle with 2 different radii + context.strokeStyle = "orange"; + context.beginPath(); + context.roundRect(10, 350, 150, 100, [10, 40]); + context.stroke(); + + // Rounded rectangle with four different radii + context.strokeStyle = "green"; + context.beginPath(); + context.roundRect(200, 220, 200, 100, [0, 30, 50, 60]); + context.stroke(); + + // Same rectangle drawn backwards + context.strokeStyle = "magenta"; + context.beginPath(); + context.roundRect(400, 350, -200, 100, [0, 30, 50, 60]); + context.stroke(); + + // Path 2D stroke + context.strokeStyle = "black"; + context.lineWidth = 2; + let heartPath = new engine.createCanvasPath2D("M390,30 A 20, 20 0, 0, 1 430, 30 A 20, 20 0, 0, 1 470, 30 Q 470, 60 430, 90 Q 390, 60 390, 30 z"); + let squarePath = new engine.createCanvasPath2D("M380, 10 h100 v100 h-100 Z"); + heartPath.addPath(squarePath, { a: 1, b: 0, c: 0, d: 1, e: 0, f: -5 }); // push square 5px up to center heart. + context.stroke(heartPath); + + // Path 2D fill + context.fillStyle = "yellow"; + let diamondPath = new engine.createCanvasPath2D(); + diamondPath.moveTo(350, 200); // Start at the center + diamondPath.lineTo(375, 175); // Move to the top point + diamondPath.lineTo(400, 200); // Move to the right point + diamondPath.lineTo(375, 225); // Move to the bottom point + diamondPath.lineTo(350, 200); // Close back to the starting point + context.fill(diamondPath); + + // Path 2D round rect + context.strokeStyle = "red"; + let roundRectPath = new engine.createCanvasPath2D(); + roundRectPath.roundRect(300, 150, 45, 70, { x: 30, y: 15 }); + context.stroke(roundRectPath); + + // Draw clipped round rect + // TODO: this is currently broken, clipping area does not have round corners + context.beginPath(); + context.roundRect(40, 450, 100, 50, 10); + context.clip(); + context.fillStyle = "blue"; + context.fillRect(0, 0, 1000, 1000); + + // tick update + dynamicTexture.update(); + t += 0.01; + }); + + }); + }, undefined, undefined, true); + // This creates and positions a free camera (non-mesh) scene.createDefaultCamera(true, true, true); scene.activeCamera.alpha += Math.PI; diff --git a/Apps/UnitTests/Scripts/tests.js b/Apps/UnitTests/Scripts/tests.js index 134e0d96f..8b7959136 100644 --- a/Apps/UnitTests/Scripts/tests.js +++ b/Apps/UnitTests/Scripts/tests.js @@ -1,4 +1,5 @@ -mocha.setup({ ui: "bdd", reporter: "spec", retries: 5 }); +"use strict"; +mocha.setup({ ui: "bdd", reporter: "spec", retries: 5 }); const expect = chai.expect; @@ -15,6 +16,20 @@ describe("RequestFile", function () { }); }); +describe("CanvasAndContext", function () { + const engine = new BABYLON.NativeEngine(); + const scene = new BABYLON.Scene(engine); + + const texSize = 512; + const dynamicTexture = new BABYLON.DynamicTexture("dynamic texture", texSize, scene); + const context = dynamicTexture.getContext(); + const otherContext = dynamicTexture.getContext(); + + expect(context).to.equal(context.canvas.getContext()); + expect(context).to.equal(otherContext); + expect(context).to.equal(otherContext.canvas.getContext()); +}); + describe("ColorParsing", function () { expect(_native.Canvas.parseColor("")).to.equal(0); expect(_native.Canvas.parseColor("transparent")).to.equal(0); diff --git a/Plugins/NativeEngine/CMakeLists.txt b/Plugins/NativeEngine/CMakeLists.txt index e85c831fa..aae20c030 100644 --- a/Plugins/NativeEngine/CMakeLists.txt +++ b/Plugins/NativeEngine/CMakeLists.txt @@ -33,21 +33,40 @@ target_include_directories(NativeEngine PUBLIC "Include" PRIVATE "${BIMG_DIR}/3rdparty") -target_link_libraries(NativeEngine - PUBLIC napi - PRIVATE JsRuntime - PRIVATE GraphicsDevice - PRIVATE arcana - PRIVATE bgfx - PRIVATE bimg - PRIVATE bimg_encode - PRIVATE bimg_decode - PRIVATE bx - PRIVATE glslang - PRIVATE glslang-default-resource-limits - PRIVATE SPIRV - PRIVATE GraphicsDeviceContext) -warnings_as_errors(NativeEngine) + +if(BGFX_BUILD_TOOLS) + target_link_libraries(NativeEngine + PUBLIC napi + PRIVATE JsRuntime + PRIVATE GraphicsDevice + PRIVATE arcana + PRIVATE bgfx + PRIVATE bimg + PRIVATE bimg_encode + PRIVATE bimg_decode + PRIVATE bx + PRIVATE glslang + PRIVATE spirv-opt + PRIVATE GraphicsDeviceContext) + target_compile_definitions(NativeEngine PRIVATE BGFX_BUILD_TOOLS) +else() + target_link_libraries(NativeEngine + PUBLIC napi + PRIVATE JsRuntime + PRIVATE GraphicsDevice + PRIVATE arcana + PRIVATE bgfx + PRIVATE bimg + PRIVATE bimg_encode + PRIVATE bimg_decode + PRIVATE bx + PRIVATE glslang + PRIVATE glslang-default-resource-limits + PRIVATE SPIRV + PRIVATE GraphicsDeviceContext) + + warnings_as_errors(NativeEngine) +endif() if(TARGET spirv-cross-hlsl) target_link_libraries(NativeEngine diff --git a/Plugins/NativeEngine/Source/ShaderCompilerMetal.cpp b/Plugins/NativeEngine/Source/ShaderCompilerMetal.cpp index e8a13c023..5b5241024 100644 --- a/Plugins/NativeEngine/Source/ShaderCompilerMetal.cpp +++ b/Plugins/NativeEngine/Source/ShaderCompilerMetal.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include #include #include diff --git a/Plugins/NativeEngine/Source/ShaderCompilerTraversers.cpp b/Plugins/NativeEngine/Source/ShaderCompilerTraversers.cpp index f3d0633c1..b272acdeb 100644 --- a/Plugins/NativeEngine/Source/ShaderCompilerTraversers.cpp +++ b/Plugins/NativeEngine/Source/ShaderCompilerTraversers.cpp @@ -220,8 +220,11 @@ namespace Babylon::ShaderCompilerTraversers // Create the symbol for the actual struct. The name of this symbol, "anon@0", // mirrors the kinds of strings glslang generates automatically for these sorts // of objects. - TIntermSymbol* structSymbol = intermediate->addSymbol(TIntermSymbol{ids.Next(), "anon@0", structType}); - +#ifdef BGFX_BUILD_TOOLS + TIntermSymbol* structSymbol = intermediate->addSymbol(TIntermSymbol{ids.Next(), "anon@0", intermediate->getStage(), structType}); +#else + TIntermSymbol* structSymbol = intermediate->addSymbol(TIntermSymbol{ ids.Next(), "anon@0", structType }); +#endif // Every affected symbol in the AST (except linker objects) must be replaced // with a new operation to retrieve its value from the struct. This operation // consists of a binary operation indexing into the struct at a specified @@ -521,7 +524,11 @@ namespace Babylon::ShaderCompilerTraversers TType newType{publicType}; newType.setBasicType(symbol->getType().getBasicType()); - auto* newSymbol = intermediate->addSymbol(TIntermSymbol{ids.Next(), newName, newType}); +#ifdef BGFX_BUILD_TOOLS + auto* newSymbol = intermediate->addSymbol(TIntermSymbol{ids.Next(), newName, intermediate->getStage(), newType}); +#else + auto* newSymbol = intermediate->addSymbol(TIntermSymbol{ ids.Next(), newName, newType }); +#endif originalNameToReplacement[name] = newSymbol; replacementToOriginalName[newName] = name; } @@ -794,7 +801,11 @@ namespace Babylon::ShaderCompilerTraversers TType newType{publicType}; std::string newName = name + "Texture"; - newTexture = intermediate->addSymbol(TIntermSymbol{ids.Next(), newName.c_str(), newType}); +#ifdef BGFX_BUILD_TOOLS + newTexture = intermediate->addSymbol(TIntermSymbol{ids.Next(), newName.c_str(), intermediate->getStage(), newType}); +#else + newTexture = intermediate->addSymbol(TIntermSymbol{ ids.Next(), newName.c_str(), newType }); +#endif } // Create the new sampler symbol. @@ -809,7 +820,11 @@ namespace Babylon::ShaderCompilerTraversers publicType.sampler.sampler = true; TType newType{publicType}; - newSampler = intermediate->addSymbol(TIntermSymbol{ids.Next(), name.c_str(), newType}); +#ifdef BGFX_BUILD_TOOLS + newSampler = intermediate->addSymbol(TIntermSymbol{ids.Next(), name.c_str(), intermediate->getStage(), newType}); +#else + newSampler = intermediate->addSymbol(TIntermSymbol{ ids.Next(), name.c_str(), newType }); +#endif } nameToNewTextureAndSampler[name] = std::pair{newTexture, newSampler}; diff --git a/Polyfills/Canvas/CMakeLists.txt b/Polyfills/Canvas/CMakeLists.txt index be6b3c514..8171ac010 100644 --- a/Polyfills/Canvas/CMakeLists.txt +++ b/Polyfills/Canvas/CMakeLists.txt @@ -18,27 +18,29 @@ function(add_bgfx_shader FILE FOLDER) set(OUTPUTS_PRETTY "") # dx11 - set(DX11_OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/Source/Shaders/dx11/${FILENAME}.h) - if(NOT "${TYPE}" STREQUAL "COMPUTE") - _bgfx_shaderc_parse( - DX11 ${COMMON} WINDOWS - PROFILE s_5_0 - O 3 - OUTPUT ${DX11_OUTPUT} - BIN2C "${FILENAME}_dx11" - ) - else() - _bgfx_shaderc_parse( - DX11 ${COMMON} WINDOWS - PROFILE s_5_0 - O 1 - OUTPUT ${DX11_OUTPUT} - BIN2C "${FILENAME}_dx11" - ) + if(WIN32) + set(DX11_OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/Source/Shaders/dx11/${FILENAME}.h) + if(NOT "${TYPE}" STREQUAL "COMPUTE") + _bgfx_shaderc_parse( + DX11 ${COMMON} WINDOWS + PROFILE s_5_0 + O 3 + OUTPUT ${DX11_OUTPUT} + BIN2C "${FILENAME}_dx11" + ) + else() + _bgfx_shaderc_parse( + DX11 ${COMMON} WINDOWS + PROFILE s_5_0 + O 1 + OUTPUT ${DX11_OUTPUT} + BIN2C "${FILENAME}_dx11" + ) + endif() + list(APPEND OUTPUTS "DX11") + set(OUTPUTS_PRETTY "${OUTPUTS_PRETTY}DX11, ") endif() - list(APPEND OUTPUTS "DX11") - set(OUTPUTS_PRETTY "${OUTPUTS_PRETTY}DX11, ") - + # metal set(METAL_OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/Source/Shaders/metal/${FILENAME}.h) _bgfx_shaderc_parse(METAL ${COMMON} OSX PROFILE metal OUTPUT ${METAL_OUTPUT} BIN2C "${FILENAME}_mtl") @@ -93,32 +95,40 @@ set(SOURCES "Source/Canvas.cpp" "Source/Canvas.h" "Source/Colors.h" + "Source/FrameBufferPool.cpp" + "Source/FrameBufferPool.h" "Source/Image.cpp" "Source/Image.h" "Source/ImageData.cpp" "Source/ImageData.h" + "Source/Path2D.cpp" + "Source/Path2D.h" + "Source/LineCaps.h" "Source/Context.cpp" "Source/Context.h" "Source/MeasureText.cpp" "Source/MeasureText.h" - "Source/nanovg_babylon.cpp" - "Source/nanovg_babylon.h" + "Source/Gradient.cpp" + "Source/Gradient.h" + "Source/Font.cpp" + "Source/Font.h" + "Source/nanosvg.h" + "Source/nanovg/nanovg.cpp" + "Source/nanovg/nanovg.h" + "Source/nanovg/nanovg_babylon.cpp" + "Source/nanovg/nanovg_babylon.h" + "Source/nanovg/nanovg_filterstack.cpp" + "Source/nanovg/nanovg_filterstack.h" ) file(GLOB SHADERS "Source/Shaders/*.sc" "Source/Shaders/*.sh") -file(GLOB FONT_SOURCES ${BGFX_DIR}/examples/common/font/*.cpp) -file(GLOB NANOVG_SOURCES ${BGFX_DIR}/examples/common/nanovg/nanovg.cpp) -set(ATLAS_SOURCES ${BGFX_DIR}/examples/common/cube_atlas.cpp) - -add_library(Canvas ${SOURCES} ${FONT_SOURCES} ${ATLAS_SOURCES} ${NANOVG_SOURCES} ${SHADERS}) +add_library(Canvas ${SOURCES} ${SHADERS}) target_include_directories(Canvas PUBLIC "Include" PRIVATE "Source" - PRIVATE "${BGFX_DIR}/3rdparty" - PRIVATE "${BGFX_DIR}/examples/common" - PRIVATE "${BGFX_DIR}/examples/common/nanovg") + PRIVATE "${BGFX_DIR}/3rdparty") target_link_libraries(Canvas PUBLIC napi @@ -141,6 +151,6 @@ endif() set_property(TARGET Canvas PROPERTY FOLDER Polyfills) source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${SOURCES}) -source_group("3rd party Sources" ${CMAKE_CURRENT_SOURCE_DIR} FILES ${FONT_SOURCES} ${NANOVG_SOURCES} ${ATLAS_SOURCES}) +source_group("3rd party Sources" ${CMAKE_CURRENT_SOURCE_DIR} FILES ${FONT_SOURCES} ${ATLAS_SOURCES}) source_group("Shaders" ${CMAKE_CURRENT_SOURCE_DIR} FILES ${SHADERS}) -target_compile_definitions(Canvas PRIVATE _CRT_SECURE_NO_WARNINGS) \ No newline at end of file +target_compile_definitions(Canvas PRIVATE _CRT_SECURE_NO_WARNINGS) diff --git a/Polyfills/Canvas/Source/Canvas.cpp b/Polyfills/Canvas/Source/Canvas.cpp index 594697908..74c0d51be 100644 --- a/Polyfills/Canvas/Source/Canvas.cpp +++ b/Polyfills/Canvas/Source/Canvas.cpp @@ -1,10 +1,12 @@ #include "Canvas.h" #include "Image.h" +#include "Path2D.h" #include "Context.h" #include #include #include #include "Colors.h" +#include "Gradient.h" namespace { @@ -23,6 +25,7 @@ namespace Babylon::Polyfills::Internal env, JS_CONSTRUCTOR_NAME, { + StaticMethod("loadTTF", &NativeCanvas::LoadTTF), StaticMethod("loadTTFAsync", &NativeCanvas::LoadTTFAsync), InstanceAccessor("width", &NativeCanvas::GetWidth, &NativeCanvas::SetWidth), InstanceAccessor("height", &NativeCanvas::GetHeight, &NativeCanvas::SetHeight), @@ -57,22 +60,27 @@ namespace Babylon::Polyfills::Internal // called when removed from document which has no meaning for Native } + void NativeCanvas::LoadTTF(const Napi::CallbackInfo& info) + { + // don't allow same font to be loaded more than once + // why? because Context doesn't update nvgCreateFontMem when old fontBuffer released + auto fontName = info[0].As().Utf8Value(); + if (fontsInfos.find(fontName) == fontsInfos.end()) + { + const auto buffer = info[1].As(); + std::vector fontBuffer(buffer.ByteLength()); + memcpy(fontBuffer.data(), (uint8_t*)buffer.Data(), buffer.ByteLength()); + fontsInfos[fontName] = std::move(fontBuffer); + } + } + + // @deprecated: LoadTTFAsync is always synchronous, use LoadTTF instead Napi::Value NativeCanvas::LoadTTFAsync(const Napi::CallbackInfo& info) { - const auto buffer = info[1].As(); - std::vector fontBuffer(buffer.ByteLength()); - memcpy(fontBuffer.data(), (uint8_t*)buffer.Data(), buffer.ByteLength()); + LoadTTF(info); - auto& graphicsContext{Graphics::DeviceContext::GetFromJavaScript(info.Env())}; - auto update = graphicsContext.GetUpdate("update"); - std::shared_ptr runtimeScheduler{std::make_shared(JsRuntime::GetFromJavaScript(info.Env()))}; auto deferred{Napi::Promise::Deferred::New(info.Env())}; - arcana::make_task(update.Scheduler(), arcana::cancellation::none(), [fontName{info[0].As().Utf8Value()}, fontData{std::move(fontBuffer)}]() { - fontsInfos[fontName] = fontData; - }).then(*runtimeScheduler, arcana::cancellation::none(), [runtimeScheduler /*Keep reference alive*/, env{info.Env()}, deferred]() { - deferred.Resolve(env.Undefined()); - }); - + deferred.Resolve(info.Env().Undefined()); return deferred.Promise(); } @@ -99,7 +107,16 @@ namespace Babylon::Polyfills::Internal void NativeCanvas::SetWidth(const Napi::CallbackInfo&, const Napi::Value& value) { auto width = static_cast(value.As().Uint32Value()); - if (width != m_width && width) + if (!width) + { + return; + } + + if (width == m_width) + { + m_clear = true; + } + else { m_width = width; m_dirty = true; @@ -113,16 +130,29 @@ namespace Babylon::Polyfills::Internal void NativeCanvas::SetHeight(const Napi::CallbackInfo&, const Napi::Value& value) { - auto height = value.As().Uint32Value(); - if (height != m_height && height) + auto height = static_cast(value.As().Uint32Value()); + if (!height) + { + return; + } + + if (height == m_height) + { + m_clear = true; + } + else { m_height = height; m_dirty = true; } } - void NativeCanvas::UpdateRenderTarget() + bool NativeCanvas::UpdateRenderTarget() { + // in some scenarios (eg. no size change on SetSize/SetHeight) we can re-use framebuffer + bool needClear = m_clear; + m_clear = false; + if (m_dirty) { // make sure render targets are filled with 0 : https://registry.khronos.org/webgl/specs/latest/1.0/#TEXIMAGE2D @@ -152,7 +182,15 @@ namespace Babylon::Polyfills::Internal { m_texture.reset(); } + + m_frameBufferPool.Clear(); + m_frameBufferPool.SetDimensions(m_width, m_height); + m_frameBufferPool.SetGraphicsContext(&m_graphicsContext); + + return true; } + + return needClear; } Napi::Value NativeCanvas::GetCanvasTexture(const Napi::CallbackInfo& info) @@ -178,6 +216,7 @@ namespace Babylon::Polyfills::Internal { m_frameBuffer.reset(); m_texture.reset(); + m_frameBufferPool.Clear(); } void NativeCanvas::Dispose(const Napi::CallbackInfo& /*info*/) @@ -252,7 +291,8 @@ namespace Babylon::Polyfills Internal::NativeCanvas::Initialize(env); Internal::NativeCanvasImage::Initialize(env); - + Internal::NativeCanvasPath2D::Initialize(env); + Internal::CanvasGradient::Initialize(env); Internal::Context::Initialize(env); return {impl}; diff --git a/Polyfills/Canvas/Source/Canvas.h b/Polyfills/Canvas/Source/Canvas.h index 5de7441f0..d2f1d35e0 100644 --- a/Polyfills/Canvas/Source/Canvas.h +++ b/Polyfills/Canvas/Source/Canvas.h @@ -6,6 +6,8 @@ #include #include +#include "FrameBufferPool.h" + namespace Babylon::Polyfills { class Canvas::Impl final : public std::enable_shared_from_this @@ -64,8 +66,9 @@ namespace Babylon::Polyfills::Internal static inline std::map> fontsInfos; - void UpdateRenderTarget(); + bool UpdateRenderTarget(); Babylon::Graphics::FrameBuffer& GetFrameBuffer() { return *m_frameBuffer; } + FrameBufferPool m_frameBufferPool; Graphics::DeviceContext& GetGraphicsContext() { @@ -79,12 +82,15 @@ namespace Babylon::Polyfills::Internal Napi::Value GetHeight(const Napi::CallbackInfo&); void SetHeight(const Napi::CallbackInfo&, const Napi::Value& value); Napi::Value GetCanvasTexture(const Napi::CallbackInfo& info); + static void LoadTTF(const Napi::CallbackInfo& info); static Napi::Value LoadTTFAsync(const Napi::CallbackInfo& info); static Napi::Value ParseColor(const Napi::CallbackInfo& info); void Remove(const Napi::CallbackInfo& info); void Dispose(const Napi::CallbackInfo& info); void Dispose(); + Napi::ObjectReference m_contextObject{}; + uint16_t m_width{1}; uint16_t m_height{1}; @@ -93,6 +99,7 @@ namespace Babylon::Polyfills::Internal std::unique_ptr m_frameBuffer; std::unique_ptr m_texture{}; bool m_dirty{}; + bool m_clear{}; void FlushGraphicResources() override; }; diff --git a/Polyfills/Canvas/Source/Colors.h b/Polyfills/Canvas/Source/Colors.h index fa131e529..7073fd2c9 100644 --- a/Polyfills/Canvas/Source/Colors.h +++ b/Polyfills/Canvas/Source/Colors.h @@ -1,6 +1,6 @@ #pragma once #include -#include "nanovg.h" +#include "nanovg/nanovg.h" namespace Babylon::Polyfills::Internal { diff --git a/Polyfills/Canvas/Source/Context.cpp b/Polyfills/Canvas/Source/Context.cpp index a1e45ebc3..823f9110a 100644 --- a/Polyfills/Canvas/Source/Context.cpp +++ b/Polyfills/Canvas/Source/Context.cpp @@ -10,7 +10,7 @@ #endif #include "nanovg/nanovg.h" -#include "nanovg_babylon.h" +#include "nanovg/nanovg_babylon.h" #ifdef __GNUC__ #pragma GCC diagnostic pop @@ -25,7 +25,10 @@ #include "MeasureText.h" #include "Image.h" #include "ImageData.h" +#include "Path2D.h" #include "Colors.h" +#include "LineCaps.h" +#include "Gradient.h" /* Most of these context methods are preliminary work. They are currenbly not tested properly. @@ -51,6 +54,7 @@ namespace Babylon::Polyfills::Internal InstanceMethod("translate", &Context::Translate), InstanceMethod("strokeRect", &Context::StrokeRect), InstanceMethod("rect", &Context::Rect), + InstanceMethod("roundRect", &Context::RoundRect), InstanceMethod("clip", &Context::Clip), InstanceMethod("putImageData", &Context::PutImageData), InstanceMethod("arc", &Context::Arc), @@ -68,12 +72,19 @@ namespace Babylon::Polyfills::Internal InstanceMethod("fillText", &Context::FillText), InstanceMethod("strokeText", &Context::StrokeText), InstanceMethod("createLinearGradient", &Context::CreateLinearGradient), + InstanceMethod("createRadialGradient", &Context::CreateRadialGradient), + InstanceMethod("getTransform", &Context::GetTransform), InstanceMethod("setTransform", &Context::SetTransform), + InstanceMethod("transform", &Context::Transform), InstanceMethod("dispose", &Context::Dispose), InstanceMethod("flush", &Context::Flush), + InstanceAccessor("lineCap", &Context::GetLineCap, &Context::SetLineCap), InstanceAccessor("lineJoin", &Context::GetLineJoin, &Context::SetLineJoin), InstanceAccessor("miterLimit", &Context::GetMiterLimit, &Context::SetMiterLimit), + InstanceAccessor("filter", &Context::GetFilter, &Context::SetFilter), + InstanceAccessor("direction", &Context::GetDirection, &Context::SetDirection), InstanceAccessor("font", &Context::GetFont, &Context::SetFont), + InstanceAccessor("letterSpacing", &Context::GetLetterSpacing, &Context::SetLetterSpacing), InstanceAccessor("strokeStyle", &Context::GetStrokeStyle, &Context::SetStrokeStyle), InstanceAccessor("fillStyle", &Context::GetFillStyle, &Context::SetFillStyle), InstanceAccessor("globalAlpha", nullptr, &Context::SetGlobalAlpha), @@ -95,7 +106,7 @@ namespace Babylon::Polyfills::Internal Context::Context(const Napi::CallbackInfo& info) : Napi::ObjectWrap{info} , m_canvas{NativeCanvas::Unwrap(info[0].As())} - , m_nvg{nvgCreate(1)} + , m_nvg{std::make_shared(nvgCreate(1))} , m_graphicsContext{m_canvas->GetGraphicsContext()} , m_update{m_graphicsContext.GetUpdate("update")} , m_cancellationSource{std::make_shared()} @@ -108,7 +119,8 @@ namespace Babylon::Polyfills::Internal for (auto& font : NativeCanvas::fontsInfos) { - m_fonts[font.first] = nvgCreateFontMem(m_nvg, font.first.c_str(), font.second.data(), static_cast(font.second.size()), 0); + // TODO: update nvgCreateFontMem safely when old font buffer invalidated + m_fonts[font.first] = nvgCreateFontMem(*m_nvg, font.first.c_str(), font.second.data(), static_cast(font.second.size()), 0); } } @@ -134,15 +146,46 @@ namespace Babylon::Polyfills::Internal { for (auto& image : m_nvgImageIndices) { - nvgDeleteImage(m_nvg, image.second); + nvgDeleteImage(*m_nvg, image.second); } - nvgDelete(m_nvg); + nvgDelete(*m_nvg); m_nvg = nullptr; } m_isClipped = false; } + void Context::BindFillStyle(const Napi::CallbackInfo& info, float left, float top, float width, float height) + { + if (std::holds_alternative(m_fillStyle)) + { + const auto color = StringToColor(info.Env(), std::get(m_fillStyle)); + nvgFillColor(*m_nvg, color); + } + else if (std::holds_alternative(m_fillStyle)) + { + CanvasGradient* gradient = std::get(m_fillStyle); + gradient->UpdateCache(); + // TODO: replace left/lop/width/height by context bounds + NVGpaint imagePaint = nvgImagePattern(*m_nvg, 0.f, 0.f, width + left, height, 0.f, gradient->CachedImage(), 1.f); + nvgFillPaint(*m_nvg, imagePaint); + } + else + { + throw Napi::Error::New(info.Env(), "Fillstyle is not a color string or a gradient."); + } + } + + void Context::SetFilterStack() + { + if (m_filter.length()) + { + nanovg_filterstack filterStack; + filterStack.ParseString(m_filter); + nvgFilterStack(*m_nvg, filterStack); // sets filterStack on nanovg + } + } + void Context::FillRect(const Napi::CallbackInfo& info) { auto left = info[0].As().FloatValue(); @@ -152,26 +195,43 @@ namespace Babylon::Polyfills::Internal if (!m_isClipped) { - nvgBeginPath(m_nvg); + nvgBeginPath(*m_nvg); } - nvgRect(m_nvg, left, top, width, height); + nvgRect(*m_nvg, left, top, width, height); + + BindFillStyle(info, left, top, width, height); - const auto color = StringToColor(info.Env(), m_fillStyle); - nvgFillColor(m_nvg, color); - nvgFill(m_nvg); + SetFilterStack(); + nvgFill(*m_nvg); } Napi::Value Context::GetFillStyle(const Napi::CallbackInfo&) { - return Napi::Value::From(Env(), m_fillStyle); + if (std::holds_alternative(m_fillStyle)) + { + return Napi::Value::From(Env(), std::get(m_fillStyle)); + } + else + { + return Napi::External::New(Env(), std::get(m_fillStyle)); + } } void Context::SetFillStyle(const Napi::CallbackInfo& info, const Napi::Value& value) { - m_fillStyle = value.As().Utf8Value(); - const auto color = StringToColor(info.Env(), m_fillStyle); - nvgFillColor(m_nvg, color); + if (value.IsString()) + { + auto string = value.As().Utf8Value(); + const auto color = StringToColor(info.Env(), string); + m_fillStyle = string; + nvgFillColor(*m_nvg, color); + } + else + { + CanvasGradient* canvasGradient = CanvasGradient::Unwrap(info[0].As()); + m_fillStyle = canvasGradient; + } } Napi::Value Context::GetStrokeStyle(const Napi::CallbackInfo&) @@ -183,7 +243,7 @@ namespace Babylon::Polyfills::Internal { m_strokeStyle = value.As().Utf8Value(); auto color = StringToColor(info.Env(), m_strokeStyle); - nvgStrokeColor(m_nvg, color); + nvgStrokeColor(*m_nvg, color); } Napi::Value Context::GetLineWidth(const Napi::CallbackInfo&) @@ -194,22 +254,35 @@ namespace Babylon::Polyfills::Internal void Context::SetLineWidth(const Napi::CallbackInfo&, const Napi::Value& value) { m_lineWidth = value.As().FloatValue(); - nvgStrokeWidth(m_nvg, m_lineWidth); + nvgStrokeWidth(*m_nvg, m_lineWidth); } - void Context::Fill(const Napi::CallbackInfo&) + void Context::Fill(const Napi::CallbackInfo& info) { - nvgFill(m_nvg); + SetFilterStack(); + + const NativeCanvasPath2D* path = info.Length() >= 1 && info[0].IsObject() + ? NativeCanvasPath2D::Unwrap(info[0].As()) + : nullptr; + // TODO: handle fillRule: nonzero, evenodd + + // draw Path2D if exists + if (path != nullptr) + { + PlayPath2D(path); + } + + nvgFill(*m_nvg); } void Context::Save(const Napi::CallbackInfo&) { - nvgSave(m_nvg); + nvgSave(*m_nvg); } void Context::Restore(const Napi::CallbackInfo&) { - nvgRestore(m_nvg); + nvgRestore(*m_nvg); m_isClipped = false; } @@ -220,54 +293,54 @@ namespace Babylon::Polyfills::Internal const float width = info[2].As().FloatValue(); const float height = info[3].As().FloatValue(); - nvgSave(m_nvg); - nvgGlobalCompositeOperation(m_nvg, NVG_COPY); + nvgSave(*m_nvg); + nvgGlobalCompositeOperation(*m_nvg, NVG_COPY); if (!m_isClipped) { - nvgBeginPath(m_nvg); + nvgBeginPath(*m_nvg); } - nvgRect(m_nvg, x, y, width, height); + nvgRect(*m_nvg, x, y, width, height); if (!m_isClipped) { - nvgClosePath(m_nvg); + nvgClosePath(*m_nvg); } - nvgFillColor(m_nvg, TRANSPARENT_BLACK); - nvgFill(m_nvg); - nvgRestore(m_nvg); + nvgFillColor(*m_nvg, TRANSPARENT_BLACK); + nvgFill(*m_nvg); + nvgRestore(*m_nvg); } void Context::Translate(const Napi::CallbackInfo& info) { const auto x = info[0].As().FloatValue(); const auto y = info[1].As().FloatValue(); - nvgTranslate(m_nvg, x, y); + nvgTranslate(*m_nvg, x, y); } void Context::Rotate(const Napi::CallbackInfo& info) { const auto angle = info[0].As().FloatValue(); - nvgRotate(m_nvg, angle); + nvgRotate(*m_nvg, angle); } void Context::Scale(const Napi::CallbackInfo& info) { const auto x = info[0].As().FloatValue(); const auto y = info[1].As().FloatValue(); - nvgScale(m_nvg, x, y); + nvgScale(*m_nvg, x, y); } void Context::BeginPath(const Napi::CallbackInfo&) { - nvgBeginPath(m_nvg); + nvgBeginPath(*m_nvg); } void Context::ClosePath(const Napi::CallbackInfo&) { - nvgClosePath(m_nvg); + nvgClosePath(*m_nvg); } void Context::Rect(const Napi::CallbackInfo& info) @@ -277,10 +350,78 @@ namespace Babylon::Polyfills::Internal const auto width = info[2].As().FloatValue(); const auto height = info[3].As().FloatValue(); - nvgRect(m_nvg, left, top, width, height); + nvgRect(*m_nvg, left, top, width, height); m_rectangleClipping = {left, top, width, height}; } + void Context::RoundRect(const Napi::CallbackInfo& info) + { + const auto x = info[0].As().FloatValue(); + const auto y = info[1].As().FloatValue(); + const auto width = info[2].As().FloatValue(); + const auto height = info[3].As().FloatValue(); + const auto radii = info[4]; + + if (radii.IsNumber()) + { + const auto radius = radii.As().FloatValue(); + nvgRoundedRect(*m_nvg, x, y, width, height, radius); + } + else if (radii.IsArray()) + { + const auto radiiArray = radii.As(); + const auto radiiArrayLength = radiiArray.Length(); + if (radiiArrayLength == 1) + { + const auto radius = radiiArray[0u].As().FloatValue(); + nvgRoundedRect(*m_nvg, x, y, width, height, radius); + } + else if (radiiArrayLength == 2) + { + const auto topLeftBottomRight = radiiArray[0u].As().FloatValue(); + const auto topRightBottomLeft = radiiArray[1].As().FloatValue(); + + nvgRoundedRectVarying(*m_nvg, x, y, width, height, topLeftBottomRight, topRightBottomLeft, topLeftBottomRight, topRightBottomLeft); + } + else if (radiiArrayLength == 3) + { + const auto topLeft = radiiArray[0u].As().FloatValue(); + const auto topRightBottomLeft = radiiArray[1].As().FloatValue(); + const auto bottomRight = radiiArray[2].As().FloatValue(); + + nvgRoundedRectVarying(*m_nvg, x, y, width, height, topLeft, topRightBottomLeft, bottomRight, topRightBottomLeft); + } + else if (radiiArrayLength == 4) + { + const auto topLeft = radiiArray[0u].As().FloatValue(); + const auto topRight = radiiArray[1].As().FloatValue(); + const auto bottomRight = radiiArray[2].As().FloatValue(); + const auto bottomLeft = radiiArray[3].As().FloatValue(); + + nvgRoundedRectVarying(*m_nvg, x, y, width, height, topLeft, topRight, bottomRight, bottomLeft); + } + else + { + throw Napi::Error::New(info.Env(), "Invalid number of parameters for radii"); + } + } + // DOMPoint + // TODO: move duplicate Path2D & Context args parsing into a utils.cpp + else if (radii.IsObject()) + { + const auto dompoint = radii.As(); + const auto dpx = dompoint.Get("x").As().FloatValue(); + const auto dpy = dompoint.Get("y").As().FloatValue(); + nvgRoundedRectElliptic(*m_nvg, x, y, width, height, dpx, dpy, dpx, dpy, dpx, dpy, dpx, dpy); + } + else + { + throw Napi::Error::New(info.Env(), "Invalid radii parameter"); + } + + m_rectangleClipping = {x, y, width, height}; + } + void Context::Clip(const Napi::CallbackInfo& /*info*/) { m_isClipped = true; @@ -290,7 +431,7 @@ namespace Babylon::Polyfills::Internal auto h = m_rectangleClipping.height != 0 ? m_rectangleClipping.height : m_canvas->GetHeight(); // expand clipping 1pix in each direction because nanovg AA gets cut a bit short. - nvgScissor(m_nvg, m_rectangleClipping.left - 1, m_rectangleClipping.top - 1, w + 1, h + 1); + nvgScissor(*m_nvg, m_rectangleClipping.left - 1, m_rectangleClipping.top - 1, w + 1, h + 1); } void Context::StrokeRect(const Napi::CallbackInfo& info) @@ -300,13 +441,97 @@ namespace Babylon::Polyfills::Internal const auto width = info[2].As().FloatValue(); const auto height = info[3].As().FloatValue(); - nvgRect(m_nvg, left, top, width, height); - nvgStroke(m_nvg); + nvgRect(*m_nvg, left, top, width, height); + SetFilterStack(); + nvgStroke(*m_nvg); + } + + void Context::PlayPath2D(const NativeCanvasPath2D* path) + { + nvgBeginPath(*m_nvg); + for (const auto& command : *path) + { + const auto args = command.args; + switch (command.type) + { + case P2D_CLOSE: + nvgClosePath(*m_nvg); + break; + case P2D_MOVETO: + nvgMoveTo(*m_nvg, args.moveTo.x, args.moveTo.y); + break; + case P2D_LINETO: + nvgLineTo(*m_nvg, args.lineTo.x, args.lineTo.y); + break; + case P2D_BEZIERTO: + nvgBezierTo(*m_nvg, args.bezierTo.cp1x, args.bezierTo.cp1y, + args.bezierTo.cp2x, args.bezierTo.cp2y, + args.bezierTo.x, args.bezierTo.y); + break; + case P2D_QUADTO: + nvgQuadTo(*m_nvg, args.quadTo.cpx, args.quadTo.cpy, + args.quadTo.x, args.quadTo.y); + break; + case P2D_ARC: + nvgArc(*m_nvg, args.arc.x, args.arc.y, args.arc.radius, + args.arc.startAngle, args.arc.endAngle, + args.arc.counterclockwise ? NVG_CCW : NVG_CW); + break; + case P2D_ARCTO: + nvgArcTo(*m_nvg, args.arcTo.x1, args.arcTo.y1, + args.arcTo.x2, args.arcTo.y2, + args.arcTo.radius); + break; + case P2D_ELLIPSE: + // TODO: handle clockwise for nvgElipse (args.ellipse.counterclockwise) + nvgEllipse(*m_nvg, args.ellipse.x, args.ellipse.y, + args.ellipse.radiusX, args.ellipse.radiusY); + break; + case P2D_RECT: + nvgRect(*m_nvg, args.rect.x, args.rect.y, + args.rect.width, args.rect.height); + break; + case P2D_ROUNDRECT: + nvgRoundedRect(*m_nvg, args.roundRect.x, args.roundRect.y, + args.roundRect.width, args.roundRect.height, + args.roundRect.radii); + break; + case P2D_ROUNDRECTVARYING: + nvgRoundedRectVarying(*m_nvg, args.roundRectVarying.x, args.roundRectVarying.y, + args.roundRectVarying.width, args.roundRectVarying.height, + args.roundRectVarying.topLeft, args.roundRectVarying.topRight, + args.roundRectVarying.bottomRight, args.roundRectVarying.bottomLeft); + break; + case P2D_ROUNDRECTELLIPTIC: + nvgRoundedRectElliptic(*m_nvg, args.roundRectElliptic.x, args.roundRectElliptic.y, + args.roundRectElliptic.width, args.roundRectElliptic.height, + args.roundRectElliptic.topLeftX, args.roundRectElliptic.topLeftY, + args.roundRectElliptic.topRightX, args.roundRectElliptic.topRightY, + args.roundRectElliptic.bottomRightX, args.roundRectElliptic.bottomRightY, + args.roundRectElliptic.bottomLeftX, args.roundRectElliptic.bottomLeftY); + break; + case P2D_TRANSFORM: + nvgTransform(*m_nvg, + args.transform.a, args.transform.b, args.transform.c, + args.transform.d, args.transform.e, args.transform.f); + break; + default: + break; + } + } } - void Context::Stroke(const Napi::CallbackInfo&) + void Context::Stroke(const Napi::CallbackInfo& info) { - nvgStroke(m_nvg); + // draw Path2D if exists + const NativeCanvasPath2D* path = info.Length() == 1 ? NativeCanvasPath2D::Unwrap(info[0].As()) : nullptr; + if (path != nullptr) + { + PlayPath2D(path); + } + + SetFilterStack(); + nvgStroke(*m_nvg); } void Context::MoveTo(const Napi::CallbackInfo& info) @@ -314,7 +539,7 @@ namespace Babylon::Polyfills::Internal const auto x = info[0].As().FloatValue(); const auto y = info[1].As().FloatValue(); - nvgMoveTo(m_nvg, x, y); + nvgMoveTo(*m_nvg, x, y); } void Context::LineTo(const Napi::CallbackInfo& info) @@ -322,7 +547,7 @@ namespace Babylon::Polyfills::Internal const auto x = info[0].As().FloatValue(); const auto y = info[1].As().FloatValue(); - nvgLineTo(m_nvg, x, y); + nvgLineTo(*m_nvg, x, y); } void Context::QuadraticCurveTo(const Napi::CallbackInfo& info) @@ -332,7 +557,7 @@ namespace Babylon::Polyfills::Internal const auto x = info[2].As().FloatValue(); const auto y = info[3].As().FloatValue(); - nvgBezierTo(m_nvg, cx, cy, cx, cy, x, y); + nvgBezierTo(*m_nvg, cx, cy, cx, cy, x, y); } Napi::Value Context::MeasureText(const Napi::CallbackInfo& info) @@ -341,44 +566,94 @@ namespace Babylon::Polyfills::Internal return MeasureText::CreateInstance(info.Env(), this, text); } + bool Context::SetFontFaceId() + { + if (m_fonts.empty()) + { + return false; + } + else if (m_currentFontId >= 0) + { + nvgFontFaceId(*m_nvg, m_currentFontId); + } + else + { + nvgFontFaceId(*m_nvg, m_fonts.begin()->second); + } + return true; + } + void Context::FillText(const Napi::CallbackInfo& info) { - const std::string text = info[0].As().Utf8Value(); + std::string text = info[0].As().Utf8Value(); auto x = info[1].As().FloatValue(); auto y = info[2].As().FloatValue(); - if (!m_fonts.empty()) + // TODO: support ligatures, etc. + if (m_direction.compare("rtl") == 0) { + std::reverse(text.begin(), text.end()); + } + + if (SetFontFaceId()) { - if (m_currentFontId >= 0) - { - nvgFontFaceId(m_nvg, m_currentFontId); - } - else + BindFillStyle(info, 0.f, 0.f, x, y); + + if (m_filter.length()) { - nvgFontFaceId(m_nvg, m_fonts.begin()->second); + nanovg_filterstack filterStack; + filterStack.ParseString(m_filter); + nvgFilterStack(*m_nvg, filterStack); // sets filterStack on nanovg } - nvgText(m_nvg, x, y, text.c_str(), nullptr); + nvgText(*m_nvg, x, y, text.c_str(), nullptr); } } void Context::Flush(const Napi::CallbackInfo&) { - m_canvas->UpdateRenderTarget(); + bool needClear = m_canvas->UpdateRenderTarget(); Graphics::FrameBuffer& frameBuffer = m_canvas->GetFrameBuffer(); auto updateToken{m_update.GetUpdateToken()}; bgfx::Encoder* encoder = updateToken.GetEncoder(); frameBuffer.Bind(*encoder); + if (needClear) + { + frameBuffer.Clear(*encoder, BGFX_CLEAR_COLOR | BGFX_CLEAR_DEPTH | BGFX_CLEAR_STENCIL, 0, 1.f, 0); + } frameBuffer.SetViewPort(*encoder, 0.f, 0.f, 1.f, 1.f); const auto width = m_canvas->GetWidth(); const auto height = m_canvas->GetHeight(); - nvgBeginFrame(m_nvg, float(width), float(height), 1.0f); - nvgSetFrameBufferAndEncoder(m_nvg, frameBuffer, encoder); - nvgEndFrame(m_nvg); + for (auto& buffer : m_canvas->m_frameBufferPool.GetPoolBuffers()) + { + // sanity check no buffers should have been acquired yet + assert(buffer.isAvailable == true); + } + std::function acquire = [this, encoder]() -> Babylon::Graphics::FrameBuffer* { + Babylon::Graphics::FrameBuffer *frameBuffer = this->m_canvas->m_frameBufferPool.Acquire(); + frameBuffer->Bind(*encoder); + return frameBuffer; + }; + std::function release = [this, encoder](Babylon::Graphics::FrameBuffer* frameBuffer) -> void { + // clear framebuffer when released + frameBuffer->Clear(*encoder, BGFX_CLEAR_COLOR | BGFX_CLEAR_DEPTH | BGFX_CLEAR_STENCIL, 0, 1.f, 0); + this->m_canvas->m_frameBufferPool.Release(frameBuffer); + frameBuffer->Unbind(*encoder); + }; + + nvgBeginFrame(*m_nvg, float(width), float(height), 1.0f); + nvgSetFrameBufferAndEncoder(*m_nvg, frameBuffer, encoder); + nvgSetFrameBufferPool(*m_nvg, { acquire, release }); + nvgEndFrame(*m_nvg); frameBuffer.Unbind(*encoder); + + for (auto& buffer : m_canvas->m_frameBufferPool.GetPoolBuffers()) + { + // sanity check no unreleased buffers + assert(buffer.isAvailable == true); + } } void Context::PutImageData(const Napi::CallbackInfo&) @@ -394,7 +669,7 @@ namespace Babylon::Polyfills::Internal const auto startAngle = static_cast(info[3].As().DoubleValue()); const auto endAngle = static_cast(info[4].As().DoubleValue()); const NVGwinding winding = (info.Length() == 6 && info[5].As()) ? NVGwinding::NVG_CCW : NVGwinding::NVG_CW; - nvgArc(m_nvg, x, y, radius, startAngle, endAngle, winding); + nvgArc(*m_nvg, x, y, radius, startAngle, endAngle, winding); } void Context::DrawImage(const Napi::CallbackInfo& info) @@ -405,7 +680,7 @@ namespace Babylon::Polyfills::Internal const auto nvgImageIter = m_nvgImageIndices.find(canvasImage); if (nvgImageIter == m_nvgImageIndices.end()) { - imageIndex = canvasImage->CreateNVGImageForContext(m_nvg); + imageIndex = canvasImage->CreateNVGImageForContext(*m_nvg); m_nvgImageIndices.try_emplace(canvasImage, imageIndex); } else @@ -421,16 +696,17 @@ namespace Babylon::Polyfills::Internal const auto width = static_cast(canvasImage->GetWidth()); const auto height = static_cast(canvasImage->GetHeight()); - NVGpaint imagePaint = nvgImagePattern(m_nvg, 0.f, 0.f, width, height, 0.f, imageIndex, 1.f); + NVGpaint imagePaint = nvgImagePattern(*m_nvg, 0.f, 0.f, width, height, 0.f, imageIndex, 1.f); if (!m_isClipped) { - nvgBeginPath(m_nvg); + nvgBeginPath(*m_nvg); } - nvgRect(m_nvg, dx, dy, width, height); - nvgFillPaint(m_nvg, imagePaint); - nvgFill(m_nvg); + nvgRect(*m_nvg, dx, dy, width, height); + nvgFillPaint(*m_nvg, imagePaint); + SetFilterStack(); + nvgFill(*m_nvg); } else if (info.Length() == 5) { @@ -439,16 +715,17 @@ namespace Babylon::Polyfills::Internal const auto dWidth = static_cast(info[3].As().Uint32Value()); const auto dHeight = static_cast(info[4].As().Uint32Value()); - NVGpaint imagePaint = nvgImagePattern(m_nvg, dx, dy, dWidth, dHeight, 0.f, imageIndex, 1.f); + NVGpaint imagePaint = nvgImagePattern(*m_nvg, dx, dy, dWidth, dHeight, 0.f, imageIndex, 1.f); if (!m_isClipped) { - nvgBeginPath(m_nvg); + nvgBeginPath(*m_nvg); } - nvgRect(m_nvg, dx, dy, dWidth, dHeight); - nvgFillPaint(m_nvg, imagePaint); - nvgFill(m_nvg); + nvgRect(*m_nvg, dx, dy, dWidth, dHeight); + nvgFillPaint(*m_nvg, imagePaint); + SetFilterStack(); + nvgFill(*m_nvg); } else if (info.Length() == 9) { @@ -463,16 +740,17 @@ namespace Babylon::Polyfills::Internal const auto width = static_cast(canvasImage->GetWidth()); const auto height = static_cast(canvasImage->GetHeight()); - NVGpaint imagePaint = nvgImagePattern(m_nvg, dx, dy, dWidth, dHeight, 0.f, imageIndex, 1.f); + NVGpaint imagePaint = nvgImagePattern(*m_nvg, dx, dy, dWidth, dHeight, 0.f, imageIndex, 1.f); if (!m_isClipped) { - nvgBeginPath(m_nvg); + nvgBeginPath(*m_nvg); } - nvgRect(m_nvg, dx, dy, dWidth, dHeight); - nvgFillPaint(m_nvg, imagePaint); - nvgFill(m_nvg); + nvgRect(*m_nvg, dx, dy, dWidth, dHeight); + nvgFillPaint(*m_nvg, imagePaint); + SetFilterStack(); + nvgFill(*m_nvg); } else { @@ -498,42 +776,170 @@ namespace Babylon::Polyfills::Internal void Context::StrokeText(const Napi::CallbackInfo& info) { - throw Napi::Error::New(info.Env(), "not implemented"); + std::string text = info[0].As().Utf8Value(); + auto x = info[1].As().FloatValue(); + auto y = info[2].As().FloatValue(); + + // TODO: support ligatures, etc. + if (m_direction.compare("rtl") == 0) { + std::reverse(text.begin(), text.end()); + } + + if (SetFontFaceId()) + { + nvgStrokeText(*m_nvg, x, y, text.c_str(), nullptr); + } } Napi::Value Context::CreateLinearGradient(const Napi::CallbackInfo& info) { - throw Napi::Error::New(info.Env(), "not implemented"); + const auto x0 = info[0].As().FloatValue(); + const auto y0 = info[1].As().FloatValue(); + const auto x1 = info[2].As().FloatValue(); + const auto y1 = info[3].As().FloatValue(); + + auto gradient = CanvasGradient::CreateLinear(info.Env(), m_nvg, x0, y0, x1, y1); + return gradient; + } + + Napi::Value Context::CreateRadialGradient(const Napi::CallbackInfo& info) + { + const auto x0 = info[0].As().FloatValue(); + const auto y0 = info[1].As().FloatValue(); + const auto r0 = info[2].As().FloatValue(); + const auto x1 = info[3].As().FloatValue(); + const auto y1 = info[4].As().FloatValue(); + const auto r1 = info[5].As().FloatValue(); + + auto gradient = CanvasGradient::CreateRadial(info.Env(), m_nvg, x0, y0, r0, x1, y1, r1); + return gradient; + } + + Napi::Value Context::GetTransform(const Napi::CallbackInfo&) + { + float xform[6]; + nvgCurrentTransform(*m_nvg, xform); + + // set DOMMatrix properties + Napi::Object obj = Napi::Object::New(Env()); + obj.Set("a", xform[0]); + obj.Set("b", xform[1]); + obj.Set("c", xform[2]); + obj.Set("d", xform[3]); + obj.Set("e", xform[4]); + obj.Set("f", xform[5]); + obj.Set("m11", xform[0]); + obj.Set("m12", xform[1]); + obj.Set("m13", 0); + obj.Set("m14", 0); + obj.Set("m21", xform[2]); + obj.Set("m22", xform[3]); + obj.Set("m23", 0); + obj.Set("m24", 0); + obj.Set("m31", 0); + obj.Set("m32", 0); + obj.Set("m33", 1); + obj.Set("m34", 0); + obj.Set("m41", xform[4]); + obj.Set("m42", xform[5]); + obj.Set("m43", 0); + obj.Set("m44", 1); + obj.Set("is2D", true); + obj.Set("isIdentity", false); + return obj; } void Context::SetTransform(const Napi::CallbackInfo& info) { - throw Napi::Error::New(info.Env(), "not implemented"); + const auto a = info[0].As().FloatValue(); + const auto b = info[1].As().FloatValue(); + const auto c = info[2].As().FloatValue(); + const auto d = info[3].As().FloatValue(); + const auto e = info[4].As().FloatValue(); + const auto f = info[5].As().FloatValue(); + nvgResetTransform(*m_nvg); + nvgTransform(*m_nvg, a, b, c, d, e, f); + } + + void Context::Transform(const Napi::CallbackInfo& info) + { + const auto a = info[0].As().FloatValue(); + const auto b = info[1].As().FloatValue(); + const auto c = info[2].As().FloatValue(); + const auto d = info[3].As().FloatValue(); + const auto e = info[4].As().FloatValue(); + const auto f = info[5].As().FloatValue(); + nvgTransform(*m_nvg, a, b, c, d, e, f); + } + + Napi::Value Context::GetLineCap(const Napi::CallbackInfo& info) + { + return Napi::Value::From(Env(), m_lineCap); + } + + void Context::SetLineCap(const Napi::CallbackInfo& info, const Napi::Value& value) + { + m_lineCap = value.As().Utf8Value(); + const auto lineCap = StringToLineCap(info.Env(), m_lineCap); + nvgLineCap(*m_nvg, lineCap); } Napi::Value Context::GetLineJoin(const Napi::CallbackInfo& info) { - throw Napi::Error::New(info.Env(), "not implemented"); + return Napi::Value::From(Env(), m_lineJoin); } void Context::SetLineJoin(const Napi::CallbackInfo& info, const Napi::Value& value) { - throw Napi::Error::New(info.Env(), "not implemented"); + m_lineJoin = value.As().Utf8Value(); + const auto lineJoin = StringToLineJoin(info.Env(), m_lineJoin); + nvgLineJoin(*m_nvg, lineJoin); } Napi::Value Context::GetMiterLimit(const Napi::CallbackInfo& info) { - throw Napi::Error::New(info.Env(), "not implemented"); + return Napi::Value::From(Env(), m_miterLimit); } void Context::SetMiterLimit(const Napi::CallbackInfo& info, const Napi::Value& value) { - throw Napi::Error::New(info.Env(), "not implemented"); + m_miterLimit = value.As().FloatValue(); + nvgMiterLimit(*m_nvg, m_miterLimit); + } + + Napi::Value Context::GetFilter(const Napi::CallbackInfo& info) + { + return Napi::Value::From(Env(), m_filter); + } + + void Context::SetFilter(const Napi::CallbackInfo& info, const Napi::Value& value) + { + std::string filterString = value.As().Utf8Value(); + // Keep existing filter if the new one is invalid + if (nanovg_filterstack::ValidString(filterString)) + { + m_filter = filterString; + } + } + + Napi::Value Context::GetDirection(const Napi::CallbackInfo& info) + { + return Napi::Value::From(Env(), m_direction); + } + + void Context::SetDirection(const Napi::CallbackInfo& info, const Napi::Value& value) + { + std::string direction = value.As().Utf8Value(); + const bool valid = !(direction.compare("ltr") && direction.compare("rtl")); + if (valid) + { + m_direction = direction; + } } Napi::Value Context::GetFont(const Napi::CallbackInfo& info) { - return Napi::Value::From(Env(), m_font); + return Napi::Value::From(Env(), static_cast(m_font)); } void Context::SetFont(const Napi::CallbackInfo& info, const Napi::Value& value) @@ -543,42 +949,52 @@ namespace Babylon::Polyfills::Internal throw Napi::Error::New(info.Env(), "invalid argument"); } - const std::string fontOptions = value.ToString(); + auto font = Font::Parse(value.ToString()); + if (!font) + { + return; + } - // Default font id, and font size values. - // TODO: Determine better way of signaling to user that font specified is invalid. - m_currentFontId = -1; - float fontSize{16.f}; + nvgFontSize(*m_nvg, font->Size); + if (m_fonts.find(font->Family) == m_fonts.end()) + { + // TODO: handle finding font face for a specific weight and style + m_currentFontId = -1; + } + else + { + m_currentFontId = m_fonts.at(font->Family); + } - // Regex to parse font styling information. For now we are only capturing font size (capture group 3) and font family name (capture group 4). - static const std::regex fontStyleRegex("([[a-zA-Z]+\\s+)*((\\d+(\\.\\d+)?)px\\s+)?(\\w+)"); - std::smatch fontStyleMatch; + m_font = std::move(*font); + } - // Perform the actual regex_match. - if (std::regex_match(fontOptions, fontStyleMatch, fontStyleRegex)) - { - // Check if font size was specified. - if (fontStyleMatch[3].matched) - { - fontSize = std::stof(fontStyleMatch[3]); - } + Napi::Value Context::GetLetterSpacing(const Napi::CallbackInfo& info) + { + std::string letterSpacingStr = std::to_string(m_letterSpacing); + letterSpacingStr.erase(letterSpacingStr.find_last_not_of('0') + 1, std::string::npos); + letterSpacingStr.erase(letterSpacingStr.find_last_not_of('.') + 1, std::string::npos); + return Napi::Value::From(Env(), letterSpacingStr + "px"); + } - // Check if the specified font family name is valid, and if so assign the current font id. - if (m_fonts.find(fontStyleMatch[4]) != m_fonts.end()) - { - m_currentFontId = m_fonts.at(fontStyleMatch[4]); - m_font = fontOptions; - } - } + void Context::SetLetterSpacing(const Napi::CallbackInfo& info, const Napi::Value& value) + { + const std::string letterSpacingOption = value.ToString(); - // Set font size on the current context. - nvgFontSize(m_nvg, fontSize); + // regex the letter spacing string + static const std::regex letterSpacingRegex("(\\d+(\\.\\d+)?)px"); + std::smatch letterSpacingMatch; + if (std::regex_match(letterSpacingOption, letterSpacingMatch, letterSpacingRegex)) + { + m_letterSpacing = std::stof(letterSpacingMatch[1]); + } + nvgTextLetterSpacing(*m_nvg, m_letterSpacing); } void Context::SetGlobalAlpha(const Napi::CallbackInfo& info, const Napi::Value& value) { const float alpha = value.As().FloatValue(); - nvgGlobalAlpha(m_nvg, alpha); + nvgGlobalAlpha(*m_nvg, alpha); } Napi::Value Context::GetShadowColor(const Napi::CallbackInfo& info) diff --git a/Polyfills/Canvas/Source/Context.h b/Polyfills/Canvas/Source/Context.h index 2d37a2241..e4472964e 100644 --- a/Polyfills/Canvas/Source/Context.h +++ b/Polyfills/Canvas/Source/Context.h @@ -4,11 +4,16 @@ #include #include #include "Image.h" +#include "Path2D.h" +#include "Font.h" +#include "nanovg/nanovg_filterstack.h" struct NVGcontext; namespace Babylon::Polyfills::Internal { + class CanvasGradient; + class Context final : public Napi::ObjectWrap, Polyfills::Canvas::Impl::MonitoredResource { public: @@ -18,7 +23,7 @@ namespace Babylon::Polyfills::Internal explicit Context(const Napi::CallbackInfo& info); virtual ~Context(); - NVGcontext* GetNVGContext() const { return m_nvg; } + NVGcontext* GetNVGContext() const { return *m_nvg.get(); } private: void FillRect(const Napi::CallbackInfo&); @@ -35,6 +40,7 @@ namespace Babylon::Polyfills::Internal void ClosePath(const Napi::CallbackInfo&); void Clip(const Napi::CallbackInfo&); void Rect(const Napi::CallbackInfo&); + void RoundRect(const Napi::CallbackInfo&); void StrokeRect(const Napi::CallbackInfo&); void Stroke(const Napi::CallbackInfo&); void MoveTo(const Napi::CallbackInfo&); @@ -46,7 +52,10 @@ namespace Babylon::Polyfills::Internal void SetLineDash(const Napi::CallbackInfo&); void StrokeText(const Napi::CallbackInfo&); Napi::Value CreateLinearGradient(const Napi::CallbackInfo&); + Napi::Value CreateRadialGradient(const Napi::CallbackInfo&); + Napi::Value GetTransform(const Napi::CallbackInfo&); void SetTransform(const Napi::CallbackInfo&); + void Transform(const Napi::CallbackInfo&); void QuadraticCurveTo(const Napi::CallbackInfo&); Napi::Value GetFillStyle(const Napi::CallbackInfo&); void SetFillStyle(const Napi::CallbackInfo&, const Napi::Value& value); @@ -54,12 +63,20 @@ namespace Babylon::Polyfills::Internal void SetStrokeStyle(const Napi::CallbackInfo&, const Napi::Value& value); Napi::Value GetLineWidth(const Napi::CallbackInfo&); void SetLineWidth(const Napi::CallbackInfo&, const Napi::Value& value); + Napi::Value GetLineCap(const Napi::CallbackInfo&); + void SetLineCap(const Napi::CallbackInfo&, const Napi::Value& value); Napi::Value GetLineJoin(const Napi::CallbackInfo&); void SetLineJoin(const Napi::CallbackInfo&, const Napi::Value& value); Napi::Value GetMiterLimit(const Napi::CallbackInfo&); void SetMiterLimit(const Napi::CallbackInfo&, const Napi::Value& value); + Napi::Value GetFilter(const Napi::CallbackInfo& info); + void SetFilter(const Napi::CallbackInfo& info, const Napi::Value& value); + Napi::Value GetDirection(const Napi::CallbackInfo&); + void SetDirection(const Napi::CallbackInfo&, const Napi::Value& value); Napi::Value GetFont(const Napi::CallbackInfo&); void SetFont(const Napi::CallbackInfo&, const Napi::Value& value); + Napi::Value GetLetterSpacing(const Napi::CallbackInfo&); + void SetLetterSpacing(const Napi::CallbackInfo&, const Napi::Value& value); void SetGlobalAlpha(const Napi::CallbackInfo&, const Napi::Value& value); Napi::Value GetShadowColor(const Napi::CallbackInfo&); void SetShadowColor(const Napi::CallbackInfo&, const Napi::Value& value); @@ -71,16 +88,23 @@ namespace Babylon::Polyfills::Internal void SetShadowOffsetY(const Napi::CallbackInfo&, const Napi::Value& value); void Dispose(const Napi::CallbackInfo&); void Dispose(); + bool SetFontFaceId(); void Flush(const Napi::CallbackInfo&); NativeCanvas* m_canvas; - NVGcontext* m_nvg; + std::shared_ptr m_nvg; - std::string m_font{}; - std::string m_fillStyle{}; + Font m_font; + std::variant m_fillStyle{}; std::string m_strokeStyle{}; + std::string m_lineCap{}; // 'butt', 'round', 'square' + std::string m_lineJoin{}; // 'round', 'bevel', 'miter' + std::string m_filter{}; + std::string m_direction{"ltr"}; // 'ltr', 'rtl' + float m_miterLimit{0.f}; float m_lineWidth{0.f}; float m_globalAlpha{1.f}; + float m_letterSpacing{0.f}; std::map m_fonts; int m_currentFontId{-1}; @@ -99,8 +123,10 @@ namespace Babylon::Polyfills::Internal JsRuntimeScheduler m_runtimeScheduler; std::unordered_map m_nvgImageIndices; - + void BindFillStyle(const Napi::CallbackInfo& info, float left, float top, float width, float height); void FlushGraphicResources() override; + void PlayPath2D(const NativeCanvasPath2D* path); + void SetFilterStack(); friend class Canvas; }; diff --git a/Polyfills/Canvas/Source/Font.cpp b/Polyfills/Canvas/Source/Font.cpp new file mode 100644 index 000000000..6c8f1ff9f --- /dev/null +++ b/Polyfills/Canvas/Source/Font.cpp @@ -0,0 +1,97 @@ +#include +#include + +#include "Font.h" + +namespace +{ + auto STYLE_REGEX = std::regex(R"(^\s*(normal|italic)\s)"); + auto WEIGHT_REGEX = std::regex(R"(^\s*(normal|bold|\d+)\s)"); + auto SIZE_REGEX = std::regex(R"(^\s*((?:\d+(?:\.\d+)?|\.\d+)(?:[eE][+-]?\d+)?)px\s)"); + auto FAMILY_IDENT_REGEX = std::regex(R"(^\s*((?:[\w-]|\\.)+))"); + auto FAMILY_STRING_REGEX = std::regex(R"(^\s*(["'])((?:[^\\]|\\.)*?)\1)"); +} + +namespace Babylon::Polyfills::Internal +{ + std::optional Font::Parse(const std::string& fontString) + { + Font font; + auto begin = fontString.cbegin(); + auto end = fontString.cend(); + std::smatch match; + + // The style and weight can be in any order + bool foundStyle = false; + bool foundWeight = false; + while (!foundStyle || !foundWeight) + { + if (!foundStyle && std::regex_search(begin, end, match, STYLE_REGEX)) + { + begin = match[0].second; + foundStyle = true; + if (match[1] == "italic") + { + font.Style = FontStyle::Italic; + } + } + else if (!foundWeight && std::regex_search(begin, end, match, WEIGHT_REGEX)) + { + begin = match[0].second; + foundWeight = true; + if (match[1] == "bold") + { + font.Weight = BOLD_WEIGHT; + } + else + { + font.Weight = std::stoi(match[1]); + } + } + else + { + break; + } + } + + if (!std::regex_search(begin, end, match, SIZE_REGEX)) + { + return std::nullopt; + } + begin = match[0].second; + font.Size = std::stof(match[1]); + + if (std::regex_search(begin, end, match, FAMILY_IDENT_REGEX)) + { + font.Family = match[1]; + } + else if (std::regex_search(begin, end, match, FAMILY_STRING_REGEX)) + { + // The first capture group is used for the quotation mark (" or ') + font.Family = match[2]; + } + else + { + return std::nullopt; + } + + return font; + } + + Font::operator std::string() const + { + std::ostringstream stream; + if (Style == FontStyle::Italic) + { + stream << "italic "; + } + + if (Weight != NORMAL_WEIGHT) + { + stream << Weight << " "; + } + + stream << Size << "px \"" << Family << "\""; + return stream.str(); + } +} diff --git a/Polyfills/Canvas/Source/Font.h b/Polyfills/Canvas/Source/Font.h new file mode 100644 index 000000000..c5ca4069d --- /dev/null +++ b/Polyfills/Canvas/Source/Font.h @@ -0,0 +1,30 @@ +#pragma once + +#include +#include + +namespace Babylon::Polyfills::Internal +{ + enum class FontStyle + { + Normal, + Italic, + }; + + struct Font + { + private: + static constexpr int NORMAL_WEIGHT = 400; + static constexpr int BOLD_WEIGHT = 700; + + public: + FontStyle Style = FontStyle::Normal; + int Weight = NORMAL_WEIGHT; + float Size = 10; + std::string Family = "sans-serif"; + + operator std::string() const; + + static std::optional Parse(const std::string& fontString); + }; +} diff --git a/Polyfills/Canvas/Source/FrameBufferPool.cpp b/Polyfills/Canvas/Source/FrameBufferPool.cpp new file mode 100644 index 000000000..ea7b415ff --- /dev/null +++ b/Polyfills/Canvas/Source/FrameBufferPool.cpp @@ -0,0 +1,122 @@ +#include +#include +#include + +#include +#include +#include "FrameBufferPool.h" + +namespace Babylon::Polyfills +{ + const std::vector& FrameBufferPool::GetPoolBuffers() + { + return mPoolBuffers; + } + + // sets dimension of framebuffers, can only be set if no buffers in pool + void FrameBufferPool::SetDimensions(int width, int height) + { + assert(width > 0 && height > 0); + // TODO: support multiple framebuffer dimensions + if (mPoolBuffers.size() > 0) + { + throw std::runtime_error("Cannot set dimensions. FrameBufferPool already has buffers."); + } + + this->m_width = width; + this->m_height = height; + } + + // sets graphics context to be used for creating framebuffers + void FrameBufferPool::SetGraphicsContext(Graphics::DeviceContext* graphicsContext) + { + m_graphicsContext = graphicsContext; + } + + void FrameBufferPool::Add(int nBuffers) + { + if (m_graphicsContext == nullptr) + { + throw std::runtime_error("Cannot add framebuffer to pool. Graphics context is not set."); + } + + for (int i = 0; i < nBuffers; ++i) + { + bgfx::FrameBufferHandle TextBuffer{bgfx::kInvalidHandle}; + Graphics::FrameBuffer* FrameBuffer; + + // make sure render targets are filled with 0 : https://registry.khronos.org/webgl/specs/latest/1.0/#TEXIMAGE2D + bgfx::ReleaseFn releaseFn{[](void*, void* userData) { + bimg::imageFree(static_cast(userData)); + }}; + + bimg::ImageContainer* image = bimg::imageAlloc(&Babylon::Graphics::DeviceContext::GetDefaultAllocator(), bimg::TextureFormat::RGBA8, m_width, m_height, 1 /*depth*/, 1, false /*cubeMap*/, false /*hasMips*/); + const bgfx::Memory* mem = bgfx::makeRef(image->m_data, image->m_size, releaseFn, image); + bx::memSet(image->m_data, 0, image->m_size); + // TODO: make sampler flags configurable + // border sampling will result in transparent edge artifacts for blur, but this behaviour is consistent with browser implementation + std::array textures{ + bgfx::createTexture2D(m_width, m_height, false, 1, bgfx::TextureFormat::RGBA8, BGFX_TEXTURE_RT | BGFX_SAMPLER_U_BORDER | BGFX_SAMPLER_V_BORDER | BGFX_SAMPLER_BORDER_COLOR(0), mem), + bgfx::createTexture2D(m_width, m_height, false, 1, bgfx::TextureFormat::D24S8, BGFX_TEXTURE_RT | BGFX_SAMPLER_U_BORDER | BGFX_SAMPLER_V_BORDER | BGFX_SAMPLER_BORDER_COLOR(0))}; + + std::array attachments{}; + for (size_t idx = 0; idx < attachments.size(); ++idx) + { + attachments[idx].init(textures[idx]); + } + TextBuffer = bgfx::createFrameBuffer(static_cast(attachments.size()), attachments.data(), true); + + FrameBuffer = new Graphics::FrameBuffer(*m_graphicsContext, TextBuffer, m_width, m_height, false, false, false); + m_available++; + mPoolBuffers.push_back({FrameBuffer, true}); + } + } + + void FrameBufferPool::Clear() + { + for (auto& buffer : mPoolBuffers) + { + if (buffer.frameBuffer) + { + buffer.frameBuffer->Dispose(); + delete buffer.frameBuffer; + } + } + m_available = 0; + mPoolBuffers.clear(); + } + + Graphics::FrameBuffer* FrameBufferPool::Acquire() + { + // no buffers in pool, add one + if (m_available == 0) + { + Add(1); + } + + for (auto& buffer : mPoolBuffers) + { + if (buffer.isAvailable) + { + buffer.isAvailable = false; + m_available--; + return buffer.frameBuffer; + } + } + + throw std::runtime_error("No available frame buffer in pool."); + } + + void FrameBufferPool::Release(Graphics::FrameBuffer* frameBuffer) + { + for (auto& buffer : mPoolBuffers) + { + if (buffer.frameBuffer == frameBuffer) + { + buffer.isAvailable = true; + m_available++; + return; + } + } + } +} diff --git a/Polyfills/Canvas/Source/FrameBufferPool.h b/Polyfills/Canvas/Source/FrameBufferPool.h new file mode 100644 index 000000000..003dc88d7 --- /dev/null +++ b/Polyfills/Canvas/Source/FrameBufferPool.h @@ -0,0 +1,33 @@ +#pragma once + +#include +#include + +namespace Babylon::Polyfills +{ + class FrameBufferPool final + { + public: + struct PoolBuffer + { + Graphics::FrameBuffer* frameBuffer; + bool isAvailable; + }; + // acquire a frame buffer from the pool, graphics context must be set + Graphics::FrameBuffer* Acquire(); + void Add(int nBuffers); + void Clear(); + void Release(Graphics::FrameBuffer* frameBuffer); + void SetDimensions(int width, int height); + // sets graphics context to be used for creating framebuffers + void SetGraphicsContext(Graphics::DeviceContext *graphicsContext); + const std::vector& GetPoolBuffers(); + + private: + std::vector mPoolBuffers{}; + Graphics::DeviceContext* m_graphicsContext; + int m_available{0}; + int m_width{256}; + int m_height{256}; + }; +} diff --git a/Polyfills/Canvas/Source/Gradient.cpp b/Polyfills/Canvas/Source/Gradient.cpp new file mode 100644 index 000000000..031b83ab3 --- /dev/null +++ b/Polyfills/Canvas/Source/Gradient.cpp @@ -0,0 +1,353 @@ +#include +#include +#include "Canvas.h" +#include "Context.h" +#include "Gradient.h" +#include "Colors.h" + +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" +#endif + +#include "nanovg/nanovg.h" + +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif + +namespace Babylon::Polyfills::Internal +{ + static const int GRADIENT_SAMPLES_L = 256; + static const int GRADIENT_SAMPLES_R = 256; + + typedef struct LVGColorTransform + { + float mul[4]; + float add[4]; + } LVGColorTransform; + + struct ColorStop + { + float offset; + NVGcolor color; + }; + + float clampf(float a, float mn, float mx) { return a < mn ? mn : (a > mx ? mx : a); } + + void gradientSpan(uint32_t* dst, NVGcolor color0, NVGcolor color1, float offset0, float offset1) + { + float s0o = clampf(offset0, 0.0f, 1.0f); + float s1o = clampf(offset1, 0.0f, 1.0f); + unsigned s = static_cast(s0o * static_cast(GRADIENT_SAMPLES_L)); + unsigned e = static_cast(s1o * static_cast(GRADIENT_SAMPLES_L)); + float r = color0.rgba[0]; + float g = color0.rgba[1]; + float b = color0.rgba[2]; + float a = color0.rgba[3]; + float dr = (color1.rgba[0] - r) / (e - s); + float dg = (color1.rgba[1] - g) / (e - s); + float db = (color1.rgba[2] - b) / (e - s); + float da = (color1.rgba[3] - a) / (e - s); + for (unsigned i = s; i < e; i++) + { + unsigned ur = (unsigned)(r * 255); unsigned ug = (unsigned)(g * 255); unsigned ub = (unsigned)(b * 255); unsigned ua = (unsigned)(a * 255); + dst[i] = (ua << 24) | (ub << 16) | (ug << 8) | ur; + r += dr; g += dg; b += db; a += da; + } + } + + NVGcolor transformColor(NVGcolor color, LVGColorTransform* x) + { + if (!x) + return color; + color = nvgRGBAf(color.r * x->mul[0], color.g * x->mul[1], color.b * x->mul[2], color.a * x->mul[3]); + color = nvgRGBAf(color.r + x->add[0], color.g + x->add[1], color.b + x->add[2], color.a + x->add[3]); + color = nvgRGBAf(fmax(0.0f, fmin(color.r, 1.0f)), fmax(0.0f, fmin(color.g, 1.0f)), fmax(0.0f, fmin(color.b, 1.0f)), fmax(0.0f, fmin(color.a, 1.0f))); + return color; + } + + static constexpr auto JS_CANVAS_GRADIENT_CONSTRUCTOR_NAME = "CanvasGradient"; + + void CanvasGradient::Initialize(Napi::Env env) + { + Napi::HandleScope scope{ env }; + + Napi::Function func = DefineClass( + env, + JS_CANVAS_GRADIENT_CONSTRUCTOR_NAME, + { + InstanceMethod("addColorStop", &CanvasGradient::AddColorStop), + + }); + JsRuntime::NativeObject::GetFromJavaScript(env).Set(JS_CANVAS_GRADIENT_CONSTRUCTOR_NAME, func); + } + + Napi::Object CanvasGradient::CreateLinear(Napi::Env env, const std::shared_ptr& context, float x0, float y0, float x1, float y1) + { + Napi::HandleScope scope{ env }; + + auto func = JsRuntime::NativeObject::GetFromJavaScript(env).Get(JS_CANVAS_GRADIENT_CONSTRUCTOR_NAME).As(); + auto gradientValue = func.New({ Napi::Value::From(env, x0), Napi::Value::From(env, y0), Napi::Value::From(env, x1), Napi::Value::From(env, y1) }); + CanvasGradient::Unwrap(gradientValue)->context = context; + return gradientValue; + } + + Napi::Object CanvasGradient::CreateRadial(Napi::Env env, const std::shared_ptr& context, float x0, float y0, float r0, float x1, float y1, float r1) + { + Napi::HandleScope scope{ env }; + + auto func = JsRuntime::NativeObject::GetFromJavaScript(env).Get(JS_CANVAS_GRADIENT_CONSTRUCTOR_NAME).As(); + auto gradientValue = func.New({ Napi::Value::From(env, x0), Napi::Value::From(env, y0), Napi::Value::From(env, x1), Napi::Value::From(env, y1), Napi::Value::From(env, r0), Napi::Value::From(env, r1) }); + CanvasGradient::Unwrap(gradientValue)->context = context; + return gradientValue; + } + + CanvasGradient::CanvasGradient(const Napi::CallbackInfo& info) + : Napi::ObjectWrap{ info } + , x0{ info[0].As().FloatValue() } + , y0{ info[1].As().FloatValue() } + , x1{ info[2].As().FloatValue() } + , y1{ info[3].As().FloatValue() } + { + gradientType = (info.Length() == 4) ? GradientType::Linear : GradientType::Radial; + if (gradientType == GradientType::Radial) + { + r0 = info[4].As().FloatValue(); + r1 = info[5].As().FloatValue(); + } + } + + CanvasGradient::~CanvasGradient() + { + Dispose(); + } + + void CanvasGradient::Dispose() + { + if (cachedImage >= 0) + { + if (context.lock()) + { + nvgDeleteImage(*context.lock(), cachedImage); + } + cachedImage = -1; + } + } + + void CanvasGradient::AddColorStop(const Napi::CallbackInfo& info) + { + const auto offset = info[0].As().FloatValue(); + + std::string colorString{ info[1].As() }; + const auto color = StringToColor(info.Env(), colorString); + colors.insert(std::make_pair(offset, color)); + dirty = true; + } + + int CanvasGradient::LinearGradientStops(LVGColorTransform* x) + { + size_t nstops = colors.size(); + if (!nstops) + { + return 0; + } + uint32_t data[GRADIENT_SAMPLES_L]; + int stopIndex{}; + std::vector colorStops(nstops); + for (auto& stop : colors) + { + colorStops[stopIndex++] = { stop.first, stop.second }; + } + if (colorStops[0].offset > 0.0f) + { + NVGcolor s0 = transformColor(colorStops[0].color, x); + gradientSpan(data, s0, s0, 0.0f, colorStops[0].offset); + } + for (unsigned i = 0; i < (nstops - 1); i++) + { + gradientSpan(data, transformColor(colorStops[i].color, x), + transformColor(colorStops[i + 1].color, x), + colorStops[i].offset, + colorStops[i + 1].offset); + } + if (colorStops[nstops - 1].offset < 1.0f) + { + NVGcolor s0 = transformColor(colorStops[nstops - 1].color, x); + gradientSpan(data, s0, s0, colorStops[nstops - 1].offset, 1.0f); + } + return nvgCreateImageRGBA(*context.lock(), GRADIENT_SAMPLES_L, 1, 0, (unsigned char*)data); + } + + NVGcolor lerpColor(NVGcolor color0, NVGcolor color1, float offset0, float offset1, float g) + { + NVGcolor dst; + float den = fmax(0.00001f, offset1 - offset0); + for (int i = 0; i < 4; i++) + dst.rgba[i] = color0.rgba[i] + (color1.rgba[i] - color0.rgba[i]) * (g - offset0) / den; + dst = nvgRGBAf(fmax(0.0f, fmin(dst.r, 1.0f)), fmax(0.0f, fmin(dst.g, 1.0f)), fmax(0.0f, fmin(dst.b, 1.0f)), fmax(0.0f, fmin(dst.a, 1.0f))); + return dst; + } + + void calcStops(const std::vector& gradient, LVGColorTransform* x, NVGcolor* color0, NVGcolor* color1, float* stop0, float* stop1, float g) + { + const float* s0{}; + const float* s1{}; + for (size_t i = 0; i < gradient.size() && !s1; i++) + { + const float* curr = &gradient[i].offset; + if (g >= curr[0]) + { + s0 = curr; + *color0 = transformColor(gradient[i].color, x); + } + else if (s0 && g <= curr[0]) + { + s1 = curr; + *color1 = transformColor(gradient[i].color, x); + } + } + if (!s0) + { + s0 = &gradient[0].offset; + *color0 = transformColor(gradient[0].color, x); + } + if (!s1) + { + s1 = &gradient[gradient.size() - 1].offset; + *color1 = transformColor(gradient[gradient.size() - 1].color, x); + } + *stop0 = s0[0]; + *stop1 = s1[0]; + } + + int CanvasGradient::RadialGradientStops(LVGColorTransform* cxform) + { + const int width = GRADIENT_SAMPLES_R, height = GRADIENT_SAMPLES_R; + uint32_t* image = (unsigned int*)malloc(width * height * sizeof(uint32_t)); + static const int SPREAD_PAD = 0; + static const int SPREAD_REPEAT = 1; + static const int SPREAD_REFLECT = 2; + + size_t nstops = colors.size(); + int stopIndex{}; + std::vector colorStops(nstops); + for (auto& stop : colors) + { + colorStops[stopIndex++] = { stop.first, stop.second }; + } + int spreadMode = 0; + + float fxn = width / 2; + float fyn = height / 2; + float fxp = 0; + float fyp = 0; + float rn = width / 2 - 1.0001f; + float denominator = (rn * rn) - (fxp * fxp + fyp * fyp); + + for (int x = 0; x < width; x++) + { + float dx = x - fxn; + for (int y = 0; y < height; y++) + { + float dy = y - fyn; + + float numerator = (dx * fxp + dy * fyp); + float df = dx * fyp - dy * fxp; + numerator += sqrtf((rn * rn) * (dx * dx + dy * dy) - (df * df)); + float g = numerator / denominator; + + // color = c0 + (c1 - c0)(g - x0)/(x1 - x0) + // where c0 = stop color 0, c1 = stop color 1 + // where x0 = stop offset 0, x1 = stop offset 1 + NVGcolor finalcolor; + float stop0, stop1; + NVGcolor color0, color1; + + if (spreadMode == SPREAD_PAD) + { + if (g < 0.0f) + { + finalcolor = transformColor(colorStops[0].color, cxform); + } + else if (g > 1.0f) + { + finalcolor = transformColor(colorStops[nstops - 1].color, cxform); + } + else + { + calcStops(colorStops, cxform, &color0, &color1, &stop0, &stop1, g); + finalcolor = lerpColor(color0, color1, stop0, stop1, g); + } + } + else + { + int w = (int)fabsf(g); + if (spreadMode == SPREAD_REPEAT) + { + if (g < 0) + { + g = 1 - (fabs(g) - w); + } + else + { + g = g - w; + } + } + else if (spreadMode == SPREAD_REFLECT) + { + if (g < 0) + { + if (w % 2 == 0) + { // even + g = (fabsf(g) - w); + } + else + { // odd + g = (1 - (fabsf(g) - w)); + } + } + else + { + if (w % 2 == 0) + { // even + g = g - w; + } + else + { // odd + g = 1 - (g - w); + } + } + } + // clamp + if (g > 1) + g = 1; + if (g < 0) + g = 0; + calcStops(colorStops, cxform, &color0, &color1, &stop0, &stop1, g); + finalcolor = lerpColor(color0, color1, stop0, stop1, g); + } + uint32_t color = ((uint32_t)(finalcolor.a * 255) << 24) | ((uint32_t)(finalcolor.b * 255) << 16) | + ((uint32_t)(finalcolor.g * 255) << 8) | (uint32_t)(finalcolor.r * 255); + image[(y * width) + x] = color; + } + } + int img = nvgCreateImageRGBA(*context.lock(), width, height, 0, (unsigned char*)image); + free(image); + return img; + } + + void CanvasGradient::UpdateCache() + { + if (!dirty) + { + return; + } + if (cachedImage >= 0) + { + nvgDeleteImage(*context.lock(), cachedImage); + } + cachedImage = gradientType == GradientType::Linear ? LinearGradientStops(nullptr) : RadialGradientStops(nullptr); + dirty = false; + } +} diff --git a/Polyfills/Canvas/Source/Gradient.h b/Polyfills/Canvas/Source/Gradient.h new file mode 100644 index 000000000..603cc1990 --- /dev/null +++ b/Polyfills/Canvas/Source/Gradient.h @@ -0,0 +1,43 @@ +#pragma once + +#include +#include +#include "nanovg/nanovg.h" + +struct NVGcontext; + +namespace Babylon::Polyfills::Internal +{ + struct LVGColorTransform; + class CanvasGradient final : public Napi::ObjectWrap + { + public: + static void Initialize(Napi::Env); + static Napi::Object CreateLinear(Napi::Env env, const std::shared_ptr& context, float x0, float y0, float x1, float y1); + static Napi::Object CreateRadial(Napi::Env env, const std::shared_ptr& context, float x0, float y0, float r0, float x1, float y1, float r1); + + explicit CanvasGradient(const Napi::CallbackInfo& info); + virtual ~CanvasGradient(); + + void UpdateCache(); + int CachedImage() const { return cachedImage; } + void Dispose(); + + protected: + float x0, y0, x1, y1; + float r0, r1; + std::map colors; + int cachedImage{-1}; + std::weak_ptr< NVGcontext*> context; + bool dirty{}; + enum class GradientType + { + Linear, + Radial + }; + GradientType gradientType; + void AddColorStop(const Napi::CallbackInfo& info); + int LinearGradientStops(LVGColorTransform* x); + int RadialGradientStops(LVGColorTransform* cxform); + }; +} \ No newline at end of file diff --git a/Polyfills/Canvas/Source/Image.cpp b/Polyfills/Canvas/Source/Image.cpp index b8a227378..8e4424728 100644 --- a/Polyfills/Canvas/Source/Image.cpp +++ b/Polyfills/Canvas/Source/Image.cpp @@ -8,7 +8,7 @@ #include #include #include -#include "nanovg.h" +#include "nanovg/nanovg.h" #include #include #include diff --git a/Polyfills/Canvas/Source/LineCaps.h b/Polyfills/Canvas/Source/LineCaps.h new file mode 100644 index 000000000..67760bb9d --- /dev/null +++ b/Polyfills/Canvas/Source/LineCaps.h @@ -0,0 +1,50 @@ +#pragma once +#include +#include "nanovg/nanovg.h" + +namespace Babylon::Polyfills::Internal +{ + static NVGlineCap StringToLineCap(Napi::Env env, const std::string& lineCapString) + { + std::string str = lineCapString; + std::transform(str.begin(), str.end(), str.begin(), + [](unsigned char c) { return std::tolower(c); }); + + static const std::unordered_map lineCaps = { + {"butt", NVG_BUTT}, + {"round", NVG_ROUND}, + {"square", NVG_SQUARE}}; + + auto iter = lineCaps.find(str); + if (iter != lineCaps.end()) + { + auto lineCap = iter->second; + return lineCap; + } + + // fallback default 'butt' + return NVG_BUTT; + } + + static NVGlineCap StringToLineJoin(Napi::Env env, const std::string& lineJoinString) + { + std::string str = lineJoinString; + std::transform(str.begin(), str.end(), str.begin(), + [](unsigned char c) { return std::tolower(c); }); + + static const std::unordered_map lineJoins = { + {"bevel", NVG_BEVEL}, + {"round", NVG_ROUND}, + {"miter", NVG_MITER}}; + + auto iter = lineJoins.find(str); + if (iter != lineJoins.end()) + { + auto lineJoin = iter->second; + return lineJoin; + } + + // fallback default 'miter' + return NVG_MITER; + } +} diff --git a/Polyfills/Canvas/Source/MeasureText.cpp b/Polyfills/Canvas/Source/MeasureText.cpp index 680d104cc..5e33b7252 100644 --- a/Polyfills/Canvas/Source/MeasureText.cpp +++ b/Polyfills/Canvas/Source/MeasureText.cpp @@ -21,12 +21,15 @@ namespace Babylon::Polyfills::Internal { float bounds[4]; nvgTextBounds(context->GetNVGContext(), 0, 0, text.c_str(), nullptr, bounds); - + float textMetrics[3]; + nvgTextMetrics(context->GetNVGContext(), &textMetrics[0], &textMetrics[1], &textMetrics[2]); auto obj{Napi::Object::New(env)}; obj.Set("width", Napi::Value::From(env, bounds[2] - bounds[0])); obj.Set("height", Napi::Value::From(env, bounds[3] - bounds[1])); obj.Set("actualBoundingBoxLeft", Napi::Value::From(env, bounds[0])); obj.Set("actualBoundingBoxRight", Napi::Value::From(env, bounds[2])); + obj.Set("fontBoundingBoxAscent", Napi::Value::From(env, textMetrics[0])); + obj.Set("fontBoundingBoxDescent", Napi::Value::From(env, -textMetrics[1])); return obj.As(); } diff --git a/Polyfills/Canvas/Source/Path2D.cpp b/Polyfills/Canvas/Source/Path2D.cpp new file mode 100644 index 000000000..95d927222 --- /dev/null +++ b/Polyfills/Canvas/Source/Path2D.cpp @@ -0,0 +1,354 @@ +#include +#include +#include +#include "Canvas.h" +#include "Path2D.h" +#include + +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" +#endif + +#define NANOSVG_IMPLEMENTATION // Expands implementation +#include "nanosvg.h" + +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif + +namespace Babylon::Polyfills::Internal +{ + static constexpr auto JS_PATH2D_CONSTRUCTOR_NAME = "Path2D"; + + void NativeCanvasPath2D::Initialize(Napi::Env env) + { + Napi::HandleScope scope{env}; + + Napi::Function func = DefineClass( + env, + JS_PATH2D_CONSTRUCTOR_NAME, + { + InstanceMethod("addPath", &NativeCanvasPath2D::AddPath), + InstanceMethod("closePath", &NativeCanvasPath2D::ClosePath), + InstanceMethod("moveTo", &NativeCanvasPath2D::MoveTo), + InstanceMethod("lineTo", &NativeCanvasPath2D::LineTo), + InstanceMethod("bezierCurveTo", &NativeCanvasPath2D::BezierCurveTo), + InstanceMethod("quadraticCurveTo", &NativeCanvasPath2D::QuadraticCurveTo), + InstanceMethod("arc", &NativeCanvasPath2D::Arc), + InstanceMethod("arcTo", &NativeCanvasPath2D::ArcTo), + InstanceMethod("ellipse", &NativeCanvasPath2D::Ellipse), + InstanceMethod("rect", &NativeCanvasPath2D::Rect), + InstanceMethod("roundRect", &NativeCanvasPath2D::RoundRect), + }); + + JsRuntime::NativeObject::GetFromJavaScript(env).Set(JS_PATH2D_CONSTRUCTOR_NAME, func); + } + + NativeCanvasPath2D::NativeCanvasPath2D(const Napi::CallbackInfo& info) + : Napi::ObjectWrap{info} + , m_commands{std::deque()} + { + const NativeCanvasPath2D* path = info.Length() == 1 && info[0].IsObject() + ? NativeCanvasPath2D::Unwrap(info[0].As()) + : nullptr; + const std::string d = info.Length() == 1 && info[0].IsString() ? info[0].As().Utf8Value() : ""; + + if (path != nullptr) + { + for (const auto& command : *path) + { + m_commands.push_back(command); + } + } + + if (!d.empty()) + { + NSVGparser* parser = nsvg__createParser(); + const char* path[] = {"d", d.c_str(), NULL}; + const char** attr = {path}; + + assert(strcmp(attr[0], "d") == 0); + assert(!attr[2]); // nsvg__parsePath terminates attr parsing on falsy + + nsvg__parsePath(parser, attr); + + for (NSVGshape *shape = parser->image->shapes; shape != NULL; shape = shape->next) { + for (NSVGpath *path = shape->paths; path != NULL; path = path->next) { + for (int i = 0; i < path->npts-1; i += 3) { + float* p = &path->pts[i*2]; + + auto x0 = p[0]; // start x, same as end x of previous + auto y0 = p[1]; // start y, same as end y of previous + auto cpx1 = p[2]; + auto cpy1 = p[3]; + auto cpx2 = p[4]; + auto cpy2 = p[5]; + auto x1 = p[6]; // end x + auto y1 = p[7]; // end y + + // Only need to move on new shape + if (i == 0) + { + Path2DCommandArgs moveArgs = {}; + moveArgs.moveTo = {x0, y0}; + AppendCommand(P2D_MOVETO, moveArgs); + } + + Path2DCommandArgs args = {}; + args.bezierTo = {cpx1, cpy1, cpx2, cpy2, x1, y1}; + AppendCommand(P2D_BEZIERTO, args); + } + } + } + + nsvg__deleteParser(parser); + } + } + + typename std::deque::iterator NativeCanvasPath2D::begin() + { + return m_commands.begin(); + } + + typename std::deque::iterator NativeCanvasPath2D::end() + { + return m_commands.end(); + } + + typename std::deque::const_iterator NativeCanvasPath2D::begin() const + { + return m_commands.begin(); + } + + typename std::deque::const_iterator NativeCanvasPath2D::end() const + { + return m_commands.end(); + } + + void NativeCanvasPath2D::AppendCommand(Path2DCommandTypes type, Path2DCommandArgs args) + { + m_commands.push_back({type, args}); + } + + void NativeCanvasPath2D::AddPath(const Napi::CallbackInfo& info) + { + const NativeCanvasPath2D* path = NativeCanvasPath2D::Unwrap(info[0].As()); + + // optional transform arg + float *xformInv = nullptr; + if (info.Length() == 2) + { + Napi::Object transform = info[1].As(); + auto a = transform.Get("a").As().FloatValue(); + auto b = transform.Get("b").As().FloatValue(); + auto c = transform.Get("c").As().FloatValue(); + auto d = transform.Get("d").As().FloatValue(); + auto e = transform.Get("e").As().FloatValue(); + auto f = transform.Get("f").As().FloatValue(); + + float xform[6] = {a, b, c, d, e, f}; + xformInv = new float[6]; + nsvg__xformInverse(xformInv, xform); + + Path2DCommandArgs args = {}; + args.transform = { xform[0], xform[1], xform[2], xform[3], xform[4], xform[5] }; + AppendCommand(P2D_TRANSFORM, args); + } + + for (const auto& command : *path) + { + m_commands.push_back(command); + } + + // invert transform after all commands played + if (info.Length() == 2) + { + assert(xformInv != nullptr); + Path2DCommandArgs argsInv = {}; + argsInv.transform = { xformInv[0], xformInv[1], xformInv[2], xformInv[3], xformInv[4], xformInv[5] }; + AppendCommand(P2D_TRANSFORM, argsInv); + } + } + + void NativeCanvasPath2D::ClosePath(const Napi::CallbackInfo& info) + { + AppendCommand(P2D_CLOSE, {}); + } + + void NativeCanvasPath2D::MoveTo(const Napi::CallbackInfo& info) + { + const auto x = static_cast(info[0].As().DoubleValue()); + const auto y = static_cast(info[1].As().DoubleValue()); + + Path2DCommandArgs args = {}; + args.moveTo = {x, y}; + AppendCommand(P2D_MOVETO, args); + } + + void NativeCanvasPath2D::LineTo(const Napi::CallbackInfo& info) + { + const auto x = static_cast(info[0].As().DoubleValue()); + const auto y = static_cast(info[1].As().DoubleValue()); + + Path2DCommandArgs args = {}; + args.lineTo = {x, y}; + AppendCommand(P2D_LINETO, args); + } + + void NativeCanvasPath2D::BezierCurveTo(const Napi::CallbackInfo& info) + { + const auto cp1x = static_cast(info[0].As().DoubleValue()); + const auto cp1y = static_cast(info[1].As().DoubleValue()); + const auto cp2x = static_cast(info[2].As().DoubleValue()); + const auto cp2y = static_cast(info[3].As().DoubleValue()); + const auto x = static_cast(info[4].As().DoubleValue()); + const auto y = static_cast(info[5].As().DoubleValue()); + + Path2DCommandArgs args = {}; + args.bezierTo = {cp1x, cp1y, cp2x, cp2y, x, y}; + AppendCommand(P2D_BEZIERTO, args); + } + + void NativeCanvasPath2D::QuadraticCurveTo(const Napi::CallbackInfo& info) + { + const auto cpx = static_cast(info[0].As().DoubleValue()); + const auto cpy = static_cast(info[1].As().DoubleValue()); + const auto x = static_cast(info[2].As().DoubleValue()); + const auto y = static_cast(info[3].As().DoubleValue()); + + Path2DCommandArgs args = {}; + args.quadTo = {cpx, cpy, x, y}; + AppendCommand(P2D_QUADTO, args); + } + + void NativeCanvasPath2D::Arc(const Napi::CallbackInfo& info) + { + const auto x = static_cast(info[0].As().DoubleValue()); + const auto y = static_cast(info[1].As().DoubleValue()); + const auto radius = static_cast(info[2].As().DoubleValue()); + const auto startAngle = static_cast(info[3].As().DoubleValue()); + const auto endAngle = static_cast(info[4].As().DoubleValue()); + const auto counterclockwise = info.Length() == 6 ? info[5].As() : false; + + Path2DCommandArgs args = {}; + args.arc = {x, y, radius, startAngle, endAngle, counterclockwise}; + AppendCommand(P2D_ARC, args); + } + + void NativeCanvasPath2D::ArcTo(const Napi::CallbackInfo& info) + { + const auto x1 = static_cast(info[0].As().DoubleValue()); + const auto y1 = static_cast(info[1].As().DoubleValue()); + const auto x2 = static_cast(info[2].As().DoubleValue()); + const auto y2 = static_cast(info[3].As().DoubleValue()); + const auto radius = static_cast(info[4].As().DoubleValue()); + + Path2DCommandArgs args = {}; + args.arcTo = {x1, y1, x2, y2, radius}; + AppendCommand(P2D_ARCTO, args); + } + + void NativeCanvasPath2D::Ellipse(const Napi::CallbackInfo& info) + { + const auto x = static_cast(info[0].As().DoubleValue()); + const auto y = static_cast(info[1].As().DoubleValue()); + const auto radiusX = static_cast(info[2].As().DoubleValue()); + const auto radiusY = static_cast(info[3].As().DoubleValue()); + const auto rotation = static_cast(info[4].As().DoubleValue()); + const auto startAngle = static_cast(info[5].As().DoubleValue()); + const auto endAngle = static_cast(info[6].As().DoubleValue()); + const auto counterclockwise = info.Length() == 8 ? info[7].As() : false; + + Path2DCommandArgs args = {}; + args.ellipse = {x, y, radiusX, radiusY, rotation, startAngle, endAngle, counterclockwise}; + AppendCommand(P2D_ELLIPSE, args); + } + + void NativeCanvasPath2D::Rect(const Napi::CallbackInfo& info) + { + const auto x = static_cast(info[0].As().DoubleValue()); + const auto y = static_cast(info[1].As().DoubleValue()); + const auto width = static_cast(info[2].As().DoubleValue()); + const auto height = static_cast(info[3].As().DoubleValue()); + + Path2DCommandArgs args = {}; + args.rect = {x, y, width, height}; + AppendCommand(P2D_RECT, args); + } + + void NativeCanvasPath2D::RoundRect(const Napi::CallbackInfo& info) + { + const auto x = static_cast(info[0].As().DoubleValue()); + const auto y = static_cast(info[1].As().DoubleValue()); + const auto width = static_cast(info[2].As().DoubleValue()); + const auto height = static_cast(info[3].As().DoubleValue()); + const auto radii = info[4]; + + if (radii.IsNumber()) + { + const auto radius = radii.As().FloatValue(); + Path2DCommandArgs args = {}; + args.roundRect = {x, y, width, height, radius}; + AppendCommand(P2D_ROUNDRECT, args); + } + else if (radii.IsArray()) + { + const auto radiiArray = radii.As(); + const auto radiiArrayLength = radiiArray.Length(); + if (radiiArrayLength == 1) + { + const auto radius = radiiArray[0u].As().FloatValue(); + Path2DCommandArgs args = {}; + args.roundRect = {x, y, width, height, radius}; + AppendCommand(P2D_ROUNDRECT, args); + } + else if (radiiArrayLength == 2) + { + const auto topLeftBottomRight = radiiArray[0u].As().FloatValue(); + const auto topRightBottomLeft = radiiArray[1].As().FloatValue(); + Path2DCommandArgs args = {}; + args.roundRectVarying = {x, y, width, height, topLeftBottomRight, topRightBottomLeft, topLeftBottomRight, topRightBottomLeft}; + AppendCommand(P2D_ROUNDRECTVARYING, args); + } + else if (radiiArrayLength == 3) + { + const auto topLeft = radiiArray[0u].As().FloatValue(); + const auto topRightBottomLeft = radiiArray[1].As().FloatValue(); + const auto bottomRight = radiiArray[2].As().FloatValue(); + Path2DCommandArgs args = {}; + args.roundRectVarying = {x, y, width, height, topLeft, topRightBottomLeft, bottomRight, topRightBottomLeft}; + AppendCommand(P2D_ROUNDRECTVARYING, args); + } + else if (radiiArrayLength == 4) + { + const auto topLeft = radiiArray[0u].As().FloatValue(); + const auto topRight = radiiArray[1].As().FloatValue(); + const auto bottomRight = radiiArray[2].As().FloatValue(); + const auto bottomLeft = radiiArray[3].As().FloatValue(); + Path2DCommandArgs args = {}; + args.roundRectVarying = {x, y, width, height, topLeft, topRight, bottomRight, bottomLeft}; + AppendCommand(P2D_ROUNDRECTVARYING, args); + } + else + { + throw Napi::Error::New(info.Env(), "Invalid number of parameters for radii"); + } + } + // DOMPoint + // TODO: move duplicate Path2D & Context args parsing into a utils.cpp + else if (radii.IsObject()) + { + const auto dompoint = radii.As(); + const auto radiusX = dompoint.Get("x").As().FloatValue(); + const auto radiusY = dompoint.Get("y").As().FloatValue(); + Path2DCommandArgs args = {}; + args.roundRectElliptic = {x, y, width, height, radiusX, radiusY, radiusX, radiusY, radiusX, radiusY, radiusX, radiusY}; + AppendCommand(P2D_ROUNDRECTELLIPTIC, args); + } + else + { + throw Napi::Error::New(info.Env(), "Invalid radii parameter"); + } + } +} diff --git a/Polyfills/Canvas/Source/Path2D.h b/Polyfills/Canvas/Source/Path2D.h new file mode 100644 index 000000000..9f00bb558 --- /dev/null +++ b/Polyfills/Canvas/Source/Path2D.h @@ -0,0 +1,94 @@ +#pragma once + +#include +#include +#include + +enum Path2DCommandTypes +{ + P2D_CLOSE = 0, + P2D_MOVETO = 1, + P2D_LINETO = 2, + P2D_BEZIERTO = 3, + P2D_QUADTO = 4, + P2D_ARC = 5, + P2D_ARCTO = 6, + P2D_ELLIPSE = 7, + P2D_RECT = 8, + P2D_ROUNDRECT = 9, + P2D_ROUNDRECTVARYING = 10, + P2D_ROUNDRECTELLIPTIC = 11, + P2D_TRANSFORM = 12, +}; + +struct Path2DClose {}; // TODO: don't bother if no args? +struct Path2DMoveTo { float x; float y; }; +struct Path2DLineTo { float x; float y; }; +struct Path2DBezierTo { float cp1x; float cp1y; float cp2x; float cp2y; float x; float y; }; +struct Path2DQuadTo { float cpx; float cpy; float x; float y; }; +struct Path2DArc { float x; float y; float radius; float startAngle; float endAngle; bool counterclockwise; }; +struct Path2DArcTo { float x1; float y1; float x2; float y2; float radius; }; +struct Path2DEllipse { float x; float y; float radiusX; float radiusY; float rotation; float startAngle; float endAngle; bool counterclockwise; }; +struct Path2DRect { float x; float y; float width; float height; }; +struct Path2DRoundRect { float x; float y; float width; float height; float radii; }; +struct Path2DRoundRectVarying { float x; float y; float width; float height; float topLeft; float topRight; float bottomRight; float bottomLeft; }; +struct Path2DRoundRectElliptic { float x; float y; float width; float height; float topLeftX; float topLeftY; float topRightX; float topRightY; float bottomRightX; float bottomRightY; float bottomLeftX; float bottomLeftY; }; +struct Path2DTransform { float a; float b; float c; float d; float e; float f; }; + +union Path2DCommandArgs +{ + Path2DClose close; + Path2DMoveTo moveTo; + Path2DLineTo lineTo; + Path2DBezierTo bezierTo; + Path2DQuadTo quadTo; + Path2DArc arc; + Path2DArcTo arcTo; + Path2DEllipse ellipse; + Path2DRect rect; + Path2DRoundRect roundRect; + Path2DRoundRectVarying roundRectVarying; + Path2DRoundRectElliptic roundRectElliptic; + Path2DTransform transform; +}; + +struct Path2DCommand +{ + Path2DCommandTypes type; + Path2DCommandArgs args; +}; + +namespace Babylon::Polyfills::Internal +{ + class NativeCanvasPath2D final : public Napi::ObjectWrap + { + public: + static void Initialize(Napi::Env env); + + explicit NativeCanvasPath2D(const Napi::CallbackInfo& info); + // virtual ~NativeCanvasPath2D(); // TODO: destructor? empty queue? + + typename std::deque::iterator begin(); + typename std::deque::iterator end(); + typename std::deque::const_iterator begin() const; + typename std::deque::const_iterator end() const; + + private: + void AddPath(const Napi::CallbackInfo&); + void ClosePath(const Napi::CallbackInfo&); + void MoveTo(const Napi::CallbackInfo&); + void LineTo(const Napi::CallbackInfo&); + void BezierCurveTo(const Napi::CallbackInfo&); + void QuadraticCurveTo(const Napi::CallbackInfo&); + void Arc(const Napi::CallbackInfo&); + void ArcTo(const Napi::CallbackInfo&); + void Ellipse(const Napi::CallbackInfo&); + void Rect(const Napi::CallbackInfo&); + void RoundRect(const Napi::CallbackInfo&); + void RoundRectVarying(const Napi::CallbackInfo&); + + void AppendCommand(Path2DCommandTypes type, Path2DCommandArgs args); + + std::deque m_commands; // use deque because iterable + }; +} diff --git a/Polyfills/Canvas/Source/Shaders/dx11/fs_boxblur.h b/Polyfills/Canvas/Source/Shaders/dx11/fs_boxblur.h new file mode 100644 index 000000000..3ff471033 --- /dev/null +++ b/Polyfills/Canvas/Source/Shaders/dx11/fs_boxblur.h @@ -0,0 +1,73 @@ +static const uint8_t fs_boxblur_dx11[1117] = +{ + 0x46, 0x53, 0x48, 0x0b, 0xcf, 0xda, 0x1b, 0x94, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x0a, 0x75, // FSH............u + 0x5f, 0x76, 0x69, 0x65, 0x77, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // _viewSize....... + 0x00, 0x00, 0x00, 0x0b, 0x75, 0x5f, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, // ....u_direction. + 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x75, 0x5f, 0x77, 0x65, 0x69, 0x67, // ..........u_weig + 0x68, 0x74, 0x73, 0x12, 0x00, 0x20, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x73, 0x5f, // hts.. ........s_ + 0x74, 0x65, 0x78, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x73, 0x5f, // tex0..........s_ + 0x74, 0x65, 0x78, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe8, 0x03, 0x00, // tex0............ + 0x00, 0x44, 0x58, 0x42, 0x43, 0x9c, 0xe1, 0x62, 0xa5, 0xda, 0x67, 0x10, 0xc1, 0x10, 0x30, 0x16, // .DXBC..b..g...0. + 0xbb, 0xc0, 0xda, 0x44, 0x94, 0x01, 0x00, 0x00, 0x00, 0xe8, 0x03, 0x00, 0x00, 0x03, 0x00, 0x00, // ...D............ + 0x00, 0x2c, 0x00, 0x00, 0x00, 0x9c, 0x00, 0x00, 0x00, 0xd0, 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, // .,...........ISG + 0x4e, 0x68, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, // Nh...........P.. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x0f, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, // ................ + 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // ................ + 0x00, 0x0c, 0x0c, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, // .....SV_POSITION + 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0xab, 0xab, 0x4f, 0x53, 0x47, // .TEXCOORD....OSG + 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, // N,........... .. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x0f, 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x00, 0xab, // .....SV_TARGET.. + 0xab, 0x53, 0x48, 0x45, 0x58, 0x10, 0x03, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0xc4, 0x00, 0x00, // .SHEX....P...... + 0x00, 0x6a, 0x08, 0x00, 0x01, 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, // .j...Y...F. .... + 0x00, 0x03, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x03, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, // .....Z....`..... + 0x00, 0x58, 0x18, 0x00, 0x04, 0x00, 0x70, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, // .X....p......UU. + 0x00, 0x62, 0x10, 0x00, 0x03, 0xc2, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, // .b...........e.. + 0x03, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x06, 0x00, 0x00, // .. ......h...... + 0x00, 0x31, 0x00, 0x00, 0x0c, 0x32, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe6, 0x8a, 0x20, // .1...2......... + 0x80, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, // ..............@. + 0x00, 0x7a, 0x16, 0xa5, 0x35, 0x7a, 0x16, 0xa5, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .z..5z..5....... + 0x00, 0x01, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x04, // ................ + 0x03, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x8b, 0xc2, 0x00, 0x00, // .........E...... + 0x80, 0x43, 0x55, 0x15, 0x00, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe6, 0x1a, 0x10, // .CU............. + 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, // .....F~.......`. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x01, 0x36, 0x00, 0x00, 0x08, 0xf2, 0x00, 0x10, // .........6...... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ......@......... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // ................ + 0x09, 0x32, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, // .2.......F. .... + 0x00, 0x01, 0x00, 0x00, 0x00, 0xe6, 0x8a, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, // ....... ........ + 0x00, 0x0e, 0x00, 0x00, 0x0b, 0xc2, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, // ..............@. + 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, // ....?...?...?... + 0x3f, 0x06, 0x84, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x00, // ?.. ............ + 0x06, 0x12, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x1a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, // ........... .... + 0x00, 0x02, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x32, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, // .....8...2...... + 0x00, 0xe6, 0x0a, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, // .........F...... + 0x00, 0x36, 0x00, 0x00, 0x05, 0xf2, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, // .6...........F.. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x42, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, // .....6...B...... + 0x00, 0x01, 0x40, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x01, 0x22, 0x00, 0x00, // ..@......0...".. + 0x07, 0x82, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, // ................ + 0x00, 0x2a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x04, 0x03, 0x3a, 0x00, 0x10, // .*...........:.. + 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x05, 0x82, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, // .....+.......... + 0x00, 0x2a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0x62, 0x00, 0x10, // .*.......2...b.. + 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x01, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0xf6, 0x0f, 0x10, // ................ + 0x00, 0x01, 0x00, 0x00, 0x00, 0xa6, 0x1b, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, // .............E.. + 0x8b, 0xc2, 0x00, 0x00, 0x80, 0x43, 0x55, 0x15, 0x00, 0xf2, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, // .....CU......... + 0x00, 0x96, 0x05, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, // .........F~..... + 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xf2, 0x00, 0x10, // ..`............. + 0x00, 0x04, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, // .....F.......F.. + 0x00, 0x04, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x62, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, // .....2...b...... + 0x00, 0x06, 0x01, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xf6, 0x0f, 0x10, // .....A.......... + 0x00, 0x01, 0x00, 0x00, 0x00, 0xa6, 0x1b, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, // .............E.. + 0x8b, 0xc2, 0x00, 0x00, 0x80, 0x43, 0x55, 0x15, 0x00, 0xf2, 0x00, 0x10, 0x00, 0x05, 0x00, 0x00, // .....CU......... + 0x00, 0x96, 0x05, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, // .........F~..... + 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xf2, 0x00, 0x10, // ..`............. + 0x00, 0x03, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, // .....F.......F.. + 0x00, 0x05, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x07, 0x42, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, // .........B...... + 0x00, 0x2a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x01, 0x00, 0x00, // .*........@..... + 0x00, 0x16, 0x00, 0x00, 0x01, 0x0e, 0x00, 0x00, 0x08, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, // .......... ..... + 0x00, 0x46, 0x0e, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x06, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, // .F......... .... + 0x00, 0x02, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x30, 0x00, // .....>.....0. +}; diff --git a/Polyfills/Canvas/Source/Shaders/dx11/fs_gaussblur.h b/Polyfills/Canvas/Source/Shaders/dx11/fs_gaussblur.h new file mode 100644 index 000000000..ad54a590d --- /dev/null +++ b/Polyfills/Canvas/Source/Shaders/dx11/fs_gaussblur.h @@ -0,0 +1,107 @@ +static const uint8_t fs_gaussblur_dx11[1649] = +{ + 0x46, 0x53, 0x48, 0x0b, 0xcf, 0xda, 0x1b, 0x94, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x0a, 0x75, // FSH............u + 0x5f, 0x76, 0x69, 0x65, 0x77, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // _viewSize....... + 0x00, 0x00, 0x00, 0x0b, 0x75, 0x5f, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, // ....u_direction. + 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x75, 0x5f, 0x77, 0x65, 0x69, 0x67, // ..........u_weig + 0x68, 0x74, 0x73, 0x12, 0x05, 0x20, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x73, 0x5f, // hts.. ........s_ + 0x74, 0x65, 0x78, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x73, 0x5f, // tex0..........s_ + 0x74, 0x65, 0x78, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x05, 0x00, // tex0............ + 0x00, 0x44, 0x58, 0x42, 0x43, 0x70, 0x8c, 0x38, 0xcc, 0xcc, 0x15, 0x9f, 0x7e, 0xcf, 0xcd, 0xe8, // .DXBCp.8....~... + 0x46, 0xe2, 0xe8, 0xb2, 0xd0, 0x01, 0x00, 0x00, 0x00, 0xfc, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, // F............... + 0x00, 0x2c, 0x00, 0x00, 0x00, 0x9c, 0x00, 0x00, 0x00, 0xd0, 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, // .,...........ISG + 0x4e, 0x68, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, // Nh...........P.. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x0f, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, // ................ + 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // ................ + 0x00, 0x0c, 0x0c, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, // .....SV_POSITION + 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0xab, 0xab, 0x4f, 0x53, 0x47, // .TEXCOORD....OSG + 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, // N,........... .. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x0f, 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x00, 0xab, // .....SV_TARGET.. + 0xab, 0x53, 0x48, 0x45, 0x58, 0x24, 0x05, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x49, 0x01, 0x00, // .SHEX$...P...I.. + 0x00, 0x6a, 0x08, 0x00, 0x01, 0x35, 0x18, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, // .j...5.......... + 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ?............... + 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ....?........... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........?....... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x59, 0x08, 0x00, // ............?Y.. + 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, // .F. .........Z.. + 0x03, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x18, 0x00, 0x04, 0x00, 0x70, 0x10, // ..`......X....p. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0xc2, 0x10, 0x10, // .....UU..b...... + 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, // .....e.... ..... + 0x00, 0x68, 0x00, 0x00, 0x02, 0x06, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x8b, 0xc2, 0x00, 0x00, // .h.......E...... + 0x80, 0x43, 0x55, 0x15, 0x00, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe6, 0x1a, 0x10, // .CU............. + 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, // .....F~.......`. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, // .....8.......... + 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0x8a, 0x20, 0x00, 0x00, 0x00, 0x00, // .F......... .... + 0x00, 0x03, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x0b, 0x32, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, // .........2...... + 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, // ..@.....?...?... + 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x46, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ?...?F. ........ + 0x00, 0x38, 0x00, 0x00, 0x08, 0x32, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x00, 0x10, // .8...2.......F.. + 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // .....F. ........ + 0x00, 0x36, 0x00, 0x00, 0x05, 0xf2, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, // .6...........F.. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x42, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, // .....6...B...... + 0x00, 0x01, 0x40, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x01, 0x22, 0x00, 0x00, // ..@......0...".. + 0x07, 0x82, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x06, 0x00, 0x00, // ..........@..... + 0x00, 0x2a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x04, 0x03, 0x3a, 0x00, 0x10, // .*...........:.. + 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x05, 0x82, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, // .....+.......... + 0x00, 0x2a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0x32, 0x00, 0x10, // .*.......2...2.. + 0x00, 0x03, 0x00, 0x00, 0x00, 0x46, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0xf6, 0x0f, 0x10, // .....F.......... + 0x00, 0x01, 0x00, 0x00, 0x00, 0xe6, 0x1a, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, // .............E.. + 0x8b, 0xc2, 0x00, 0x00, 0x80, 0x43, 0x55, 0x15, 0x00, 0xf2, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, // .....CU......... + 0x00, 0x46, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, // .F.......F~..... + 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x0a, 0x32, 0x00, 0x10, // ..`..........2.. + 0x00, 0x04, 0x00, 0x00, 0x00, 0xa6, 0x0a, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, // ..............@. + 0x00, 0x06, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x55, 0x00, 0x00, 0x07, 0x42, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, // .U...B.......... + 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, // ......@......+.. + 0x05, 0x12, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, // ................ + 0x00, 0x38, 0x00, 0x00, 0x07, 0x82, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, // .8.............. + 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3e, 0x41, 0x00, 0x00, // ......@.....>A.. + 0x05, 0x82, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, // .........:...... + 0x00, 0x32, 0x00, 0x00, 0x0a, 0x12, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, // .2...........:.. + 0x80, 0x41, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, // .A........@..... + 0x40, 0x0a, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x00, 0x05, 0x12, 0x00, 0x10, // @............... + 0x00, 0x04, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, // ................ + 0x0b, 0x12, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x06, 0x00, 0x00, 0x00, // .........F. .... + 0x00, 0x02, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x46, 0x9e, 0x90, // .....*.......F.. + 0x00, 0x0a, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0xf2, 0x00, 0x10, // .........2...... + 0x00, 0x03, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, // .....F.......... + 0x00, 0x04, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, // .....F.......2.. + 0x0a, 0x52, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x06, 0x01, 0x10, 0x80, 0x41, 0x00, 0x00, // .R...........A.. + 0x00, 0x01, 0x00, 0x00, 0x00, 0xf6, 0x0f, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0xa6, 0x1b, 0x10, // ................ + 0x00, 0x01, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x8b, 0xc2, 0x00, 0x00, 0x80, 0x43, 0x55, 0x15, // .....E.......CU. + 0x00, 0xf2, 0x00, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00, 0x86, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, // ................ + 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, // .F~.......`..... + 0x00, 0x1e, 0x00, 0x00, 0x08, 0x82, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, // .............*.. + 0x80, 0x41, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x06, 0x00, 0x00, // .A........@..... + 0x00, 0x57, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, // .W...........:.. + 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, // ......@......$.. + 0x08, 0x42, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, // .B.......:...... + 0x00, 0x3a, 0x00, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, // .:...A.......U.. + 0x07, 0x42, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, // .B.......*...... + 0x00, 0x01, 0x40, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x05, 0x82, 0x00, 0x10, // ..@......(...... + 0x00, 0x04, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // .....*.......... + 0x07, 0x12, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, // ................ + 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x37, 0x00, 0x00, 0x09, 0x12, 0x00, 0x10, // ..@......7...... + 0x00, 0x04, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, // .............:.. + 0x00, 0x04, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, // .....*.......+.. + 0x05, 0x82, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, // .........:...... + 0x00, 0x38, 0x00, 0x00, 0x07, 0x42, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, // .8...B.......:.. + 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3e, 0x41, 0x00, 0x00, // ......@.....>A.. + 0x05, 0x42, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, // .B.......*...... + 0x00, 0x32, 0x00, 0x00, 0x0a, 0x82, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, // .2...........*.. + 0x80, 0x41, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, // .A........@..... + 0x40, 0x3a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x00, 0x05, 0x82, 0x00, 0x10, // @:.............. + 0x00, 0x01, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, // .....:.......... + 0x0b, 0x82, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x06, 0x00, 0x00, 0x00, // .........F. .... + 0x00, 0x02, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x46, 0x9e, 0x90, // .............F.. + 0x00, 0x3a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0xf2, 0x00, 0x10, // .:.......2...... + 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00, 0xf6, 0x0f, 0x10, // .....F.......... + 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, // .....F.......6.. + 0x05, 0x42, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, // .B.............. + 0x00, 0x16, 0x00, 0x00, 0x01, 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, // .....6.... ..... + 0x00, 0x46, 0x0e, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x70, // .F.......>.....p + 0x00, // . +}; diff --git a/Polyfills/Canvas/Source/Shaders/dx11/fs_nanovg_fill.h b/Polyfills/Canvas/Source/Shaders/dx11/fs_nanovg_fill.h index 63fd02ecb..764b5dc21 100644 --- a/Polyfills/Canvas/Source/Shaders/dx11/fs_nanovg_fill.h +++ b/Polyfills/Canvas/Source/Shaders/dx11/fs_nanovg_fill.h @@ -1,6 +1,6 @@ -static const uint8_t fs_nanovg_fill_dx11[2436] = +static const uint8_t fs_nanovg_fill_dx11[3258] = { - 0x46, 0x53, 0x48, 0x0b, 0xcf, 0xda, 0x1b, 0x94, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x0c, 0x75, // FSH............u + 0x46, 0x53, 0x48, 0x0b, 0x1e, 0x98, 0xde, 0xee, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x0c, 0x75, // FSH............u 0x5f, 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x4d, 0x61, 0x74, 0x13, 0x00, 0x00, 0x00, 0x03, // _scissorMat..... 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x75, 0x5f, 0x70, 0x61, 0x69, 0x6e, 0x74, 0x4d, 0x61, 0x74, // ......u_paintMat 0x13, 0x00, 0x30, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x75, 0x5f, 0x69, 0x6e, 0x6e, // ..0........u_inn @@ -10,147 +10,198 @@ static const uint8_t fs_nanovg_fill_dx11[2436] = 0x74, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x12, 0x00, 0x80, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // tScale.......... 0x0e, 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x12, // .u_extentRadius. 0x00, 0x90, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, // ..........u_para - 0x6d, 0x73, 0x12, 0x00, 0xa0, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x73, 0x5f, 0x74, // ms...........s_t - 0x65, 0x78, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x73, 0x5f, 0x74, // ex0..........s_t - 0x65, 0x78, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0x08, 0x00, 0x00, // ex0............. - 0x44, 0x58, 0x42, 0x43, 0x3f, 0x86, 0x86, 0x0a, 0xea, 0xf5, 0x27, 0x11, 0x51, 0x17, 0x18, 0x97, // DXBC?.....'.Q... - 0x9b, 0x8e, 0x53, 0xe7, 0x01, 0x00, 0x00, 0x00, 0xb0, 0x08, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // ..S............. - 0x2c, 0x00, 0x00, 0x00, 0x9c, 0x00, 0x00, 0x00, 0xd0, 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, // ,...........ISGN - 0x68, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, // h...........P... - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x0f, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x03, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, // ................ - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // ................ - 0x0c, 0x0c, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, // ....SV_POSITION. - 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0xab, 0xab, 0x4f, 0x53, 0x47, 0x4e, // TEXCOORD....OSGN - 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, // ,........... ... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x0f, 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, // ....SV_TARGET... - 0x53, 0x48, 0x45, 0x58, 0xd8, 0x07, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0xf6, 0x01, 0x00, 0x00, // SHEX....P....... - 0x6a, 0x08, 0x00, 0x01, 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // j...Y...F. ..... - 0x0b, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x03, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....Z....`...... - 0x58, 0x18, 0x00, 0x04, 0x00, 0x70, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, // X....p......UU.. - 0x62, 0x10, 0x00, 0x03, 0x32, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, // b...2.......b... - 0xc2, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, // ........e.... .. - 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x03, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, // ....h.......8... - 0x32, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x15, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // 2.......V....... - 0x46, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, // F. .........2... - 0x32, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // 2.......F. ..... - 0x00, 0x00, 0x00, 0x00, 0x06, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x00, 0x10, 0x00, // ............F... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x32, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ........2....... - 0x46, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // F.......F. ..... - 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x32, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ........2....... - 0x46, 0x00, 0x10, 0x80, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x80, 0x20, 0x80, // F...........F. . - 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x32, 0x20, 0x00, 0x0e, // A...........2 .. - 0x32, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x00, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, // 2.......F...A... - 0x00, 0x00, 0x00, 0x00, 0xe6, 0x8a, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, // ...... ......... - 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00, // .@.....?...?.... - 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....8........... - 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x32, 0x00, 0x00, 0x09, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x10, 0x10, 0x00, // 2...".......*... - 0x01, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x01, 0x40, 0x00, 0x00, // .....@.....@.@.. - 0x00, 0x00, 0x80, 0xbf, 0x00, 0x00, 0x00, 0x08, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ........"....... - 0x1a, 0x00, 0x10, 0x80, 0xc1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, // .............@.. - 0x00, 0x00, 0x80, 0x3f, 0x38, 0x00, 0x00, 0x08, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ...?8..."....... - 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // .......... ..... - 0x0a, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x07, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....3..."....... - 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, // .........@.....? - 0x33, 0x00, 0x00, 0x07, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x10, 0x10, 0x00, // 3...B.......:... - 0x01, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x38, 0x00, 0x00, 0x07, // .....@.....?8... - 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ".......*....... - 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x08, 0x42, 0x00, 0x10, 0x00, // ............B... - 0x00, 0x00, 0x00, 0x00, 0x3a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, // ....:. ......... - 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x04, 0x03, 0x2a, 0x00, 0x10, 0x00, // .@..........*... - 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0xc2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....8........... - 0x56, 0x15, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x84, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // V......... ..... - 0x04, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xc2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....2........... - 0x06, 0x84, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x06, 0x10, 0x10, 0x00, // .. ............. - 0x01, 0x00, 0x00, 0x00, 0xa6, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, // ................ - 0xc2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x06, 0x84, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, // .. ............. - 0x32, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0xa6, 0x8a, 0x20, 0x80, 0x41, 0x00, 0x00, 0x00, // 2......... .A... - 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x46, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // ........F. ..... - 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0xc2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0xa6, 0x0e, 0x10, 0x80, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x04, 0x10, 0x80, // ................ - 0x41, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, // A.......4....... - 0x01, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, // ....:.......*... - 0x00, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ....3........... - 0x0a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .........@...... - 0x34, 0x00, 0x00, 0x0a, 0xc2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0x0e, 0x10, 0x00, // 4............... - 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .....@.......... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x07, 0x42, 0x00, 0x10, 0x00, // ............B... - 0x00, 0x00, 0x00, 0x00, 0xe6, 0x0a, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe6, 0x0a, 0x10, 0x00, // ................ - 0x00, 0x00, 0x00, 0x00, 0x4b, 0x00, 0x00, 0x05, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....K...B....... - 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x42, 0x00, 0x10, 0x00, // *...........B... - 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, // ....*........... - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ........B....... - 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x80, 0x20, 0x80, 0x41, 0x00, 0x00, 0x00, // *.......*. .A... - 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x42, 0x00, 0x10, 0x00, // ........2...B... - 0x00, 0x00, 0x00, 0x00, 0x0a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, // ...... ......... - 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // .@.....?*....... - 0x0e, 0x20, 0x00, 0x08, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, // . ..B.......*... - 0x00, 0x00, 0x00, 0x00, 0x0a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, // ...... ......... - 0x00, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x80, // ............F. . - 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, // A...........F. . - 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, // ........2....... - 0x01, 0x00, 0x00, 0x00, 0xa6, 0x0a, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, // ............F... - 0x01, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, // ....F. ......... - 0x38, 0x00, 0x00, 0x07, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, // 8...B........... - 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, // ............8... - 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0x0a, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // . .............. - 0x46, 0x0e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x01, 0x18, 0x00, 0x00, 0x08, // F............... - 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // B.......:. ..... - 0x0a, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x1f, 0x00, 0x04, 0x03, // .....@.....?.... - 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0xc2, 0x00, 0x10, 0x00, // *.......8....... - 0x00, 0x00, 0x00, 0x00, 0x56, 0x15, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x84, 0x20, 0x00, // ....V......... . - 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xc2, 0x00, 0x10, 0x00, // ........2....... - 0x00, 0x00, 0x00, 0x00, 0x06, 0x84, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // ...... ......... - 0x06, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0xa6, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x08, 0xc2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0x0e, 0x10, 0x00, // ................ - 0x00, 0x00, 0x00, 0x00, 0x06, 0x84, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, // ...... ......... - 0x0e, 0x00, 0x00, 0x08, 0xc2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0x0e, 0x10, 0x00, // ................ - 0x00, 0x00, 0x00, 0x00, 0x06, 0x84, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, // ...... ......... - 0x45, 0x00, 0x00, 0x8b, 0xc2, 0x00, 0x00, 0x80, 0x43, 0x55, 0x15, 0x00, 0xf2, 0x00, 0x10, 0x00, // E.......CU...... - 0x01, 0x00, 0x00, 0x00, 0xe6, 0x0a, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, // ............F~.. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x0b, // .....`.......... - 0xc2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0x8a, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // .......... ..... - 0x0a, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .....@.......... - 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x40, 0x38, 0x00, 0x00, 0x07, 0x72, 0x00, 0x10, 0x00, // ...?...@8...r... - 0x02, 0x00, 0x00, 0x00, 0xf6, 0x0f, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, // ............F... - 0x01, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x09, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ....7...r....... - 0xa6, 0x0a, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, // ........F....... - 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x09, 0xe2, 0x00, 0x10, 0x00, // F.......7....... - 0x01, 0x00, 0x00, 0x00, 0xf6, 0x0f, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00, // ................ - 0x01, 0x00, 0x00, 0x00, 0x56, 0x0e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, // ....V.......8... - 0xf2, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ........F....... - 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, // F. .........8... - 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // "............... - 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0xf2, 0x20, 0x10, 0x00, // ........8.... .. - 0x00, 0x00, 0x00, 0x00, 0x56, 0x05, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, // ....V.......F... - 0x01, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x01, 0x18, 0x00, 0x00, 0x08, 0x22, 0x00, 0x10, 0x00, // ............"... - 0x00, 0x00, 0x00, 0x00, 0x3a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, // ....:. ......... - 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x1f, 0x00, 0x04, 0x03, 0x1a, 0x00, 0x10, 0x00, // .@.....@........ - 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x08, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....6.... ...... - 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, // .@.....?...?...? - 0x00, 0x00, 0x80, 0x3f, 0x12, 0x00, 0x00, 0x01, 0x18, 0x00, 0x00, 0x08, 0x22, 0x00, 0x10, 0x00, // ...?........"... - 0x00, 0x00, 0x00, 0x00, 0x3a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, // ....:. ......... - 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x1f, 0x00, 0x04, 0x03, 0x1a, 0x00, 0x10, 0x00, // .@....@@........ - 0x00, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x8b, 0xc2, 0x00, 0x00, 0x80, 0x43, 0x55, 0x15, 0x00, // ....E.......CU.. - 0xf2, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0xe6, 0x1a, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ................ - 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // F~.......`...... - 0x18, 0x00, 0x00, 0x0b, 0x62, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0x8a, 0x20, 0x00, // ....b......... . - 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .........@...... - 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, // ...?...@....8... - 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0xf6, 0x0f, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // r............... - 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x09, 0x72, 0x00, 0x10, 0x00, // F.......7...r... - 0x01, 0x00, 0x00, 0x00, 0x56, 0x05, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, // ....V.......F... - 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x09, // ....F.......7... - 0xe2, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0xa6, 0x0a, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x06, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x56, 0x0e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ........V....... - 0x38, 0x00, 0x00, 0x07, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00, // 8............... - 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, // ....F.......8... - 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // . ......F....... - 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x01, // F. ............. - 0x15, 0x00, 0x00, 0x01, 0x15, 0x00, 0x00, 0x01, 0x15, 0x00, 0x00, 0x01, 0x3e, 0x00, 0x00, 0x01, // ............>... - 0x00, 0x00, 0xb0, 0x00, // .... + 0x6d, 0x73, 0x12, 0x00, 0xa0, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x75, 0x5f, 0x73, // ms...........u_s + 0x64, 0x66, 0x12, 0x00, 0xb0, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x73, 0x5f, 0x74, // df...........s_t + 0x65, 0x78, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x73, 0x5f, 0x74, // ex0..........s_t + 0x65, 0x78, 0x32, 0x30, 0x01, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x73, 0x5f, // ex20..........s_ + 0x74, 0x65, 0x78, 0x30, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x73, 0x5f, // tex0..........s_ + 0x74, 0x65, 0x78, 0x32, 0x30, 0x01, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb4, 0x0b, // tex20........... + 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, 0xe1, 0x6d, 0xb5, 0x97, 0x27, 0xb7, 0xf1, 0x7f, 0xcd, 0x81, // ..DXBC.m..'..... + 0xa9, 0x2d, 0x96, 0x4d, 0x85, 0xb9, 0x01, 0x00, 0x00, 0x00, 0xb4, 0x0b, 0x00, 0x00, 0x03, 0x00, // .-.M............ + 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, 0xe8, 0x00, 0x00, 0x00, 0x49, 0x53, // ..,...........IS + 0x47, 0x4e, 0x80, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x68, 0x00, // GN............h. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ......t......... + 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x03, 0x00, 0x00, 0x74, 0x00, // ..............t. + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, // ................ + 0x00, 0x00, 0x0c, 0x0c, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // ......t......... + 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x03, 0x00, 0x00, 0x53, 0x56, // ..............SV + 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, // _POSITION.TEXCOO + 0x52, 0x44, 0x00, 0xab, 0xab, 0xab, 0x4f, 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, // RD....OSGN,..... + 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ...... ......... + 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x53, 0x56, // ..............SV + 0x5f, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, 0x53, 0x48, 0x45, 0x58, 0xc4, 0x0a, // _TARGET...SHEX.. + 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0xb1, 0x02, 0x00, 0x00, 0x6a, 0x08, 0x00, 0x01, 0x59, 0x00, // ..P.......j...Y. + 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x5a, 0x00, // ..F. .........Z. + 0x00, 0x03, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x03, 0x00, 0x60, // ...`......Z....` + 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x58, 0x18, 0x00, 0x04, 0x00, 0x70, 0x10, 0x00, 0x00, 0x00, // ......X....p.... + 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x58, 0x18, 0x00, 0x04, 0x00, 0x70, 0x10, 0x00, 0x01, 0x00, // ..UU..X....p.... + 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0x32, 0x10, 0x10, 0x00, 0x01, 0x00, // ..UU..b...2..... + 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0xc2, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x62, 0x10, // ..b...........b. + 0x00, 0x03, 0x32, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, // ..2.......e.... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x04, 0x00, 0x00, 0x00, 0x38, 0x00, // ......h.......8. + 0x00, 0x08, 0x32, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x15, 0x10, 0x00, 0x01, 0x00, // ..2.......V..... + 0x00, 0x00, 0x46, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, // ..F. .........2. + 0x00, 0x0a, 0x32, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x80, 0x20, 0x00, 0x00, 0x00, // ..2.......F. ... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x00, // ..............F. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x32, 0x00, 0x10, 0x00, 0x00, 0x00, // ..........2..... + 0x00, 0x00, 0x46, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x80, 0x20, 0x00, 0x00, 0x00, // ..F.......F. ... + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x32, 0x00, 0x10, 0x00, 0x00, 0x00, // ..........2..... + 0x00, 0x00, 0x46, 0x00, 0x10, 0x80, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x80, // ..F...........F. + 0x20, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x32, 0x20, // .A...........2 + 0x00, 0x0e, 0x32, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x00, 0x10, 0x80, 0x41, 0x00, // ..2.......F...A. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe6, 0x8a, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, // ........ ....... + 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, // ...@.....?...?.. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, // ......8......... + 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x10, // ..2...".......*. + 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x01, 0x40, // .......@.....@.@ + 0x00, 0x00, 0x00, 0x00, 0x80, 0xbf, 0x00, 0x00, 0x00, 0x08, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, // .........."..... + 0x00, 0x00, 0x1a, 0x00, 0x10, 0x80, 0xc1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, // ...............@ + 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x38, 0x00, 0x00, 0x08, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, // .....?8..."..... + 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x80, 0x20, 0x00, 0x00, 0x00, // ............ ... + 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x07, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, // ......3..."..... + 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, // ...........@.... + 0x80, 0x3f, 0x33, 0x00, 0x00, 0x07, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x10, // .?3...B.......:. + 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x38, 0x00, // .......@.....?8. + 0x00, 0x07, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, // ..".......*..... + 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x08, 0x42, 0x00, // ..............B. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, // ......:. ....... + 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x04, 0x03, 0x2a, 0x00, // ...@..........*. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0xc2, 0x00, 0x10, 0x00, 0x00, 0x00, // ......8......... + 0x00, 0x00, 0x56, 0x15, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x84, 0x20, 0x00, 0x00, 0x00, // ..V......... ... + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xc2, 0x00, 0x10, 0x00, 0x00, 0x00, // ......2......... + 0x00, 0x00, 0x06, 0x84, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x06, 0x10, // .... ........... + 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0xa6, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x08, 0xc2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0x0e, 0x10, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x06, 0x84, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, // .... ........... + 0x00, 0x0a, 0x32, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0xa6, 0x8a, 0x20, 0x80, 0x41, 0x00, // ..2......... .A. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x46, 0x80, 0x20, 0x00, 0x00, 0x00, // ..........F. ... + 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0xc2, 0x00, 0x10, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0xa6, 0x0e, 0x10, 0x80, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x04, // ................ + 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x07, 0x12, 0x00, // ..A.......4..... + 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, // ......:.......*. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x01, 0x00, // ......3......... + 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, // ...........@.... + 0x00, 0x00, 0x34, 0x00, 0x00, 0x0a, 0xc2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0x0e, // ..4............. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .......@........ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x07, 0x42, 0x00, // ..............B. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe6, 0x0a, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe6, 0x0a, // ................ + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4b, 0x00, 0x00, 0x05, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, // ......K...B..... + 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x42, 0x00, // ..*...........B. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, // ......*......... + 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, // ..........B..... + 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x80, 0x20, 0x80, 0x41, 0x00, // ..*.......*. .A. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x42, 0x00, // ..........2...B. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, // ........ ....... + 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, // ...@.....?*..... + 0x00, 0x00, 0x0e, 0x20, 0x00, 0x08, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, // ... ..B.......*. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, // ........ ....... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x8e, // ..............F. + 0x20, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x46, 0x8e, // .A...........F. + 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, // .........2..... + 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0xa6, 0x0a, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, // ..............F. + 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, // ......F. ....... + 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, // ..8...B......... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, // ..............8. + 0x00, 0x07, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0x0a, 0x10, 0x00, 0x00, 0x00, // ... ............ + 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x01, 0x18, 0x00, // ..F............. + 0x00, 0x08, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x80, 0x20, 0x00, 0x00, 0x00, // ..B.......:. ... + 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x1f, 0x00, // .......@.....?.. + 0x04, 0x03, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0xc2, 0x00, // ..*.......8..... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x15, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x84, // ......V......... + 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xc2, 0x00, // .........2..... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x84, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, // ........ ....... + 0x00, 0x00, 0x06, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0xa6, 0x0e, 0x10, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0xc2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0x0e, // ................ + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x84, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, // ........ ....... + 0x00, 0x00, 0x0e, 0x00, 0x00, 0x08, 0xc2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0x0e, // ................ + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x84, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, // ........ ....... + 0x00, 0x00, 0x45, 0x00, 0x00, 0x8b, 0xc2, 0x00, 0x00, 0x80, 0x43, 0x55, 0x15, 0x00, 0xf2, 0x00, // ..E.......CU.... + 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0xe6, 0x0a, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x7e, // ..............F~ + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, // .......`........ + 0x00, 0x0b, 0xc2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0x8a, 0x20, 0x00, 0x00, 0x00, // ............ ... + 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .......@........ + 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x40, 0x38, 0x00, 0x00, 0x07, 0x72, 0x00, // .....?...@8...r. + 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0xf6, 0x0f, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x02, // ..............F. + 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x09, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, // ......7...r..... + 0x00, 0x00, 0xa6, 0x0a, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, // ..........F..... + 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x09, 0xe2, 0x00, // ..F.......7..... + 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0xf6, 0x0f, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, // ................ + 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x56, 0x0e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, // ......V.......8. + 0x00, 0x08, 0xf2, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x01, 0x00, // ..........F..... + 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x38, 0x00, // ..F. .........8. + 0x00, 0x07, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, // .."............. + 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0xf2, 0x20, // ..........8.... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x05, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, // ......V.......F. + 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x01, 0x18, 0x00, 0x00, 0x08, 0x22, 0x00, // ..............". + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, // ......:. ....... + 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x1f, 0x00, 0x04, 0x03, 0x1a, 0x00, // ...@.....@...... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x08, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, // ......6.... .... + 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, // ...@.....?...?.. + 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x12, 0x00, 0x00, 0x01, 0x18, 0x00, 0x00, 0x08, 0x22, 0x00, // .?...?........". + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, // ......:. ....... + 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x1f, 0x00, 0x04, 0x03, 0x1a, 0x00, // ...@....@@...... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x8b, 0xc2, 0x00, 0x00, 0x80, 0x43, 0x55, // ......E.......CU + 0x15, 0x00, 0xf2, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0xe6, 0x1a, 0x10, 0x00, 0x01, 0x00, // ................ + 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, // ..F~.......`.... + 0x00, 0x00, 0x18, 0x00, 0x00, 0x0b, 0x62, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0x8a, // ......b......... + 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, // ..........@.... + 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, // .....?...@....8. + 0x00, 0x07, 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0xf6, 0x0f, 0x10, 0x00, 0x01, 0x00, // ..r............. + 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x09, 0x72, 0x00, // ..F.......7...r. + 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x56, 0x05, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, // ......V.......F. + 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // ......F......... + 0x00, 0x09, 0xa2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00, 0x01, 0x00, // ................ + 0x00, 0x00, 0x06, 0x84, 0x20, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x00, // .... .A......... + 0x00, 0x00, 0x0e, 0x00, 0x00, 0x08, 0xa2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x0d, // ..............V. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0x8a, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x00, // ........ ....... + 0x00, 0x00, 0x00, 0x20, 0x00, 0x0a, 0xa2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x0d, // ... ..........V. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .......@........ + 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x08, 0x82, 0x00, // .?.......?...... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, // ......:...A..... + 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x38, 0x00, 0x00, 0x07, 0x22, 0x00, // ...@.....?8...". + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, // ......:......... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x09, 0xf2, 0x00, 0x10, 0x00, 0x01, 0x00, // ......7......... + 0x00, 0x00, 0xa6, 0x0a, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x05, 0x10, 0x00, 0x00, 0x00, // ..........V..... + 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0xf2, 0x00, // ..F.......8..... + 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, // ..............F. + 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, // ......8.... .... + 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, // ..F.......F. ... + 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x01, 0x18, 0x00, 0x00, 0x08, 0x22, 0x00, // ..............". + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, // ......:. ....... + 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x1f, 0x00, 0x04, 0x03, 0x1a, 0x00, // ...@.....@...... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x8b, 0xc2, 0x00, 0x00, 0x80, 0x43, 0x55, // ......E.......CU + 0x15, 0x00, 0xf2, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0xe6, 0x1a, 0x10, 0x00, 0x01, 0x00, // ................ + 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, // ..F~.......`.... + 0x00, 0x00, 0x45, 0x00, 0x00, 0x8b, 0xc2, 0x00, 0x00, 0x80, 0x43, 0x55, 0x15, 0x00, 0xf2, 0x00, // ..E.......CU.... + 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x7e, // ......F.......F~ + 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x18, 0x00, // .......`........ + 0x00, 0x0b, 0x62, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0x8a, 0x20, 0x00, 0x00, 0x00, // ..b......... ... + 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .......@........ + 0x80, 0x3f, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x72, 0x00, // .?...@....8...r. + 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf6, 0x0f, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x02, // ..............F. + 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x09, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, // ......7...r..... + 0x00, 0x00, 0x56, 0x05, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x03, 0x00, // ..V.......F..... + 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0xa2, 0x00, // ..F............. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x84, // ................ + 0x20, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x0e, 0x00, // .A............. + 0x00, 0x08, 0xa2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x0d, 0x10, 0x00, 0x00, 0x00, // ..........V..... + 0x00, 0x00, 0xa6, 0x8a, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x20, // .... .......... + 0x00, 0x0a, 0xa2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x0d, 0x10, 0x00, 0x00, 0x00, // ..........V..... + 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, // ...@.........?.. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x08, 0x82, 0x00, 0x10, 0x00, 0x00, 0x00, // .....?.......... + 0x00, 0x00, 0x3a, 0x00, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, // ..:...A........@ + 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x38, 0x00, 0x00, 0x07, 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, // .....?8..."..... + 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, // ..:............. + 0x00, 0x00, 0x37, 0x00, 0x00, 0x09, 0xf2, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0xa6, 0x0a, // ..7............. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x05, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, // ......V.......F. + 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, // ......8......... + 0x00, 0x00, 0x06, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x01, 0x00, // ..........F..... + 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, // ..8...........F. + 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, // ......F.......8. + 0x00, 0x08, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, // ... ......F..... + 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x15, 0x00, // ..F. ........... + 0x00, 0x01, 0x15, 0x00, 0x00, 0x01, 0x15, 0x00, 0x00, 0x01, 0x15, 0x00, 0x00, 0x01, 0x15, 0x00, // ................ + 0x00, 0x01, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0xc0, 0x00, // ..>....... }; diff --git a/Polyfills/Canvas/Source/Shaders/dx11/vs_fspass.h b/Polyfills/Canvas/Source/Shaders/dx11/vs_fspass.h new file mode 100644 index 000000000..38842b67a --- /dev/null +++ b/Polyfills/Canvas/Source/Shaders/dx11/vs_fspass.h @@ -0,0 +1,34 @@ +static const uint8_t vs_fspass_dx11[494] = +{ + 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0xcf, 0xda, 0x1b, 0x94, 0x00, 0x00, 0xd4, 0x01, // VSH............. + 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, 0x2d, 0x40, 0xc0, 0xce, 0x39, 0x67, 0x5a, 0x73, 0x8a, 0xa9, // ..DXBC-@..9gZs.. + 0xd5, 0x79, 0x02, 0xcf, 0x9d, 0xb2, 0x01, 0x00, 0x00, 0x00, 0xd4, 0x01, 0x00, 0x00, 0x03, 0x00, // .y.............. + 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x49, 0x53, // ..,...........IS + 0x47, 0x4e, 0x4c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x38, 0x00, // GNL...........8. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x03, 0x03, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ......A......... + 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x50, 0x4f, // ..............PO + 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, // SITION.TEXCOORD. + 0xab, 0xab, 0x4f, 0x53, 0x47, 0x4e, 0x68, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, // ..OSGNh......... + 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, // ..P............. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x0c, // ................ + 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, // ................ + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0c, 0x03, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, // ..........SV_POS + 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, // ITION.TEXCOORD.. + 0xab, 0xab, 0x53, 0x48, 0x45, 0x58, 0xdc, 0x00, 0x00, 0x00, 0x50, 0x00, 0x01, 0x00, 0x37, 0x00, // ..SHEX....P...7. + 0x00, 0x00, 0x6a, 0x08, 0x00, 0x01, 0x5f, 0x00, 0x00, 0x03, 0x32, 0x10, 0x10, 0x00, 0x00, 0x00, // ..j..._...2..... + 0x00, 0x00, 0x67, 0x00, 0x00, 0x04, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, // ..g.... ........ + 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0x32, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, // ..e...2 ......e. + 0x00, 0x03, 0xc2, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0f, 0x32, 0x20, // ... ......2...2 + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, // ......F........@ + 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x00, 0x00, 0x40, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ....@@..@@...... + 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xbf, 0x00, 0x00, // ...@............ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x08, 0xc2, 0x20, 0x10, 0x00, 0x00, 0x00, // ......6.... .... + 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ...@............ + 0x00, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x32, 0x00, 0x00, 0x0f, 0xf2, 0x20, 0x10, 0x00, 0x01, 0x00, // .?...?2.... .... + 0x00, 0x00, 0x46, 0x14, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, // ..F........@.... + 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0xc0, 0x3f, 0x00, 0x00, 0xc0, 0xbf, 0x02, 0x40, // .?...?...?.....@ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, // .............?.. + 0x80, 0x3f, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x02, 0x01, 0x00, 0x10, 0x00, 0x00, 0x00, // .?>........... +}; diff --git a/Polyfills/Canvas/Source/Shaders/dx11/vs_nanovg_fill.h b/Polyfills/Canvas/Source/Shaders/dx11/vs_nanovg_fill.h index 56ae7b75f..ddd5e8ade 100644 --- a/Polyfills/Canvas/Source/Shaders/dx11/vs_nanovg_fill.h +++ b/Polyfills/Canvas/Source/Shaders/dx11/vs_nanovg_fill.h @@ -1,40 +1,53 @@ -static const uint8_t vs_nanovg_fill_dx11[591] = +static const uint8_t vs_nanovg_fill_dx11[800] = { - 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0xcf, 0xda, 0x1b, 0x94, 0x01, 0x00, 0x0a, 0x75, // VSH............u + 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x98, 0xde, 0xee, 0x02, 0x00, 0x0a, 0x75, // VSH............u 0x5f, 0x76, 0x69, 0x65, 0x77, 0x53, 0x69, 0x7a, 0x65, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // _viewSize....... - 0x00, 0x00, 0x00, 0x20, 0x02, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, 0x3e, 0xd0, 0x99, 0xce, 0x93, // ... ...DXBC>.... - 0x29, 0x93, 0x48, 0x9b, 0x13, 0xb5, 0x51, 0xc0, 0x9c, 0x7c, 0xac, 0x01, 0x00, 0x00, 0x00, 0x20, // ).H...Q..|..... - 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xf0, // .......,........ - 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x4c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, // ...ISGNL........ - 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // ...8............ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x00, // ...........A.... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, // ................ - 0x03, 0x00, 0x00, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x54, 0x45, 0x58, 0x43, // ...POSITION.TEXC - 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0xab, 0x4f, 0x53, 0x47, 0x4e, 0x68, 0x00, 0x00, 0x00, 0x03, // OORD...OSGNh.... - 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // .......P........ - 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x5c, // ................ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, // ................ - 0x00, 0x00, 0x00, 0x03, 0x0c, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0c, 0x03, 0x00, 0x00, 0x53, // ...............S - 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, // V_POSITION.TEXCO - 0x4f, 0x52, 0x44, 0x00, 0xab, 0xab, 0xab, 0x53, 0x48, 0x45, 0x58, 0x28, 0x01, 0x00, 0x00, 0x50, // ORD....SHEX(...P - 0x00, 0x01, 0x00, 0x4a, 0x00, 0x00, 0x00, 0x6a, 0x08, 0x00, 0x01, 0x59, 0x00, 0x00, 0x04, 0x46, // ...J...j...Y...F - 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0x32, // . ........._...2 - 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0x32, 0x10, 0x10, 0x00, 0x01, // ......._...2.... - 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x04, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // ...g.... ....... - 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0x32, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, // ...e...2 ......e - 0x00, 0x00, 0x03, 0xc2, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x01, // .... ......h.... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x32, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, // .......2.......F - 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, // .......F........ - 0x00, 0x00, 0x08, 0x32, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x00, 0x10, 0x00, 0x00, // ...2.......F.... - 0x00, 0x00, 0x00, 0x46, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ...F. .......... - 0x00, 0x00, 0x07, 0x12, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, // .... ........... - 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0xbf, 0x00, 0x00, 0x00, 0x08, 0x22, // ....@.........." - 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, // ..........A.... - 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x36, 0x00, 0x00, 0x08, 0xc2, // ....@.....?6.... - 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .......@....... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x36, 0x00, 0x00, 0x05, 0x32, // ..........?6...2 - 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, // ......F.......6 - 0x00, 0x00, 0x05, 0xc2, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x14, 0x10, 0x00, 0x01, // .... ........... - 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x02, 0x01, 0x00, 0x10, 0x00, 0x10, 0x00, // ...>........... + 0x00, 0x00, 0x00, 0x0e, 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x64, 0x69, // ....u_extentRadi + 0x75, 0x73, 0x02, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd8, 0x02, 0x00, 0x00, // us.............. + 0x44, 0x58, 0x42, 0x43, 0xc7, 0x19, 0x6a, 0x7b, 0x6d, 0xdd, 0x20, 0x8f, 0x45, 0xa7, 0x12, 0x6e, // DXBC..j{m. .E..n + 0x64, 0x13, 0xe1, 0x6b, 0x01, 0x00, 0x00, 0x00, 0xd8, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // d..k............ + 0x2c, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x08, 0x01, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, // ,...........ISGN + 0x4c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, // L...........8... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x03, 0x03, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ....A........... + 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x03, 0x00, 0x00, 0x50, 0x4f, 0x53, 0x49, // ............POSI + 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0xab, // TION.TEXCOORD... + 0x4f, 0x53, 0x47, 0x4e, 0x80, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, // OSGN............ + 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // h............... + 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........t....... + 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x0c, 0x00, 0x00, // ................ + 0x74, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // t............... + 0x01, 0x00, 0x00, 0x00, 0x0c, 0x03, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, // ........t....... + 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x0c, 0x00, 0x00, // ................ + 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x54, 0x45, 0x58, 0x43, // SV_POSITION.TEXC + 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0xab, 0xab, 0x53, 0x48, 0x45, 0x58, 0xc8, 0x01, 0x00, 0x00, // OORD....SHEX.... + 0x50, 0x00, 0x01, 0x00, 0x72, 0x00, 0x00, 0x00, 0x6a, 0x08, 0x00, 0x01, 0x59, 0x00, 0x00, 0x04, // P...r...j...Y... + 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, // F. ........._... + 0x32, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0x32, 0x10, 0x10, 0x00, // 2......._...2... + 0x01, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x04, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....g.... ...... + 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0x32, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ....e...2 ...... + 0x65, 0x00, 0x00, 0x03, 0xc2, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, // e.... ......e... + 0x32, 0x20, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, // 2 ......h....... + 0x00, 0x00, 0x00, 0x07, 0x32, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00, // ....2.......F... + 0x00, 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x08, // ....F........... + 0x32, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // 2.......F....... + 0x46, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, // F. ............. + 0x12, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // . .............. + 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0xbf, 0x00, 0x00, 0x00, 0x08, 0x22, 0x20, 0x10, 0x00, // .@.........." .. + 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........A....... + 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x36, 0x00, 0x00, 0x08, 0xc2, 0x20, 0x10, 0x00, // .@.....?6.... .. + 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .....@.......... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x36, 0x00, 0x00, 0x05, 0x32, 0x20, 0x10, 0x00, // .......?6...2 .. + 0x01, 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, // ....F.......6... + 0xc2, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x14, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // . .............. + 0x0e, 0x00, 0x00, 0x08, 0x32, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00, // ....2.......F... + 0x00, 0x00, 0x00, 0x00, 0x46, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ....F. ......... + 0x0e, 0x00, 0x00, 0x09, 0x32, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x80, 0x20, 0x00, // ....2.......F. . + 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // .......... ..... + 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x42, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ....6...B....... + 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x08, 0x32, 0x00, 0x10, 0x00, // .@.....?....2... + 0x00, 0x00, 0x00, 0x00, 0x46, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86, 0x00, 0x10, 0x80, // ....F........... + 0x41, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x07, 0x32, 0x20, 0x10, 0x00, // A...........2 .. + 0x02, 0x00, 0x00, 0x00, 0x46, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x96, 0x05, 0x10, 0x00, // ....F........... + 0x01, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x02, 0x01, 0x00, 0x10, 0x00, 0x20, 0x00, // ....>......... . }; diff --git a/Polyfills/Canvas/Source/Shaders/essl/fs_boxblur.h b/Polyfills/Canvas/Source/Shaders/essl/fs_boxblur.h new file mode 100644 index 000000000..63262dcbd --- /dev/null +++ b/Polyfills/Canvas/Source/Shaders/essl/fs_boxblur.h @@ -0,0 +1,80 @@ +static const uint8_t fs_boxblur_essl[1218] = +{ + 0x46, 0x53, 0x48, 0x0b, 0xcf, 0xda, 0x1b, 0x94, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x0a, 0x75, // FSH............u + 0x5f, 0x76, 0x69, 0x65, 0x77, 0x53, 0x69, 0x7a, 0x65, 0x02, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, // _viewSize....... + 0x00, 0x00, 0x00, 0x0b, 0x75, 0x5f, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x02, // ....u_direction. + 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x75, 0x5f, 0x77, 0x65, 0x69, 0x67, // ..........u_weig + 0x68, 0x74, 0x73, 0x02, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x73, 0x5f, // hts...........s_ + 0x74, 0x65, 0x78, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x04, 0x00, // tex..........`.. + 0x00, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, // .varying highp v + 0x65, 0x63, 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, // ec2 v_texcoord0; + 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, // .uniform highp v + 0x65, 0x63, 0x34, 0x20, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x53, 0x69, 0x7a, 0x65, 0x3b, 0x0a, // ec4 u_viewSize;. + 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, // uniform highp ve + 0x63, 0x34, 0x20, 0x75, 0x5f, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, // c4 u_direction;. + 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, // uniform highp ve + 0x63, 0x34, 0x20, 0x75, 0x5f, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x73, 0x3b, 0x0a, 0x75, 0x6e, // c4 u_weights;.un + 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x32, 0x44, 0x20, // iform sampler2D + 0x73, 0x5f, 0x74, 0x65, 0x78, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, // s_tex;.void main + 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, // ().{. highp ve + 0x63, 0x32, 0x20, 0x74, 0x65, 0x78, 0x65, 0x6c, 0x53, 0x69, 0x7a, 0x65, 0x5f, 0x32, 0x3b, 0x0a, // c2 texelSize_2;. + 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x64, 0x69, 0x72, // highp vec2 dir + 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, // ection_3;. lowp + 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x34, 0x3b, 0x0a, 0x20, // vec4 color_4;. + 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x74, 0x65, 0x78, 0x63, // highp vec2 texc + 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x5f, 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x65, 0x78, 0x63, 0x6f, // oord0_5;. texco + 0x6f, 0x72, 0x64, 0x30, 0x5f, 0x35, 0x20, 0x3d, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, // ord0_5 = v_texco + 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, // ord0;. lowp vec + 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, // 4 tmpvar_6;. tm + 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x2e, 0x78, 0x20, 0x3d, 0x20, 0x30, 0x2e, 0x30, 0x3b, 0x0a, // pvar_6.x = 0.0;. + 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x2e, 0x79, 0x20, 0x3d, 0x20, 0x30, // tmpvar_6.y = 0 + 0x2e, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x2e, 0x7a, // .0;. tmpvar_6.z + 0x20, 0x3d, 0x20, 0x30, 0x2e, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // = 0.0;. tmpvar + 0x5f, 0x36, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x30, 0x2e, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x63, 0x6f, // _6.w = 0.0;. co + 0x6c, 0x6f, 0x72, 0x5f, 0x34, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, // lor_4 = tmpvar_6 + 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, // ;. highp float + 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x37, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, // tmpvar_7;. tmpv + 0x61, 0x72, 0x5f, 0x37, 0x20, 0x3d, 0x20, 0x61, 0x62, 0x73, 0x28, 0x75, 0x5f, 0x77, 0x65, 0x69, // ar_7 = abs(u_wei + 0x67, 0x68, 0x74, 0x73, 0x2e, 0x7a, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x62, 0x6f, 0x6f, 0x6c, 0x20, // ghts.z);. bool + 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x38, 0x3b, 0x0a, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, // tmpvar_8;. if ( + 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x37, 0x20, 0x3c, 0x20, 0x31, 0x2e, 0x32, 0x33, // (tmpvar_7 < 1.23 + 0x65, 0x2d, 0x30, 0x36, 0x29, 0x29, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, // e-06)) {. tmp + 0x76, 0x61, 0x72, 0x5f, 0x38, 0x20, 0x3d, 0x20, 0x28, 0x61, 0x62, 0x73, 0x28, 0x75, 0x5f, 0x77, // var_8 = (abs(u_w + 0x65, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x77, 0x29, 0x20, 0x3c, 0x20, 0x31, 0x2e, 0x32, 0x33, // eights.w) < 1.23 + 0x65, 0x2d, 0x30, 0x36, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x7d, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x20, // e-06);. } else + 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x38, 0x20, 0x3d, // {. tmpvar_8 = + 0x20, 0x62, 0x6f, 0x6f, 0x6c, 0x28, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x7d, 0x3b, 0x0a, 0x20, // bool(0);. };. + 0x20, 0x69, 0x66, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x38, 0x29, 0x20, 0x7b, // if (tmpvar_8) { + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x34, 0x20, 0x3d, 0x20, 0x74, // . color_4 = t + 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x32, 0x44, 0x20, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x2c, // exture2D (s_tex, + 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x29, 0x3b, 0x0a, 0x20, // v_texcoord0);. + 0x20, 0x7d, 0x3b, 0x0a, 0x20, 0x20, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, // };. direction_ + 0x33, 0x20, 0x3d, 0x20, 0x28, 0x75, 0x5f, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, // 3 = (u_direction + 0x2e, 0x78, 0x79, 0x20, 0x2b, 0x20, 0x75, 0x5f, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, // .xy + u_weights. + 0x7a, 0x77, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x65, 0x78, 0x65, 0x6c, 0x53, 0x69, 0x7a, 0x65, // zw);. texelSize + 0x5f, 0x32, 0x20, 0x3d, 0x20, 0x28, 0x31, 0x2e, 0x30, 0x2f, 0x28, 0x75, 0x5f, 0x76, 0x69, 0x65, // _2 = (1.0/(u_vie + 0x77, 0x53, 0x69, 0x7a, 0x65, 0x2e, 0x78, 0x79, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6f, // wSize.xy));. fo + 0x72, 0x20, 0x28, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x69, 0x6e, 0x74, 0x20, 0x69, 0x5f, 0x31, // r (highp int i_1 + 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x20, 0x69, 0x5f, 0x31, 0x20, 0x3c, 0x3d, 0x20, 0x69, 0x6e, 0x74, // = 1; i_1 <= int + 0x28, 0x75, 0x5f, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x79, 0x29, 0x3b, 0x20, 0x69, // (u_weights.y); i + 0x5f, 0x31, 0x2b, 0x2b, 0x29, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, // _1++) {. high + 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x39, 0x3b, // p vec2 tmpvar_9; + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x39, 0x20, 0x3d, 0x20, // . tmpvar_9 = + 0x28, 0x28, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x33, 0x20, 0x2a, 0x20, // ((direction_3 * + 0x74, 0x65, 0x78, 0x65, 0x6c, 0x53, 0x69, 0x7a, 0x65, 0x5f, 0x32, 0x29, 0x20, 0x2a, 0x20, 0x66, // texelSize_2) * f + 0x6c, 0x6f, 0x61, 0x74, 0x28, 0x69, 0x5f, 0x31, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // loat(i_1));. + 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x34, 0x20, 0x3d, 0x20, 0x28, 0x63, 0x6f, 0x6c, 0x6f, 0x72, // color_4 = (color + 0x5f, 0x34, 0x20, 0x2b, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x32, 0x44, 0x20, 0x28, // _4 + texture2D ( + 0x73, 0x5f, 0x74, 0x65, 0x78, 0x2c, 0x20, 0x28, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, // s_tex, (texcoord + 0x30, 0x5f, 0x35, 0x20, 0x2b, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x39, 0x29, 0x29, // 0_5 + tmpvar_9)) + 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x34, 0x20, 0x3d, // );. color_4 = + 0x20, 0x28, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x34, 0x20, 0x2b, 0x20, 0x74, 0x65, 0x78, 0x74, // (color_4 + text + 0x75, 0x72, 0x65, 0x32, 0x44, 0x20, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x2c, 0x20, 0x28, 0x74, // ure2D (s_tex, (t + 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x5f, 0x35, 0x20, 0x2d, 0x20, 0x74, 0x6d, 0x70, // excoord0_5 - tmp + 0x76, 0x61, 0x72, 0x5f, 0x39, 0x29, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x7d, 0x3b, 0x0a, 0x20, // var_9)));. };. + 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x34, 0x20, 0x3d, 0x20, 0x28, 0x63, 0x6f, 0x6c, 0x6f, // color_4 = (colo + 0x72, 0x5f, 0x34, 0x20, 0x2f, 0x20, 0x75, 0x5f, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, // r_4 / u_weights. + 0x78, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, // x);. gl_FragCol + 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x34, 0x3b, 0x0a, 0x7d, 0x0a, // or = color_4;.}. + 0x0a, 0x00, // .. +}; diff --git a/Polyfills/Canvas/Source/Shaders/essl/fs_gaussblur.h b/Polyfills/Canvas/Source/Shaders/essl/fs_gaussblur.h new file mode 100644 index 000000000..96ad5e99b --- /dev/null +++ b/Polyfills/Canvas/Source/Shaders/essl/fs_gaussblur.h @@ -0,0 +1,125 @@ +static const uint8_t fs_gaussblur_essl[1942] = +{ + 0x46, 0x53, 0x48, 0x0b, 0xcf, 0xda, 0x1b, 0x94, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x0a, 0x75, // FSH............u + 0x5f, 0x76, 0x69, 0x65, 0x77, 0x53, 0x69, 0x7a, 0x65, 0x02, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, // _viewSize....... + 0x00, 0x00, 0x00, 0x0b, 0x75, 0x5f, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x02, // ....u_direction. + 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x75, 0x5f, 0x77, 0x65, 0x69, 0x67, // ..........u_weig + 0x68, 0x74, 0x73, 0x02, 0x05, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x73, 0x5f, // hts...........s_ + 0x74, 0x65, 0x78, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x34, 0x07, 0x00, // tex..........4.. + 0x00, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, // .varying highp v + 0x65, 0x63, 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, // ec2 v_texcoord0; + 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, // .uniform highp v + 0x65, 0x63, 0x34, 0x20, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x53, 0x69, 0x7a, 0x65, 0x3b, 0x0a, // ec4 u_viewSize;. + 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, // uniform highp ve + 0x63, 0x34, 0x20, 0x75, 0x5f, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, // c4 u_direction;. + 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x75, 0x5f, 0x77, // uniform vec4 u_w + 0x65, 0x69, 0x67, 0x68, 0x74, 0x73, 0x5b, 0x35, 0x5d, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, // eights[5];.unifo + 0x72, 0x6d, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x32, 0x44, 0x20, 0x73, 0x5f, 0x74, // rm sampler2D s_t + 0x65, 0x78, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, // ex;.void main () + 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, // .{. highp vec2 + 0x74, 0x65, 0x78, 0x65, 0x6c, 0x53, 0x69, 0x7a, 0x65, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x6c, // texelSize_1;. l + 0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x32, // owp vec4 color_2 + 0x3b, 0x0a, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x32, 0x20, 0x3d, 0x20, 0x28, 0x74, // ;. color_2 = (t + 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x32, 0x44, 0x20, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x2c, // exture2D (s_tex, + 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x29, 0x20, 0x2a, 0x20, // v_texcoord0) * + 0x75, 0x5f, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x73, 0x5b, 0x31, 0x5d, 0x2e, 0x7a, 0x29, 0x3b, // u_weights[1].z); + 0x0a, 0x20, 0x20, 0x74, 0x65, 0x78, 0x65, 0x6c, 0x53, 0x69, 0x7a, 0x65, 0x5f, 0x31, 0x20, 0x3d, // . texelSize_1 = + 0x20, 0x28, 0x31, 0x2e, 0x30, 0x2f, 0x28, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x53, 0x69, 0x7a, // (1.0/(u_viewSiz + 0x65, 0x2e, 0x78, 0x79, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, // e.xy));. highp + 0x76, 0x65, 0x63, 0x32, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x3b, 0x0a, 0x20, // vec2 tmpvar_3;. + 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x20, 0x3d, 0x20, 0x28, 0x75, 0x5f, 0x64, // tmpvar_3 = (u_d + 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x78, 0x79, 0x20, 0x2a, 0x20, 0x74, 0x65, // irection.xy * te + 0x78, 0x65, 0x6c, 0x53, 0x69, 0x7a, 0x65, 0x5f, 0x31, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x63, 0x6f, // xelSize_1);. co + 0x6c, 0x6f, 0x72, 0x5f, 0x32, 0x20, 0x3d, 0x20, 0x28, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x32, // lor_2 = (color_2 + 0x20, 0x2b, 0x20, 0x28, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x32, 0x44, 0x20, 0x28, 0x73, // + (texture2D (s + 0x5f, 0x74, 0x65, 0x78, 0x2c, 0x20, 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, // _tex, (v_texcoor + 0x64, 0x30, 0x20, 0x2b, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x29, 0x29, 0x20, // d0 + tmpvar_3)) + 0x2a, 0x20, 0x75, 0x5f, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x73, 0x5b, 0x31, 0x5d, 0x2e, 0x77, // * u_weights[1].w + 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x32, 0x20, 0x3d, 0x20, // ));. color_2 = + 0x28, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x32, 0x20, 0x2b, 0x20, 0x28, 0x74, 0x65, 0x78, 0x74, // (color_2 + (text + 0x75, 0x72, 0x65, 0x32, 0x44, 0x20, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x2c, 0x20, 0x28, 0x76, // ure2D (s_tex, (v + 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x2d, 0x20, 0x74, 0x6d, 0x70, // _texcoord0 - tmp + 0x76, 0x61, 0x72, 0x5f, 0x33, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x75, 0x5f, 0x77, 0x65, 0x69, 0x67, // var_3)) * u_weig + 0x68, 0x74, 0x73, 0x5b, 0x31, 0x5d, 0x2e, 0x79, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x69, // hts[1].y));. hi + 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // ghp vec2 tmpvar_ + 0x34, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x20, 0x3d, 0x20, // 4;. tmpvar_4 = + 0x28, 0x28, 0x75, 0x5f, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x78, 0x79, // ((u_direction.xy + 0x20, 0x2a, 0x20, 0x74, 0x65, 0x78, 0x65, 0x6c, 0x53, 0x69, 0x7a, 0x65, 0x5f, 0x31, 0x29, 0x20, // * texelSize_1) + 0x2a, 0x20, 0x32, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, // * 2.0);. color_ + 0x32, 0x20, 0x3d, 0x20, 0x28, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x32, 0x20, 0x2b, 0x20, 0x28, // 2 = (color_2 + ( + 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x32, 0x44, 0x20, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, // texture2D (s_tex + 0x2c, 0x20, 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x2b, // , (v_texcoord0 + + 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x75, 0x5f, // tmpvar_4)) * u_ + 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x73, 0x5b, 0x32, 0x5d, 0x2e, 0x78, 0x29, 0x29, 0x3b, 0x0a, // weights[2].x));. + 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x32, 0x20, 0x3d, 0x20, 0x28, 0x63, 0x6f, 0x6c, // color_2 = (col + 0x6f, 0x72, 0x5f, 0x32, 0x20, 0x2b, 0x20, 0x28, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x32, // or_2 + (texture2 + 0x44, 0x20, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x2c, 0x20, 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, // D (s_tex, (v_tex + 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x2d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // coord0 - tmpvar_ + 0x34, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x75, 0x5f, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x73, 0x5b, // 4)) * u_weights[ + 0x31, 0x5d, 0x2e, 0x78, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, // 1].x));. highp + 0x76, 0x65, 0x63, 0x32, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x3b, 0x0a, 0x20, // vec2 tmpvar_5;. + 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x20, 0x3d, 0x20, 0x28, 0x28, 0x75, 0x5f, // tmpvar_5 = ((u_ + 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x78, 0x79, 0x20, 0x2a, 0x20, 0x74, // direction.xy * t + 0x65, 0x78, 0x65, 0x6c, 0x53, 0x69, 0x7a, 0x65, 0x5f, 0x31, 0x29, 0x20, 0x2a, 0x20, 0x33, 0x2e, // exelSize_1) * 3. + 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x32, 0x20, 0x3d, 0x20, // 0);. color_2 = + 0x28, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x32, 0x20, 0x2b, 0x20, 0x28, 0x74, 0x65, 0x78, 0x74, // (color_2 + (text + 0x75, 0x72, 0x65, 0x32, 0x44, 0x20, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x2c, 0x20, 0x28, 0x76, // ure2D (s_tex, (v + 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x2b, 0x20, 0x74, 0x6d, 0x70, // _texcoord0 + tmp + 0x76, 0x61, 0x72, 0x5f, 0x35, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x75, 0x5f, 0x77, 0x65, 0x69, 0x67, // var_5)) * u_weig + 0x68, 0x74, 0x73, 0x5b, 0x32, 0x5d, 0x2e, 0x79, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x63, 0x6f, // hts[2].y));. co + 0x6c, 0x6f, 0x72, 0x5f, 0x32, 0x20, 0x3d, 0x20, 0x28, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x32, // lor_2 = (color_2 + 0x20, 0x2b, 0x20, 0x28, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x32, 0x44, 0x20, 0x28, 0x73, // + (texture2D (s + 0x5f, 0x74, 0x65, 0x78, 0x2c, 0x20, 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, // _tex, (v_texcoor + 0x64, 0x30, 0x20, 0x2d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x29, 0x29, 0x20, // d0 - tmpvar_5)) + 0x2a, 0x20, 0x75, 0x5f, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x73, 0x5b, 0x30, 0x5d, 0x2e, 0x77, // * u_weights[0].w + 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, // ));. highp vec2 + 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, // tmpvar_6;. tmp + 0x76, 0x61, 0x72, 0x5f, 0x36, 0x20, 0x3d, 0x20, 0x28, 0x28, 0x75, 0x5f, 0x64, 0x69, 0x72, 0x65, // var_6 = ((u_dire + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x78, 0x79, 0x20, 0x2a, 0x20, 0x74, 0x65, 0x78, 0x65, 0x6c, // ction.xy * texel + 0x53, 0x69, 0x7a, 0x65, 0x5f, 0x31, 0x29, 0x20, 0x2a, 0x20, 0x34, 0x2e, 0x30, 0x29, 0x3b, 0x0a, // Size_1) * 4.0);. + 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x32, 0x20, 0x3d, 0x20, 0x28, 0x63, 0x6f, 0x6c, // color_2 = (col + 0x6f, 0x72, 0x5f, 0x32, 0x20, 0x2b, 0x20, 0x28, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x32, // or_2 + (texture2 + 0x44, 0x20, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x2c, 0x20, 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, // D (s_tex, (v_tex + 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x2b, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // coord0 + tmpvar_ + 0x36, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x75, 0x5f, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x73, 0x5b, // 6)) * u_weights[ + 0x32, 0x5d, 0x2e, 0x7a, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, // 2].z));. color_ + 0x32, 0x20, 0x3d, 0x20, 0x28, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x32, 0x20, 0x2b, 0x20, 0x28, // 2 = (color_2 + ( + 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x32, 0x44, 0x20, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, // texture2D (s_tex + 0x2c, 0x20, 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x2d, // , (v_texcoord0 - + 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x75, 0x5f, // tmpvar_6)) * u_ + 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x73, 0x5b, 0x30, 0x5d, 0x2e, 0x7a, 0x29, 0x29, 0x3b, 0x0a, // weights[0].z));. + 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x74, 0x6d, 0x70, // highp vec2 tmp + 0x76, 0x61, 0x72, 0x5f, 0x37, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // var_7;. tmpvar_ + 0x37, 0x20, 0x3d, 0x20, 0x28, 0x28, 0x75, 0x5f, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, // 7 = ((u_directio + 0x6e, 0x2e, 0x78, 0x79, 0x20, 0x2a, 0x20, 0x74, 0x65, 0x78, 0x65, 0x6c, 0x53, 0x69, 0x7a, 0x65, // n.xy * texelSize + 0x5f, 0x31, 0x29, 0x20, 0x2a, 0x20, 0x35, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x63, 0x6f, // _1) * 5.0);. co + 0x6c, 0x6f, 0x72, 0x5f, 0x32, 0x20, 0x3d, 0x20, 0x28, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x32, // lor_2 = (color_2 + 0x20, 0x2b, 0x20, 0x28, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x32, 0x44, 0x20, 0x28, 0x73, // + (texture2D (s + 0x5f, 0x74, 0x65, 0x78, 0x2c, 0x20, 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, // _tex, (v_texcoor + 0x64, 0x30, 0x20, 0x2b, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x37, 0x29, 0x29, 0x20, // d0 + tmpvar_7)) + 0x2a, 0x20, 0x75, 0x5f, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x73, 0x5b, 0x32, 0x5d, 0x2e, 0x77, // * u_weights[2].w + 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x32, 0x20, 0x3d, 0x20, // ));. color_2 = + 0x28, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x32, 0x20, 0x2b, 0x20, 0x28, 0x74, 0x65, 0x78, 0x74, // (color_2 + (text + 0x75, 0x72, 0x65, 0x32, 0x44, 0x20, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x2c, 0x20, 0x28, 0x76, // ure2D (s_tex, (v + 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x2d, 0x20, 0x74, 0x6d, 0x70, // _texcoord0 - tmp + 0x76, 0x61, 0x72, 0x5f, 0x37, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x75, 0x5f, 0x77, 0x65, 0x69, 0x67, // var_7)) * u_weig + 0x68, 0x74, 0x73, 0x5b, 0x30, 0x5d, 0x2e, 0x79, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x69, // hts[0].y));. hi + 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // ghp vec2 tmpvar_ + 0x38, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x38, 0x20, 0x3d, 0x20, // 8;. tmpvar_8 = + 0x28, 0x28, 0x75, 0x5f, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x78, 0x79, // ((u_direction.xy + 0x20, 0x2a, 0x20, 0x74, 0x65, 0x78, 0x65, 0x6c, 0x53, 0x69, 0x7a, 0x65, 0x5f, 0x31, 0x29, 0x20, // * texelSize_1) + 0x2a, 0x20, 0x36, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, // * 6.0);. color_ + 0x32, 0x20, 0x3d, 0x20, 0x28, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x32, 0x20, 0x2b, 0x20, 0x28, // 2 = (color_2 + ( + 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x32, 0x44, 0x20, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, // texture2D (s_tex + 0x2c, 0x20, 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x2b, // , (v_texcoord0 + + 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x38, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x75, 0x5f, // tmpvar_8)) * u_ + 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x73, 0x5b, 0x33, 0x5d, 0x2e, 0x78, 0x29, 0x29, 0x3b, 0x0a, // weights[3].x));. + 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x32, 0x20, 0x3d, 0x20, 0x28, 0x63, 0x6f, 0x6c, // color_2 = (col + 0x6f, 0x72, 0x5f, 0x32, 0x20, 0x2b, 0x20, 0x28, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x32, // or_2 + (texture2 + 0x44, 0x20, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x2c, 0x20, 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, // D (s_tex, (v_tex + 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x2d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // coord0 - tmpvar_ + 0x38, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x75, 0x5f, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x73, 0x5b, // 8)) * u_weights[ + 0x30, 0x5d, 0x2e, 0x78, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, // 0].x));. gl_Fra + 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x32, // gColor = color_2 + 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // ;.}... +}; diff --git a/Polyfills/Canvas/Source/Shaders/essl/fs_nanovg_fill.h b/Polyfills/Canvas/Source/Shaders/essl/fs_nanovg_fill.h index 188c3dcfc..6d15d321e 100644 --- a/Polyfills/Canvas/Source/Shaders/essl/fs_nanovg_fill.h +++ b/Polyfills/Canvas/Source/Shaders/essl/fs_nanovg_fill.h @@ -1,6 +1,6 @@ -static const uint8_t fs_nanovg_fill_essl[2964] = +static const uint8_t fs_nanovg_fill_essl[4729] = { - 0x46, 0x53, 0x48, 0x0b, 0xcf, 0xda, 0x1b, 0x94, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x0c, 0x75, // FSH............u + 0x46, 0x53, 0x48, 0x0b, 0x1e, 0x98, 0xde, 0xee, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x0c, 0x75, // FSH............u 0x5f, 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x4d, 0x61, 0x74, 0x03, 0x01, 0x00, 0x00, 0x03, // _scissorMat..... 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x75, 0x5f, 0x70, 0x61, 0x69, 0x6e, 0x74, 0x4d, 0x61, 0x74, // ......u_paintMat 0x03, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x75, 0x5f, 0x69, 0x6e, 0x6e, // ...........u_inn @@ -10,180 +10,290 @@ static const uint8_t fs_nanovg_fill_essl[2964] = 0x74, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x02, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // tScale.......... 0x0e, 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x02, // .u_extentRadius. 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, // ..........u_para - 0x6d, 0x73, 0x02, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x73, 0x5f, 0x74, // ms...........s_t - 0x65, 0x78, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd3, 0x0a, 0x00, 0x00, // ex.............. + 0x6d, 0x73, 0x02, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x75, 0x5f, 0x73, // ms...........u_s + 0x64, 0x66, 0x02, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x73, 0x5f, 0x74, // df...........s_t + 0x65, 0x78, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x73, 0x5f, 0x74, // ex...........s_t + 0x65, 0x78, 0x32, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x97, 0x11, 0x00, // ex2............. + 0x00, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, // .varying highp v + 0x65, 0x63, 0x32, 0x20, 0x76, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, // ec2 v_position;. 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, // varying highp ve - 0x63, 0x32, 0x20, 0x76, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x76, // c2 v_position;.v - 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, // arying highp vec - 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x75, // 2 v_texcoord0;.u - 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x6d, 0x61, 0x74, // niform highp mat - 0x33, 0x20, 0x75, 0x5f, 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x4d, 0x61, 0x74, 0x3b, 0x0a, // 3 u_scissorMat;. + 0x63, 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, // c2 v_texcoord0;. + 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, // varying highp ve + 0x63, 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x31, 0x3b, 0x0a, // c2 v_texcoord1;. 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x6d, 0x61, // uniform highp ma - 0x74, 0x33, 0x20, 0x75, 0x5f, 0x70, 0x61, 0x69, 0x6e, 0x74, 0x4d, 0x61, 0x74, 0x3b, 0x0a, 0x75, // t3 u_paintMat;.u + 0x74, 0x33, 0x20, 0x75, 0x5f, 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x4d, 0x61, 0x74, 0x3b, // t3 u_scissorMat; + 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x6d, // .uniform highp m + 0x61, 0x74, 0x33, 0x20, 0x75, 0x5f, 0x70, 0x61, 0x69, 0x6e, 0x74, 0x4d, 0x61, 0x74, 0x3b, 0x0a, // at3 u_paintMat;. + 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, // uniform highp ve + 0x63, 0x34, 0x20, 0x75, 0x5f, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x3b, 0x0a, 0x75, // c4 u_innerCol;.u 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, // niform highp vec - 0x34, 0x20, 0x75, 0x5f, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x3b, 0x0a, 0x75, 0x6e, // 4 u_innerCol;.un + 0x34, 0x20, 0x75, 0x5f, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x3b, 0x0a, 0x75, 0x6e, // 4 u_outerCol;.un 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, // iform highp vec4 - 0x20, 0x75, 0x5f, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x3b, 0x0a, 0x75, 0x6e, 0x69, // u_outerCol;.uni - 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, // form highp vec4 - 0x75, 0x5f, 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x53, 0x63, 0x61, 0x6c, // u_scissorExtScal - 0x65, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, // e;.uniform highp - 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x61, // vec4 u_extentRa - 0x64, 0x69, 0x75, 0x73, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, 0x69, // dius;.uniform hi - 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, // ghp vec4 u_param - 0x73, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, // s;.uniform sampl - 0x65, 0x72, 0x32, 0x44, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, // er2D s_tex;.void - 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x6c, 0x6f, 0x77, // main ().{. low - 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x31, 0x3b, // p vec4 result_1; - 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x74, // . highp float t - 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, // mpvar_2;. highp - 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x73, 0x63, 0x5f, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x69, // vec2 sc_3;. hi - 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // ghp vec3 tmpvar_ - 0x34, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x2e, 0x7a, 0x20, // 4;. tmpvar_4.z - 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // = 1.0;. tmpvar_ - 0x34, 0x2e, 0x78, 0x79, 0x20, 0x3d, 0x20, 0x76, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, // 4.xy = v_positio - 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x73, 0x63, 0x5f, 0x33, 0x20, 0x3d, 0x20, 0x28, 0x76, 0x65, 0x63, // n;. sc_3 = (vec - 0x32, 0x28, 0x30, 0x2e, 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x20, 0x2d, 0x20, 0x28, 0x28, // 2(0.5, 0.5) - (( - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x61, 0x62, 0x73, 0x28, 0x28, 0x75, 0x5f, 0x73, 0x63, 0x69, 0x73, // . abs((u_scis - 0x73, 0x6f, 0x72, 0x4d, 0x61, 0x74, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // sorMat * tmpvar_ - 0x34, 0x29, 0x2e, 0x78, 0x79, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x2d, 0x20, 0x75, 0x5f, 0x73, 0x63, // 4).xy). - u_sc - 0x69, 0x73, 0x73, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x2e, 0x78, 0x79, // issorExtScale.xy - 0x29, 0x20, 0x2a, 0x20, 0x75, 0x5f, 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x45, 0x78, 0x74, // ) * u_scissorExt - 0x53, 0x63, 0x61, 0x6c, 0x65, 0x2e, 0x7a, 0x77, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, // Scale.zw));. tm - 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x20, 0x3d, 0x20, 0x28, 0x63, 0x6c, 0x61, 0x6d, 0x70, 0x20, // pvar_2 = (clamp - 0x28, 0x73, 0x63, 0x5f, 0x33, 0x2e, 0x78, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, // (sc_3.x, 0.0, 1. - 0x30, 0x29, 0x20, 0x2a, 0x20, 0x63, 0x6c, 0x61, 0x6d, 0x70, 0x20, 0x28, 0x73, 0x63, 0x5f, 0x33, // 0) * clamp (sc_3 - 0x2e, 0x79, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x29, 0x3b, 0x0a, // .y, 0.0, 1.0));. - 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x74, 0x6d, // highp float tm - 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // pvar_5;. tmpvar - 0x5f, 0x35, 0x20, 0x3d, 0x20, 0x28, 0x6d, 0x69, 0x6e, 0x20, 0x28, 0x31, 0x2e, 0x30, 0x2c, 0x20, // _5 = (min (1.0, - 0x28, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x28, 0x31, 0x2e, 0x30, 0x20, 0x2d, 0x20, 0x61, 0x62, 0x73, // (. (1.0 - abs - 0x28, 0x28, 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, // (((v_texcoord0.x - 0x20, 0x2a, 0x20, 0x32, 0x2e, 0x30, 0x29, 0x20, 0x2d, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x29, 0x29, // * 2.0) - 1.0))) - 0x0a, 0x20, 0x20, 0x20, 0x2a, 0x20, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x79, // . * u_params.y - 0x29, 0x29, 0x20, 0x2a, 0x20, 0x6d, 0x69, 0x6e, 0x20, 0x28, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x76, // )) * min (1.0, v - 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x79, 0x29, 0x29, 0x3b, 0x0a, // _texcoord0.y));. - 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x28, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, // if ((u_params. - 0x77, 0x20, 0x3d, 0x3d, 0x20, 0x30, 0x2e, 0x30, 0x29, 0x29, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, // w == 0.0)) {. - 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x74, 0x6d, 0x70, 0x76, // highp vec3 tmpv - 0x61, 0x72, 0x5f, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // ar_6;. tmpvar - 0x5f, 0x36, 0x2e, 0x7a, 0x20, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // _6.z = 1.0;. - 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x2e, 0x78, 0x79, 0x20, 0x3d, 0x20, 0x76, 0x5f, // tmpvar_6.xy = v_ - 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x68, 0x69, // position;. hi - 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // ghp vec2 tmpvar_ - 0x37, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x37, 0x20, // 7;. tmpvar_7 - 0x3d, 0x20, 0x28, 0x61, 0x62, 0x73, 0x28, 0x28, 0x75, 0x5f, 0x70, 0x61, 0x69, 0x6e, 0x74, 0x4d, // = (abs((u_paintM - 0x61, 0x74, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x29, 0x2e, 0x78, // at * tmpvar_6).x - 0x79, 0x29, 0x20, 0x2d, 0x20, 0x28, 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x61, // y) - (u_extentRa - 0x64, 0x69, 0x75, 0x73, 0x2e, 0x78, 0x79, 0x20, 0x2d, 0x20, 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, // dius.xy - u_exte - 0x6e, 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x2e, 0x7a, 0x7a, 0x29, 0x29, 0x3b, 0x0a, 0x20, // ntRadius.zz));. + 0x20, 0x75, 0x5f, 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x53, 0x63, 0x61, // u_scissorExtSca + 0x6c, 0x65, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, 0x69, 0x67, 0x68, // le;.uniform high + 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x52, // p vec4 u_extentR + 0x61, 0x64, 0x69, 0x75, 0x73, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, // adius;.uniform h + 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, // ighp vec4 u_para + 0x6d, 0x73, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, 0x69, 0x67, 0x68, // ms;.uniform high + 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x75, 0x5f, 0x73, 0x64, 0x66, 0x3b, 0x0a, 0x75, 0x6e, // p vec4 u_sdf;.un + 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x32, 0x44, 0x20, // iform sampler2D + 0x73, 0x5f, 0x74, 0x65, 0x78, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x73, // s_tex;.uniform s + 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x32, 0x44, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x32, 0x3b, // ampler2D s_tex2; + 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, // .void main ().{. + 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x72, 0x65, 0x73, 0x75, // lowp vec4 resu + 0x6c, 0x74, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x66, 0x6c, // lt_1;. highp fl + 0x6f, 0x61, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x3b, 0x0a, 0x20, 0x20, // oat tmpvar_2;. + 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x73, 0x63, 0x5f, 0x33, 0x3b, // highp vec2 sc_3; + 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x74, 0x6d, // . highp vec3 tm + 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // pvar_4;. tmpvar + 0x5f, 0x34, 0x2e, 0x7a, 0x20, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, // _4.z = 1.0;. tm + 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x2e, 0x78, 0x79, 0x20, 0x3d, 0x20, 0x76, 0x5f, 0x70, 0x6f, // pvar_4.xy = v_po + 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x73, 0x63, 0x5f, 0x33, 0x20, 0x3d, // sition;. sc_3 = + 0x20, 0x28, 0x76, 0x65, 0x63, 0x32, 0x28, 0x30, 0x2e, 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x35, 0x29, // (vec2(0.5, 0.5) + 0x20, 0x2d, 0x20, 0x28, 0x28, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x61, 0x62, 0x73, 0x28, 0x28, 0x75, // - ((. abs((u + 0x5f, 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x4d, 0x61, 0x74, 0x20, 0x2a, 0x20, 0x74, 0x6d, // _scissorMat * tm + 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x29, 0x2e, 0x78, 0x79, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x2d, // pvar_4).xy). - + 0x20, 0x75, 0x5f, 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x53, 0x63, 0x61, // u_scissorExtSca + 0x6c, 0x65, 0x2e, 0x78, 0x79, 0x29, 0x20, 0x2a, 0x20, 0x75, 0x5f, 0x73, 0x63, 0x69, 0x73, 0x73, // le.xy) * u_sciss + 0x6f, 0x72, 0x45, 0x78, 0x74, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x2e, 0x7a, 0x77, 0x29, 0x29, 0x3b, // orExtScale.zw)); + 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x20, 0x3d, 0x20, 0x28, 0x63, // . tmpvar_2 = (c + 0x6c, 0x61, 0x6d, 0x70, 0x20, 0x28, 0x73, 0x63, 0x5f, 0x33, 0x2e, 0x78, 0x2c, 0x20, 0x30, 0x2e, // lamp (sc_3.x, 0. + 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x20, 0x2a, 0x20, 0x63, 0x6c, 0x61, 0x6d, 0x70, 0x20, // 0, 1.0) * clamp + 0x28, 0x73, 0x63, 0x5f, 0x33, 0x2e, 0x79, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, // (sc_3.y, 0.0, 1. + 0x30, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x66, 0x6c, 0x6f, // 0));. highp flo + 0x61, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x74, // at tmpvar_5;. t + 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x20, 0x3d, 0x20, 0x28, 0x6d, 0x69, 0x6e, 0x20, 0x28, // mpvar_5 = (min ( + 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x28, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x28, 0x31, 0x2e, 0x30, 0x20, // 1.0, (. (1.0 + 0x2d, 0x20, 0x61, 0x62, 0x73, 0x28, 0x28, 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, // - abs(((v_texcoo + 0x72, 0x64, 0x30, 0x2e, 0x78, 0x20, 0x2a, 0x20, 0x32, 0x2e, 0x30, 0x29, 0x20, 0x2d, 0x20, 0x31, // rd0.x * 2.0) - 1 + 0x2e, 0x30, 0x29, 0x29, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x2a, 0x20, 0x75, 0x5f, 0x70, 0x61, 0x72, // .0))). * u_par + 0x61, 0x6d, 0x73, 0x2e, 0x79, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x6d, 0x69, 0x6e, 0x20, 0x28, 0x31, // ams.y)) * min (1 + 0x2e, 0x30, 0x2c, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, // .0, v_texcoord0. + 0x79, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x28, 0x75, 0x5f, 0x70, 0x61, // y));. if ((u_pa + 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x77, 0x20, 0x3d, 0x3d, 0x20, 0x30, 0x2e, 0x30, 0x29, 0x29, 0x20, // rams.w == 0.0)) + 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, // {. highp vec3 + 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, // tmpvar_6;. t + 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x2e, 0x7a, 0x20, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x3b, // mpvar_6.z = 1.0; + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x2e, 0x78, 0x79, // . tmpvar_6.xy + 0x20, 0x3d, 0x20, 0x76, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, // = v_position;. 0x20, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x74, 0x6d, // highp vec2 tm - 0x70, 0x76, 0x61, 0x72, 0x5f, 0x38, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, // pvar_8;. tmpv - 0x61, 0x72, 0x5f, 0x38, 0x20, 0x3d, 0x20, 0x6d, 0x61, 0x78, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, // ar_8 = max (tmpv - 0x61, 0x72, 0x5f, 0x37, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // ar_7, 0.0);. - 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x31, 0x20, 0x3d, 0x20, 0x28, 0x6d, 0x69, 0x78, 0x20, // result_1 = (mix - 0x28, 0x75, 0x5f, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x2c, 0x20, 0x75, 0x5f, 0x6f, // (u_innerCol, u_o - 0x75, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x2c, 0x20, 0x63, 0x6c, 0x61, 0x6d, 0x70, 0x20, 0x28, // uterCol, clamp ( - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x28, 0x28, 0x28, 0x28, 0x0a, 0x20, 0x20, 0x20, 0x20, // . ((((. - 0x20, 0x20, 0x20, 0x20, 0x6d, 0x69, 0x6e, 0x20, 0x28, 0x6d, 0x61, 0x78, 0x20, 0x28, 0x74, 0x6d, // min (max (tm - 0x70, 0x76, 0x61, 0x72, 0x5f, 0x37, 0x2e, 0x78, 0x2c, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // pvar_7.x, tmpvar - 0x5f, 0x37, 0x2e, 0x79, 0x29, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, // _7.y), 0.0). - 0x20, 0x20, 0x20, 0x2b, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x73, 0x71, // + . sq - 0x72, 0x74, 0x28, 0x64, 0x6f, 0x74, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x38, // rt(dot (tmpvar_8 - 0x2c, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x38, 0x29, 0x29, 0x0a, 0x20, 0x20, 0x20, // , tmpvar_8)). - 0x20, 0x20, 0x20, 0x29, 0x20, 0x2d, 0x20, 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x52, // ) - u_extentR - 0x61, 0x64, 0x69, 0x75, 0x73, 0x2e, 0x7a, 0x29, 0x20, 0x2b, 0x20, 0x28, 0x75, 0x5f, 0x70, 0x61, // adius.z) + (u_pa - 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x78, 0x20, 0x2a, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x29, 0x20, 0x2f, // rams.x * 0.5)) / - 0x20, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x78, 0x29, 0x0a, 0x20, 0x20, 0x20, // u_params.x). - 0x20, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x29, 0x20, 0x2a, 0x20, // , 0.0, 1.0)) * - 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, // (tmpvar_5 * tmpv - 0x61, 0x72, 0x5f, 0x32, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x7d, 0x20, 0x65, 0x6c, 0x73, 0x65, // ar_2));. } else - 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x28, 0x75, 0x5f, 0x70, 0x61, // {. if ((u_pa - 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x77, 0x20, 0x3d, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x29, 0x20, // rams.w == 1.0)) - 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, // {. lowp vec - 0x34, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x39, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // 4 color_9;. - 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x74, 0x6d, 0x70, 0x76, // highp vec3 tmpv - 0x61, 0x72, 0x5f, 0x31, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, // ar_10;. tmp - 0x76, 0x61, 0x72, 0x5f, 0x31, 0x30, 0x2e, 0x7a, 0x20, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x3b, 0x0a, // var_10.z = 1.0;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x30, 0x2e, // tmpvar_10. - 0x78, 0x79, 0x20, 0x3d, 0x20, 0x76, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, // xy = v_position; - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, // . lowp vec4 - 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // tmpvar_11;. - 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x31, 0x20, 0x3d, 0x20, 0x74, 0x65, // tmpvar_11 = te - 0x78, 0x74, 0x75, 0x72, 0x65, 0x32, 0x44, 0x20, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x2c, 0x20, // xture2D (s_tex, - 0x28, 0x28, 0x75, 0x5f, 0x70, 0x61, 0x69, 0x6e, 0x74, 0x4d, 0x61, 0x74, 0x20, 0x2a, 0x20, 0x74, // ((u_paintMat * t - 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x30, 0x29, 0x2e, 0x78, 0x79, 0x20, 0x2f, 0x20, 0x75, // mpvar_10).xy / u - 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x2e, 0x78, 0x79, // _extentRadius.xy - 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, // ));. color_ - 0x39, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x31, 0x3b, 0x0a, 0x20, // 9 = tmpvar_11;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x28, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, // if ((u_para - 0x6d, 0x73, 0x2e, 0x7a, 0x20, 0x3d, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x29, 0x20, 0x7b, 0x0a, // ms.z == 1.0)) {. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, // lowp vec - 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x20, // 4 tmpvar_12;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x32, 0x2e, 0x78, // tmpvar_12.x - 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x31, 0x2e, // yz = (tmpvar_11. - 0x78, 0x79, 0x7a, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x31, 0x2e, // xyz * tmpvar_11. - 0x77, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, // w);. tmpv - 0x61, 0x72, 0x5f, 0x31, 0x32, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // ar_12.w = tmpvar - 0x5f, 0x31, 0x31, 0x2e, 0x77, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x63, // _11.w;. c + 0x70, 0x76, 0x61, 0x72, 0x5f, 0x37, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, // pvar_7;. tmpv + 0x61, 0x72, 0x5f, 0x37, 0x20, 0x3d, 0x20, 0x28, 0x61, 0x62, 0x73, 0x28, 0x28, 0x75, 0x5f, 0x70, // ar_7 = (abs((u_p + 0x61, 0x69, 0x6e, 0x74, 0x4d, 0x61, 0x74, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // aintMat * tmpvar + 0x5f, 0x36, 0x29, 0x2e, 0x78, 0x79, 0x29, 0x20, 0x2d, 0x20, 0x28, 0x75, 0x5f, 0x65, 0x78, 0x74, // _6).xy) - (u_ext + 0x65, 0x6e, 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x2e, 0x78, 0x79, 0x20, 0x2d, 0x20, 0x75, // entRadius.xy - u + 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x2e, 0x7a, 0x7a, // _extentRadius.zz + 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, // ));. highp ve + 0x63, 0x32, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x38, 0x3b, 0x0a, 0x20, 0x20, 0x20, // c2 tmpvar_8;. + 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x38, 0x20, 0x3d, 0x20, 0x6d, 0x61, 0x78, 0x20, // tmpvar_8 = max + 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x37, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x29, 0x3b, // (tmpvar_7, 0.0); + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x31, 0x20, 0x3d, 0x20, // . result_1 = + 0x28, 0x6d, 0x69, 0x78, 0x20, 0x28, 0x75, 0x5f, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x43, 0x6f, 0x6c, // (mix (u_innerCol + 0x2c, 0x20, 0x75, 0x5f, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x2c, 0x20, 0x63, 0x6c, // , u_outerCol, cl + 0x61, 0x6d, 0x70, 0x20, 0x28, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x28, 0x28, 0x28, 0x28, // amp (. (((( + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6d, 0x69, 0x6e, 0x20, 0x28, 0x6d, 0x61, // . min (ma + 0x78, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x37, 0x2e, 0x78, 0x2c, 0x20, 0x74, // x (tmpvar_7.x, t + 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x37, 0x2e, 0x79, 0x29, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x29, // mpvar_7.y), 0.0) + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2b, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // . + . + 0x20, 0x20, 0x20, 0x73, 0x71, 0x72, 0x74, 0x28, 0x64, 0x6f, 0x74, 0x20, 0x28, 0x74, 0x6d, 0x70, // sqrt(dot (tmp + 0x76, 0x61, 0x72, 0x5f, 0x38, 0x2c, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x38, 0x29, // var_8, tmpvar_8) + 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x29, 0x20, 0x2d, 0x20, 0x75, 0x5f, 0x65, 0x78, // ). ) - u_ex + 0x74, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x2e, 0x7a, 0x29, 0x20, 0x2b, 0x20, // tentRadius.z) + + 0x28, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x78, 0x20, 0x2a, 0x20, 0x30, 0x2e, // (u_params.x * 0. + 0x35, 0x29, 0x29, 0x20, 0x2f, 0x20, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x78, // 5)) / u_params.x + 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, // ). , 0.0, 1.0 + 0x29, 0x29, 0x20, 0x2a, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x20, 0x2a, // )) * (tmpvar_5 * + 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x7d, // tmpvar_2));. } + 0x20, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, // else {. if ( + 0x28, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x77, 0x20, 0x3d, 0x3d, 0x20, 0x31, // (u_params.w == 1 + 0x2e, 0x30, 0x29, 0x29, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x77, // .0)) {. low + 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x39, 0x3b, 0x0a, // p vec4 color_9;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, // highp vec3 + 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // tmpvar_10;. + 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x30, 0x2e, 0x7a, 0x20, 0x3d, 0x20, // tmpvar_10.z = + 0x31, 0x2e, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // 1.0;. tmpva + 0x72, 0x5f, 0x31, 0x30, 0x2e, 0x78, 0x79, 0x20, 0x3d, 0x20, 0x76, 0x5f, 0x70, 0x6f, 0x73, 0x69, // r_10.xy = v_posi + 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, // tion;. lowp + 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x31, 0x3b, // vec4 tmpvar_11; + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x31, // . tmpvar_11 + 0x20, 0x3d, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x32, 0x44, 0x20, 0x28, 0x73, 0x5f, // = texture2D (s_ + 0x74, 0x65, 0x78, 0x2c, 0x20, 0x28, 0x28, 0x75, 0x5f, 0x70, 0x61, 0x69, 0x6e, 0x74, 0x4d, 0x61, // tex, ((u_paintMa + 0x74, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x30, 0x29, 0x2e, 0x78, // t * tmpvar_10).x + 0x79, 0x20, 0x2f, 0x20, 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x64, 0x69, // y / u_extentRadi + 0x75, 0x73, 0x2e, 0x78, 0x79, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x63, // us.xy));. c 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x39, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // olor_9 = tmpvar_ - 0x31, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x3b, 0x0a, 0x20, 0x20, 0x20, // 12;. };. + 0x31, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x28, 0x75, // 11;. if ((u + 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x7a, 0x20, 0x3d, 0x3d, 0x20, 0x31, 0x2e, 0x30, // _params.z == 1.0 + 0x29, 0x29, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x77, // )) {. low + 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x32, // p vec4 tmpvar_12 + 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // ;. tmpvar + 0x5f, 0x31, 0x32, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, // _12.xyz = (tmpva + 0x72, 0x5f, 0x31, 0x31, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // r_11.xyz * tmpva + 0x72, 0x5f, 0x31, 0x31, 0x2e, 0x77, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // r_11.w);. + 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x32, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x74, // tmpvar_12.w = t + 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x31, 0x2e, 0x77, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // mpvar_11.w;. + 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x39, 0x20, 0x3d, 0x20, 0x74, 0x6d, // color_9 = tm + 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, // pvar_12;. } + 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x28, 0x75, 0x5f, 0x70, // ;. if ((u_p + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x7a, 0x20, 0x3d, 0x3d, 0x20, 0x32, 0x2e, 0x30, 0x29, 0x29, // arams.z == 2.0)) + 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, // {. color + 0x5f, 0x39, 0x20, 0x3d, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x39, 0x2e, 0x78, 0x78, 0x78, // _9 = color_9.xxx + 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // x;. };. + 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x39, 0x20, 0x3d, 0x20, 0x28, 0x63, 0x6f, 0x6c, // color_9 = (col + 0x6f, 0x72, 0x5f, 0x39, 0x20, 0x2a, 0x20, 0x75, 0x5f, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x43, 0x6f, // or_9 * u_innerCo + 0x6c, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, // l);. color_ + 0x39, 0x20, 0x3d, 0x20, 0x28, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x39, 0x20, 0x2a, 0x20, 0x28, // 9 = (color_9 * ( + 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // tmpvar_5 * tmpva + 0x72, 0x5f, 0x32, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x73, // r_2));. res + 0x75, 0x6c, 0x74, 0x5f, 0x31, 0x20, 0x3d, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x39, 0x3b, // ult_1 = color_9; + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x7b, 0x0a, 0x20, 0x20, // . } else {. + 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x28, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, // if ((u_param + 0x73, 0x2e, 0x77, 0x20, 0x3d, 0x3d, 0x20, 0x32, 0x2e, 0x30, 0x29, 0x29, 0x20, 0x7b, 0x0a, 0x20, // s.w == 2.0)) {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x31, 0x20, // result_1 + 0x3d, 0x20, 0x76, 0x65, 0x63, 0x34, 0x28, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x2c, // = vec4(1.0, 1.0, + 0x20, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // 1.0, 1.0);. + 0x20, 0x20, 0x7d, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // } else {. 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x28, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, // if ((u_params - 0x2e, 0x7a, 0x20, 0x3d, 0x3d, 0x20, 0x32, 0x2e, 0x30, 0x29, 0x29, 0x20, 0x7b, 0x0a, 0x20, 0x20, // .z == 2.0)) {. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x39, 0x20, 0x3d, 0x20, // color_9 = - 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x39, 0x2e, 0x78, 0x78, 0x78, 0x78, 0x3b, 0x0a, 0x20, 0x20, // color_9.xxxx;. - 0x20, 0x20, 0x20, 0x20, 0x7d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, // };. col - 0x6f, 0x72, 0x5f, 0x39, 0x20, 0x3d, 0x20, 0x28, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x39, 0x20, // or_9 = (color_9 - 0x2a, 0x20, 0x75, 0x5f, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x29, 0x3b, 0x0a, 0x20, // * u_innerCol);. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x39, 0x20, 0x3d, 0x20, 0x28, // color_9 = ( - 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x39, 0x20, 0x2a, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, // color_9 * (tmpva - 0x72, 0x5f, 0x35, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x29, 0x29, // r_5 * tmpvar_2)) - 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x31, // ;. result_1 - 0x20, 0x3d, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x39, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // = color_9;. - 0x7d, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, // } else {. i - 0x66, 0x20, 0x28, 0x28, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x77, 0x20, 0x3d, // f ((u_params.w = - 0x3d, 0x20, 0x32, 0x2e, 0x30, 0x29, 0x29, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // = 2.0)) {. - 0x20, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x31, 0x20, 0x3d, 0x20, 0x76, 0x65, 0x63, // result_1 = vec - 0x34, 0x28, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x2c, // 4(1.0, 1.0, 1.0, - 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x20, 0x65, // 1.0);. } e - 0x6c, 0x73, 0x65, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, // lse {. if - 0x20, 0x28, 0x28, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x77, 0x20, 0x3d, 0x3d, // ((u_params.w == - 0x20, 0x33, 0x2e, 0x30, 0x29, 0x29, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 3.0)) {. - 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x63, 0x6f, 0x6c, // lowp vec4 col - 0x6f, 0x72, 0x5f, 0x31, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // or_13;. - 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // lowp vec4 tmpva - 0x72, 0x5f, 0x31, 0x34, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // r_14;. - 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x34, 0x20, 0x3d, 0x20, 0x74, 0x65, 0x78, 0x74, // tmpvar_14 = text - 0x75, 0x72, 0x65, 0x32, 0x44, 0x20, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x2c, 0x20, 0x76, 0x5f, // ure2D (s_tex, v_ - 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // texcoord0);. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x31, 0x33, 0x20, 0x3d, // color_13 = - 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x34, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // tmpvar_14;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x28, 0x75, 0x5f, 0x70, 0x61, 0x72, // if ((u_par - 0x61, 0x6d, 0x73, 0x2e, 0x7a, 0x20, 0x3d, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x29, 0x20, 0x7b, // ams.z == 1.0)) { - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x77, // . low - 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x35, // p vec4 tmpvar_15 + 0x2e, 0x77, 0x20, 0x3d, 0x3d, 0x20, 0x33, 0x2e, 0x30, 0x29, 0x29, 0x20, 0x7b, 0x0a, 0x20, 0x20, // .w == 3.0)) {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, // lowp vec + 0x34, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x31, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // 4 color_13;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, // lowp vec4 + 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x34, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // tmpvar_14;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x34, 0x20, 0x3d, // tmpvar_14 = + 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x32, 0x44, 0x20, 0x28, 0x73, 0x5f, 0x74, 0x65, // texture2D (s_te + 0x78, 0x2c, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x29, 0x3b, // x, v_texcoord0); + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, // . color + 0x5f, 0x31, 0x33, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x34, 0x3b, // _13 = tmpvar_14; + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x28, // . if (( + 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x7a, 0x20, 0x3d, 0x3d, 0x20, 0x31, 0x2e, // u_params.z == 1. + 0x30, 0x29, 0x29, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 0)) {. + 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, // lowp vec4 tmpv + 0x61, 0x72, 0x5f, 0x31, 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // ar_15;. + 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x35, 0x2e, 0x78, 0x79, 0x7a, // tmpvar_15.xyz + 0x20, 0x3d, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x34, 0x2e, 0x78, 0x79, // = (tmpvar_14.xy + 0x7a, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x34, 0x2e, 0x77, 0x29, // z * tmpvar_14.w) 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, // ;. tm - 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x35, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x28, 0x74, // pvar_15.xyz = (t - 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x34, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x2a, 0x20, 0x74, // mpvar_14.xyz * t - 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x34, 0x2e, 0x77, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, // mpvar_14.w);. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // tmpvar_ - 0x31, 0x35, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x34, // 15.w = tmpvar_14 - 0x2e, 0x77, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // .w;. - 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x31, 0x33, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // color_13 = tmpva - 0x72, 0x5f, 0x31, 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // r_15;. - 0x7d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, // };. if - 0x28, 0x28, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x7a, 0x20, 0x3d, 0x3d, 0x20, // ((u_params.z == - 0x32, 0x2e, 0x30, 0x29, 0x29, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 2.0)) {. - 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x31, 0x33, 0x20, 0x3d, 0x20, 0x63, // color_13 = c - 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x31, 0x33, 0x2e, 0x78, 0x78, 0x78, 0x78, 0x3b, 0x0a, 0x20, 0x20, // olor_13.xxxx;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // };. + 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x35, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, // pvar_15.w = tmpv + 0x61, 0x72, 0x5f, 0x31, 0x34, 0x2e, 0x77, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // ar_14.w;. 0x20, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x31, 0x33, 0x20, 0x3d, 0x20, // color_13 = - 0x28, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x31, 0x33, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, // (color_13 * tmpv - 0x61, 0x72, 0x5f, 0x32, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // ar_2);. - 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x31, 0x20, 0x3d, 0x20, 0x28, 0x63, 0x6f, 0x6c, // result_1 = (col - 0x6f, 0x72, 0x5f, 0x31, 0x33, 0x20, 0x2a, 0x20, 0x75, 0x5f, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x43, // or_13 * u_innerC - 0x6f, 0x6c, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x3b, 0x0a, // ol);. };. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x3b, 0x0a, // };. };. - 0x20, 0x20, 0x7d, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, // };. gl_FragCo - 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x31, 0x3b, 0x0a, // lor = result_1;. - 0x7d, 0x0a, 0x0a, 0x00, // }... + 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // tmpvar_15;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // };. + 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x28, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, // if ((u_params. + 0x7a, 0x20, 0x3d, 0x3d, 0x20, 0x32, 0x2e, 0x30, 0x29, 0x29, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, // z == 2.0)) {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x66, 0x6c, // lowp fl + 0x6f, 0x61, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x36, 0x3b, 0x0a, 0x20, // oat tmpvar_16;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // tmpva + 0x72, 0x5f, 0x31, 0x36, 0x20, 0x3d, 0x20, 0x28, 0x63, 0x6c, 0x61, 0x6d, 0x70, 0x20, 0x28, 0x28, // r_16 = (clamp (( + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x28, // . ( + 0x28, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x31, 0x33, 0x2e, 0x78, 0x20, 0x2d, 0x20, 0x75, 0x5f, // (color_13.x - u_ + 0x73, 0x64, 0x66, 0x2e, 0x78, 0x29, 0x20, 0x2f, 0x20, 0x75, 0x5f, 0x73, 0x64, 0x66, 0x2e, 0x7a, // sdf.x) / u_sdf.z + 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2b, // ). + + 0x20, 0x30, 0x2e, 0x35, 0x29, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, // 0.5), 0.0, 1.0) + 0x20, 0x2a, 0x20, 0x28, 0x31, 0x2e, 0x30, 0x20, 0x2d, 0x20, 0x63, 0x6c, 0x61, 0x6d, 0x70, 0x20, // * (1.0 - clamp + 0x28, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // (. + 0x28, 0x28, 0x28, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x31, 0x33, 0x2e, 0x78, 0x20, 0x2d, 0x20, // (((color_13.x - + 0x75, 0x5f, 0x73, 0x64, 0x66, 0x2e, 0x79, 0x29, 0x20, 0x2f, 0x20, 0x75, 0x5f, 0x73, 0x64, 0x66, // u_sdf.y) / u_sdf + 0x2e, 0x7a, 0x29, 0x20, 0x2b, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // .z) + 0.5). + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, // , 0.0, 1. + 0x30, 0x29, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 0)));. + 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, // lowp vec4 tmpv + 0x61, 0x72, 0x5f, 0x31, 0x37, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // ar_17;. + 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x37, 0x2e, 0x78, 0x20, 0x3d, // tmpvar_17.x = + 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // tmpvar_16;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, // tmpvar_1 + 0x37, 0x2e, 0x79, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x36, 0x3b, // 7.y = tmpvar_16; + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, // . tmp + 0x76, 0x61, 0x72, 0x5f, 0x31, 0x37, 0x2e, 0x7a, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // var_17.z = tmpva + 0x72, 0x5f, 0x31, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // r_16;. + 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x37, 0x2e, 0x77, 0x20, 0x3d, 0x20, // tmpvar_17.w = + 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // tmpvar_16;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x31, 0x33, 0x20, // color_13 + 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x37, 0x3b, 0x0a, 0x20, 0x20, 0x20, // = tmpvar_17;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // };. + 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x31, 0x33, 0x20, 0x3d, 0x20, 0x28, // color_13 = ( + 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x31, 0x33, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // color_13 * tmpva + 0x72, 0x5f, 0x32, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // r_2);. + 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x31, 0x20, 0x3d, 0x20, 0x28, 0x63, 0x6f, 0x6c, 0x6f, // result_1 = (colo + 0x72, 0x5f, 0x31, 0x33, 0x20, 0x2a, 0x20, 0x75, 0x5f, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x43, 0x6f, // r_13 * u_innerCo + 0x6c, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x20, 0x65, 0x6c, // l);. } el + 0x73, 0x65, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, // se {. i + 0x66, 0x20, 0x28, 0x28, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x77, 0x20, 0x3d, // f ((u_params.w = + 0x3d, 0x20, 0x34, 0x2e, 0x30, 0x29, 0x29, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // = 4.0)) {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, // lowp vec4 + 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x31, 0x38, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // color_18;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, // lowp vec4 + 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x39, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // tmpvar_19;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x39, // tmpvar_19 + 0x20, 0x3d, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x32, 0x44, 0x20, 0x28, 0x73, 0x5f, // = texture2D (s_ + 0x74, 0x65, 0x78, 0x2c, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, // tex, v_texcoord0 + 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x63, // );. c + 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x31, 0x38, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // olor_18 = tmpvar + 0x5f, 0x31, 0x39, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // _19;. + 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // lowp vec4 tmpva + 0x72, 0x5f, 0x32, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // r_20;. + 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x30, 0x20, 0x3d, 0x20, 0x74, 0x65, // tmpvar_20 = te + 0x78, 0x74, 0x75, 0x72, 0x65, 0x32, 0x44, 0x20, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x32, 0x2c, // xture2D (s_tex2, + 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x31, 0x29, 0x3b, 0x0a, 0x20, // v_texcoord1);. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x28, // if (( + 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x7a, 0x20, 0x3d, 0x3d, 0x20, 0x31, 0x2e, // u_params.z == 1. + 0x30, 0x29, 0x29, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 0)) {. + 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, // lowp vec4 tm + 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // pvar_21;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x31, // tmpvar_21 + 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, // .xyz = (tmpvar_1 + 0x39, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, // 9.xyz * tmpvar_1 + 0x39, 0x2e, 0x77, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 9.w);. + 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x31, 0x2e, 0x77, 0x20, // tmpvar_21.w + 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x39, 0x2e, 0x77, 0x3b, 0x0a, 0x20, // = tmpvar_19.w;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, // col + 0x6f, 0x72, 0x5f, 0x31, 0x38, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, // or_18 = tmpvar_2 + 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, // 1;. } + 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, // ;. if + 0x20, 0x28, 0x28, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x7a, 0x20, 0x3d, 0x3d, // ((u_params.z == + 0x20, 0x32, 0x2e, 0x30, 0x29, 0x29, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 2.0)) {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x66, 0x6c, 0x6f, 0x61, // lowp floa + 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x20, // t tmpvar_22;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // tmpva + 0x72, 0x5f, 0x32, 0x32, 0x20, 0x3d, 0x20, 0x28, 0x63, 0x6c, 0x61, 0x6d, 0x70, 0x20, 0x28, 0x28, // r_22 = (clamp (( + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // . + 0x20, 0x28, 0x28, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x31, 0x38, 0x2e, 0x78, 0x20, 0x2d, 0x20, // ((color_18.x - + 0x75, 0x5f, 0x73, 0x64, 0x66, 0x2e, 0x78, 0x29, 0x20, 0x2f, 0x20, 0x75, 0x5f, 0x73, 0x64, 0x66, // u_sdf.x) / u_sdf + 0x2e, 0x7a, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // .z). + 0x20, 0x20, 0x20, 0x2b, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x2c, 0x20, // + 0.5), 0.0, + 0x31, 0x2e, 0x30, 0x29, 0x20, 0x2a, 0x20, 0x28, 0x31, 0x2e, 0x30, 0x20, 0x2d, 0x20, 0x63, 0x6c, // 1.0) * (1.0 - cl + 0x61, 0x6d, 0x70, 0x20, 0x28, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // amp (. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x28, 0x28, 0x28, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x31, // (((color_1 + 0x38, 0x2e, 0x78, 0x20, 0x2d, 0x20, 0x75, 0x5f, 0x73, 0x64, 0x66, 0x2e, 0x79, 0x29, 0x20, 0x2f, // 8.x - u_sdf.y) / + 0x20, 0x75, 0x5f, 0x73, 0x64, 0x66, 0x2e, 0x7a, 0x29, 0x20, 0x2b, 0x20, 0x30, 0x2e, 0x35, 0x29, // u_sdf.z) + 0.5) + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2c, // . , + 0x20, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, // 0.0, 1.0)));. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x77, 0x70, // lowp + 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x33, 0x3b, // vec4 tmpvar_23; + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, // . t + 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x33, 0x2e, 0x78, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, // mpvar_23.x = tmp + 0x76, 0x61, 0x72, 0x5f, 0x32, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // var_22;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x33, 0x2e, // tmpvar_23. + 0x79, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x32, 0x3b, 0x0a, 0x20, // y = tmpvar_22;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, // tmp + 0x76, 0x61, 0x72, 0x5f, 0x32, 0x33, 0x2e, 0x7a, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // var_23.z = tmpva + 0x72, 0x5f, 0x32, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // r_22;. + 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x33, 0x2e, 0x77, 0x20, // tmpvar_23.w + 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x20, // = tmpvar_22;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, // color + 0x5f, 0x31, 0x38, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x33, 0x3b, // _18 = tmpvar_23; + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x3b, 0x0a, // . };. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, // colo + 0x72, 0x5f, 0x31, 0x38, 0x20, 0x3d, 0x20, 0x28, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x31, 0x38, // r_18 = (color_18 + 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x29, 0x3b, 0x0a, 0x20, 0x20, // * tmpvar_2);. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, // color_ + 0x31, 0x38, 0x20, 0x3d, 0x20, 0x28, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x31, 0x38, 0x20, 0x2a, // 18 = (color_18 * + 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, // tmpvar_20);. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, // result_ + 0x31, 0x20, 0x3d, 0x20, 0x28, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x31, 0x38, 0x20, 0x2a, 0x20, // 1 = (color_18 * + 0x75, 0x5f, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, // u_innerCol);. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // };. + 0x20, 0x20, 0x7d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x3b, 0x0a, 0x20, 0x20, // };. };. + 0x20, 0x20, 0x7d, 0x3b, 0x0a, 0x20, 0x20, 0x7d, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, // };. };. gl_F + 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, // ragColor = resul + 0x74, 0x5f, 0x31, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // t_1;.}... }; diff --git a/Polyfills/Canvas/Source/Shaders/essl/vs_fspass.h b/Polyfills/Canvas/Source/Shaders/essl/vs_fspass.h new file mode 100644 index 000000000..9e5f9354e --- /dev/null +++ b/Polyfills/Canvas/Source/Shaders/essl/vs_fspass.h @@ -0,0 +1,33 @@ +static const uint8_t vs_fspass_essl[480] = +{ + 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0xcf, 0xda, 0x1b, 0x94, 0x00, 0x00, 0xcd, 0x01, // VSH............. + 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, // ..attribute high + 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, // p vec2 a_positio + 0x6e, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, // n;.varying highp + 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x76, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, // vec2 v_position + 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, // ;.varying highp + 0x76, 0x65, 0x63, 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, // vec2 v_texcoord0 + 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, // ;.void main ().{ + 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, // . v_position = + 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x69, // a_position;. hi + 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // ghp vec2 tmpvar_ + 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x20, 0x3d, 0x20, // 1;. tmpvar_1 = + 0x28, 0x28, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x2a, 0x20, 0x33, // ((a_position * 3 + 0x2e, 0x30, 0x29, 0x20, 0x2d, 0x20, 0x76, 0x65, 0x63, 0x32, 0x28, 0x30, 0x2e, 0x30, 0x2c, 0x20, // .0) - vec2(0.0, + 0x31, 0x2e, 0x30, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, // 1.0));. highp v + 0x65, 0x63, 0x32, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x3b, 0x0a, 0x20, 0x20, // ec2 tmpvar_2;. + 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x78, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, // tmpvar_2.x = tmp + 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // var_1.x;. tmpva + 0x72, 0x5f, 0x32, 0x2e, 0x79, 0x20, 0x3d, 0x20, 0x28, 0x31, 0x2e, 0x30, 0x20, 0x2d, 0x20, 0x74, // r_2.y = (1.0 - t + 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x79, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x5f, // mpvar_1.y);. v_ + 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x3d, 0x20, 0x28, 0x28, 0x74, 0x6d, // texcoord0 = ((tm + 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x20, 0x2a, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x20, 0x2b, 0x20, // pvar_2 * 0.5) + + 0x76, 0x65, 0x63, 0x32, 0x28, 0x30, 0x2e, 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x29, 0x29, 0x3b, // vec2(0.5, 0.0)); + 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, // . highp vec4 tm + 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // pvar_3;. tmpvar + 0x5f, 0x33, 0x2e, 0x7a, 0x77, 0x20, 0x3d, 0x20, 0x76, 0x65, 0x63, 0x32, 0x28, 0x30, 0x2e, 0x35, // _3.zw = vec2(0.5 + 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // , 1.0);. tmpvar + 0x5f, 0x33, 0x2e, 0x78, 0x79, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, // _3.xy = tmpvar_1 + 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, // ;. gl_Position + 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // = tmpvar_3;.}... +}; diff --git a/Polyfills/Canvas/Source/Shaders/essl/vs_nanovg_fill.h b/Polyfills/Canvas/Source/Shaders/essl/vs_nanovg_fill.h index 1a001b501..417847cf9 100644 --- a/Polyfills/Canvas/Source/Shaders/essl/vs_nanovg_fill.h +++ b/Polyfills/Canvas/Source/Shaders/essl/vs_nanovg_fill.h @@ -1,38 +1,60 @@ -static const uint8_t vs_nanovg_fill_essl[553] = +static const uint8_t vs_nanovg_fill_essl[903] = { - 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0xcf, 0xda, 0x1b, 0x94, 0x02, 0x00, 0x0a, 0x75, // VSH............u + 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x98, 0xde, 0xee, 0x03, 0x00, 0x0a, 0x75, // VSH............u 0x5f, 0x76, 0x69, 0x65, 0x77, 0x53, 0x69, 0x7a, 0x65, 0x02, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, // _viewSize....... - 0x00, 0x00, 0x00, 0x0b, 0x75, 0x5f, 0x68, 0x61, 0x6c, 0x66, 0x54, 0x65, 0x78, 0x65, 0x6c, 0x02, // ....u_halfTexel. - 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xeb, 0x01, 0x00, 0x00, 0x61, 0x74, 0x74, // .............att - 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, // ribute highp vec - 0x32, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x61, 0x74, // 2 a_position;.at - 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, // tribute highp ve - 0x63, 0x32, 0x20, 0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, // c2 a_texcoord0;. - 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, // varying highp ve - 0x63, 0x32, 0x20, 0x76, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x76, // c2 v_position;.v - 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, // arying highp vec - 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x75, // 2 v_texcoord0;.u - 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, // niform highp vec - 0x34, 0x20, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x53, 0x69, 0x7a, 0x65, 0x3b, 0x0a, 0x75, 0x6e, // 4 u_viewSize;.un - 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, // iform highp vec4 - 0x20, 0x75, 0x5f, 0x68, 0x61, 0x6c, 0x66, 0x54, 0x65, 0x78, 0x65, 0x6c, 0x3b, 0x0a, 0x76, 0x6f, // u_halfTexel;.vo - 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x76, // id main ().{. v - 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x70, 0x6f, // _position = a_po - 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, // sition;. v_texc - 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x3d, 0x20, 0x28, 0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, // oord0 = (a_texco - 0x6f, 0x72, 0x64, 0x30, 0x20, 0x2b, 0x20, 0x75, 0x5f, 0x68, 0x61, 0x6c, 0x66, 0x54, 0x65, 0x78, // ord0 + u_halfTex - 0x65, 0x6c, 0x2e, 0x78, 0x79, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, // el.xy);. highp - 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, // vec4 tmpvar_1;. - 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x7a, 0x77, 0x20, 0x3d, 0x20, 0x76, // tmpvar_1.zw = v - 0x65, 0x63, 0x32, 0x28, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, // ec2(0.0, 1.0);. - 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x20, 0x3d, 0x20, 0x28, 0x28, // tmpvar_1.x = (( - 0x28, 0x32, 0x2e, 0x30, 0x20, 0x2a, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, // (2.0 * a_positio - 0x6e, 0x2e, 0x78, 0x29, 0x20, 0x2f, 0x20, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x53, 0x69, 0x7a, // n.x) / u_viewSiz - 0x65, 0x2e, 0x78, 0x29, 0x20, 0x2d, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x74, // e.x) - 1.0);. t - 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x79, 0x20, 0x3d, 0x20, 0x28, 0x31, 0x2e, 0x30, // mpvar_1.y = (1.0 - 0x20, 0x2d, 0x20, 0x28, 0x28, 0x32, 0x2e, 0x30, 0x20, 0x2a, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, // - ((2.0 * a_pos - 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x79, 0x29, 0x20, 0x2f, 0x20, 0x75, 0x5f, 0x76, 0x69, 0x65, // ition.y) / u_vie - 0x77, 0x53, 0x69, 0x7a, 0x65, 0x2e, 0x79, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, // wSize.y));. gl_ - 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // Position = tmpva - 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // r_1;.}... + 0x00, 0x00, 0x00, 0x0e, 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x64, 0x69, // ....u_extentRadi + 0x75, 0x73, 0x02, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x75, 0x5f, 0x68, // us...........u_h + 0x61, 0x6c, 0x66, 0x54, 0x65, 0x78, 0x65, 0x6c, 0x02, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // alfTexel........ + 0x00, 0x00, 0x30, 0x03, 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, // ..0...attribute + 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, // highp vec2 a_pos + 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, // ition;.attribute + 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x61, 0x5f, 0x74, 0x65, // highp vec2 a_te + 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, // xcoord0;.varying + 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x76, 0x5f, 0x70, 0x6f, // highp vec2 v_po + 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, // sition;.varying + 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, // highp vec2 v_tex + 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, // coord0;.varying + 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, // highp vec2 v_tex + 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x31, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, // coord1;.uniform + 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x75, 0x5f, 0x76, 0x69, 0x65, // highp vec4 u_vie + 0x77, 0x53, 0x69, 0x7a, 0x65, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x68, // wSize;.uniform h + 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, // ighp vec4 u_exte + 0x6e, 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, // ntRadius;.unifor + 0x6d, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x75, 0x5f, 0x68, // m highp vec4 u_h + 0x61, 0x6c, 0x66, 0x54, 0x65, 0x78, 0x65, 0x6c, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, // alfTexel;.void m + 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x70, 0x6f, 0x73, // ain ().{. v_pos + 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, // ition = a_positi + 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, // on;. v_texcoord + 0x30, 0x20, 0x3d, 0x20, 0x28, 0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, // 0 = (a_texcoord0 + 0x20, 0x2b, 0x20, 0x75, 0x5f, 0x68, 0x61, 0x6c, 0x66, 0x54, 0x65, 0x78, 0x65, 0x6c, 0x2e, 0x78, // + u_halfTexel.x + 0x79, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, // y);. highp vec2 + 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, // tmpvar_1;. tmp + 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x79, 0x20, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x3b, 0x0a, 0x20, // var_1.y = 1.0;. + 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x20, 0x3d, 0x20, 0x28, 0x75, // tmpvar_1.x = (u + 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x2e, 0x78, 0x20, // _extentRadius.x + 0x2f, 0x20, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x53, 0x69, 0x7a, 0x65, 0x2e, 0x78, 0x29, 0x3b, // / u_viewSize.x); + 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x74, 0x6d, // . highp vec2 tm + 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // pvar_2;. tmpvar + 0x5f, 0x32, 0x2e, 0x79, 0x20, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, // _2.y = 1.0;. tm + 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x78, 0x20, 0x3d, 0x20, 0x28, 0x75, 0x5f, 0x65, 0x78, // pvar_2.x = (u_ex + 0x74, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x2e, 0x79, 0x20, 0x2f, 0x20, 0x75, // tentRadius.y / u + 0x5f, 0x76, 0x69, 0x65, 0x77, 0x53, 0x69, 0x7a, 0x65, 0x2e, 0x78, 0x29, 0x3b, 0x0a, 0x20, 0x20, // _viewSize.x);. + 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x31, 0x20, 0x3d, 0x20, 0x28, 0x28, // v_texcoord1 = (( + 0x28, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x2f, 0x20, 0x75, 0x5f, // (a_position / u_ + 0x76, 0x69, 0x65, 0x77, 0x53, 0x69, 0x7a, 0x65, 0x2e, 0x78, 0x79, 0x29, 0x20, 0x2d, 0x20, 0x74, // viewSize.xy) - t + 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x29, 0x20, 0x2f, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // mpvar_1) / tmpva + 0x72, 0x5f, 0x32, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, // r_2);. highp ve + 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x74, // c4 tmpvar_3;. t + 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x2e, 0x7a, 0x77, 0x20, 0x3d, 0x20, 0x76, 0x65, 0x63, // mpvar_3.zw = vec + 0x32, 0x28, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x74, // 2(0.0, 1.0);. t + 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x2e, 0x78, 0x20, 0x3d, 0x20, 0x28, 0x28, 0x28, 0x32, // mpvar_3.x = (((2 + 0x2e, 0x30, 0x20, 0x2a, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, // .0 * a_position. + 0x78, 0x29, 0x20, 0x2f, 0x20, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x53, 0x69, 0x7a, 0x65, 0x2e, // x) / u_viewSize. + 0x78, 0x29, 0x20, 0x2d, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, // x) - 1.0);. tmp + 0x76, 0x61, 0x72, 0x5f, 0x33, 0x2e, 0x79, 0x20, 0x3d, 0x20, 0x28, 0x31, 0x2e, 0x30, 0x20, 0x2d, // var_3.y = (1.0 - + 0x20, 0x28, 0x28, 0x32, 0x2e, 0x30, 0x20, 0x2a, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, // ((2.0 * a_posit + 0x69, 0x6f, 0x6e, 0x2e, 0x79, 0x29, 0x20, 0x2f, 0x20, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x53, // ion.y) / u_viewS + 0x69, 0x7a, 0x65, 0x2e, 0x79, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x50, 0x6f, // ize.y));. gl_Po + 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // sition = tmpvar_ + 0x33, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // 3;.}... }; diff --git a/Polyfills/Canvas/Source/Shaders/fs_boxblur.sc b/Polyfills/Canvas/Source/Shaders/fs_boxblur.sc new file mode 100644 index 000000000..161623c8a --- /dev/null +++ b/Polyfills/Canvas/Source/Shaders/fs_boxblur.sc @@ -0,0 +1,49 @@ +$input v_position, v_texcoord0 + +#include "./common.sh" + +uniform vec4 u_viewSize; // vec4 (width, height, unused, unused) +uniform vec4 u_direction; // vec4 (x, y, unused, unused) +uniform vec4 u_weights; // vec4 (kernel, radius, offsetX, offsetY) + +SAMPLER2D(s_tex, 0); + +#if NEED_HALF_TEXEL +uniform vec4 u_halfTexel; +#endif // NEED_HALF_TEXEL + +#define EPSILON 1.23e-6 +#define kernel u_weights.x +#define radius u_weights.y +#define offsetX u_weights.z +#define offsetY u_weights.w + +void main() +{ +#if !NEED_HALF_TEXEL + vec4 u_halfTexel = vec4_splat(0.0); +#endif // !NEED_HALF_TEXEL + vec2 texcoord0 = v_texcoord0 + u_halfTexel.xy; + vec4 color = vec4_splat(0.0); + + // sample center if no offset (ie. odd kernel) + if (abs(offsetX) < EPSILON && abs(offsetY) < EPSILON) + { + color += texture2D(s_tex, texcoord0); + } + + // shift by offset (ie. even kernel) + vec2 direction = u_direction.xy + vec2(offsetX, offsetY); + vec2 texelSize = vec2_splat(1.0) / u_viewSize.xy; + + // sample sides + for (int i = 1; i <= int(radius); i++) + { + vec2 offset = direction * texelSize * float(i); + color += texture2D(s_tex, texcoord0 + offset); + color += texture2D(s_tex, texcoord0 - offset); + } + color = color / kernel; // distribute equally + + gl_FragColor = color; +} diff --git a/Polyfills/Canvas/Source/Shaders/fs_gaussblur.sc b/Polyfills/Canvas/Source/Shaders/fs_gaussblur.sc new file mode 100644 index 000000000..c65c7a277 --- /dev/null +++ b/Polyfills/Canvas/Source/Shaders/fs_gaussblur.sc @@ -0,0 +1,44 @@ +$input v_position, v_texcoord0 + +#include "./common.sh" + +// 13-taps +#define W_MID 6 +#define W_USIZE 5 + +uniform vec4 u_viewSize; // vec4 (width, height, unused, unused) +uniform vec4 u_direction; // vec4 (x, y, unused, unused) +uniform vec4 u_sigma; // vec4 (sigma, unused, unused, unused) +uniform vec4 u_weights[W_USIZE]; // vec4 (weight0, weight1, ..., weight12, unused, unused, unused) + +SAMPLER2D(s_tex, 0); + +#if NEED_HALF_TEXEL +uniform vec4 u_halfTexel; +#endif // NEED_HALF_TEXEL + +float getWeight(int i) +{ + int vecIndex = int(i / 4); + int compIndex = int(mod(i, 4)); + return u_weights[vecIndex][compIndex]; +} + +void main() +{ +#if !NEED_HALF_TEXEL + vec4 u_halfTexel = vec4_splat(0.0); +#endif // !NEED_HALF_TEXEL + vec2 texcoord0 = v_texcoord0 + u_halfTexel.xy; + vec4 color = texture2D(s_tex, texcoord0) * getWeight(W_MID); // center pixel + vec2 texelSize = vec2_splat(1.0) / u_viewSize.xy; + + for (int i = 1; i <= W_MID; i++) + { + vec2 offset = u_direction.xy * texelSize * float(i); + color += texture2D(s_tex, texcoord0 + offset) * getWeight(W_MID + i); + color += texture2D(s_tex, texcoord0 - offset) * getWeight(W_MID - i); + } + + gl_FragColor = color; +} diff --git a/Polyfills/Canvas/Source/Shaders/fs_nanovg_fill.sc b/Polyfills/Canvas/Source/Shaders/fs_nanovg_fill.sc index f9853577e..f02cd2dde 100644 --- a/Polyfills/Canvas/Source/Shaders/fs_nanovg_fill.sc +++ b/Polyfills/Canvas/Source/Shaders/fs_nanovg_fill.sc @@ -1,9 +1,10 @@ -$input v_position, v_texcoord0 +$input v_position, v_texcoord0, v_texcoord1 #include "./common.sh" #define EDGE_AA 1 +uniform vec4 u_viewSize; uniform mat3 u_scissorMat; uniform mat3 u_paintMat; uniform vec4 u_innerCol; @@ -11,8 +12,10 @@ uniform vec4 u_outerCol; uniform vec4 u_scissorExtScale; uniform vec4 u_extentRadius; uniform vec4 u_params; +uniform vec4 u_sdf; SAMPLER2D(s_tex, 0); +SAMPLER2D(s_tex2, 1); #define u_scissorExt (u_scissorExtScale.xy) #define u_scissorScale (u_scissorExtScale.zw) @@ -22,6 +25,11 @@ SAMPLER2D(s_tex, 0); #define u_strokeMult (u_params.y) #define u_texType (u_params.z) #define u_type (u_params.w) +#define u_sdfMin (u_sdf.x) +#define u_sdfMax (u_sdf.y) +#define u_sdfBlur (u_sdf.z) + +#define SDF_EDGE (128.0/255.0) float sdroundrect(vec2 pt, vec2 ext, float rad) { @@ -48,6 +56,12 @@ float strokeMask(vec2 _texcoord) #endif // EDGE_AA } +float sampleSDF(float edge, vec4 color) +{ + float result = (color.x - edge) / u_sdfBlur + 0.5; + return clamp(result, 0.0, 1.0); +} + void main() { vec4 result; @@ -85,8 +99,25 @@ void main() { vec4 color = texture2D(s_tex, v_texcoord0.xy); if (u_texType == 1.0) color = vec4(color.xyz * color.w, color.w); - if (u_texType == 2.0) color = color.xxxx; + if (u_texType == 2.0) { + float sdf = sampleSDF(u_sdfMin, color) * (1.0 - sampleSDF(u_sdfMax, color)); + color = vec4(sdf, sdf, sdf, sdf); + } + color *= scissor; + result = color * u_innerCol; + } + else if (u_type == 4.0) // Textured tris modulated by texture + { + vec4 color = texture2D(s_tex, v_texcoord0.xy); + vec2 pt = v_texcoord1.xy; + vec4 color2 = texture2D(s_tex2, pt); + if (u_texType == 1.0) color = vec4(color.xyz * color.w, color.w); + if (u_texType == 2.0) { + float sdf = sampleSDF(u_sdfMin, color) * (1.0 - sampleSDF(u_sdfMax, color)); + color = vec4(sdf, sdf, sdf, sdf); + } color *= scissor; + color *= color2; result = color * u_innerCol; } diff --git a/Polyfills/Canvas/Source/Shaders/glsl/fs_boxblur.h b/Polyfills/Canvas/Source/Shaders/glsl/fs_boxblur.h new file mode 100644 index 000000000..49a379b13 --- /dev/null +++ b/Polyfills/Canvas/Source/Shaders/glsl/fs_boxblur.h @@ -0,0 +1,75 @@ +static const uint8_t fs_boxblur_glsl[1137] = +{ + 0x46, 0x53, 0x48, 0x0b, 0xcf, 0xda, 0x1b, 0x94, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x0a, 0x75, // FSH............u + 0x5f, 0x76, 0x69, 0x65, 0x77, 0x53, 0x69, 0x7a, 0x65, 0x02, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, // _viewSize....... + 0x00, 0x00, 0x00, 0x0b, 0x75, 0x5f, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x02, // ....u_direction. + 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x75, 0x5f, 0x77, 0x65, 0x69, 0x67, // ..........u_weig + 0x68, 0x74, 0x73, 0x02, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x73, 0x5f, // hts...........s_ + 0x74, 0x65, 0x78, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x04, 0x00, // tex............. + 0x00, 0x69, 0x6e, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, // .in vec2 v_texco + 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x76, 0x65, // ord0;.uniform ve + 0x63, 0x34, 0x20, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x53, 0x69, 0x7a, 0x65, 0x3b, 0x0a, 0x75, // c4 u_viewSize;.u + 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x75, 0x5f, 0x64, 0x69, // niform vec4 u_di + 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, // rection;.uniform + 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x75, 0x5f, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x73, 0x3b, // vec4 u_weights; + 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, // .uniform sampler + 0x32, 0x44, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, // 2D s_tex;.void m + 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, // ain ().{. vec2 + 0x74, 0x65, 0x78, 0x65, 0x6c, 0x53, 0x69, 0x7a, 0x65, 0x5f, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x76, // texelSize_2;. v + 0x65, 0x63, 0x32, 0x20, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x33, 0x3b, // ec2 direction_3; + 0x0a, 0x20, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x34, 0x3b, // . vec4 color_4; + 0x0a, 0x20, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, // . vec2 texcoord + 0x30, 0x5f, 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, // 0_5;. texcoord0 + 0x5f, 0x35, 0x20, 0x3d, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, // _5 = v_texcoord0 + 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // ;. vec4 tmpvar_ + 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x2e, 0x78, 0x20, // 6;. tmpvar_6.x + 0x3d, 0x20, 0x30, 0x2e, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // = 0.0;. tmpvar_ + 0x36, 0x2e, 0x79, 0x20, 0x3d, 0x20, 0x30, 0x2e, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, // 6.y = 0.0;. tmp + 0x76, 0x61, 0x72, 0x5f, 0x36, 0x2e, 0x7a, 0x20, 0x3d, 0x20, 0x30, 0x2e, 0x30, 0x3b, 0x0a, 0x20, // var_6.z = 0.0;. + 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x30, 0x2e, // tmpvar_6.w = 0. + 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x34, 0x20, 0x3d, 0x20, 0x74, // 0;. color_4 = t + 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, // mpvar_6;. float + 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x37, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, // tmpvar_7;. tmp + 0x76, 0x61, 0x72, 0x5f, 0x37, 0x20, 0x3d, 0x20, 0x61, 0x62, 0x73, 0x28, 0x75, 0x5f, 0x77, 0x65, // var_7 = abs(u_we + 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x7a, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x62, 0x6f, 0x6f, 0x6c, // ights.z);. bool + 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x38, 0x3b, 0x0a, 0x20, 0x20, 0x69, 0x66, 0x20, // tmpvar_8;. if + 0x28, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x37, 0x20, 0x3c, 0x20, 0x31, 0x2e, 0x32, // ((tmpvar_7 < 1.2 + 0x33, 0x65, 0x2d, 0x30, 0x36, 0x29, 0x29, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, // 3e-06)) {. tm + 0x70, 0x76, 0x61, 0x72, 0x5f, 0x38, 0x20, 0x3d, 0x20, 0x28, 0x61, 0x62, 0x73, 0x28, 0x75, 0x5f, // pvar_8 = (abs(u_ + 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x77, 0x29, 0x20, 0x3c, 0x20, 0x31, 0x2e, 0x32, // weights.w) < 1.2 + 0x33, 0x65, 0x2d, 0x30, 0x36, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x7d, 0x20, 0x65, 0x6c, 0x73, 0x65, // 3e-06);. } else + 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x38, 0x20, // {. tmpvar_8 + 0x3d, 0x20, 0x62, 0x6f, 0x6f, 0x6c, 0x28, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x7d, 0x3b, 0x0a, // = bool(0);. };. + 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x38, 0x29, 0x20, // if (tmpvar_8) + 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x34, 0x20, 0x3d, 0x20, // {. color_4 = + 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x20, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x2c, 0x20, // texture (s_tex, + 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, // v_texcoord0);. + 0x7d, 0x3b, 0x0a, 0x20, 0x20, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x33, // };. direction_3 + 0x20, 0x3d, 0x20, 0x28, 0x75, 0x5f, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, // = (u_direction. + 0x78, 0x79, 0x20, 0x2b, 0x20, 0x75, 0x5f, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x7a, // xy + u_weights.z + 0x77, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x65, 0x78, 0x65, 0x6c, 0x53, 0x69, 0x7a, 0x65, 0x5f, // w);. texelSize_ + 0x32, 0x20, 0x3d, 0x20, 0x28, 0x31, 0x2e, 0x30, 0x2f, 0x28, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, // 2 = (1.0/(u_view + 0x53, 0x69, 0x7a, 0x65, 0x2e, 0x78, 0x79, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6f, 0x72, // Size.xy));. for + 0x20, 0x28, 0x69, 0x6e, 0x74, 0x20, 0x69, 0x5f, 0x31, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x20, 0x69, // (int i_1 = 1; i + 0x5f, 0x31, 0x20, 0x3c, 0x3d, 0x20, 0x69, 0x6e, 0x74, 0x28, 0x75, 0x5f, 0x77, 0x65, 0x69, 0x67, // _1 <= int(u_weig + 0x68, 0x74, 0x73, 0x2e, 0x79, 0x29, 0x3b, 0x20, 0x69, 0x5f, 0x31, 0x2b, 0x2b, 0x29, 0x20, 0x7b, // hts.y); i_1++) { + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // . vec2 tmpvar + 0x5f, 0x39, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x39, // _9;. tmpvar_9 + 0x20, 0x3d, 0x20, 0x28, 0x28, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x33, // = ((direction_3 + 0x20, 0x2a, 0x20, 0x74, 0x65, 0x78, 0x65, 0x6c, 0x53, 0x69, 0x7a, 0x65, 0x5f, 0x32, 0x29, 0x20, // * texelSize_2) + 0x2a, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x28, 0x69, 0x5f, 0x31, 0x29, 0x29, 0x3b, 0x0a, 0x20, // * float(i_1));. + 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x34, 0x20, 0x3d, 0x20, 0x28, 0x63, 0x6f, // color_4 = (co + 0x6c, 0x6f, 0x72, 0x5f, 0x34, 0x20, 0x2b, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x20, // lor_4 + texture + 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x2c, 0x20, 0x28, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, // (s_tex, (texcoor + 0x64, 0x30, 0x5f, 0x35, 0x20, 0x2b, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x39, 0x29, // d0_5 + tmpvar_9) + 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x34, 0x20, // ));. color_4 + 0x3d, 0x20, 0x28, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x34, 0x20, 0x2b, 0x20, 0x74, 0x65, 0x78, // = (color_4 + tex + 0x74, 0x75, 0x72, 0x65, 0x20, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x2c, 0x20, 0x28, 0x74, 0x65, // ture (s_tex, (te + 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x5f, 0x35, 0x20, 0x2d, 0x20, 0x74, 0x6d, 0x70, 0x76, // xcoord0_5 - tmpv + 0x61, 0x72, 0x5f, 0x39, 0x29, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x7d, 0x3b, 0x0a, 0x20, 0x20, // ar_9)));. };. + 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x34, 0x20, 0x3d, 0x20, 0x28, 0x63, 0x6f, 0x6c, 0x6f, 0x72, // color_4 = (color + 0x5f, 0x34, 0x20, 0x2f, 0x20, 0x75, 0x5f, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x78, // _4 / u_weights.x + 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, // );. gl_FragColo + 0x72, 0x20, 0x3d, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x34, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, // r = color_4;.}.. + 0x00, // . +}; diff --git a/Polyfills/Canvas/Source/Shaders/glsl/fs_gaussblur.h b/Polyfills/Canvas/Source/Shaders/glsl/fs_gaussblur.h new file mode 100644 index 000000000..91cc4b4c9 --- /dev/null +++ b/Polyfills/Canvas/Source/Shaders/glsl/fs_gaussblur.h @@ -0,0 +1,119 @@ +static const uint8_t fs_gaussblur_glsl[1846] = +{ + 0x46, 0x53, 0x48, 0x0b, 0xcf, 0xda, 0x1b, 0x94, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x0a, 0x75, // FSH............u + 0x5f, 0x76, 0x69, 0x65, 0x77, 0x53, 0x69, 0x7a, 0x65, 0x02, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, // _viewSize....... + 0x00, 0x00, 0x00, 0x0b, 0x75, 0x5f, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x02, // ....u_direction. + 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x75, 0x5f, 0x77, 0x65, 0x69, 0x67, // ..........u_weig + 0x68, 0x74, 0x73, 0x02, 0x05, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x73, 0x5f, // hts...........s_ + 0x74, 0x65, 0x78, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd4, 0x06, 0x00, // tex............. + 0x00, 0x69, 0x6e, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, // .in vec2 v_texco + 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x76, 0x65, // ord0;.uniform ve + 0x63, 0x34, 0x20, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x53, 0x69, 0x7a, 0x65, 0x3b, 0x0a, 0x75, // c4 u_viewSize;.u + 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x75, 0x5f, 0x64, 0x69, // niform vec4 u_di + 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, // rection;.uniform + 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x75, 0x5f, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x73, 0x5b, // vec4 u_weights[ + 0x35, 0x5d, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x73, 0x61, 0x6d, 0x70, // 5];.uniform samp + 0x6c, 0x65, 0x72, 0x32, 0x44, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x3b, 0x0a, 0x76, 0x6f, 0x69, // ler2D s_tex;.voi + 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x76, 0x65, // d main ().{. ve + 0x63, 0x32, 0x20, 0x74, 0x65, 0x78, 0x65, 0x6c, 0x53, 0x69, 0x7a, 0x65, 0x5f, 0x31, 0x3b, 0x0a, // c2 texelSize_1;. + 0x20, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x32, 0x3b, 0x0a, // vec4 color_2;. + 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x32, 0x20, 0x3d, 0x20, 0x28, 0x74, 0x65, 0x78, // color_2 = (tex + 0x74, 0x75, 0x72, 0x65, 0x20, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x2c, 0x20, 0x76, 0x5f, 0x74, // ture (s_tex, v_t + 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x29, 0x20, 0x2a, 0x20, 0x75, 0x5f, 0x77, 0x65, // excoord0) * u_we + 0x69, 0x67, 0x68, 0x74, 0x73, 0x5b, 0x31, 0x5d, 0x2e, 0x7a, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x74, // ights[1].z);. t + 0x65, 0x78, 0x65, 0x6c, 0x53, 0x69, 0x7a, 0x65, 0x5f, 0x31, 0x20, 0x3d, 0x20, 0x28, 0x31, 0x2e, // exelSize_1 = (1. + 0x30, 0x2f, 0x28, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x53, 0x69, 0x7a, 0x65, 0x2e, 0x78, 0x79, // 0/(u_viewSize.xy + 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // ));. vec2 tmpva + 0x72, 0x5f, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x20, // r_3;. tmpvar_3 + 0x3d, 0x20, 0x28, 0x75, 0x5f, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x78, // = (u_direction.x + 0x79, 0x20, 0x2a, 0x20, 0x74, 0x65, 0x78, 0x65, 0x6c, 0x53, 0x69, 0x7a, 0x65, 0x5f, 0x31, 0x29, // y * texelSize_1) + 0x3b, 0x0a, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x32, 0x20, 0x3d, 0x20, 0x28, 0x63, // ;. color_2 = (c + 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x32, 0x20, 0x2b, 0x20, 0x28, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, // olor_2 + (textur + 0x65, 0x20, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x2c, 0x20, 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, // e (s_tex, (v_tex + 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x2b, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // coord0 + tmpvar_ + 0x33, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x75, 0x5f, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x73, 0x5b, // 3)) * u_weights[ + 0x31, 0x5d, 0x2e, 0x77, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, // 1].w));. color_ + 0x32, 0x20, 0x3d, 0x20, 0x28, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x32, 0x20, 0x2b, 0x20, 0x28, // 2 = (color_2 + ( + 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x20, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x2c, 0x20, // texture (s_tex, + 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x2d, 0x20, 0x74, // (v_texcoord0 - t + 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x75, 0x5f, 0x77, 0x65, // mpvar_3)) * u_we + 0x69, 0x67, 0x68, 0x74, 0x73, 0x5b, 0x31, 0x5d, 0x2e, 0x79, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, // ights[1].y));. + 0x76, 0x65, 0x63, 0x32, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x3b, 0x0a, 0x20, // vec2 tmpvar_4;. + 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x20, 0x3d, 0x20, 0x28, 0x28, 0x75, 0x5f, // tmpvar_4 = ((u_ + 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x78, 0x79, 0x20, 0x2a, 0x20, 0x74, // direction.xy * t + 0x65, 0x78, 0x65, 0x6c, 0x53, 0x69, 0x7a, 0x65, 0x5f, 0x31, 0x29, 0x20, 0x2a, 0x20, 0x32, 0x2e, // exelSize_1) * 2. + 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x32, 0x20, 0x3d, 0x20, // 0);. color_2 = + 0x28, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x32, 0x20, 0x2b, 0x20, 0x28, 0x74, 0x65, 0x78, 0x74, // (color_2 + (text + 0x75, 0x72, 0x65, 0x20, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x2c, 0x20, 0x28, 0x76, 0x5f, 0x74, // ure (s_tex, (v_t + 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x2b, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // excoord0 + tmpva + 0x72, 0x5f, 0x34, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x75, 0x5f, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, // r_4)) * u_weight + 0x73, 0x5b, 0x32, 0x5d, 0x2e, 0x78, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, // s[2].x));. colo + 0x72, 0x5f, 0x32, 0x20, 0x3d, 0x20, 0x28, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x32, 0x20, 0x2b, // r_2 = (color_2 + + 0x20, 0x28, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x20, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, // (texture (s_tex + 0x2c, 0x20, 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x2d, // , (v_texcoord0 - + 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x75, 0x5f, // tmpvar_4)) * u_ + 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x73, 0x5b, 0x31, 0x5d, 0x2e, 0x78, 0x29, 0x29, 0x3b, 0x0a, // weights[1].x));. + 0x20, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x3b, // vec2 tmpvar_5; + 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x20, 0x3d, 0x20, 0x28, 0x28, // . tmpvar_5 = (( + 0x75, 0x5f, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x78, 0x79, 0x20, 0x2a, // u_direction.xy * + 0x20, 0x74, 0x65, 0x78, 0x65, 0x6c, 0x53, 0x69, 0x7a, 0x65, 0x5f, 0x31, 0x29, 0x20, 0x2a, 0x20, // texelSize_1) * + 0x33, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x32, 0x20, // 3.0);. color_2 + 0x3d, 0x20, 0x28, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x32, 0x20, 0x2b, 0x20, 0x28, 0x74, 0x65, // = (color_2 + (te + 0x78, 0x74, 0x75, 0x72, 0x65, 0x20, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x2c, 0x20, 0x28, 0x76, // xture (s_tex, (v + 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x2b, 0x20, 0x74, 0x6d, 0x70, // _texcoord0 + tmp + 0x76, 0x61, 0x72, 0x5f, 0x35, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x75, 0x5f, 0x77, 0x65, 0x69, 0x67, // var_5)) * u_weig + 0x68, 0x74, 0x73, 0x5b, 0x32, 0x5d, 0x2e, 0x79, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x63, 0x6f, // hts[2].y));. co + 0x6c, 0x6f, 0x72, 0x5f, 0x32, 0x20, 0x3d, 0x20, 0x28, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x32, // lor_2 = (color_2 + 0x20, 0x2b, 0x20, 0x28, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x20, 0x28, 0x73, 0x5f, 0x74, // + (texture (s_t + 0x65, 0x78, 0x2c, 0x20, 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, // ex, (v_texcoord0 + 0x20, 0x2d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x29, 0x29, 0x20, 0x2a, 0x20, // - tmpvar_5)) * + 0x75, 0x5f, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x73, 0x5b, 0x30, 0x5d, 0x2e, 0x77, 0x29, 0x29, // u_weights[0].w)) + 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // ;. vec2 tmpvar_ + 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x20, 0x3d, 0x20, // 6;. tmpvar_6 = + 0x28, 0x28, 0x75, 0x5f, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x78, 0x79, // ((u_direction.xy + 0x20, 0x2a, 0x20, 0x74, 0x65, 0x78, 0x65, 0x6c, 0x53, 0x69, 0x7a, 0x65, 0x5f, 0x31, 0x29, 0x20, // * texelSize_1) + 0x2a, 0x20, 0x34, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, // * 4.0);. color_ + 0x32, 0x20, 0x3d, 0x20, 0x28, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x32, 0x20, 0x2b, 0x20, 0x28, // 2 = (color_2 + ( + 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x20, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x2c, 0x20, // texture (s_tex, + 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x2b, 0x20, 0x74, // (v_texcoord0 + t + 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x75, 0x5f, 0x77, 0x65, // mpvar_6)) * u_we + 0x69, 0x67, 0x68, 0x74, 0x73, 0x5b, 0x32, 0x5d, 0x2e, 0x7a, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, // ights[2].z));. + 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x32, 0x20, 0x3d, 0x20, 0x28, 0x63, 0x6f, 0x6c, 0x6f, 0x72, // color_2 = (color + 0x5f, 0x32, 0x20, 0x2b, 0x20, 0x28, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x20, 0x28, 0x73, // _2 + (texture (s + 0x5f, 0x74, 0x65, 0x78, 0x2c, 0x20, 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, // _tex, (v_texcoor + 0x64, 0x30, 0x20, 0x2d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x29, 0x29, 0x20, // d0 - tmpvar_6)) + 0x2a, 0x20, 0x75, 0x5f, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x73, 0x5b, 0x30, 0x5d, 0x2e, 0x7a, // * u_weights[0].z + 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // ));. vec2 tmpva + 0x72, 0x5f, 0x37, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x37, 0x20, // r_7;. tmpvar_7 + 0x3d, 0x20, 0x28, 0x28, 0x75, 0x5f, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, // = ((u_direction. + 0x78, 0x79, 0x20, 0x2a, 0x20, 0x74, 0x65, 0x78, 0x65, 0x6c, 0x53, 0x69, 0x7a, 0x65, 0x5f, 0x31, // xy * texelSize_1 + 0x29, 0x20, 0x2a, 0x20, 0x35, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, // ) * 5.0);. colo + 0x72, 0x5f, 0x32, 0x20, 0x3d, 0x20, 0x28, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x32, 0x20, 0x2b, // r_2 = (color_2 + + 0x20, 0x28, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x20, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, // (texture (s_tex + 0x2c, 0x20, 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x2b, // , (v_texcoord0 + + 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x37, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x75, 0x5f, // tmpvar_7)) * u_ + 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x73, 0x5b, 0x32, 0x5d, 0x2e, 0x77, 0x29, 0x29, 0x3b, 0x0a, // weights[2].w));. + 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x32, 0x20, 0x3d, 0x20, 0x28, 0x63, 0x6f, 0x6c, // color_2 = (col + 0x6f, 0x72, 0x5f, 0x32, 0x20, 0x2b, 0x20, 0x28, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x20, // or_2 + (texture + 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x2c, 0x20, 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, // (s_tex, (v_texco + 0x6f, 0x72, 0x64, 0x30, 0x20, 0x2d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x37, 0x29, // ord0 - tmpvar_7) + 0x29, 0x20, 0x2a, 0x20, 0x75, 0x5f, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x73, 0x5b, 0x30, 0x5d, // ) * u_weights[0] + 0x2e, 0x79, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x74, 0x6d, 0x70, // .y));. vec2 tmp + 0x76, 0x61, 0x72, 0x5f, 0x38, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // var_8;. tmpvar_ + 0x38, 0x20, 0x3d, 0x20, 0x28, 0x28, 0x75, 0x5f, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, // 8 = ((u_directio + 0x6e, 0x2e, 0x78, 0x79, 0x20, 0x2a, 0x20, 0x74, 0x65, 0x78, 0x65, 0x6c, 0x53, 0x69, 0x7a, 0x65, // n.xy * texelSize + 0x5f, 0x31, 0x29, 0x20, 0x2a, 0x20, 0x36, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x63, 0x6f, // _1) * 6.0);. co + 0x6c, 0x6f, 0x72, 0x5f, 0x32, 0x20, 0x3d, 0x20, 0x28, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x32, // lor_2 = (color_2 + 0x20, 0x2b, 0x20, 0x28, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x20, 0x28, 0x73, 0x5f, 0x74, // + (texture (s_t + 0x65, 0x78, 0x2c, 0x20, 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, // ex, (v_texcoord0 + 0x20, 0x2b, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x38, 0x29, 0x29, 0x20, 0x2a, 0x20, // + tmpvar_8)) * + 0x75, 0x5f, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x73, 0x5b, 0x33, 0x5d, 0x2e, 0x78, 0x29, 0x29, // u_weights[3].x)) + 0x3b, 0x0a, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x32, 0x20, 0x3d, 0x20, 0x28, 0x63, // ;. color_2 = (c + 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x32, 0x20, 0x2b, 0x20, 0x28, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, // olor_2 + (textur + 0x65, 0x20, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x2c, 0x20, 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, // e (s_tex, (v_tex + 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x2d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // coord0 - tmpvar_ + 0x38, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x75, 0x5f, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x73, 0x5b, // 8)) * u_weights[ + 0x30, 0x5d, 0x2e, 0x78, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, // 0].x));. gl_Fra + 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x32, // gColor = color_2 + 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // ;.}... +}; diff --git a/Polyfills/Canvas/Source/Shaders/glsl/fs_nanovg_fill.h b/Polyfills/Canvas/Source/Shaders/glsl/fs_nanovg_fill.h index 51d741de6..555ba6393 100644 --- a/Polyfills/Canvas/Source/Shaders/glsl/fs_nanovg_fill.h +++ b/Polyfills/Canvas/Source/Shaders/glsl/fs_nanovg_fill.h @@ -1,6 +1,6 @@ -static const uint8_t fs_nanovg_fill_glsl[2813] = +static const uint8_t fs_nanovg_fill_glsl[4517] = { - 0x46, 0x53, 0x48, 0x0b, 0xcf, 0xda, 0x1b, 0x94, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x0c, 0x75, // FSH............u + 0x46, 0x53, 0x48, 0x0b, 0x1e, 0x98, 0xde, 0xee, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x0c, 0x75, // FSH............u 0x5f, 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x4d, 0x61, 0x74, 0x03, 0x01, 0x00, 0x00, 0x03, // _scissorMat..... 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x75, 0x5f, 0x70, 0x61, 0x69, 0x6e, 0x74, 0x4d, 0x61, 0x74, // ......u_paintMat 0x03, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x75, 0x5f, 0x69, 0x6e, 0x6e, // ...........u_inn @@ -10,170 +10,277 @@ static const uint8_t fs_nanovg_fill_glsl[2813] = 0x74, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x02, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // tScale.......... 0x0e, 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x02, // .u_extentRadius. 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, // ..........u_para - 0x6d, 0x73, 0x02, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x73, 0x5f, 0x74, // ms...........s_t - 0x65, 0x78, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x0a, 0x00, 0x00, // ex..........<... - 0x69, 0x6e, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x76, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, // in vec2 v_positi - 0x6f, 0x6e, 0x3b, 0x0a, 0x69, 0x6e, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, // on;.in vec2 v_te - 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, // xcoord0;.uniform - 0x20, 0x6d, 0x61, 0x74, 0x33, 0x20, 0x75, 0x5f, 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x4d, // mat3 u_scissorM - 0x61, 0x74, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x6d, 0x61, 0x74, 0x33, // at;.uniform mat3 - 0x20, 0x75, 0x5f, 0x70, 0x61, 0x69, 0x6e, 0x74, 0x4d, 0x61, 0x74, 0x3b, 0x0a, 0x75, 0x6e, 0x69, // u_paintMat;.uni - 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x75, 0x5f, 0x69, 0x6e, 0x6e, 0x65, // form vec4 u_inne - 0x72, 0x43, 0x6f, 0x6c, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x76, 0x65, // rCol;.uniform ve - 0x63, 0x34, 0x20, 0x75, 0x5f, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x3b, 0x0a, 0x75, // c4 u_outerCol;.u - 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x75, 0x5f, 0x73, 0x63, // niform vec4 u_sc - 0x69, 0x73, 0x73, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x3b, 0x0a, 0x75, // issorExtScale;.u - 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x75, 0x5f, 0x65, 0x78, // niform vec4 u_ex - 0x74, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, // tentRadius;.unif - 0x6f, 0x72, 0x6d, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, // orm vec4 u_param - 0x73, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, // s;.uniform sampl - 0x65, 0x72, 0x32, 0x44, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, // er2D s_tex;.void - 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x76, 0x65, 0x63, // main ().{. vec - 0x34, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, // 4 result_1;. fl - 0x6f, 0x61, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x3b, 0x0a, 0x20, 0x20, // oat tmpvar_2;. - 0x76, 0x65, 0x63, 0x32, 0x20, 0x73, 0x63, 0x5f, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x65, 0x63, // vec2 sc_3;. vec - 0x33, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, // 3 tmpvar_4;. tm - 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x2e, 0x7a, 0x20, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x3b, 0x0a, // pvar_4.z = 1.0;. - 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x2e, 0x78, 0x79, 0x20, 0x3d, 0x20, // tmpvar_4.xy = - 0x76, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x73, 0x63, // v_position;. sc - 0x5f, 0x33, 0x20, 0x3d, 0x20, 0x28, 0x76, 0x65, 0x63, 0x32, 0x28, 0x30, 0x2e, 0x35, 0x2c, 0x20, // _3 = (vec2(0.5, - 0x30, 0x2e, 0x35, 0x29, 0x20, 0x2d, 0x20, 0x28, 0x28, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x61, 0x62, // 0.5) - ((. ab - 0x73, 0x28, 0x28, 0x75, 0x5f, 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x4d, 0x61, 0x74, 0x20, // s((u_scissorMat - 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x29, 0x2e, 0x78, 0x79, 0x29, 0x0a, // * tmpvar_4).xy). - 0x20, 0x20, 0x20, 0x2d, 0x20, 0x75, 0x5f, 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x45, 0x78, // - u_scissorEx - 0x74, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x2e, 0x78, 0x79, 0x29, 0x20, 0x2a, 0x20, 0x75, 0x5f, 0x73, // tScale.xy) * u_s - 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x2e, 0x7a, // cissorExtScale.z - 0x77, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x20, // w));. tmpvar_2 - 0x3d, 0x20, 0x28, 0x63, 0x6c, 0x61, 0x6d, 0x70, 0x20, 0x28, 0x73, 0x63, 0x5f, 0x33, 0x2e, 0x78, // = (clamp (sc_3.x - 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x20, 0x2a, 0x20, 0x63, 0x6c, // , 0.0, 1.0) * cl - 0x61, 0x6d, 0x70, 0x20, 0x28, 0x73, 0x63, 0x5f, 0x33, 0x2e, 0x79, 0x2c, 0x20, 0x30, 0x2e, 0x30, // amp (sc_3.y, 0.0 - 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, // , 1.0));. float - 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, // tmpvar_5;. tmp - 0x76, 0x61, 0x72, 0x5f, 0x35, 0x20, 0x3d, 0x20, 0x28, 0x6d, 0x69, 0x6e, 0x20, 0x28, 0x31, 0x2e, // var_5 = (min (1. - 0x30, 0x2c, 0x20, 0x28, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x28, 0x31, 0x2e, 0x30, 0x20, 0x2d, 0x20, // 0, (. (1.0 - - 0x61, 0x62, 0x73, 0x28, 0x28, 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, // abs(((v_texcoord - 0x30, 0x2e, 0x78, 0x20, 0x2a, 0x20, 0x32, 0x2e, 0x30, 0x29, 0x20, 0x2d, 0x20, 0x31, 0x2e, 0x30, // 0.x * 2.0) - 1.0 - 0x29, 0x29, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x2a, 0x20, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, // ))). * u_param - 0x73, 0x2e, 0x79, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x6d, 0x69, 0x6e, 0x20, 0x28, 0x31, 0x2e, 0x30, // s.y)) * min (1.0 - 0x2c, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x79, 0x29, // , v_texcoord0.y) - 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x28, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, // );. if ((u_para - 0x6d, 0x73, 0x2e, 0x77, 0x20, 0x3d, 0x3d, 0x20, 0x30, 0x2e, 0x30, 0x29, 0x29, 0x20, 0x7b, 0x0a, // ms.w == 0.0)) {. - 0x20, 0x20, 0x20, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // vec3 tmpvar_ - 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x2e, // 6;. tmpvar_6. - 0x7a, 0x20, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, // z = 1.0;. tmp - 0x76, 0x61, 0x72, 0x5f, 0x36, 0x2e, 0x78, 0x79, 0x20, 0x3d, 0x20, 0x76, 0x5f, 0x70, 0x6f, 0x73, // var_6.xy = v_pos - 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, // ition;. vec2 - 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x37, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, // tmpvar_7;. tm - 0x70, 0x76, 0x61, 0x72, 0x5f, 0x37, 0x20, 0x3d, 0x20, 0x28, 0x61, 0x62, 0x73, 0x28, 0x28, 0x75, // pvar_7 = (abs((u - 0x5f, 0x70, 0x61, 0x69, 0x6e, 0x74, 0x4d, 0x61, 0x74, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, // _paintMat * tmpv - 0x61, 0x72, 0x5f, 0x36, 0x29, 0x2e, 0x78, 0x79, 0x29, 0x20, 0x2d, 0x20, 0x28, 0x75, 0x5f, 0x65, // ar_6).xy) - (u_e - 0x78, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x2e, 0x78, 0x79, 0x20, 0x2d, // xtentRadius.xy - - 0x20, 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x2e, // u_extentRadius. - 0x7a, 0x7a, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x74, // zz));. vec2 t - 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x38, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, // mpvar_8;. tmp - 0x76, 0x61, 0x72, 0x5f, 0x38, 0x20, 0x3d, 0x20, 0x6d, 0x61, 0x78, 0x20, 0x28, 0x74, 0x6d, 0x70, // var_8 = max (tmp - 0x76, 0x61, 0x72, 0x5f, 0x37, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, // var_7, 0.0);. - 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x31, 0x20, 0x3d, 0x20, 0x28, 0x6d, 0x69, 0x78, // result_1 = (mix - 0x20, 0x28, 0x75, 0x5f, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x2c, 0x20, 0x75, 0x5f, // (u_innerCol, u_ - 0x6f, 0x75, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x2c, 0x20, 0x63, 0x6c, 0x61, 0x6d, 0x70, 0x20, // outerCol, clamp - 0x28, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x28, 0x28, 0x28, 0x28, 0x0a, 0x20, 0x20, 0x20, // (. ((((. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x6d, 0x69, 0x6e, 0x20, 0x28, 0x6d, 0x61, 0x78, 0x20, 0x28, 0x74, // min (max (t - 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x37, 0x2e, 0x78, 0x2c, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // mpvar_7.x, tmpva - 0x72, 0x5f, 0x37, 0x2e, 0x79, 0x29, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x29, 0x0a, 0x20, 0x20, 0x20, // r_7.y), 0.0). - 0x20, 0x20, 0x20, 0x20, 0x2b, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x73, // + . s - 0x71, 0x72, 0x74, 0x28, 0x64, 0x6f, 0x74, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // qrt(dot (tmpvar_ - 0x38, 0x2c, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x38, 0x29, 0x29, 0x0a, 0x20, 0x20, // 8, tmpvar_8)). - 0x20, 0x20, 0x20, 0x20, 0x29, 0x20, 0x2d, 0x20, 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, // ) - u_extent - 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x2e, 0x7a, 0x29, 0x20, 0x2b, 0x20, 0x28, 0x75, 0x5f, 0x70, // Radius.z) + (u_p - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x78, 0x20, 0x2a, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x29, 0x20, // arams.x * 0.5)) - 0x2f, 0x20, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x78, 0x29, 0x0a, 0x20, 0x20, // / u_params.x). - 0x20, 0x20, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x29, 0x20, 0x2a, // , 0.0, 1.0)) * - 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, // (tmpvar_5 * tmp - 0x76, 0x61, 0x72, 0x5f, 0x32, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x7d, 0x20, 0x65, 0x6c, 0x73, // var_2));. } els - 0x65, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x28, 0x75, 0x5f, 0x70, // e {. if ((u_p - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x77, 0x20, 0x3d, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x29, // arams.w == 1.0)) - 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x63, 0x6f, // {. vec4 co - 0x6c, 0x6f, 0x72, 0x5f, 0x39, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x76, 0x65, 0x63, // lor_9;. vec - 0x33, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, // 3 tmpvar_10;. - 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x30, 0x2e, 0x7a, 0x20, 0x3d, // tmpvar_10.z = - 0x20, 0x31, 0x2e, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, // 1.0;. tmpv - 0x61, 0x72, 0x5f, 0x31, 0x30, 0x2e, 0x78, 0x79, 0x20, 0x3d, 0x20, 0x76, 0x5f, 0x70, 0x6f, 0x73, // ar_10.xy = v_pos - 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x76, 0x65, 0x63, // ition;. vec - 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x20, // 4 tmpvar_11;. - 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x31, 0x20, 0x3d, 0x20, 0x74, // tmpvar_11 = t - 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x20, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x2c, 0x20, 0x28, // exture (s_tex, ( - 0x28, 0x75, 0x5f, 0x70, 0x61, 0x69, 0x6e, 0x74, 0x4d, 0x61, 0x74, 0x20, 0x2a, 0x20, 0x74, 0x6d, // (u_paintMat * tm - 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x30, 0x29, 0x2e, 0x78, 0x79, 0x20, 0x2f, 0x20, 0x75, 0x5f, // pvar_10).xy / u_ - 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x2e, 0x78, 0x79, 0x29, // extentRadius.xy) - 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x39, // );. color_9 - 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x31, 0x3b, 0x0a, 0x20, 0x20, // = tmpvar_11;. - 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x28, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, // if ((u_param - 0x73, 0x2e, 0x7a, 0x20, 0x3d, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x29, 0x20, 0x7b, 0x0a, 0x20, // s.z == 1.0)) {. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, // vec4 tmpv - 0x61, 0x72, 0x5f, 0x31, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, // ar_12;. t - 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x32, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x28, // mpvar_12.xyz = ( - 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x31, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x2a, 0x20, // tmpvar_11.xyz * - 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x31, 0x2e, 0x77, 0x29, 0x3b, 0x0a, 0x20, 0x20, // tmpvar_11.w);. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x32, 0x2e, // tmpvar_12. - 0x77, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x31, 0x2e, 0x77, 0x3b, // w = tmpvar_11.w; - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x39, // . color_9 - 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x32, 0x3b, 0x0a, 0x20, 0x20, // = tmpvar_12;. - 0x20, 0x20, 0x20, 0x20, 0x7d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, // };. if - 0x28, 0x28, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x7a, 0x20, 0x3d, 0x3d, 0x20, // ((u_params.z == + 0x6d, 0x73, 0x02, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x75, 0x5f, 0x73, // ms...........u_s + 0x64, 0x66, 0x02, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x73, 0x5f, 0x74, // df...........s_t + 0x65, 0x78, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x73, 0x5f, 0x74, // ex...........s_t + 0x65, 0x78, 0x32, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0x10, 0x00, // ex2............. + 0x00, 0x69, 0x6e, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x76, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, // .in vec2 v_posit + 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x69, 0x6e, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x76, 0x5f, 0x74, // ion;.in vec2 v_t + 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x69, 0x6e, 0x20, 0x76, 0x65, 0x63, // excoord0;.in vec + 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x31, 0x3b, 0x0a, 0x75, // 2 v_texcoord1;.u + 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x6d, 0x61, 0x74, 0x33, 0x20, 0x75, 0x5f, 0x73, 0x63, // niform mat3 u_sc + 0x69, 0x73, 0x73, 0x6f, 0x72, 0x4d, 0x61, 0x74, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, // issorMat;.unifor + 0x6d, 0x20, 0x6d, 0x61, 0x74, 0x33, 0x20, 0x75, 0x5f, 0x70, 0x61, 0x69, 0x6e, 0x74, 0x4d, 0x61, // m mat3 u_paintMa + 0x74, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, // t;.uniform vec4 + 0x75, 0x5f, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, // u_innerCol;.unif + 0x6f, 0x72, 0x6d, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x75, 0x5f, 0x6f, 0x75, 0x74, 0x65, 0x72, // orm vec4 u_outer + 0x43, 0x6f, 0x6c, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x76, 0x65, 0x63, // Col;.uniform vec + 0x34, 0x20, 0x75, 0x5f, 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x53, 0x63, // 4 u_scissorExtSc + 0x61, 0x6c, 0x65, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x76, 0x65, 0x63, // ale;.uniform vec + 0x34, 0x20, 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, // 4 u_extentRadius + 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x75, // ;.uniform vec4 u + 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, // _params;.uniform + 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x75, 0x5f, 0x73, 0x64, 0x66, 0x3b, 0x0a, 0x75, 0x6e, 0x69, // vec4 u_sdf;.uni + 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x32, 0x44, 0x20, 0x73, // form sampler2D s + 0x5f, 0x74, 0x65, 0x78, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x73, 0x61, // _tex;.uniform sa + 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x32, 0x44, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x32, 0x3b, 0x0a, // mpler2D s_tex2;. + 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, // void main ().{. + 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x31, 0x3b, 0x0a, // vec4 result_1;. + 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, // float tmpvar_2 + 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x73, 0x63, 0x5f, 0x33, 0x3b, 0x0a, 0x20, // ;. vec2 sc_3;. + 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x3b, 0x0a, // vec3 tmpvar_4;. + 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x2e, 0x7a, 0x20, 0x3d, 0x20, 0x31, // tmpvar_4.z = 1 + 0x2e, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x2e, 0x78, // .0;. tmpvar_4.x + 0x79, 0x20, 0x3d, 0x20, 0x76, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, // y = v_position;. + 0x20, 0x20, 0x73, 0x63, 0x5f, 0x33, 0x20, 0x3d, 0x20, 0x28, 0x76, 0x65, 0x63, 0x32, 0x28, 0x30, // sc_3 = (vec2(0 + 0x2e, 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x20, 0x2d, 0x20, 0x28, 0x28, 0x0a, 0x20, 0x20, // .5, 0.5) - ((. + 0x20, 0x20, 0x61, 0x62, 0x73, 0x28, 0x28, 0x75, 0x5f, 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, // abs((u_scissor + 0x4d, 0x61, 0x74, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x34, 0x29, 0x2e, // Mat * tmpvar_4). + 0x78, 0x79, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x2d, 0x20, 0x75, 0x5f, 0x73, 0x63, 0x69, 0x73, 0x73, // xy). - u_sciss + 0x6f, 0x72, 0x45, 0x78, 0x74, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x2e, 0x78, 0x79, 0x29, 0x20, 0x2a, // orExtScale.xy) * + 0x20, 0x75, 0x5f, 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x53, 0x63, 0x61, // u_scissorExtSca + 0x6c, 0x65, 0x2e, 0x7a, 0x77, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // le.zw));. tmpva + 0x72, 0x5f, 0x32, 0x20, 0x3d, 0x20, 0x28, 0x63, 0x6c, 0x61, 0x6d, 0x70, 0x20, 0x28, 0x73, 0x63, // r_2 = (clamp (sc + 0x5f, 0x33, 0x2e, 0x78, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x20, // _3.x, 0.0, 1.0) + 0x2a, 0x20, 0x63, 0x6c, 0x61, 0x6d, 0x70, 0x20, 0x28, 0x73, 0x63, 0x5f, 0x33, 0x2e, 0x79, 0x2c, // * clamp (sc_3.y, + 0x20, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x66, // 0.0, 1.0));. f + 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x3b, 0x0a, 0x20, // loat tmpvar_5;. + 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x20, 0x3d, 0x20, 0x28, 0x6d, 0x69, 0x6e, // tmpvar_5 = (min + 0x20, 0x28, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x28, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x28, 0x31, 0x2e, // (1.0, (. (1. + 0x30, 0x20, 0x2d, 0x20, 0x61, 0x62, 0x73, 0x28, 0x28, 0x28, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, // 0 - abs(((v_texc + 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, 0x20, 0x2a, 0x20, 0x32, 0x2e, 0x30, 0x29, 0x20, 0x2d, // oord0.x * 2.0) - + 0x20, 0x31, 0x2e, 0x30, 0x29, 0x29, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x2a, 0x20, 0x75, 0x5f, 0x70, // 1.0))). * u_p + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x79, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x6d, 0x69, 0x6e, 0x20, // arams.y)) * min + 0x28, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, // (1.0, v_texcoord + 0x30, 0x2e, 0x79, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x28, 0x75, 0x5f, // 0.y));. if ((u_ + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x77, 0x20, 0x3d, 0x3d, 0x20, 0x30, 0x2e, 0x30, 0x29, // params.w == 0.0) + 0x29, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x74, 0x6d, 0x70, // ) {. vec3 tmp + 0x76, 0x61, 0x72, 0x5f, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // var_6;. tmpva + 0x72, 0x5f, 0x36, 0x2e, 0x7a, 0x20, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, // r_6.z = 1.0;. + 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x2e, 0x78, 0x79, 0x20, 0x3d, 0x20, 0x76, // tmpvar_6.xy = v + 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x76, // _position;. v + 0x65, 0x63, 0x32, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x37, 0x3b, 0x0a, 0x20, 0x20, // ec2 tmpvar_7;. + 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x37, 0x20, 0x3d, 0x20, 0x28, 0x61, 0x62, // tmpvar_7 = (ab + 0x73, 0x28, 0x28, 0x75, 0x5f, 0x70, 0x61, 0x69, 0x6e, 0x74, 0x4d, 0x61, 0x74, 0x20, 0x2a, 0x20, // s((u_paintMat * + 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x36, 0x29, 0x2e, 0x78, 0x79, 0x29, 0x20, 0x2d, 0x20, // tmpvar_6).xy) - + 0x28, 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x2e, // (u_extentRadius. + 0x78, 0x79, 0x20, 0x2d, 0x20, 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x64, // xy - u_extentRad + 0x69, 0x75, 0x73, 0x2e, 0x7a, 0x7a, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x76, 0x65, // ius.zz));. ve + 0x63, 0x32, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x38, 0x3b, 0x0a, 0x20, 0x20, 0x20, // c2 tmpvar_8;. + 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x38, 0x20, 0x3d, 0x20, 0x6d, 0x61, 0x78, 0x20, // tmpvar_8 = max + 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x37, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x29, 0x3b, // (tmpvar_7, 0.0); + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x31, 0x20, 0x3d, 0x20, // . result_1 = + 0x28, 0x6d, 0x69, 0x78, 0x20, 0x28, 0x75, 0x5f, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x43, 0x6f, 0x6c, // (mix (u_innerCol + 0x2c, 0x20, 0x75, 0x5f, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x2c, 0x20, 0x63, 0x6c, // , u_outerCol, cl + 0x61, 0x6d, 0x70, 0x20, 0x28, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x28, 0x28, 0x28, 0x28, // amp (. (((( + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6d, 0x69, 0x6e, 0x20, 0x28, 0x6d, 0x61, // . min (ma + 0x78, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x37, 0x2e, 0x78, 0x2c, 0x20, 0x74, // x (tmpvar_7.x, t + 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x37, 0x2e, 0x79, 0x29, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x29, // mpvar_7.y), 0.0) + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2b, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // . + . + 0x20, 0x20, 0x20, 0x73, 0x71, 0x72, 0x74, 0x28, 0x64, 0x6f, 0x74, 0x20, 0x28, 0x74, 0x6d, 0x70, // sqrt(dot (tmp + 0x76, 0x61, 0x72, 0x5f, 0x38, 0x2c, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x38, 0x29, // var_8, tmpvar_8) + 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x29, 0x20, 0x2d, 0x20, 0x75, 0x5f, 0x65, 0x78, // ). ) - u_ex + 0x74, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x2e, 0x7a, 0x29, 0x20, 0x2b, 0x20, // tentRadius.z) + + 0x28, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x78, 0x20, 0x2a, 0x20, 0x30, 0x2e, // (u_params.x * 0. + 0x35, 0x29, 0x29, 0x20, 0x2f, 0x20, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x78, // 5)) / u_params.x + 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, // ). , 0.0, 1.0 + 0x29, 0x29, 0x20, 0x2a, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x20, 0x2a, // )) * (tmpvar_5 * + 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x7d, // tmpvar_2));. } + 0x20, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, // else {. if ( + 0x28, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x77, 0x20, 0x3d, 0x3d, 0x20, 0x31, // (u_params.w == 1 + 0x2e, 0x30, 0x29, 0x29, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x76, 0x65, 0x63, // .0)) {. vec + 0x34, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x39, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // 4 color_9;. + 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x30, 0x3b, // vec3 tmpvar_10; + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x30, // . tmpvar_10 + 0x2e, 0x7a, 0x20, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // .z = 1.0;. + 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x30, 0x2e, 0x78, 0x79, 0x20, 0x3d, 0x20, 0x76, // tmpvar_10.xy = v + 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // _position;. + 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x31, 0x3b, // vec4 tmpvar_11; + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x31, // . tmpvar_11 + 0x20, 0x3d, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x20, 0x28, 0x73, 0x5f, 0x74, 0x65, // = texture (s_te + 0x78, 0x2c, 0x20, 0x28, 0x28, 0x75, 0x5f, 0x70, 0x61, 0x69, 0x6e, 0x74, 0x4d, 0x61, 0x74, 0x20, // x, ((u_paintMat + 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x30, 0x29, 0x2e, 0x78, 0x79, 0x20, // * tmpvar_10).xy + 0x2f, 0x20, 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, // / u_extentRadius + 0x2e, 0x78, 0x79, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, // .xy));. col + 0x6f, 0x72, 0x5f, 0x39, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x31, // or_9 = tmpvar_11 + 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x28, 0x75, 0x5f, 0x70, // ;. if ((u_p + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x7a, 0x20, 0x3d, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x29, // arams.z == 1.0)) + 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, // {. vec4 + 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // tmpvar_12;. + 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x32, 0x2e, 0x78, 0x79, 0x7a, // tmpvar_12.xyz + 0x20, 0x3d, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x31, 0x2e, 0x78, 0x79, // = (tmpvar_11.xy + 0x7a, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x31, 0x2e, 0x77, 0x29, // z * tmpvar_11.w) + 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // ;. tmpvar + 0x5f, 0x31, 0x32, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, // _12.w = tmpvar_1 + 0x31, 0x2e, 0x77, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, // 1.w;. col + 0x6f, 0x72, 0x5f, 0x39, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x32, // or_9 = tmpvar_12 + 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // ;. };. + 0x20, 0x69, 0x66, 0x20, 0x28, 0x28, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x7a, // if ((u_params.z + 0x20, 0x3d, 0x3d, 0x20, 0x32, 0x2e, 0x30, 0x29, 0x29, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, // == 2.0)) {. + 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x39, 0x20, 0x3d, 0x20, 0x63, 0x6f, // color_9 = co + 0x6c, 0x6f, 0x72, 0x5f, 0x39, 0x2e, 0x78, 0x78, 0x78, 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // lor_9.xxxx;. + 0x20, 0x20, 0x7d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, // };. color + 0x5f, 0x39, 0x20, 0x3d, 0x20, 0x28, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x39, 0x20, 0x2a, 0x20, // _9 = (color_9 * + 0x75, 0x5f, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, // u_innerCol);. + 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x39, 0x20, 0x3d, 0x20, 0x28, 0x63, 0x6f, // color_9 = (co + 0x6c, 0x6f, 0x72, 0x5f, 0x39, 0x20, 0x2a, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // lor_9 * (tmpvar_ + 0x35, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x29, 0x29, 0x3b, 0x0a, // 5 * tmpvar_2));. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x31, 0x20, 0x3d, // result_1 = + 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x39, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x20, // color_9;. } + 0x65, 0x6c, 0x73, 0x65, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, // else {. if + 0x28, 0x28, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x77, 0x20, 0x3d, 0x3d, 0x20, // ((u_params.w == 0x32, 0x2e, 0x30, 0x29, 0x29, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 2.0)) {. - 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x39, 0x20, 0x3d, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, // color_9 = color_ - 0x39, 0x2e, 0x78, 0x78, 0x78, 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x3b, // 9.xxxx;. }; - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x39, 0x20, 0x3d, // . color_9 = - 0x20, 0x28, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x39, 0x20, 0x2a, 0x20, 0x75, 0x5f, 0x69, 0x6e, // (color_9 * u_in - 0x6e, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x63, // nerCol);. c - 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x39, 0x20, 0x3d, 0x20, 0x28, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, // olor_9 = (color_ - 0x39, 0x20, 0x2a, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x35, 0x20, 0x2a, 0x20, // 9 * (tmpvar_5 * - 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // tmpvar_2));. - 0x20, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x31, 0x20, 0x3d, 0x20, 0x63, 0x6f, 0x6c, // result_1 = col - 0x6f, 0x72, 0x5f, 0x39, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x20, 0x65, 0x6c, 0x73, 0x65, // or_9;. } else - 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x28, 0x75, 0x5f, // {. if ((u_ - 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x77, 0x20, 0x3d, 0x3d, 0x20, 0x32, 0x2e, 0x30, 0x29, // params.w == 2.0) - 0x29, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x73, 0x75, // ) {. resu - 0x6c, 0x74, 0x5f, 0x31, 0x20, 0x3d, 0x20, 0x76, 0x65, 0x63, 0x34, 0x28, 0x31, 0x2e, 0x30, 0x2c, // lt_1 = vec4(1.0, - 0x20, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, // 1.0, 1.0, 1.0); - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x7b, 0x0a, // . } else {. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x28, 0x75, 0x5f, 0x70, // if ((u_p - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x77, 0x20, 0x3d, 0x3d, 0x20, 0x33, 0x2e, 0x30, 0x29, 0x29, // arams.w == 3.0)) - 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x76, 0x65, 0x63, // {. vec - 0x34, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x31, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // 4 color_13;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // vec4 tmpva - 0x72, 0x5f, 0x31, 0x34, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // r_14;. - 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x34, 0x20, 0x3d, 0x20, 0x74, 0x65, 0x78, 0x74, // tmpvar_14 = text - 0x75, 0x72, 0x65, 0x20, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x2c, 0x20, 0x76, 0x5f, 0x74, 0x65, // ure (s_tex, v_te - 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // xcoord0);. - 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x31, 0x33, 0x20, 0x3d, 0x20, 0x74, // color_13 = t + 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x31, 0x20, 0x3d, 0x20, 0x76, 0x65, 0x63, 0x34, 0x28, // result_1 = vec4( + 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x31, // 1.0, 1.0, 1.0, 1 + 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x20, 0x65, 0x6c, 0x73, // .0);. } els + 0x65, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, // e {. if ( + 0x28, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x77, 0x20, 0x3d, 0x3d, 0x20, 0x33, // (u_params.w == 3 + 0x2e, 0x30, 0x29, 0x29, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // .0)) {. + 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x31, 0x33, 0x3b, 0x0a, // vec4 color_13;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, // vec4 t 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x34, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // mpvar_14;. + 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x34, 0x20, 0x3d, 0x20, // tmpvar_14 = + 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x20, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x2c, 0x20, // texture (s_tex, + 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, // v_texcoord0);. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x31, 0x33, // color_13 + 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x34, 0x3b, 0x0a, 0x20, 0x20, // = tmpvar_14;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x28, 0x75, 0x5f, 0x70, // if ((u_p + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x7a, 0x20, 0x3d, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x29, // arams.z == 1.0)) + 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x76, // {. v + 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x35, 0x3b, 0x0a, 0x20, // ec4 tmpvar_15;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // tmpva + 0x72, 0x5f, 0x31, 0x35, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, // r_15.xyz = (tmpv + 0x61, 0x72, 0x5f, 0x31, 0x34, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, // ar_14.xyz * tmpv + 0x61, 0x72, 0x5f, 0x31, 0x34, 0x2e, 0x77, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // ar_14.w);. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x35, 0x2e, // tmpvar_15. + 0x77, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x34, 0x2e, 0x77, 0x3b, // w = tmpvar_14.w; + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, // . col + 0x6f, 0x72, 0x5f, 0x31, 0x33, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, // or_13 = tmpvar_1 + 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x3b, 0x0a, // 5;. };. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x28, 0x75, // if ((u + 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x7a, 0x20, 0x3d, 0x3d, 0x20, 0x32, 0x2e, 0x30, // _params.z == 2.0 + 0x29, 0x29, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // )) {. + 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x36, // float tmpvar_16 + 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, // ;. tm + 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x36, 0x20, 0x3d, 0x20, 0x28, 0x63, 0x6c, 0x61, 0x6d, 0x70, // pvar_16 = (clamp + 0x20, 0x28, 0x28, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // ((. + 0x20, 0x20, 0x28, 0x28, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x31, 0x33, 0x2e, 0x78, 0x20, 0x2d, // ((color_13.x - + 0x20, 0x75, 0x5f, 0x73, 0x64, 0x66, 0x2e, 0x78, 0x29, 0x20, 0x2f, 0x20, 0x75, 0x5f, 0x73, 0x64, // u_sdf.x) / u_sd + 0x66, 0x2e, 0x7a, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // f.z). + 0x20, 0x20, 0x2b, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, // + 0.5), 0.0, 1 + 0x2e, 0x30, 0x29, 0x20, 0x2a, 0x20, 0x28, 0x31, 0x2e, 0x30, 0x20, 0x2d, 0x20, 0x63, 0x6c, 0x61, // .0) * (1.0 - cla + 0x6d, 0x70, 0x20, 0x28, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // mp (. + 0x20, 0x20, 0x20, 0x28, 0x28, 0x28, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x31, 0x33, 0x2e, 0x78, // (((color_13.x + 0x20, 0x2d, 0x20, 0x75, 0x5f, 0x73, 0x64, 0x66, 0x2e, 0x79, 0x29, 0x20, 0x2f, 0x20, 0x75, 0x5f, // - u_sdf.y) / u_ + 0x73, 0x64, 0x66, 0x2e, 0x7a, 0x29, 0x20, 0x2b, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x0a, 0x20, 0x20, // sdf.z) + 0.5). + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x2c, // , 0.0, + 0x20, 0x31, 0x2e, 0x30, 0x29, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 1.0)));. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // vec4 tmpvar + 0x5f, 0x31, 0x37, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // _17;. + 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x37, 0x2e, 0x78, 0x20, 0x3d, 0x20, 0x74, // tmpvar_17.x = t + 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // mpvar_16;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x37, 0x2e, // tmpvar_17. + 0x79, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x36, 0x3b, 0x0a, 0x20, // y = tmpvar_16;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // tmpva + 0x72, 0x5f, 0x31, 0x37, 0x2e, 0x7a, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // r_17.z = tmpvar_ + 0x31, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 16;. + 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x37, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x74, 0x6d, // tmpvar_17.w = tm + 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // pvar_16;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x31, 0x33, 0x20, 0x3d, 0x20, // color_13 = + 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x37, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // tmpvar_17;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // };. + 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x31, 0x33, 0x20, 0x3d, 0x20, 0x28, 0x63, 0x6f, // color_13 = (co + 0x6c, 0x6f, 0x72, 0x5f, 0x31, 0x33, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // lor_13 * tmpvar_ + 0x32, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, // 2);. re + 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x31, 0x20, 0x3d, 0x20, 0x28, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, // sult_1 = (color_ + 0x31, 0x33, 0x20, 0x2a, 0x20, 0x75, 0x5f, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x29, // 13 * u_innerCol) + 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x20, 0x65, 0x6c, 0x73, 0x65, // ;. } else + 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, // {. if + 0x28, 0x28, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x77, 0x20, 0x3d, 0x3d, 0x20, // ((u_params.w == + 0x34, 0x2e, 0x30, 0x29, 0x29, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 4.0)) {. + 0x20, 0x20, 0x20, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x31, // vec4 color_1 + 0x38, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x76, // 8;. v + 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x39, 0x3b, 0x0a, 0x20, // ec4 tmpvar_19;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // tmpva + 0x72, 0x5f, 0x31, 0x39, 0x20, 0x3d, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x20, 0x28, // r_19 = texture ( + 0x73, 0x5f, 0x74, 0x65, 0x78, 0x2c, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, // s_tex, v_texcoor + 0x64, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // d0);. + 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x31, 0x38, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, // color_18 = tmpv + 0x61, 0x72, 0x5f, 0x31, 0x39, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // ar_19;. + 0x20, 0x20, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, // vec4 tmpvar_2 + 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, // 0;. t + 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x30, 0x20, 0x3d, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, // mpvar_20 = textu + 0x72, 0x65, 0x20, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x32, 0x2c, 0x20, 0x76, 0x5f, 0x74, 0x65, // re (s_tex2, v_te + 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x31, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // xcoord1);. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x28, 0x75, 0x5f, 0x70, 0x61, 0x72, // if ((u_par + 0x61, 0x6d, 0x73, 0x2e, 0x7a, 0x20, 0x3d, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x29, 0x20, 0x7b, // ams.z == 1.0)) { + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x76, // . v + 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x31, 0x3b, 0x0a, 0x20, // ec4 tmpvar_21;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, // tmp + 0x76, 0x61, 0x72, 0x5f, 0x32, 0x31, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x28, 0x74, 0x6d, // var_21.xyz = (tm + 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x39, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x2a, 0x20, 0x74, 0x6d, // pvar_19.xyz * tm + 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x39, 0x2e, 0x77, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // pvar_19.w);. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // tmpvar + 0x5f, 0x32, 0x31, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, // _21.w = tmpvar_1 + 0x39, 0x2e, 0x77, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 9.w;. + 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x31, 0x38, 0x20, 0x3d, 0x20, 0x74, 0x6d, // color_18 = tm + 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // pvar_21;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // };. 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x28, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, // if ((u_param - 0x73, 0x2e, 0x7a, 0x20, 0x3d, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x29, 0x20, 0x7b, 0x0a, 0x20, // s.z == 1.0)) {. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, // vec4 - 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // tmpvar_15;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x35, // tmpvar_15 - 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, // .xyz = (tmpvar_1 - 0x34, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, // 4.xyz * tmpvar_1 - 0x34, 0x2e, 0x77, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 4.w);. - 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x35, 0x2e, 0x77, 0x20, 0x3d, 0x20, // tmpvar_15.w = - 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x34, 0x2e, 0x77, 0x3b, 0x0a, 0x20, 0x20, 0x20, // tmpvar_14.w;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x31, // color_1 - 0x33, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x35, 0x3b, 0x0a, 0x20, // 3 = tmpvar_15;. + 0x73, 0x2e, 0x7a, 0x20, 0x3d, 0x3d, 0x20, 0x32, 0x2e, 0x30, 0x29, 0x29, 0x20, 0x7b, 0x0a, 0x20, // s.z == 2.0)) {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, // flo + 0x61, 0x74, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x32, 0x3b, 0x0a, 0x20, 0x20, // at tmpvar_22;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, // tmpv + 0x61, 0x72, 0x5f, 0x32, 0x32, 0x20, 0x3d, 0x20, 0x28, 0x63, 0x6c, 0x61, 0x6d, 0x70, 0x20, 0x28, // ar_22 = (clamp ( + 0x28, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // (. + 0x20, 0x20, 0x28, 0x28, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x31, 0x38, 0x2e, 0x78, 0x20, 0x2d, // ((color_18.x - + 0x20, 0x75, 0x5f, 0x73, 0x64, 0x66, 0x2e, 0x78, 0x29, 0x20, 0x2f, 0x20, 0x75, 0x5f, 0x73, 0x64, // u_sdf.x) / u_sd + 0x66, 0x2e, 0x7a, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // f.z). + 0x20, 0x20, 0x20, 0x20, 0x2b, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x2c, // + 0.5), 0.0, + 0x20, 0x31, 0x2e, 0x30, 0x29, 0x20, 0x2a, 0x20, 0x28, 0x31, 0x2e, 0x30, 0x20, 0x2d, 0x20, 0x63, // 1.0) * (1.0 - c + 0x6c, 0x61, 0x6d, 0x70, 0x20, 0x28, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // lamp (. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x28, 0x28, 0x28, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, // (((color_ + 0x31, 0x38, 0x2e, 0x78, 0x20, 0x2d, 0x20, 0x75, 0x5f, 0x73, 0x64, 0x66, 0x2e, 0x79, 0x29, 0x20, // 18.x - u_sdf.y) + 0x2f, 0x20, 0x75, 0x5f, 0x73, 0x64, 0x66, 0x2e, 0x7a, 0x29, 0x20, 0x2b, 0x20, 0x30, 0x2e, 0x35, // / u_sdf.z) + 0.5 + 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // ). + 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x29, 0x29, 0x3b, 0x0a, 0x20, // , 0.0, 1.0)));. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x76, 0x65, 0x63, // vec + 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x20, // 4 tmpvar_23;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // tmpva + 0x72, 0x5f, 0x32, 0x33, 0x2e, 0x78, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // r_23.x = tmpvar_ + 0x32, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 22;. + 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x33, 0x2e, 0x79, 0x20, 0x3d, 0x20, // tmpvar_23.y = + 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // tmpvar_22;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // tmpvar_ + 0x32, 0x33, 0x2e, 0x7a, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x32, // 23.z = tmpvar_22 + 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // ;. + 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x33, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x74, 0x6d, // tmpvar_23.w = tm + 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // pvar_22;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x31, 0x38, 0x20, // color_18 + 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x20, // = tmpvar_23;. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // };. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x28, 0x75, 0x5f, 0x70, 0x61, 0x72, // if ((u_par - 0x61, 0x6d, 0x73, 0x2e, 0x7a, 0x20, 0x3d, 0x3d, 0x20, 0x32, 0x2e, 0x30, 0x29, 0x29, 0x20, 0x7b, // ams.z == 2.0)) { - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, // . col - 0x6f, 0x72, 0x5f, 0x31, 0x33, 0x20, 0x3d, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x31, 0x33, // or_13 = color_13 - 0x2e, 0x78, 0x78, 0x78, 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // .xxxx;. - 0x20, 0x7d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, // };. co - 0x6c, 0x6f, 0x72, 0x5f, 0x31, 0x33, 0x20, 0x3d, 0x20, 0x28, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, // lor_13 = (color_ - 0x31, 0x33, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x29, 0x3b, 0x0a, // 13 * tmpvar_2);. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, // result - 0x5f, 0x31, 0x20, 0x3d, 0x20, 0x28, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x31, 0x33, 0x20, 0x2a, // _1 = (color_13 * - 0x20, 0x75, 0x5f, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x29, 0x3b, 0x0a, 0x20, 0x20, // u_innerCol);. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, // };. } - 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x3b, 0x0a, 0x20, 0x20, 0x7d, 0x3b, 0x0a, 0x20, 0x20, // ;. };. };. - 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x72, // gl_FragColor = r - 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x31, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // esult_1;.}... + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x31, 0x38, // color_18 + 0x20, 0x3d, 0x20, 0x28, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x31, 0x38, 0x20, 0x2a, 0x20, 0x74, // = (color_18 * t + 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // mpvar_2);. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x31, 0x38, 0x20, 0x3d, // color_18 = + 0x20, 0x28, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x31, 0x38, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, // (color_18 * tmp + 0x76, 0x61, 0x72, 0x5f, 0x32, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // var_20);. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x31, 0x20, 0x3d, 0x20, // result_1 = + 0x28, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x31, 0x38, 0x20, 0x2a, 0x20, 0x75, 0x5f, 0x69, 0x6e, // (color_18 * u_in + 0x6e, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // nerCol);. + 0x20, 0x20, 0x20, 0x7d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x3b, // };. }; + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x3b, // . };. }; + 0x0a, 0x20, 0x20, 0x7d, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, // . };. gl_FragC + 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x31, 0x3b, // olor = result_1; + 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // .}... }; diff --git a/Polyfills/Canvas/Source/Shaders/glsl/vs_fspass.h b/Polyfills/Canvas/Source/Shaders/glsl/vs_fspass.h new file mode 100644 index 000000000..de5b90fdb --- /dev/null +++ b/Polyfills/Canvas/Source/Shaders/glsl/vs_fspass.h @@ -0,0 +1,30 @@ +static const uint8_t vs_fspass_glsl[429] = +{ + 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0xcf, 0xda, 0x1b, 0x94, 0x00, 0x00, 0x9a, 0x01, // VSH............. + 0x00, 0x00, 0x69, 0x6e, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, // ..in vec2 a_posi + 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x6f, 0x75, 0x74, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x76, // tion;.out vec2 v + 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x6f, 0x75, 0x74, 0x20, 0x76, // _position;.out v + 0x65, 0x63, 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, // ec2 v_texcoord0; + 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, // .void main ().{. + 0x20, 0x20, 0x76, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x61, // v_position = a + 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x65, 0x63, // _position;. vec + 0x32, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, // 2 tmpvar_1;. tm + 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x20, 0x3d, 0x20, 0x28, 0x28, 0x61, 0x5f, 0x70, 0x6f, 0x73, // pvar_1 = ((a_pos + 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x2a, 0x20, 0x33, 0x2e, 0x30, 0x29, 0x20, 0x2d, 0x20, 0x76, // ition * 3.0) - v + 0x65, 0x63, 0x32, 0x28, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x29, 0x3b, 0x0a, // ec2(0.0, 1.0));. + 0x20, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x3b, // vec2 tmpvar_2; + 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x78, 0x20, 0x3d, 0x20, // . tmpvar_2.x = + 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, // tmpvar_1.x;. tm + 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x79, 0x20, 0x3d, 0x20, 0x28, 0x31, 0x2e, 0x30, 0x20, // pvar_2.y = (1.0 + 0x2d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x79, 0x29, 0x3b, 0x0a, 0x20, // - tmpvar_1.y);. + 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x3d, 0x20, 0x28, // v_texcoord0 = ( + 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x20, 0x2a, 0x20, 0x30, 0x2e, 0x35, 0x29, // (tmpvar_2 * 0.5) + 0x20, 0x2b, 0x20, 0x76, 0x65, 0x63, 0x32, 0x28, 0x30, 0x2e, 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x30, // + vec2(0.5, 0.0 + 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // ));. vec4 tmpva + 0x72, 0x5f, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x2e, // r_3;. tmpvar_3. + 0x7a, 0x77, 0x20, 0x3d, 0x20, 0x76, 0x65, 0x63, 0x32, 0x28, 0x30, 0x2e, 0x35, 0x2c, 0x20, 0x31, // zw = vec2(0.5, 1 + 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x2e, // .0);. tmpvar_3. + 0x78, 0x79, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, // xy = tmpvar_1;. + 0x20, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x74, // gl_Position = t + 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // mpvar_3;.}... +}; diff --git a/Polyfills/Canvas/Source/Shaders/glsl/vs_nanovg_fill.h b/Polyfills/Canvas/Source/Shaders/glsl/vs_nanovg_fill.h index f4b10b5f7..59b90bccd 100644 --- a/Polyfills/Canvas/Source/Shaders/glsl/vs_nanovg_fill.h +++ b/Polyfills/Canvas/Source/Shaders/glsl/vs_nanovg_fill.h @@ -1,34 +1,54 @@ -static const uint8_t vs_nanovg_fill_glsl[489] = +static const uint8_t vs_nanovg_fill_glsl[811] = { - 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0xcf, 0xda, 0x1b, 0x94, 0x02, 0x00, 0x0a, 0x75, // VSH............u + 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x98, 0xde, 0xee, 0x03, 0x00, 0x0a, 0x75, // VSH............u 0x5f, 0x76, 0x69, 0x65, 0x77, 0x53, 0x69, 0x7a, 0x65, 0x02, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, // _viewSize....... - 0x00, 0x00, 0x00, 0x0b, 0x75, 0x5f, 0x68, 0x61, 0x6c, 0x66, 0x54, 0x65, 0x78, 0x65, 0x6c, 0x02, // ....u_halfTexel. - 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xab, 0x01, 0x00, 0x00, 0x69, 0x6e, 0x20, // .............in - 0x76, 0x65, 0x63, 0x32, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, // vec2 a_position; - 0x0a, 0x69, 0x6e, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, // .in vec2 a_texco - 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x6f, 0x75, 0x74, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x76, // ord0;.out vec2 v - 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x6f, 0x75, 0x74, 0x20, 0x76, // _position;.out v - 0x65, 0x63, 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, // ec2 v_texcoord0; - 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x75, 0x5f, // .uniform vec4 u_ - 0x76, 0x69, 0x65, 0x77, 0x53, 0x69, 0x7a, 0x65, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, // viewSize;.unifor - 0x6d, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x75, 0x5f, 0x68, 0x61, 0x6c, 0x66, 0x54, 0x65, 0x78, // m vec4 u_halfTex - 0x65, 0x6c, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, // el;.void main () - 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, // .{. v_position - 0x3d, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, // = a_position;. - 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x3d, 0x20, 0x28, 0x61, // v_texcoord0 = (a - 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x2b, 0x20, 0x75, 0x5f, 0x68, // _texcoord0 + u_h - 0x61, 0x6c, 0x66, 0x54, 0x65, 0x78, 0x65, 0x6c, 0x2e, 0x78, 0x79, 0x29, 0x3b, 0x0a, 0x20, 0x20, // alfTexel.xy);. - 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, // vec4 tmpvar_1;. - 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x7a, 0x77, 0x20, 0x3d, 0x20, 0x76, // tmpvar_1.zw = v - 0x65, 0x63, 0x32, 0x28, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, // ec2(0.0, 1.0);. - 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x20, 0x3d, 0x20, 0x28, 0x28, // tmpvar_1.x = (( - 0x28, 0x32, 0x2e, 0x30, 0x20, 0x2a, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, // (2.0 * a_positio - 0x6e, 0x2e, 0x78, 0x29, 0x20, 0x2f, 0x20, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x53, 0x69, 0x7a, // n.x) / u_viewSiz - 0x65, 0x2e, 0x78, 0x29, 0x20, 0x2d, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x74, // e.x) - 1.0);. t - 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x79, 0x20, 0x3d, 0x20, 0x28, 0x31, 0x2e, 0x30, // mpvar_1.y = (1.0 - 0x20, 0x2d, 0x20, 0x28, 0x28, 0x32, 0x2e, 0x30, 0x20, 0x2a, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, // - ((2.0 * a_pos - 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x79, 0x29, 0x20, 0x2f, 0x20, 0x75, 0x5f, 0x76, 0x69, 0x65, // ition.y) / u_vie - 0x77, 0x53, 0x69, 0x7a, 0x65, 0x2e, 0x79, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, // wSize.y));. gl_ - 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // Position = tmpva - 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // r_1;.}... + 0x00, 0x00, 0x00, 0x0e, 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x64, 0x69, // ....u_extentRadi + 0x75, 0x73, 0x02, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x75, 0x5f, 0x68, // us...........u_h + 0x61, 0x6c, 0x66, 0x54, 0x65, 0x78, 0x65, 0x6c, 0x02, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // alfTexel........ + 0x00, 0x00, 0xd4, 0x02, 0x00, 0x00, 0x69, 0x6e, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x61, 0x5f, // ......in vec2 a_ + 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x69, 0x6e, 0x20, 0x76, 0x65, 0x63, // position;.in vec + 0x32, 0x20, 0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x6f, // 2 a_texcoord0;.o + 0x75, 0x74, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x76, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, // ut vec2 v_positi + 0x6f, 0x6e, 0x3b, 0x0a, 0x6f, 0x75, 0x74, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x76, 0x5f, 0x74, // on;.out vec2 v_t + 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x6f, 0x75, 0x74, 0x20, 0x76, 0x65, // excoord0;.out ve + 0x63, 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x31, 0x3b, 0x0a, // c2 v_texcoord1;. + 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x75, 0x5f, 0x76, // uniform vec4 u_v + 0x69, 0x65, 0x77, 0x53, 0x69, 0x7a, 0x65, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, // iewSize;.uniform + 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x61, // vec4 u_extentRa + 0x64, 0x69, 0x75, 0x73, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x76, 0x65, // dius;.uniform ve + 0x63, 0x34, 0x20, 0x75, 0x5f, 0x68, 0x61, 0x6c, 0x66, 0x54, 0x65, 0x78, 0x65, 0x6c, 0x3b, 0x0a, // c4 u_halfTexel;. + 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, // void main ().{. + 0x20, 0x76, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x61, 0x5f, // v_position = a_ + 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x74, 0x65, // position;. v_te + 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x3d, 0x20, 0x28, 0x61, 0x5f, 0x74, 0x65, 0x78, // xcoord0 = (a_tex + 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x2b, 0x20, 0x75, 0x5f, 0x68, 0x61, 0x6c, 0x66, 0x54, // coord0 + u_halfT + 0x65, 0x78, 0x65, 0x6c, 0x2e, 0x78, 0x79, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x65, 0x63, 0x32, // exel.xy);. vec2 + 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, // tmpvar_1;. tmp + 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x79, 0x20, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x3b, 0x0a, 0x20, // var_1.y = 1.0;. + 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x20, 0x3d, 0x20, 0x28, 0x75, // tmpvar_1.x = (u + 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x2e, 0x78, 0x20, // _extentRadius.x + 0x2f, 0x20, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x53, 0x69, 0x7a, 0x65, 0x2e, 0x78, 0x29, 0x3b, // / u_viewSize.x); + 0x0a, 0x20, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, // . vec2 tmpvar_2 + 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x79, 0x20, 0x3d, // ;. tmpvar_2.y = + 0x20, 0x31, 0x2e, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, // 1.0;. tmpvar_2 + 0x2e, 0x78, 0x20, 0x3d, 0x20, 0x28, 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x61, // .x = (u_extentRa + 0x64, 0x69, 0x75, 0x73, 0x2e, 0x79, 0x20, 0x2f, 0x20, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x53, // dius.y / u_viewS + 0x69, 0x7a, 0x65, 0x2e, 0x78, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, // ize.x);. v_texc + 0x6f, 0x6f, 0x72, 0x64, 0x31, 0x20, 0x3d, 0x20, 0x28, 0x28, 0x28, 0x61, 0x5f, 0x70, 0x6f, 0x73, // oord1 = (((a_pos + 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x2f, 0x20, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x53, 0x69, // ition / u_viewSi + 0x7a, 0x65, 0x2e, 0x78, 0x79, 0x29, 0x20, 0x2d, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // ze.xy) - tmpvar_ + 0x31, 0x29, 0x20, 0x2f, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x29, 0x3b, 0x0a, // 1) / tmpvar_2);. + 0x20, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x3b, // vec4 tmpvar_3; + 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x2e, 0x7a, 0x77, 0x20, 0x3d, // . tmpvar_3.zw = + 0x20, 0x76, 0x65, 0x63, 0x32, 0x28, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, // vec2(0.0, 1.0); + 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x2e, 0x78, 0x20, 0x3d, 0x20, // . tmpvar_3.x = + 0x28, 0x28, 0x28, 0x32, 0x2e, 0x30, 0x20, 0x2a, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, // (((2.0 * a_posit + 0x69, 0x6f, 0x6e, 0x2e, 0x78, 0x29, 0x20, 0x2f, 0x20, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x53, // ion.x) / u_viewS + 0x69, 0x7a, 0x65, 0x2e, 0x78, 0x29, 0x20, 0x2d, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, // ize.x) - 1.0);. + 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x33, 0x2e, 0x79, 0x20, 0x3d, 0x20, 0x28, 0x31, // tmpvar_3.y = (1 + 0x2e, 0x30, 0x20, 0x2d, 0x20, 0x28, 0x28, 0x32, 0x2e, 0x30, 0x20, 0x2a, 0x20, 0x61, 0x5f, 0x70, // .0 - ((2.0 * a_p + 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x79, 0x29, 0x20, 0x2f, 0x20, 0x75, 0x5f, 0x76, // osition.y) / u_v + 0x69, 0x65, 0x77, 0x53, 0x69, 0x7a, 0x65, 0x2e, 0x79, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x67, // iewSize.y));. g + 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x74, 0x6d, 0x70, // l_Position = tmp + 0x76, 0x61, 0x72, 0x5f, 0x33, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // var_3;.}... }; diff --git a/Polyfills/Canvas/Source/Shaders/metal/fs_boxblur.h b/Polyfills/Canvas/Source/Shaders/metal/fs_boxblur.h new file mode 100644 index 000000000..e1de6ed64 --- /dev/null +++ b/Polyfills/Canvas/Source/Shaders/metal/fs_boxblur.h @@ -0,0 +1,96 @@ +static const uint8_t fs_boxblur_mtl[1487] = +{ + 0x46, 0x53, 0x48, 0x0b, 0xcf, 0xda, 0x1b, 0x94, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x0c, 0x73, // FSH............s + 0x5f, 0x74, 0x65, 0x78, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x11, 0x01, 0xff, 0xff, 0x01, // _texSampler..... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x54, 0x65, 0x78, 0x74, 0x75, // ......s_texTextu + 0x72, 0x65, 0x11, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x75, 0x5f, 0x77, // re...........u_w + 0x65, 0x69, 0x67, 0x68, 0x74, 0x73, 0x12, 0x01, 0x20, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // eights.. ....... + 0x0b, 0x75, 0x5f, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x01, 0x10, 0x00, // .u_direction.... + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x53, 0x69, 0x7a, // .......u_viewSiz + 0x65, 0x12, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x73, 0x5f, 0x74, 0x65, // e...........s_te + 0x78, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x05, 0x00, 0x00, 0x23, // x..........<...# + 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, 0x3c, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x5f, 0x73, // include .#include + 0x3c, 0x73, 0x69, 0x6d, 0x64, 0x2f, 0x73, 0x69, 0x6d, 0x64, 0x2e, 0x68, 0x3e, 0x0a, 0x0a, 0x75, // ..u + 0x73, 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x6d, // sing namespace m + 0x65, 0x74, 0x61, 0x6c, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x5f, 0x47, // etal;..struct _G + 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, // lobal.{. floa + 0x74, 0x34, 0x20, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x53, 0x69, 0x7a, 0x65, 0x3b, 0x0a, 0x20, // t4 u_viewSize;. + 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x64, 0x69, 0x72, 0x65, // float4 u_dire + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, // ction;. float + 0x34, 0x20, 0x75, 0x5f, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x73, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, // 4 u_weights;.};. + 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, // .struct xlatMtlM + 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, // ain_out.{. fl + 0x6f, 0x61, 0x74, 0x34, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, // oat4 bgfx_FragDa + 0x74, 0x61, 0x30, 0x20, 0x5b, 0x5b, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, // ta0 [[color(0)]] + 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, // ;.};..struct xla + 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x6e, 0x0a, 0x7b, 0x0a, 0x20, 0x20, // tMtlMain_in.{. + 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, // float2 v_texco + 0x6f, 0x72, 0x64, 0x30, 0x20, 0x5b, 0x5b, 0x75, 0x73, 0x65, 0x72, 0x28, 0x6c, 0x6f, 0x63, 0x6e, // ord0 [[user(locn + 0x31, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, // 1)]];.};..fragme + 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, // nt xlatMtlMain_o + 0x75, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x28, 0x78, // ut xlatMtlMain(x + 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x6e, 0x20, 0x69, 0x6e, // latMtlMain_in in + 0x20, 0x5b, 0x5b, 0x73, 0x74, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x5d, 0x5d, 0x2c, 0x20, 0x63, // [[stage_in]], c + 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, 0x5f, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x26, // onstant _Global& + 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x20, 0x5b, 0x5b, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, // _mtl_u [[buffer + 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x2c, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x32, 0x64, // (0)]], texture2d + 0x3c, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3e, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x20, 0x5b, 0x5b, // s_tex [[ + 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x2c, 0x20, 0x73, 0x61, // texture(0)]], sa + 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x53, 0x61, 0x6d, 0x70, 0x6c, // mpler s_texSampl + 0x65, 0x72, 0x20, 0x5b, 0x5b, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, // er [[sampler(0)] + 0x5d, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, // ]).{. xlatMtl + 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x20, 0x6f, 0x75, 0x74, 0x20, 0x3d, 0x20, 0x7b, // Main_out out = { + 0x7d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x33, // };. float4 _3 + 0x37, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x28, 0x61, 0x62, 0x73, // 73;. if ((abs + 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, // (_mtl_u.u_weight + 0x73, 0x2e, 0x7a, 0x29, 0x20, 0x3c, 0x20, 0x31, 0x2e, 0x32, 0x32, 0x39, 0x39, 0x39, 0x39, 0x39, // s.z) < 1.2299999 + 0x35, 0x32, 0x35, 0x35, 0x36, 0x36, 0x38, 0x31, 0x38, 0x31, 0x39, 0x32, 0x36, 0x30, 0x31, 0x32, // 5255668181926012 + 0x30, 0x33, 0x39, 0x31, 0x38, 0x34, 0x35, 0x37, 0x65, 0x2d, 0x30, 0x36, 0x29, 0x20, 0x26, 0x26, // 03918457e-06) && + 0x20, 0x28, 0x61, 0x62, 0x73, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x77, // (abs(_mtl_u.u_w + 0x65, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x77, 0x29, 0x20, 0x3c, 0x20, 0x31, 0x2e, 0x32, 0x32, // eights.w) < 1.22 + 0x39, 0x39, 0x39, 0x39, 0x39, 0x35, 0x32, 0x35, 0x35, 0x36, 0x36, 0x38, 0x31, 0x38, 0x31, 0x39, // 9999952556681819 + 0x32, 0x36, 0x30, 0x31, 0x32, 0x30, 0x33, 0x39, 0x31, 0x38, 0x34, 0x35, 0x37, 0x65, 0x2d, 0x30, // 2601203918457e-0 + 0x36, 0x29, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 6)). {. + 0x20, 0x20, 0x5f, 0x33, 0x37, 0x33, 0x20, 0x3d, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x2e, 0x73, // _373 = s_tex.s + 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x53, 0x61, 0x6d, 0x70, 0x6c, // ample(s_texSampl + 0x65, 0x72, 0x2c, 0x20, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, // er, in.v_texcoor + 0x64, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, // d0);. }. e + 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // lse. {. + 0x20, 0x20, 0x5f, 0x33, 0x37, 0x33, 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x28, // _373 = float4( + 0x30, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, // 0.0);. }. + 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x20, 0x5f, 0x32, 0x36, 0x39, 0x20, 0x3d, 0x20, 0x5f, 0x6d, // float2 _269 = _m + 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, // tl_u.u_direction + 0x2e, 0x78, 0x79, 0x20, 0x2b, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x28, 0x5f, 0x6d, 0x74, // .xy + float2(_mt + 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x73, 0x2e, 0x7a, 0x2c, // l_u.u_weights.z, + 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, // _mtl_u.u_weight + 0x73, 0x2e, 0x77, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, // s.w);. float2 + 0x20, 0x5f, 0x32, 0x37, 0x34, 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x28, 0x31, // _274 = float2(1 + 0x2e, 0x30, 0x29, 0x20, 0x2f, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x76, // .0) / _mtl_u.u_v + 0x69, 0x65, 0x77, 0x53, 0x69, 0x7a, 0x65, 0x2e, 0x78, 0x79, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // iewSize.xy;. + 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x33, 0x37, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x20, // float4 _372;. + 0x20, 0x5f, 0x33, 0x37, 0x32, 0x20, 0x3d, 0x20, 0x5f, 0x33, 0x37, 0x33, 0x3b, 0x0a, 0x20, 0x20, // _372 = _373;. + 0x20, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x28, 0x69, 0x6e, 0x74, 0x20, 0x5f, 0x33, 0x37, 0x31, 0x20, // for (int _371 + 0x3d, 0x20, 0x31, 0x3b, 0x20, 0x5f, 0x33, 0x37, 0x31, 0x20, 0x3c, 0x3d, 0x20, 0x69, 0x6e, 0x74, // = 1; _371 <= int + 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, // (_mtl_u.u_weight + 0x73, 0x2e, 0x79, 0x29, 0x3b, 0x20, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, // s.y); ). {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x20, 0x5f, 0x32, 0x38, // float2 _28 + 0x38, 0x20, 0x3d, 0x20, 0x28, 0x5f, 0x32, 0x36, 0x39, 0x20, 0x2a, 0x20, 0x5f, 0x32, 0x37, 0x34, // 8 = (_269 * _274 + 0x29, 0x20, 0x2a, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x28, 0x5f, 0x33, 0x37, 0x31, 0x29, 0x3b, // ) * float(_371); + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x33, 0x37, 0x32, 0x20, 0x3d, 0x20, // . _372 = + 0x28, 0x5f, 0x33, 0x37, 0x32, 0x20, 0x2b, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x2e, 0x73, 0x61, // (_372 + s_tex.sa + 0x6d, 0x70, 0x6c, 0x65, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, // mple(s_texSample + 0x72, 0x2c, 0x20, 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, // r, (in.v_texcoor + 0x64, 0x30, 0x20, 0x2b, 0x20, 0x5f, 0x32, 0x38, 0x38, 0x29, 0x29, 0x29, 0x20, 0x2b, 0x20, 0x73, // d0 + _288))) + s + 0x5f, 0x74, 0x65, 0x78, 0x2e, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x28, 0x73, 0x5f, 0x74, 0x65, // _tex.sample(s_te + 0x78, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x2c, 0x20, 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, // xSampler, (in.v_ + 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x2d, 0x20, 0x5f, 0x32, 0x38, 0x38, // texcoord0 - _288 + 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x33, 0x37, 0x31, // ));. _371 + 0x2b, 0x2b, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6e, 0x74, // ++;. cont + 0x69, 0x6e, 0x75, 0x65, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, // inue;. }. + 0x6f, 0x75, 0x74, 0x2e, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, // out.bgfx_FragDat + 0x61, 0x30, 0x20, 0x3d, 0x20, 0x5f, 0x33, 0x37, 0x32, 0x20, 0x2f, 0x20, 0x66, 0x6c, 0x6f, 0x61, // a0 = _372 / floa + 0x74, 0x34, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x77, 0x65, 0x69, 0x67, // t4(_mtl_u.u_weig + 0x68, 0x74, 0x73, 0x2e, 0x78, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, // hts.x);. retu + 0x72, 0x6e, 0x20, 0x6f, 0x75, 0x74, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, 0x00, 0x50, 0x00, // rn out;.}....P. +}; diff --git a/Polyfills/Canvas/Source/Shaders/metal/fs_gaussblur.h b/Polyfills/Canvas/Source/Shaders/metal/fs_gaussblur.h new file mode 100644 index 000000000..154618275 --- /dev/null +++ b/Polyfills/Canvas/Source/Shaders/metal/fs_gaussblur.h @@ -0,0 +1,94 @@ +static const uint8_t fs_gaussblur_mtl[1444] = +{ + 0x46, 0x53, 0x48, 0x0b, 0xcf, 0xda, 0x1b, 0x94, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x0c, 0x73, // FSH............s + 0x5f, 0x74, 0x65, 0x78, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x11, 0x01, 0xff, 0xff, 0x01, // _texSampler..... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x54, 0x65, 0x78, 0x74, 0x75, // ......s_texTextu + 0x72, 0x65, 0x11, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x75, 0x5f, 0x77, // re...........u_w + 0x65, 0x69, 0x67, 0x68, 0x74, 0x73, 0x12, 0x05, 0x20, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, // eights.. ....... + 0x0a, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x01, 0x00, 0x00, 0x01, // .u_viewSize..... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x75, 0x5f, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, // ......u_directio + 0x6e, 0x12, 0x01, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x73, 0x5f, 0x74, 0x65, // n...........s_te + 0x78, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x05, 0x00, 0x00, 0x23, // x..............# + 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, 0x3c, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x5f, 0x73, // include .#include + 0x3c, 0x73, 0x69, 0x6d, 0x64, 0x2f, 0x73, 0x69, 0x6d, 0x64, 0x2e, 0x68, 0x3e, 0x0a, 0x0a, 0x75, // ..u + 0x73, 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x6d, // sing namespace m + 0x65, 0x74, 0x61, 0x6c, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x5f, 0x47, // etal;..struct _G + 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, // lobal.{. floa + 0x74, 0x34, 0x20, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x53, 0x69, 0x7a, 0x65, 0x3b, 0x0a, 0x20, // t4 u_viewSize;. + 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x64, 0x69, 0x72, 0x65, // float4 u_dire + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, // ction;. float + 0x34, 0x20, 0x75, 0x5f, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x73, 0x5b, 0x35, 0x5d, 0x3b, 0x0a, // 4 u_weights[5];. + 0x7d, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, // };..struct xlatM + 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, // tlMain_out.{. + 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, // float4 bgfx_Fra + 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x20, 0x5b, 0x5b, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x28, 0x30, // gData0 [[color(0 + 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, // )]];.};..struct + 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x6e, 0x0a, 0x7b, // xlatMtlMain_in.{ + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, // . float2 v_te + 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x5b, 0x5b, 0x75, 0x73, 0x65, 0x72, 0x28, 0x6c, // xcoord0 [[user(l + 0x6f, 0x63, 0x6e, 0x31, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x66, 0x72, 0x61, // ocn1)]];.};..fra + 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, // gment xlatMtlMai + 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, // n_out xlatMtlMai + 0x6e, 0x28, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x6e, // n(xlatMtlMain_in + 0x20, 0x69, 0x6e, 0x20, 0x5b, 0x5b, 0x73, 0x74, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x5d, 0x5d, // in [[stage_in]] + 0x2c, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, 0x5f, 0x47, 0x6c, 0x6f, 0x62, // , constant _Glob + 0x61, 0x6c, 0x26, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x20, 0x5b, 0x5b, 0x62, 0x75, 0x66, // al& _mtl_u [[buf + 0x66, 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x2c, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, // fer(0)]], textur + 0x65, 0x32, 0x64, 0x3c, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3e, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, // e2d s_tex + 0x20, 0x5b, 0x5b, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x2c, // [[texture(0)]], + 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x53, 0x61, // sampler s_texSa + 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x20, 0x5b, 0x5b, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x28, // mpler [[sampler( + 0x30, 0x29, 0x5d, 0x5d, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x78, 0x6c, 0x61, 0x74, // 0)]]).{. xlat + 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x20, 0x6f, 0x75, 0x74, 0x20, // MtlMain_out out + 0x3d, 0x20, 0x7b, 0x7d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, // = {};. float2 + 0x20, 0x5f, 0x32, 0x37, 0x32, 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x28, 0x31, // _272 = float2(1 + 0x2e, 0x30, 0x29, 0x20, 0x2f, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x76, // .0) / _mtl_u.u_v + 0x69, 0x65, 0x77, 0x53, 0x69, 0x7a, 0x65, 0x2e, 0x78, 0x79, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // iewSize.xy;. + 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x34, 0x34, 0x39, 0x3b, 0x0a, 0x20, 0x20, 0x20, // float4 _449;. + 0x20, 0x5f, 0x34, 0x34, 0x39, 0x20, 0x3d, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x2e, 0x73, 0x61, // _449 = s_tex.sa + 0x6d, 0x70, 0x6c, 0x65, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, // mple(s_texSample + 0x72, 0x2c, 0x20, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, // r, in.v_texcoord + 0x30, 0x29, 0x20, 0x2a, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x77, 0x65, // 0) * _mtl_u.u_we + 0x69, 0x67, 0x68, 0x74, 0x73, 0x5b, 0x31, 0x5d, 0x5b, 0x69, 0x6e, 0x74, 0x28, 0x36, 0x2e, 0x30, // ights[1][int(6.0 + 0x20, 0x2d, 0x20, 0x28, 0x34, 0x2e, 0x30, 0x20, 0x2a, 0x20, 0x66, 0x6c, 0x6f, 0x6f, 0x72, 0x28, // - (4.0 * floor( + 0x31, 0x2e, 0x35, 0x29, 0x29, 0x29, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6f, 0x72, // 1.5)))];. for + 0x20, 0x28, 0x69, 0x6e, 0x74, 0x20, 0x5f, 0x34, 0x34, 0x38, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x20, // (int _448 = 1; + 0x5f, 0x34, 0x34, 0x38, 0x20, 0x3c, 0x3d, 0x20, 0x36, 0x3b, 0x20, 0x29, 0x0a, 0x20, 0x20, 0x20, // _448 <= 6; ). + 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, // {. float + 0x32, 0x20, 0x5f, 0x32, 0x38, 0x35, 0x20, 0x3d, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, // 2 _285 = (_mtl_u + 0x2e, 0x75, 0x5f, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x78, 0x79, 0x20, // .u_direction.xy + 0x2a, 0x20, 0x5f, 0x32, 0x37, 0x32, 0x29, 0x20, 0x2a, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x28, // * _272) * float( + 0x5f, 0x34, 0x34, 0x38, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, // _448);. i + 0x6e, 0x74, 0x20, 0x5f, 0x32, 0x39, 0x32, 0x20, 0x3d, 0x20, 0x36, 0x20, 0x2b, 0x20, 0x5f, 0x34, // nt _292 = 6 + _4 + 0x34, 0x38, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, // 48;. floa + 0x74, 0x20, 0x5f, 0x33, 0x37, 0x38, 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x28, 0x5f, // t _378 = float(_ + 0x32, 0x39, 0x32, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x6e, // 292);. in + 0x74, 0x20, 0x5f, 0x33, 0x30, 0x33, 0x20, 0x3d, 0x20, 0x36, 0x20, 0x2d, 0x20, 0x5f, 0x34, 0x34, // t _303 = 6 - _44 + 0x38, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, // 8;. float + 0x20, 0x5f, 0x34, 0x31, 0x33, 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x28, 0x5f, 0x33, // _413 = float(_3 + 0x30, 0x33, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x34, 0x34, // 03);. _44 + 0x39, 0x20, 0x3d, 0x20, 0x28, 0x5f, 0x34, 0x34, 0x39, 0x20, 0x2b, 0x20, 0x28, 0x73, 0x5f, 0x74, // 9 = (_449 + (s_t + 0x65, 0x78, 0x2e, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x53, // ex.sample(s_texS + 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x2c, 0x20, 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, // ampler, (in.v_te + 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x2b, 0x20, 0x5f, 0x32, 0x38, 0x35, 0x29, 0x29, // xcoord0 + _285)) + 0x20, 0x2a, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x77, 0x65, 0x69, 0x67, // * _mtl_u.u_weig + 0x68, 0x74, 0x73, 0x5b, 0x5f, 0x32, 0x39, 0x32, 0x20, 0x2f, 0x20, 0x34, 0x5d, 0x5b, 0x69, 0x6e, // hts[_292 / 4][in + 0x74, 0x28, 0x5f, 0x33, 0x37, 0x38, 0x20, 0x2d, 0x20, 0x28, 0x34, 0x2e, 0x30, 0x20, 0x2a, 0x20, // t(_378 - (4.0 * + 0x66, 0x6c, 0x6f, 0x6f, 0x72, 0x28, 0x5f, 0x33, 0x37, 0x38, 0x20, 0x2a, 0x20, 0x30, 0x2e, 0x32, // floor(_378 * 0.2 + 0x35, 0x29, 0x29, 0x29, 0x5d, 0x29, 0x29, 0x20, 0x2b, 0x20, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, // 5)))])) + (s_tex + 0x2e, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x53, 0x61, 0x6d, // .sample(s_texSam + 0x70, 0x6c, 0x65, 0x72, 0x2c, 0x20, 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, // pler, (in.v_texc + 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x2d, 0x20, 0x5f, 0x32, 0x38, 0x35, 0x29, 0x29, 0x20, 0x2a, // oord0 - _285)) * + 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, // _mtl_u.u_weight + 0x73, 0x5b, 0x5f, 0x33, 0x30, 0x33, 0x20, 0x2f, 0x20, 0x34, 0x5d, 0x5b, 0x69, 0x6e, 0x74, 0x28, // s[_303 / 4][int( + 0x5f, 0x34, 0x31, 0x33, 0x20, 0x2d, 0x20, 0x28, 0x34, 0x2e, 0x30, 0x20, 0x2a, 0x20, 0x66, 0x6c, // _413 - (4.0 * fl + 0x6f, 0x6f, 0x72, 0x28, 0x5f, 0x34, 0x31, 0x33, 0x20, 0x2a, 0x20, 0x30, 0x2e, 0x32, 0x35, 0x29, // oor(_413 * 0.25) + 0x29, 0x29, 0x5d, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x34, // ))]);. _4 + 0x34, 0x38, 0x2b, 0x2b, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, // 48++;. co + 0x6e, 0x74, 0x69, 0x6e, 0x75, 0x65, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, // ntinue;. }. + 0x20, 0x20, 0x6f, 0x75, 0x74, 0x2e, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, // out.bgfx_FragD + 0x61, 0x74, 0x61, 0x30, 0x20, 0x3d, 0x20, 0x5f, 0x34, 0x34, 0x39, 0x3b, 0x0a, 0x20, 0x20, 0x20, // ata0 = _449;. + 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6f, 0x75, 0x74, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, // return out;.}.. + 0x00, 0x00, 0x90, 0x00, // .... +}; diff --git a/Polyfills/Canvas/Source/Shaders/metal/fs_nanovg_fill.h b/Polyfills/Canvas/Source/Shaders/metal/fs_nanovg_fill.h index 68992443c..efb525417 100644 --- a/Polyfills/Canvas/Source/Shaders/metal/fs_nanovg_fill.h +++ b/Polyfills/Canvas/Source/Shaders/metal/fs_nanovg_fill.h @@ -1,238 +1,341 @@ -static const uint8_t fs_nanovg_fill_mtl[3752] = +static const uint8_t fs_nanovg_fill_mtl[5401] = { - 0x46, 0x53, 0x48, 0x0b, 0xcf, 0xda, 0x1b, 0x94, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x0c, 0x73, // FSH............s + 0x46, 0x53, 0x48, 0x0b, 0x1e, 0x98, 0xde, 0xee, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x0c, 0x73, // FSH............s 0x5f, 0x74, 0x65, 0x78, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x11, 0x01, 0xff, 0xff, 0x01, // _texSampler..... 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x54, 0x65, 0x78, 0x74, 0x75, // ......s_texTextu + 0x72, 0x65, 0x11, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x73, 0x5f, 0x74, // re...........s_t + 0x65, 0x78, 0x32, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x11, 0x01, 0xff, 0xff, 0x01, 0x00, // ex2Sampler...... + 0x00, 0x00, 0x00, 0x00, 0x0d, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x32, 0x54, 0x65, 0x78, 0x74, 0x75, // .....s_tex2Textu 0x72, 0x65, 0x11, 0x01, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x75, 0x5f, 0x73, // re...........u_s 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x4d, 0x61, 0x74, 0x13, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, // cissorMat....... 0x00, 0x00, 0x00, 0x11, 0x75, 0x5f, 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x45, 0x78, 0x74, // ....u_scissorExt 0x53, 0x63, 0x61, 0x6c, 0x65, 0x12, 0x01, 0x80, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, // Scale........... 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x01, 0xa0, 0x00, 0x01, 0x00, 0x00, 0x00, // u_params........ + 0x00, 0x00, 0x05, 0x75, 0x5f, 0x73, 0x64, 0x66, 0x12, 0x01, 0xb0, 0x00, 0x01, 0x00, 0x00, 0x00, // ...u_sdf........ 0x00, 0x00, 0x0a, 0x75, 0x5f, 0x70, 0x61, 0x69, 0x6e, 0x74, 0x4d, 0x61, 0x74, 0x13, 0x01, 0x30, // ...u_paintMat..0 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, // ........u_extent 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x12, 0x01, 0x90, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // Radius.......... 0x0a, 0x75, 0x5f, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x12, 0x01, 0x60, 0x00, 0x01, // .u_innerCol..`.. 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x75, 0x5f, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6c, // ......u_outerCol 0x12, 0x01, 0x70, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x73, 0x5f, 0x74, 0x65, 0x78, // ..p........s_tex - 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb6, 0x0d, 0x00, 0x00, 0x23, 0x69, // ..............#i - 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, 0x3c, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x74, // nclude .#include < - 0x73, 0x69, 0x6d, 0x64, 0x2f, 0x73, 0x69, 0x6d, 0x64, 0x2e, 0x68, 0x3e, 0x0a, 0x0a, 0x75, 0x73, // simd/simd.h>..us - 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x6d, 0x65, // ing namespace me - 0x74, 0x61, 0x6c, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x5f, 0x47, 0x6c, // tal;..struct _Gl - 0x6f, 0x62, 0x61, 0x6c, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, // obal.{. float - 0x33, 0x78, 0x33, 0x20, 0x75, 0x5f, 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x4d, 0x61, 0x74, // 3x3 u_scissorMat - 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x78, 0x33, 0x20, 0x75, // ;. float3x3 u - 0x5f, 0x70, 0x61, 0x69, 0x6e, 0x74, 0x4d, 0x61, 0x74, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, // _paintMat;. f - 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x43, 0x6f, 0x6c, // loat4 u_innerCol - 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x6f, // ;. float4 u_o - 0x75, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, // uterCol;. flo - 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x45, 0x78, 0x74, // at4 u_scissorExt - 0x53, 0x63, 0x61, 0x6c, 0x65, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, // Scale;. float - 0x34, 0x20, 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, // 4 u_extentRadius - 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x70, // ;. float4 u_p - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x73, 0x74, // arams;.};..const - 0x61, 0x6e, 0x74, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x36, 0x38, 0x36, 0x20, // ant float4 _686 - 0x3d, 0x20, 0x7b, 0x7d, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, // = {};..struct xl - 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x0a, 0x7b, 0x0a, // atMtlMain_out.{. - 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, // float4 bgfx_ - 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x20, 0x5b, 0x5b, 0x63, 0x6f, 0x6c, 0x6f, // FragData0 [[colo - 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, // r(0)]];.};..stru - 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x69, // ct xlatMtlMain_i - 0x6e, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x20, 0x76, // n.{. float2 v - 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x5b, 0x5b, 0x75, 0x73, 0x65, 0x72, // _position [[user - 0x28, 0x6c, 0x6f, 0x63, 0x6e, 0x30, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, // (locn0)]];. f - 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, // loat2 v_texcoord - 0x30, 0x20, 0x5b, 0x5b, 0x75, 0x73, 0x65, 0x72, 0x28, 0x6c, 0x6f, 0x63, 0x6e, 0x31, 0x29, 0x5d, // 0 [[user(locn1)] - 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, // ];.};..fragment - 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x20, // xlatMtlMain_out - 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x28, 0x78, 0x6c, 0x61, 0x74, // xlatMtlMain(xlat - 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x6e, 0x20, 0x69, 0x6e, 0x20, 0x5b, 0x5b, // MtlMain_in in [[ - 0x73, 0x74, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x5d, 0x5d, 0x2c, 0x20, 0x63, 0x6f, 0x6e, 0x73, // stage_in]], cons - 0x74, 0x61, 0x6e, 0x74, 0x20, 0x5f, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x26, 0x20, 0x5f, 0x6d, // tant _Global& _m - 0x74, 0x6c, 0x5f, 0x75, 0x20, 0x5b, 0x5b, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x28, 0x30, 0x29, // tl_u [[buffer(0) - 0x5d, 0x5d, 0x2c, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x32, 0x64, 0x3c, 0x66, 0x6c, // ]], texture2d s_tex [[tex - 0x74, 0x75, 0x72, 0x65, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x2c, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, // ture(0)]], sampl - 0x65, 0x72, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x20, // er s_texSampler - 0x5b, 0x5b, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x29, 0x0a, // [[sampler(0)]]). - 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, // {. xlatMtlMai - 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x20, 0x6f, 0x75, 0x74, 0x20, 0x3d, 0x20, 0x7b, 0x7d, 0x3b, 0x0a, // n_out out = {};. - 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x20, 0x5f, 0x35, 0x38, 0x37, 0x20, // float2 _587 - 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x28, 0x30, 0x2e, 0x35, 0x29, 0x20, 0x2d, 0x20, // = float2(0.5) - - 0x28, 0x28, 0x61, 0x62, 0x73, 0x28, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, // ((abs((_mtl_u.u_ - 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x4d, 0x61, 0x74, 0x20, 0x2a, 0x20, 0x66, 0x6c, 0x6f, // scissorMat * flo - 0x61, 0x74, 0x33, 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, // at3(in.v_positio - 0x6e, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x29, 0x2e, 0x78, 0x79, 0x29, 0x20, 0x2d, 0x20, 0x5f, // n, 1.0)).xy) - _ - 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x45, // mtl_u.u_scissorE - 0x78, 0x74, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x2e, 0x78, 0x79, 0x29, 0x20, 0x2a, 0x20, 0x5f, 0x6d, // xtScale.xy) * _m - 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x45, 0x78, // tl_u.u_scissorEx - 0x74, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x2e, 0x7a, 0x77, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // tScale.zw);. - 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x35, 0x39, 0x34, 0x20, 0x3d, 0x20, 0x66, 0x61, 0x73, // float _594 = fas - 0x74, 0x3a, 0x3a, 0x63, 0x6c, 0x61, 0x6d, 0x70, 0x28, 0x5f, 0x35, 0x38, 0x37, 0x2e, 0x78, 0x2c, // t::clamp(_587.x, - 0x20, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x20, 0x2a, 0x20, 0x66, 0x61, 0x73, // 0.0, 1.0) * fas - 0x74, 0x3a, 0x3a, 0x63, 0x6c, 0x61, 0x6d, 0x70, 0x28, 0x5f, 0x35, 0x38, 0x37, 0x2e, 0x79, 0x2c, // t::clamp(_587.y, - 0x20, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // 0.0, 1.0);. - 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, 0x36, 0x31, 0x30, 0x20, 0x3d, 0x20, 0x66, 0x61, 0x73, // float _610 = fas - 0x74, 0x3a, 0x3a, 0x6d, 0x69, 0x6e, 0x28, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x28, 0x31, 0x2e, 0x30, // t::min(1.0, (1.0 - 0x20, 0x2d, 0x20, 0x61, 0x62, 0x73, 0x28, 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, // - abs((in.v_tex - 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x78, 0x20, 0x2a, 0x20, 0x32, 0x2e, 0x30, 0x29, 0x20, // coord0.x * 2.0) - 0x2d, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, // - 1.0)) * _mtl_u - 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x79, 0x29, 0x20, 0x2a, 0x20, 0x66, // .u_params.y) * f - 0x61, 0x73, 0x74, 0x3a, 0x3a, 0x6d, 0x69, 0x6e, 0x28, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x69, 0x6e, // ast::min(1.0, in - 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x79, 0x29, 0x3b, // .v_texcoord0.y); - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x36, 0x38, 0x32, // . float4 _682 - 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, // ;. if (_mtl_u - 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x77, 0x20, 0x3d, 0x3d, 0x20, 0x30, // .u_params.w == 0 - 0x2e, 0x30, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // .0). {. - 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x20, 0x5f, 0x36, 0x32, 0x32, 0x20, 0x3d, 0x20, // float2 _622 = - 0x61, 0x62, 0x73, 0x28, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, // abs((_mtl_u.u_pa - 0x69, 0x6e, 0x74, 0x4d, 0x61, 0x74, 0x20, 0x2a, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, // intMat * float3( - 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x20, 0x31, // in.v_position, 1 - 0x2e, 0x30, 0x29, 0x29, 0x2e, 0x78, 0x79, 0x29, 0x20, 0x2d, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, // .0)).xy) - (_mtl - 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, // _u.u_extentRadiu - 0x73, 0x2e, 0x78, 0x79, 0x20, 0x2d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x28, 0x5f, 0x6d, // s.xy - float2(_m - 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x64, // tl_u.u_extentRad - 0x69, 0x75, 0x73, 0x2e, 0x7a, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // ius.z));. - 0x20, 0x5f, 0x36, 0x38, 0x32, 0x20, 0x3d, 0x20, 0x6d, 0x69, 0x78, 0x28, 0x5f, 0x6d, 0x74, 0x6c, // _682 = mix(_mtl - 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x2c, 0x20, 0x5f, // _u.u_innerCol, _ - 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6c, // mtl_u.u_outerCol - 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x28, 0x66, 0x61, 0x73, 0x74, 0x3a, 0x3a, 0x63, // , float4(fast::c - 0x6c, 0x61, 0x6d, 0x70, 0x28, 0x28, 0x28, 0x28, 0x66, 0x61, 0x73, 0x74, 0x3a, 0x3a, 0x6d, 0x69, // lamp((((fast::mi - 0x6e, 0x28, 0x66, 0x61, 0x73, 0x74, 0x3a, 0x3a, 0x6d, 0x61, 0x78, 0x28, 0x5f, 0x36, 0x32, 0x32, // n(fast::max(_622 - 0x2e, 0x78, 0x2c, 0x20, 0x5f, 0x36, 0x32, 0x32, 0x2e, 0x79, 0x29, 0x2c, 0x20, 0x30, 0x2e, 0x30, // .x, _622.y), 0.0 - 0x29, 0x20, 0x2b, 0x20, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x28, 0x66, 0x61, 0x73, 0x74, 0x3a, // ) + length(fast: - 0x3a, 0x6d, 0x61, 0x78, 0x28, 0x5f, 0x36, 0x32, 0x32, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, // :max(_622, float - 0x32, 0x28, 0x30, 0x2e, 0x30, 0x29, 0x29, 0x29, 0x29, 0x20, 0x2d, 0x20, 0x5f, 0x6d, 0x74, 0x6c, // 2(0.0)))) - _mtl - 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, // _u.u_extentRadiu - 0x73, 0x2e, 0x7a, 0x29, 0x20, 0x2b, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, // s.z) + (_mtl_u.u - 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x78, 0x20, 0x2a, 0x20, 0x30, 0x2e, 0x35, 0x29, // _params.x * 0.5) - 0x29, 0x20, 0x2f, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, // ) / _mtl_u.u_par - 0x61, 0x6d, 0x73, 0x2e, 0x78, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, // ams.x, 0.0, 1.0) - 0x29, 0x29, 0x20, 0x2a, 0x20, 0x28, 0x5f, 0x36, 0x31, 0x30, 0x20, 0x2a, 0x20, 0x5f, 0x35, 0x39, // )) * (_610 * _59 - 0x34, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, // 4);. }. el - 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // se. {. - 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x36, 0x38, 0x33, 0x3b, 0x0a, 0x20, 0x20, // float4 _683;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, // if (_mtl_u - 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x77, 0x20, 0x3d, 0x3d, 0x20, 0x31, // .u_params.w == 1 - 0x2e, 0x30, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, // .0). {. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, // float4 - 0x20, 0x5f, 0x36, 0x34, 0x39, 0x20, 0x3d, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x2e, 0x73, 0x61, // _649 = s_tex.sa - 0x6d, 0x70, 0x6c, 0x65, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, // mple(s_texSample - 0x72, 0x2c, 0x20, 0x28, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, // r, ((_mtl_u.u_pa - 0x69, 0x6e, 0x74, 0x4d, 0x61, 0x74, 0x20, 0x2a, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, // intMat * float3( - 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x20, 0x31, // in.v_position, 1 - 0x2e, 0x30, 0x29, 0x29, 0x2e, 0x78, 0x79, 0x20, 0x2f, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, // .0)).xy / _mtl_u - 0x2e, 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x2e, // .u_extentRadius. - 0x78, 0x79, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // xy));. - 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x36, 0x38, 0x30, 0x3b, 0x0a, 0x20, // float4 _680;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x5f, // if (_ - 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x7a, // mtl_u.u_params.z - 0x20, 0x3d, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // == 1.0). + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x73, 0x5f, 0x74, 0x65, 0x78, // ...........s_tex + 0x32, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0x13, 0x00, 0x00, 0x23, // 2..............# + 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, 0x3c, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x5f, 0x73, // include .#include + 0x3c, 0x73, 0x69, 0x6d, 0x64, 0x2f, 0x73, 0x69, 0x6d, 0x64, 0x2e, 0x68, 0x3e, 0x0a, 0x0a, 0x75, // ..u + 0x73, 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x6d, // sing namespace m + 0x65, 0x74, 0x61, 0x6c, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x5f, 0x47, // etal;..struct _G + 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, // lobal.{. floa + 0x74, 0x33, 0x78, 0x33, 0x20, 0x75, 0x5f, 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x4d, 0x61, // t3x3 u_scissorMa + 0x74, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x78, 0x33, 0x20, // t;. float3x3 + 0x75, 0x5f, 0x70, 0x61, 0x69, 0x6e, 0x74, 0x4d, 0x61, 0x74, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // u_paintMat;. + 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x43, 0x6f, // float4 u_innerCo + 0x6c, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, // l;. float4 u_ + 0x6f, 0x75, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, // outerCol;. fl + 0x6f, 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x45, 0x78, // oat4 u_scissorEx + 0x74, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, // tScale;. floa + 0x74, 0x34, 0x20, 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, // t4 u_extentRadiu + 0x73, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, // s;. float4 u_ + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, // params;. floa + 0x74, 0x34, 0x20, 0x75, 0x5f, 0x73, 0x64, 0x66, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x63, 0x6f, // t4 u_sdf;.};..co + 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x39, // nstant float4 _9 + 0x37, 0x32, 0x20, 0x3d, 0x20, 0x7b, 0x7d, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, // 72 = {};..struct + 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, // xlatMtlMain_out + 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x62, 0x67, // .{. float4 bg + 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x20, 0x5b, 0x5b, 0x63, // fx_FragData0 [[c + 0x6f, 0x6c, 0x6f, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x73, // olor(0)]];.};..s + 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, // truct xlatMtlMai + 0x6e, 0x5f, 0x69, 0x6e, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, // n_in.{. float + 0x32, 0x20, 0x76, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x5b, 0x5b, 0x75, // 2 v_position [[u + 0x73, 0x65, 0x72, 0x28, 0x6c, 0x6f, 0x63, 0x6e, 0x30, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, // ser(locn0)]];. + 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, // float2 v_texco + 0x6f, 0x72, 0x64, 0x30, 0x20, 0x5b, 0x5b, 0x75, 0x73, 0x65, 0x72, 0x28, 0x6c, 0x6f, 0x63, 0x6e, // ord0 [[user(locn + 0x31, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, // 1)]];. float2 + 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x31, 0x20, 0x5b, 0x5b, 0x75, // v_texcoord1 [[u + 0x73, 0x65, 0x72, 0x28, 0x6c, 0x6f, 0x63, 0x6e, 0x32, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, // ser(locn2)]];.}; + 0x0a, 0x0a, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, // ..fragment xlatM + 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, // tlMain_out xlatM + 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x28, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, // tlMain(xlatMtlMa + 0x69, 0x6e, 0x5f, 0x69, 0x6e, 0x20, 0x69, 0x6e, 0x20, 0x5b, 0x5b, 0x73, 0x74, 0x61, 0x67, 0x65, // in_in in [[stage + 0x5f, 0x69, 0x6e, 0x5d, 0x5d, 0x2c, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, // _in]], constant + 0x5f, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x26, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x20, // _Global& _mtl_u + 0x5b, 0x5b, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x2c, 0x20, 0x74, // [[buffer(0)]], t + 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x32, 0x64, 0x3c, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3e, 0x20, // exture2d + 0x73, 0x5f, 0x74, 0x65, 0x78, 0x20, 0x5b, 0x5b, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x28, // s_tex [[texture( + 0x30, 0x29, 0x5d, 0x5d, 0x2c, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x32, 0x64, 0x3c, // 0)]], texture2d< + 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3e, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x32, 0x20, 0x5b, 0x5b, // float> s_tex2 [[ + 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x28, 0x31, 0x29, 0x5d, 0x5d, 0x2c, 0x20, 0x73, 0x61, // texture(1)]], sa + 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x53, 0x61, 0x6d, 0x70, 0x6c, // mpler s_texSampl + 0x65, 0x72, 0x20, 0x5b, 0x5b, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, // er [[sampler(0)] + 0x5d, 0x2c, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, // ], sampler s_tex + 0x32, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x20, 0x5b, 0x5b, 0x73, 0x61, 0x6d, 0x70, 0x6c, // 2Sampler [[sampl + 0x65, 0x72, 0x28, 0x31, 0x29, 0x5d, 0x5d, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x78, // er(1)]]).{. x + 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x20, 0x6f, // latMtlMain_out o + 0x75, 0x74, 0x20, 0x3d, 0x20, 0x7b, 0x7d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, // ut = {};. flo + 0x61, 0x74, 0x32, 0x20, 0x5f, 0x37, 0x38, 0x36, 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, // at2 _786 = float + 0x32, 0x28, 0x30, 0x2e, 0x35, 0x29, 0x20, 0x2d, 0x20, 0x28, 0x28, 0x61, 0x62, 0x73, 0x28, 0x28, // 2(0.5) - ((abs(( + 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, // _mtl_u.u_scissor + 0x4d, 0x61, 0x74, 0x20, 0x2a, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x69, 0x6e, 0x2e, // Mat * float3(in. + 0x76, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, // v_position, 1.0) + 0x29, 0x2e, 0x78, 0x79, 0x29, 0x20, 0x2d, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, // ).xy) - _mtl_u.u + 0x5f, 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x53, 0x63, 0x61, 0x6c, 0x65, // _scissorExtScale + 0x2e, 0x78, 0x79, 0x29, 0x20, 0x2a, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, // .xy) * _mtl_u.u_ + 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x2e, // scissorExtScale. + 0x7a, 0x77, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, // zw);. float _ + 0x37, 0x39, 0x33, 0x20, 0x3d, 0x20, 0x66, 0x61, 0x73, 0x74, 0x3a, 0x3a, 0x63, 0x6c, 0x61, 0x6d, // 793 = fast::clam + 0x70, 0x28, 0x5f, 0x37, 0x38, 0x36, 0x2e, 0x78, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, // p(_786.x, 0.0, 1 + 0x2e, 0x30, 0x29, 0x20, 0x2a, 0x20, 0x66, 0x61, 0x73, 0x74, 0x3a, 0x3a, 0x63, 0x6c, 0x61, 0x6d, // .0) * fast::clam + 0x70, 0x28, 0x5f, 0x37, 0x38, 0x36, 0x2e, 0x79, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, // p(_786.y, 0.0, 1 + 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x5f, // .0);. float _ + 0x38, 0x30, 0x39, 0x20, 0x3d, 0x20, 0x66, 0x61, 0x73, 0x74, 0x3a, 0x3a, 0x6d, 0x69, 0x6e, 0x28, // 809 = fast::min( + 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x28, 0x31, 0x2e, 0x30, 0x20, 0x2d, 0x20, 0x61, 0x62, 0x73, 0x28, // 1.0, (1.0 - abs( + 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, // (in.v_texcoord0. + 0x78, 0x20, 0x2a, 0x20, 0x32, 0x2e, 0x30, 0x29, 0x20, 0x2d, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x29, // x * 2.0) - 1.0)) + 0x20, 0x2a, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, // * _mtl_u.u_para + 0x6d, 0x73, 0x2e, 0x79, 0x29, 0x20, 0x2a, 0x20, 0x66, 0x61, 0x73, 0x74, 0x3a, 0x3a, 0x6d, 0x69, // ms.y) * fast::mi + 0x6e, 0x28, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, // n(1.0, in.v_texc + 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x2e, 0x79, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, // oord0.y);. fl + 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x39, 0x36, 0x37, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, // oat4 _967;. i + 0x66, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, // f (_mtl_u.u_para + 0x6d, 0x73, 0x2e, 0x77, 0x20, 0x3d, 0x3d, 0x20, 0x30, 0x2e, 0x30, 0x29, 0x0a, 0x20, 0x20, 0x20, // ms.w == 0.0). + 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, // {. float + 0x32, 0x20, 0x5f, 0x38, 0x32, 0x31, 0x20, 0x3d, 0x20, 0x61, 0x62, 0x73, 0x28, 0x28, 0x5f, 0x6d, // 2 _821 = abs((_m + 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x69, 0x6e, 0x74, 0x4d, 0x61, 0x74, 0x20, // tl_u.u_paintMat + 0x2a, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x70, 0x6f, // * float3(in.v_po + 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x29, 0x2e, 0x78, 0x79, // sition, 1.0)).xy + 0x29, 0x20, 0x2d, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x65, 0x78, // ) - (_mtl_u.u_ex + 0x74, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x2e, 0x78, 0x79, 0x20, 0x2d, 0x20, // tentRadius.xy - + 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, // float2(_mtl_u.u_ + 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x2e, 0x7a, 0x29, 0x29, // extentRadius.z)) + 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x39, 0x36, 0x37, 0x20, 0x3d, // ;. _967 = + 0x20, 0x6d, 0x69, 0x78, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x69, 0x6e, // mix(_mtl_u.u_in + 0x6e, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x2c, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, // nerCol, _mtl_u.u + 0x5f, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, // _outerCol, float + 0x34, 0x28, 0x66, 0x61, 0x73, 0x74, 0x3a, 0x3a, 0x63, 0x6c, 0x61, 0x6d, 0x70, 0x28, 0x28, 0x28, // 4(fast::clamp((( + 0x28, 0x66, 0x61, 0x73, 0x74, 0x3a, 0x3a, 0x6d, 0x69, 0x6e, 0x28, 0x66, 0x61, 0x73, 0x74, 0x3a, // (fast::min(fast: + 0x3a, 0x6d, 0x61, 0x78, 0x28, 0x5f, 0x38, 0x32, 0x31, 0x2e, 0x78, 0x2c, 0x20, 0x5f, 0x38, 0x32, // :max(_821.x, _82 + 0x31, 0x2e, 0x79, 0x29, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x29, 0x20, 0x2b, 0x20, 0x6c, 0x65, 0x6e, // 1.y), 0.0) + len + 0x67, 0x74, 0x68, 0x28, 0x66, 0x61, 0x73, 0x74, 0x3a, 0x3a, 0x6d, 0x61, 0x78, 0x28, 0x5f, 0x38, // gth(fast::max(_8 + 0x32, 0x31, 0x2c, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x28, 0x30, 0x2e, 0x30, 0x29, 0x29, // 21, float2(0.0)) + 0x29, 0x29, 0x20, 0x2d, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x65, 0x78, // )) - _mtl_u.u_ex + 0x74, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x2e, 0x7a, 0x29, 0x20, 0x2b, 0x20, // tentRadius.z) + + 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, // (_mtl_u.u_params + 0x2e, 0x78, 0x20, 0x2a, 0x20, 0x30, 0x2e, 0x35, 0x29, 0x29, 0x20, 0x2f, 0x20, 0x5f, 0x6d, 0x74, // .x * 0.5)) / _mt + 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x78, 0x2c, 0x20, // l_u.u_params.x, + 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x28, 0x5f, // 0.0, 1.0))) * (_ + 0x38, 0x30, 0x39, 0x20, 0x2a, 0x20, 0x5f, 0x37, 0x39, 0x33, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, // 809 * _793);. + 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, // }. else. + 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, // {. float4 + 0x20, 0x5f, 0x39, 0x36, 0x38, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, // _968;. i + 0x66, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, // f (_mtl_u.u_para + 0x6d, 0x73, 0x2e, 0x77, 0x20, 0x3d, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x0a, 0x20, 0x20, 0x20, // ms.w == 1.0). + 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. + 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x38, 0x34, 0x38, 0x20, 0x3d, // float4 _848 = + 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x2e, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x28, 0x73, 0x5f, // s_tex.sample(s_ + 0x74, 0x65, 0x78, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x2c, 0x20, 0x28, 0x28, 0x5f, 0x6d, // texSampler, ((_m + 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x69, 0x6e, 0x74, 0x4d, 0x61, 0x74, 0x20, // tl_u.u_paintMat + 0x2a, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x70, 0x6f, // * float3(in.v_po + 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x29, 0x2e, 0x78, 0x79, // sition, 1.0)).xy + 0x20, 0x2f, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, // / _mtl_u.u_exte + 0x6e, 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x2e, 0x78, 0x79, 0x29, 0x29, 0x3b, 0x0a, 0x20, // ntRadius.xy));. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, // float + 0x34, 0x20, 0x5f, 0x39, 0x36, 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 4 _965;. + 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, // if (_mtl_u.u + 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x7a, 0x20, 0x3d, 0x3d, 0x20, 0x31, 0x2e, 0x30, // _params.z == 1.0 + 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, // ). {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // + 0x5f, 0x39, 0x36, 0x35, 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x28, 0x5f, 0x38, // _965 = float4(_8 + 0x34, 0x38, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x2a, 0x20, 0x5f, 0x38, 0x34, 0x38, 0x2e, 0x77, 0x2c, // 48.xyz * _848.w, + 0x20, 0x5f, 0x38, 0x34, 0x38, 0x2e, 0x77, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // _848.w);. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // }. + 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // else. 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x36, 0x38, 0x30, 0x20, 0x3d, 0x20, 0x66, 0x6c, // _680 = fl - 0x6f, 0x61, 0x74, 0x34, 0x28, 0x5f, 0x36, 0x34, 0x39, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x2a, 0x20, // oat4(_649.xyz * - 0x5f, 0x36, 0x34, 0x39, 0x2e, 0x77, 0x2c, 0x20, 0x5f, 0x36, 0x34, 0x39, 0x2e, 0x77, 0x29, 0x3b, // _649.w, _649.w); - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, // . }. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, // else. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x39, 0x36, 0x35, 0x20, 0x3d, 0x20, 0x5f, 0x38, // _965 = _8 + 0x34, 0x38, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 48;. + 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, // }. fl + 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x39, 0x36, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // oat4 _966;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, // if (_mtl_ + 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x7a, 0x20, 0x3d, 0x3d, 0x20, // u.u_params.z == + 0x32, 0x2e, 0x30, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 2.0). + 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. + 0x20, 0x20, 0x20, 0x5f, 0x39, 0x36, 0x36, 0x20, 0x3d, 0x20, 0x5f, 0x39, 0x36, 0x35, 0x2e, 0x78, // _966 = _965.x + 0x78, 0x78, 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // xxx;. + 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, // }. e + 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // lse. + 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. + 0x20, 0x20, 0x5f, 0x39, 0x36, 0x36, 0x20, 0x3d, 0x20, 0x5f, 0x39, 0x36, 0x35, 0x3b, 0x0a, 0x20, // _966 = _965;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, // }. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x39, 0x36, 0x38, 0x20, 0x3d, 0x20, // _968 = + 0x28, 0x5f, 0x39, 0x36, 0x36, 0x20, 0x2a, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, // (_966 * _mtl_u.u + 0x5f, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x29, 0x20, 0x2a, 0x20, 0x28, 0x5f, 0x38, // _innerCol) * (_8 + 0x30, 0x39, 0x20, 0x2a, 0x20, 0x5f, 0x37, 0x39, 0x33, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // 09 * _793);. + 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, // }. el + 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, // se. {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, // float4 + 0x5f, 0x39, 0x36, 0x39, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // _969;. + 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, // if (_mtl_u.u_p + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x77, 0x20, 0x3d, 0x3d, 0x20, 0x32, 0x2e, 0x30, 0x29, 0x0a, // arams.w == 2.0). 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, // {. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x36, // _6 - 0x38, 0x30, 0x20, 0x3d, 0x20, 0x5f, 0x36, 0x34, 0x39, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // 80 = _649;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // }. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x36, 0x38, 0x31, // float4 _681 - 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, // ;. if - 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, // (_mtl_u.u_param - 0x73, 0x2e, 0x7a, 0x20, 0x3d, 0x3d, 0x20, 0x32, 0x2e, 0x30, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, // s.z == 2.0). + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x39, // _9 + 0x36, 0x39, 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x28, 0x31, 0x2e, 0x30, 0x29, // 69 = float4(1.0) + 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, // ;. }. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, // else + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, // . {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, // f + 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x39, 0x37, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // loat4 _970;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, // if ( + 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, // _mtl_u.u_params. + 0x77, 0x20, 0x3d, 0x3d, 0x20, 0x33, 0x2e, 0x30, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // w == 3.0). + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, // {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // + 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x38, 0x35, 0x37, 0x20, 0x3d, 0x20, 0x73, 0x5f, // float4 _857 = s_ + 0x74, 0x65, 0x78, 0x2e, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, // tex.sample(s_tex + 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x2c, 0x20, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, // Sampler, in.v_te + 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // xcoord0);. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, // fl + 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x39, 0x36, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // oat4 _963;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, // i + 0x66, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, // f (_mtl_u.u_para + 0x6d, 0x73, 0x2e, 0x7a, 0x20, 0x3d, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x0a, 0x20, 0x20, 0x20, // ms.z == 1.0). + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // + 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x39, 0x36, 0x33, 0x20, // _963 + 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x28, 0x5f, 0x38, 0x35, 0x37, 0x2e, 0x78, 0x79, // = float4(_857.xy + 0x7a, 0x20, 0x2a, 0x20, 0x5f, 0x38, 0x35, 0x37, 0x2e, 0x77, 0x2c, 0x20, 0x5f, 0x38, 0x35, 0x37, // z * _857.w, _857 + 0x2e, 0x77, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // .w);. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // }. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, // e + 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // lse. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x36, 0x38, 0x31, 0x20, 0x3d, // _681 = - 0x20, 0x5f, 0x36, 0x38, 0x30, 0x2e, 0x78, 0x78, 0x78, 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // _680.xxxx;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // + 0x20, 0x20, 0x5f, 0x39, 0x36, 0x33, 0x20, 0x3d, 0x20, 0x5f, 0x38, 0x35, 0x37, 0x3b, 0x0a, 0x20, // _963 = _857;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // + 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // }. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, // float4 + 0x5f, 0x39, 0x36, 0x34, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // _964;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x5f, 0x6d, // if (_m + 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x7a, 0x20, // tl_u.u_params.z + 0x3d, 0x3d, 0x20, 0x32, 0x2e, 0x30, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // == 2.0). + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, // {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x39, 0x36, 0x34, 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, // _964 = flo + 0x61, 0x74, 0x34, 0x28, 0x66, 0x61, 0x73, 0x74, 0x3a, 0x3a, 0x63, 0x6c, 0x61, 0x6d, 0x70, 0x28, // at4(fast::clamp( + 0x28, 0x28, 0x5f, 0x39, 0x36, 0x33, 0x2e, 0x78, 0x20, 0x2d, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, // ((_963.x - _mtl_ + 0x75, 0x2e, 0x75, 0x5f, 0x73, 0x64, 0x66, 0x2e, 0x78, 0x29, 0x20, 0x2f, 0x20, 0x5f, 0x6d, 0x74, // u.u_sdf.x) / _mt + 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x73, 0x64, 0x66, 0x2e, 0x7a, 0x29, 0x20, 0x2b, 0x20, 0x30, // l_u.u_sdf.z) + 0 + 0x2e, 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x20, 0x2a, 0x20, // .5, 0.0, 1.0) * + 0x28, 0x31, 0x2e, 0x30, 0x20, 0x2d, 0x20, 0x66, 0x61, 0x73, 0x74, 0x3a, 0x3a, 0x63, 0x6c, 0x61, // (1.0 - fast::cla + 0x6d, 0x70, 0x28, 0x28, 0x28, 0x5f, 0x39, 0x36, 0x33, 0x2e, 0x78, 0x20, 0x2d, 0x20, 0x5f, 0x6d, // mp(((_963.x - _m + 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x73, 0x64, 0x66, 0x2e, 0x79, 0x29, 0x20, 0x2f, 0x20, // tl_u.u_sdf.y) / + 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x73, 0x64, 0x66, 0x2e, 0x7a, 0x29, 0x20, // _mtl_u.u_sdf.z) + 0x2b, 0x20, 0x30, 0x2e, 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, // + 0.5, 0.0, 1.0) + 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // ));. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // }. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // else. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, // el + 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // se. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x36, 0x38, 0x31, 0x20, 0x3d, 0x20, // _681 = - 0x5f, 0x36, 0x38, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // _680;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // + 0x20, 0x5f, 0x39, 0x36, 0x34, 0x20, 0x3d, 0x20, 0x5f, 0x39, 0x36, 0x33, 0x3b, 0x0a, 0x20, 0x20, // _964 = _963;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // }. - 0x5f, 0x36, 0x38, 0x33, 0x20, 0x3d, 0x20, 0x28, 0x5f, 0x36, 0x38, 0x31, 0x20, 0x2a, 0x20, 0x5f, // _683 = (_681 * _ + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x39, 0x37, 0x30, 0x20, 0x3d, 0x20, 0x28, // _970 = ( + 0x5f, 0x39, 0x36, 0x34, 0x20, 0x2a, 0x20, 0x5f, 0x37, 0x39, 0x33, 0x29, 0x20, 0x2a, 0x20, 0x5f, // _964 * _793) * _ 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x43, 0x6f, 0x6c, // mtl_u.u_innerCol - 0x29, 0x20, 0x2a, 0x20, 0x28, 0x5f, 0x36, 0x31, 0x30, 0x20, 0x2a, 0x20, 0x5f, 0x35, 0x39, 0x34, // ) * (_610 * _594 - 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, // );. }. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // else. + 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // ;. + 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // }. + 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // else. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, // f + 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x39, 0x37, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // loat4 _971;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // + 0x69, 0x66, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, // if (_mtl_u.u_par + 0x61, 0x6d, 0x73, 0x2e, 0x77, 0x20, 0x3d, 0x3d, 0x20, 0x34, 0x2e, 0x30, 0x29, 0x0a, 0x20, 0x20, // ams.w == 4.0). + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. - 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x36, 0x38, 0x34, 0x3b, 0x0a, 0x20, 0x20, 0x20, // float4 _684;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x5f, 0x6d, 0x74, // if (_mt - 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x77, 0x20, 0x3d, // l_u.u_params.w = - 0x3d, 0x20, 0x32, 0x2e, 0x30, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // = 2.0). - 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x36, 0x38, 0x34, 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, // _684 = floa - 0x74, 0x34, 0x28, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // t4(1.0);. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // }. - 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // else. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, // floa + 0x74, 0x34, 0x20, 0x5f, 0x38, 0x39, 0x32, 0x20, 0x3d, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x2e, // t4 _892 = s_tex. + 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x53, 0x61, 0x6d, 0x70, // sample(s_texSamp + 0x6c, 0x65, 0x72, 0x2c, 0x20, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, // ler, in.v_texcoo + 0x72, 0x64, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // rd0);. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, // fl + 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x39, 0x30, 0x31, 0x20, 0x3d, 0x20, 0x73, 0x5f, 0x74, 0x65, // oat4 _901 = s_te + 0x78, 0x32, 0x2e, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x32, // x2.sample(s_tex2 + 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x2c, 0x20, 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, // Sampler, in.v_te + 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x31, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // xcoord1);. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // + 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x39, 0x36, 0x31, 0x3b, 0x0a, 0x20, // float4 _961;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, // if (_mtl_ + 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x7a, 0x20, 0x3d, 0x3d, 0x20, // u.u_params.z == + 0x31, 0x2e, 0x30, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 1.0). + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, // {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x39, 0x36, 0x31, 0x20, // _961 + 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x28, 0x5f, 0x38, 0x39, 0x32, 0x2e, 0x78, 0x79, // = float4(_892.xy + 0x7a, 0x20, 0x2a, 0x20, 0x5f, 0x38, 0x39, 0x32, 0x2e, 0x77, 0x2c, 0x20, 0x5f, 0x38, 0x39, 0x32, // z * _892.w, _892 + 0x2e, 0x77, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // .w);. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, // }. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, // else. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x36, 0x38, // float4 _68 - 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 5;. - 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, // if (_mtl_u.u_ - 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x77, 0x20, 0x3d, 0x3d, 0x20, 0x33, 0x2e, 0x30, 0x29, // params.w == 3.0) - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // . - 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x36, // float4 _6 - 0x35, 0x38, 0x20, 0x3d, 0x20, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x2e, 0x73, 0x61, 0x6d, 0x70, 0x6c, // 58 = s_tex.sampl - 0x65, 0x28, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x2c, 0x20, // e(s_texSampler, - 0x69, 0x6e, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x29, 0x3b, // in.v_texcoord0); - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // . - 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x36, 0x37, 0x38, // float4 _678 - 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // ;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // + 0x20, 0x20, 0x5f, 0x39, 0x36, 0x31, 0x20, 0x3d, 0x20, 0x5f, 0x38, 0x39, 0x32, 0x3b, 0x0a, 0x20, // _961 = _892;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // }. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // + 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x39, 0x36, 0x32, 0x3b, 0x0a, 0x20, 0x20, // float4 _962;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, // if (_mtl_u - 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x7a, 0x20, 0x3d, 0x3d, 0x20, 0x31, // .u_params.z == 1 + 0x2e, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x7a, 0x20, 0x3d, 0x3d, 0x20, 0x32, // .u_params.z == 2 0x2e, 0x30, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // .0). - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, // {. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // - 0x20, 0x20, 0x5f, 0x36, 0x37, 0x38, 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x28, // _678 = float4( - 0x5f, 0x36, 0x35, 0x38, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x2a, 0x20, 0x5f, 0x36, 0x35, 0x38, 0x2e, // _658.xyz * _658. - 0x77, 0x2c, 0x20, 0x5f, 0x36, 0x35, 0x38, 0x2e, 0x77, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // w, _658.w);. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x39, 0x36, 0x32, 0x20, 0x3d, // _962 = + 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x28, 0x66, 0x61, 0x73, 0x74, 0x3a, 0x3a, 0x63, 0x6c, // float4(fast::cl + 0x61, 0x6d, 0x70, 0x28, 0x28, 0x28, 0x5f, 0x39, 0x36, 0x31, 0x2e, 0x78, 0x20, 0x2d, 0x20, 0x5f, // amp(((_961.x - _ + 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x73, 0x64, 0x66, 0x2e, 0x78, 0x29, 0x20, 0x2f, // mtl_u.u_sdf.x) / + 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x73, 0x64, 0x66, 0x2e, 0x7a, 0x29, // _mtl_u.u_sdf.z) + 0x20, 0x2b, 0x20, 0x30, 0x2e, 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, // + 0.5, 0.0, 1.0 + 0x29, 0x20, 0x2a, 0x20, 0x28, 0x31, 0x2e, 0x30, 0x20, 0x2d, 0x20, 0x66, 0x61, 0x73, 0x74, 0x3a, // ) * (1.0 - fast: + 0x3a, 0x63, 0x6c, 0x61, 0x6d, 0x70, 0x28, 0x28, 0x28, 0x5f, 0x39, 0x36, 0x31, 0x2e, 0x78, 0x20, // :clamp(((_961.x + 0x2d, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x73, 0x64, 0x66, 0x2e, 0x79, // - _mtl_u.u_sdf.y + 0x29, 0x20, 0x2f, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x73, 0x64, 0x66, // ) / _mtl_u.u_sdf + 0x2e, 0x7a, 0x29, 0x20, 0x2b, 0x20, 0x30, 0x2e, 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x2c, 0x20, // .z) + 0.5, 0.0, + 0x31, 0x2e, 0x30, 0x29, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 1.0)));. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // }. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, // else. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, // { - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // . - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x36, 0x37, 0x38, 0x20, 0x3d, 0x20, // _678 = - 0x5f, 0x36, 0x35, 0x38, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // _658;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, // }. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, // else. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // - 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x5f, 0x36, 0x37, 0x39, 0x3b, 0x0a, 0x20, 0x20, 0x20, // float4 _679;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // - 0x20, 0x69, 0x66, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x70, 0x61, // if (_mtl_u.u_pa - 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x7a, 0x20, 0x3d, 0x3d, 0x20, 0x32, 0x2e, 0x30, 0x29, 0x0a, 0x20, // rams.z == 2.0). + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // - 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x36, 0x37, // _67 - 0x39, 0x20, 0x3d, 0x20, 0x5f, 0x36, 0x37, 0x38, 0x2e, 0x78, 0x78, 0x78, 0x78, 0x3b, 0x0a, 0x20, // 9 = _678.xxxx;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x39, 0x36, 0x32, 0x20, 0x3d, 0x20, 0x5f, 0x39, 0x36, 0x31, // _962 = _961 + 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // ;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, // }. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // - 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // }. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, // else. + 0x20, 0x20, 0x20, 0x20, 0x5f, 0x39, 0x37, 0x31, 0x20, 0x3d, 0x20, 0x28, 0x28, 0x5f, 0x39, 0x36, // _971 = ((_96 + 0x32, 0x20, 0x2a, 0x20, 0x5f, 0x37, 0x39, 0x33, 0x29, 0x20, 0x2a, 0x20, 0x5f, 0x39, 0x30, 0x31, // 2 * _793) * _901 + 0x29, 0x20, 0x2a, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x69, 0x6e, 0x6e, // ) * _mtl_u.u_inn + 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // erCol;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, // }. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // - 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x36, 0x37, 0x39, // _679 - 0x20, 0x3d, 0x20, 0x5f, 0x36, 0x37, 0x38, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // = _678;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, // }. + 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // else. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, // {. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // - 0x20, 0x20, 0x20, 0x5f, 0x36, 0x38, 0x35, 0x20, 0x3d, 0x20, 0x28, 0x5f, 0x36, 0x37, 0x39, 0x20, // _685 = (_679 - 0x2a, 0x20, 0x5f, 0x35, 0x39, 0x34, 0x29, 0x20, 0x2a, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, // * _594) * _mtl_u - 0x2e, 0x75, 0x5f, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x3b, 0x0a, 0x20, 0x20, 0x20, // .u_innerCol;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, // }. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, // e - 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // lse. - 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // {. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x36, 0x38, 0x35, 0x20, 0x3d, // _685 = - 0x20, 0x5f, 0x36, 0x38, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // _686;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // }. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x36, 0x38, 0x34, 0x20, 0x3d, 0x20, // _684 = - 0x5f, 0x36, 0x38, 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // _685;. - 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // }. - 0x5f, 0x36, 0x38, 0x33, 0x20, 0x3d, 0x20, 0x5f, 0x36, 0x38, 0x34, 0x3b, 0x0a, 0x20, 0x20, 0x20, // _683 = _684;. - 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, // }. _ - 0x36, 0x38, 0x32, 0x20, 0x3d, 0x20, 0x5f, 0x36, 0x38, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // 682 = _683;. - 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x75, 0x74, 0x2e, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, // }. out.bgfx_F - 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x20, 0x3d, 0x20, 0x5f, 0x36, 0x38, 0x32, 0x3b, // ragData0 = _682; - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6f, 0x75, 0x74, 0x3b, // . return out; - 0x0a, 0x7d, 0x0a, 0x0a, 0x00, 0x00, 0xd0, 0x00, // .}...... + 0x20, 0x20, 0x20, 0x20, 0x5f, 0x39, 0x37, 0x31, 0x20, 0x3d, 0x20, 0x5f, 0x39, 0x37, 0x32, 0x3b, // _971 = _972; + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // . + 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // }. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x39, 0x37, 0x30, 0x20, // _970 + 0x3d, 0x20, 0x5f, 0x39, 0x37, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // = _971;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // }. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5f, 0x39, 0x36, 0x39, 0x20, 0x3d, // _969 = + 0x20, 0x5f, 0x39, 0x37, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // _970;. + 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // }. + 0x20, 0x5f, 0x39, 0x36, 0x38, 0x20, 0x3d, 0x20, 0x5f, 0x39, 0x36, 0x39, 0x3b, 0x0a, 0x20, 0x20, // _968 = _969;. + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, // }. + 0x5f, 0x39, 0x36, 0x37, 0x20, 0x3d, 0x20, 0x5f, 0x39, 0x36, 0x38, 0x3b, 0x0a, 0x20, 0x20, 0x20, // _967 = _968;. + 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x75, 0x74, 0x2e, 0x62, 0x67, 0x66, 0x78, 0x5f, // }. out.bgfx_ + 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x20, 0x3d, 0x20, 0x5f, 0x39, 0x36, 0x37, // FragData0 = _967 + 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6f, 0x75, 0x74, // ;. return out + 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, 0x00, 0x00, 0x01, // ;.}...... }; diff --git a/Polyfills/Canvas/Source/Shaders/metal/vs_fspass.h b/Polyfills/Canvas/Source/Shaders/metal/vs_fspass.h new file mode 100644 index 000000000..0e2a624a7 --- /dev/null +++ b/Polyfills/Canvas/Source/Shaders/metal/vs_fspass.h @@ -0,0 +1,52 @@ +static const uint8_t vs_fspass_mtl[770] = +{ + 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0xcf, 0xda, 0x1b, 0x94, 0x00, 0x00, 0xe8, 0x02, // VSH............. + 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, 0x3c, 0x6d, 0x65, 0x74, 0x61, // ..#include .#inclu + 0x64, 0x65, 0x20, 0x3c, 0x73, 0x69, 0x6d, 0x64, 0x2f, 0x73, 0x69, 0x6d, 0x64, 0x2e, 0x68, 0x3e, // de + 0x0a, 0x0a, 0x75, 0x73, 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, // ..using namespac + 0x65, 0x20, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, // e metal;..struct + 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, // xlatMtlMain_out + 0x0a, 0x7b, 0x0a, 0x09, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x6d, // .{..float bgfx_m + 0x65, 0x74, 0x61, 0x6c, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x20, 0x5b, // etal_pointSize [ + 0x5b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x5d, 0x5d, 0x20, 0x3d, 0x20, // [point_size]] = + 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x20, 0x5f, 0x65, // 1;. float2 _e + 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, // ntryPointOutput_ + 0x76, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x5b, 0x5b, 0x75, 0x73, 0x65, // v_position [[use + 0x72, 0x28, 0x6c, 0x6f, 0x63, 0x6e, 0x30, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // r(locn0)]];. + 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x20, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, // float2 _entryPoi + 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, // ntOutput_v_texco + 0x6f, 0x72, 0x64, 0x30, 0x20, 0x5b, 0x5b, 0x75, 0x73, 0x65, 0x72, 0x28, 0x6c, 0x6f, 0x63, 0x6e, // ord0 [[user(locn + 0x31, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, // 1)]];. float4 + 0x20, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x5b, 0x5b, 0x70, // gl_Position [[p + 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5d, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x73, // osition]];.};..s + 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, // truct xlatMtlMai + 0x6e, 0x5f, 0x69, 0x6e, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, // n_in.{. float + 0x32, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x5b, 0x5b, 0x61, // 2 a_position [[a + 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x7d, // ttribute(0)]];.} + 0x3b, 0x0a, 0x0a, 0x76, 0x65, 0x72, 0x74, 0x65, 0x78, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, // ;..vertex xlatMt + 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, // lMain_out xlatMt + 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x28, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, // lMain(xlatMtlMai + 0x6e, 0x5f, 0x69, 0x6e, 0x20, 0x69, 0x6e, 0x20, 0x5b, 0x5b, 0x73, 0x74, 0x61, 0x67, 0x65, 0x5f, // n_in in [[stage_ + 0x69, 0x6e, 0x5d, 0x5d, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x78, 0x6c, 0x61, 0x74, // in]]).{. xlat + 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x20, 0x6f, 0x75, 0x74, 0x20, // MtlMain_out out + 0x3d, 0x20, 0x7b, 0x7d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, // = {};. float2 + 0x20, 0x5f, 0x31, 0x31, 0x33, 0x20, 0x3d, 0x20, 0x28, 0x69, 0x6e, 0x2e, 0x61, 0x5f, 0x70, 0x6f, // _113 = (in.a_po + 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x2a, 0x20, 0x33, 0x2e, 0x30, 0x29, 0x20, 0x2d, 0x20, // sition * 3.0) - + 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x28, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, // float2(0.0, 1.0) + 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x75, 0x74, 0x2e, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, // ;. out.gl_Pos + 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x28, 0x5f, // ition = float4(_ + 0x31, 0x31, 0x33, 0x2c, 0x20, 0x30, 0x2e, 0x35, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, // 113, 0.5, 1.0);. + 0x20, 0x20, 0x20, 0x20, 0x6f, 0x75, 0x74, 0x2e, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, // out._entryPo + 0x69, 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x76, 0x5f, 0x70, 0x6f, 0x73, 0x69, // intOutput_v_posi + 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x69, 0x6e, 0x2e, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, // tion = in.a_posi + 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x75, 0x74, 0x2e, 0x5f, 0x65, // tion;. out._e + 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, // ntryPointOutput_ + 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x3d, 0x20, 0x28, 0x66, // v_texcoord0 = (f + 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x28, 0x5f, 0x31, 0x31, 0x33, 0x2e, 0x78, 0x2c, 0x20, 0x31, 0x2e, // loat2(_113.x, 1. + 0x30, 0x20, 0x2d, 0x20, 0x5f, 0x31, 0x31, 0x33, 0x2e, 0x79, 0x29, 0x20, 0x2a, 0x20, 0x30, 0x2e, // 0 - _113.y) * 0. + 0x35, 0x29, 0x20, 0x2b, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x28, 0x30, 0x2e, 0x35, 0x2c, // 5) + float2(0.5, + 0x20, 0x30, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, // 0.0);. retur + 0x6e, 0x20, 0x6f, 0x75, 0x74, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, 0x02, 0x01, 0x00, 0x10, 0x00, // n out;.}........ + 0x00, 0x00, // .. +}; diff --git a/Polyfills/Canvas/Source/Shaders/metal/vs_nanovg_fill.h b/Polyfills/Canvas/Source/Shaders/metal/vs_nanovg_fill.h index 076cb1da5..c9aec22a8 100644 --- a/Polyfills/Canvas/Source/Shaders/metal/vs_nanovg_fill.h +++ b/Polyfills/Canvas/Source/Shaders/metal/vs_nanovg_fill.h @@ -1,65 +1,85 @@ -static const uint8_t vs_nanovg_fill_mtl[989] = +static const uint8_t vs_nanovg_fill_mtl[1303] = { - 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0xcf, 0xda, 0x1b, 0x94, 0x02, 0x00, 0x0b, 0x75, // VSH............u - 0x5f, 0x68, 0x61, 0x6c, 0x66, 0x54, 0x65, 0x78, 0x65, 0x6c, 0x02, 0x01, 0x10, 0x00, 0x01, 0x00, // _halfTexel...... + 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x98, 0xde, 0xee, 0x03, 0x00, 0x0b, 0x75, // VSH............u + 0x5f, 0x68, 0x61, 0x6c, 0x66, 0x54, 0x65, 0x78, 0x65, 0x6c, 0x02, 0x01, 0x20, 0x00, 0x01, 0x00, // _halfTexel.. ... 0x00, 0x00, 0x00, 0x00, 0x0a, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x53, 0x69, 0x7a, 0x65, 0x02, // .....u_viewSize. - 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x98, 0x03, 0x00, 0x00, 0x23, 0x69, 0x6e, // .............#in - 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, 0x3c, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x64, // clude .#include ..usi - 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x6d, 0x65, 0x74, // ng namespace met - 0x61, 0x6c, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x5f, 0x47, 0x6c, 0x6f, // al;..struct _Glo - 0x62, 0x61, 0x6c, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, // bal.{. float4 - 0x20, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x53, 0x69, 0x7a, 0x65, 0x3b, 0x0a, 0x20, 0x20, 0x20, // u_viewSize;. - 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x68, 0x61, 0x6c, 0x66, 0x54, 0x65, // float4 u_halfTe - 0x78, 0x65, 0x6c, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, // xel;.};..struct - 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x0a, // xlatMtlMain_out. - 0x7b, 0x0a, 0x09, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x6d, 0x65, // {..float bgfx_me - 0x74, 0x61, 0x6c, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x20, 0x5b, 0x5b, // tal_pointSize [[ - 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x5d, 0x5d, 0x20, 0x3d, 0x20, 0x31, // point_size]] = 1 - 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x20, 0x5f, 0x65, 0x6e, // ;. float2 _en - 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x76, // tryPointOutput_v - 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x5b, 0x5b, 0x75, 0x73, 0x65, 0x72, // _position [[user - 0x28, 0x6c, 0x6f, 0x63, 0x6e, 0x30, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, // (locn0)]];. f - 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x20, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, // loat2 _entryPoin - 0x74, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, // tOutput_v_texcoo - 0x72, 0x64, 0x30, 0x20, 0x5b, 0x5b, 0x75, 0x73, 0x65, 0x72, 0x28, 0x6c, 0x6f, 0x63, 0x6e, 0x31, // rd0 [[user(locn1 - 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, // )]];. float4 - 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x5b, 0x5b, 0x70, 0x6f, // gl_Position [[po - 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5d, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x73, 0x74, // sition]];.};..st - 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, // ruct xlatMtlMain - 0x5f, 0x69, 0x6e, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, // _in.{. float2 - 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x5b, 0x5b, 0x61, 0x74, // a_position [[at - 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, // tribute(0)]];. - 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x20, 0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, // float2 a_texco - 0x6f, 0x72, 0x64, 0x30, 0x20, 0x5b, 0x5b, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, // ord0 [[attribute - 0x28, 0x31, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x76, 0x65, 0x72, 0x74, 0x65, // (1)]];.};..verte - 0x78, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, // x xlatMtlMain_ou - 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x28, 0x78, 0x6c, // t xlatMtlMain(xl - 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x6e, 0x20, 0x69, 0x6e, 0x20, // atMtlMain_in in - 0x5b, 0x5b, 0x73, 0x74, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x5d, 0x5d, 0x2c, 0x20, 0x63, 0x6f, // [[stage_in]], co - 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, 0x5f, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x26, 0x20, // nstant _Global& - 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x20, 0x5b, 0x5b, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x28, // _mtl_u [[buffer( - 0x30, 0x29, 0x5d, 0x5d, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x78, 0x6c, 0x61, 0x74, // 0)]]).{. xlat - 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x20, 0x6f, 0x75, 0x74, 0x20, // MtlMain_out out - 0x3d, 0x20, 0x7b, 0x7d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x75, 0x74, 0x2e, 0x67, 0x6c, // = {};. out.gl - 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, // _Position = floa - 0x74, 0x34, 0x28, 0x28, 0x28, 0x32, 0x2e, 0x30, 0x20, 0x2a, 0x20, 0x69, 0x6e, 0x2e, 0x61, 0x5f, // t4(((2.0 * in.a_ - 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x78, 0x29, 0x20, 0x2f, 0x20, 0x5f, 0x6d, // position.x) / _m - 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x53, 0x69, 0x7a, 0x65, 0x2e, // tl_u.u_viewSize. - 0x78, 0x29, 0x20, 0x2d, 0x20, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x20, 0x2d, 0x20, // x) - 1.0, 1.0 - - 0x28, 0x28, 0x32, 0x2e, 0x30, 0x20, 0x2a, 0x20, 0x69, 0x6e, 0x2e, 0x61, 0x5f, 0x70, 0x6f, 0x73, // ((2.0 * in.a_pos - 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x79, 0x29, 0x20, 0x2f, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, // ition.y) / _mtl_ - 0x75, 0x2e, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x53, 0x69, 0x7a, 0x65, 0x2e, 0x79, 0x29, 0x2c, // u.u_viewSize.y), - 0x20, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // 0.0, 1.0);. - 0x6f, 0x75, 0x74, 0x2e, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x4f, // out._entryPointO - 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x76, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, // utput_v_position - 0x20, 0x3d, 0x20, 0x69, 0x6e, 0x2e, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, // = in.a_position - 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x75, 0x74, 0x2e, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x79, // ;. out._entry + 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, // ..........u_exte + 0x6e, 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x02, 0x01, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ntRadius........ + 0x00, 0x00, 0xb9, 0x04, 0x00, 0x00, 0x23, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, 0x3c, // ......#include < + 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x64, 0x6c, 0x69, 0x62, 0x3e, 0x0a, 0x23, 0x69, // metal_stdlib>.#i + 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, 0x3c, 0x73, 0x69, 0x6d, 0x64, 0x2f, 0x73, 0x69, 0x6d, // nclude ..using name + 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x3b, 0x0a, 0x0a, 0x73, 0x74, // space metal;..st + 0x72, 0x75, 0x63, 0x74, 0x20, 0x5f, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x0a, 0x7b, 0x0a, 0x20, // ruct _Global.{. + 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, // float4 u_view + 0x53, 0x69, 0x7a, 0x65, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, // Size;. float4 + 0x20, 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x3b, // u_extentRadius; + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x68, 0x61, // . float4 u_ha + 0x6c, 0x66, 0x54, 0x65, 0x78, 0x65, 0x6c, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, // lfTexel;.};..str + 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, // uct xlatMtlMain_ + 0x6f, 0x75, 0x74, 0x0a, 0x7b, 0x0a, 0x09, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x62, 0x67, 0x66, // out.{..float bgf + 0x78, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x53, 0x69, 0x7a, // x_metal_pointSiz + 0x65, 0x20, 0x5b, 0x5b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x5d, 0x5d, // e [[point_size]] + 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, // = 1;. float2 + 0x20, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x70, // _entryPointOutp + 0x75, 0x74, 0x5f, 0x76, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x5b, 0x5b, // ut_v_position [[ + 0x75, 0x73, 0x65, 0x72, 0x28, 0x6c, 0x6f, 0x63, 0x6e, 0x30, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, // user(locn0)]];. + 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x20, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x79, // float2 _entry 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x76, 0x5f, 0x74, 0x65, // PointOutput_v_te - 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x3d, 0x20, 0x69, 0x6e, 0x2e, 0x61, 0x5f, 0x74, // xcoord0 = in.a_t - 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x2b, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, // excoord0 + _mtl_ - 0x75, 0x2e, 0x75, 0x5f, 0x68, 0x61, 0x6c, 0x66, 0x54, 0x65, 0x78, 0x65, 0x6c, 0x2e, 0x78, 0x79, // u.u_halfTexel.xy - 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6f, 0x75, 0x74, // ;. return out - 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, 0x02, 0x01, 0x00, 0x10, 0x00, 0x20, 0x00, // ;.}........ . + 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x5b, 0x5b, 0x75, 0x73, 0x65, 0x72, 0x28, 0x6c, // xcoord0 [[user(l + 0x6f, 0x63, 0x6e, 0x31, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, // ocn1)]];. flo + 0x61, 0x74, 0x32, 0x20, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x4f, // at2 _entryPointO + 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, // utput_v_texcoord + 0x31, 0x20, 0x5b, 0x5b, 0x75, 0x73, 0x65, 0x72, 0x28, 0x6c, 0x6f, 0x63, 0x6e, 0x32, 0x29, 0x5d, // 1 [[user(locn2)] + 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x67, 0x6c, // ];. float4 gl + 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x5b, 0x5b, 0x70, 0x6f, 0x73, 0x69, // _Position [[posi + 0x74, 0x69, 0x6f, 0x6e, 0x5d, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, // tion]];.};..stru + 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x69, // ct xlatMtlMain_i + 0x6e, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x20, 0x61, // n.{. float2 a + 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x5b, 0x5b, 0x61, 0x74, 0x74, 0x72, // _position [[attr + 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // ibute(0)]];. + 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x20, 0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, // float2 a_texcoor + 0x64, 0x30, 0x20, 0x5b, 0x5b, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x31, // d0 [[attribute(1 + 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x76, 0x65, 0x72, 0x74, 0x65, 0x78, 0x20, // )]];.};..vertex + 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x20, // xlatMtlMain_out + 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x28, 0x78, 0x6c, 0x61, 0x74, // xlatMtlMain(xlat + 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x6e, 0x20, 0x69, 0x6e, 0x20, 0x5b, 0x5b, // MtlMain_in in [[ + 0x73, 0x74, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x5d, 0x5d, 0x2c, 0x20, 0x63, 0x6f, 0x6e, 0x73, // stage_in]], cons + 0x74, 0x61, 0x6e, 0x74, 0x20, 0x5f, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x26, 0x20, 0x5f, 0x6d, // tant _Global& _m + 0x74, 0x6c, 0x5f, 0x75, 0x20, 0x5b, 0x5b, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x28, 0x30, 0x29, // tl_u [[buffer(0) + 0x5d, 0x5d, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, // ]]).{. xlatMt + 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x20, 0x6f, 0x75, 0x74, 0x20, 0x3d, 0x20, // lMain_out out = + 0x7b, 0x7d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x75, 0x74, 0x2e, 0x67, 0x6c, 0x5f, 0x50, // {};. out.gl_P + 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, // osition = float4 + 0x28, 0x28, 0x28, 0x32, 0x2e, 0x30, 0x20, 0x2a, 0x20, 0x69, 0x6e, 0x2e, 0x61, 0x5f, 0x70, 0x6f, // (((2.0 * in.a_po + 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x78, 0x29, 0x20, 0x2f, 0x20, 0x5f, 0x6d, 0x74, 0x6c, // sition.x) / _mtl + 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x53, 0x69, 0x7a, 0x65, 0x2e, 0x78, 0x29, // _u.u_viewSize.x) + 0x20, 0x2d, 0x20, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x20, 0x2d, 0x20, 0x28, 0x28, // - 1.0, 1.0 - (( + 0x32, 0x2e, 0x30, 0x20, 0x2a, 0x20, 0x69, 0x6e, 0x2e, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, // 2.0 * in.a_posit + 0x69, 0x6f, 0x6e, 0x2e, 0x79, 0x29, 0x20, 0x2f, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, // ion.y) / _mtl_u. + 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x53, 0x69, 0x7a, 0x65, 0x2e, 0x79, 0x29, 0x2c, 0x20, 0x30, // u_viewSize.y), 0 + 0x2e, 0x30, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x75, // .0, 1.0);. ou + 0x74, 0x2e, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x4f, 0x75, 0x74, // t._entryPointOut + 0x70, 0x75, 0x74, 0x5f, 0x76, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, // put_v_position = + 0x20, 0x69, 0x6e, 0x2e, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x0a, // in.a_position;. + 0x20, 0x20, 0x20, 0x20, 0x6f, 0x75, 0x74, 0x2e, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, // out._entryPo + 0x69, 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, // intOutput_v_texc + 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x3d, 0x20, 0x69, 0x6e, 0x2e, 0x61, 0x5f, 0x74, 0x65, 0x78, // oord0 = in.a_tex + 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, 0x2b, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, // coord0 + _mtl_u. + 0x75, 0x5f, 0x68, 0x61, 0x6c, 0x66, 0x54, 0x65, 0x78, 0x65, 0x6c, 0x2e, 0x78, 0x79, 0x3b, 0x0a, // u_halfTexel.xy;. + 0x20, 0x20, 0x20, 0x20, 0x6f, 0x75, 0x74, 0x2e, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, // out._entryPo + 0x69, 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, // intOutput_v_texc + 0x6f, 0x6f, 0x72, 0x64, 0x31, 0x20, 0x3d, 0x20, 0x28, 0x28, 0x69, 0x6e, 0x2e, 0x61, 0x5f, 0x70, // oord1 = ((in.a_p + 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x2f, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, // osition / _mtl_u + 0x2e, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x53, 0x69, 0x7a, 0x65, 0x2e, 0x78, 0x79, 0x29, 0x20, // .u_viewSize.xy) + 0x2d, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, // - float2(_mtl_u. + 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x2e, 0x78, // u_extentRadius.x + 0x20, 0x2f, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, // / _mtl_u.u_view + 0x53, 0x69, 0x7a, 0x65, 0x2e, 0x78, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x29, 0x20, 0x2f, 0x20, // Size.x, 1.0)) / + 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x32, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, // float2(_mtl_u.u_ + 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x2e, 0x79, 0x20, 0x2f, // extentRadius.y / + 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x53, 0x69, // _mtl_u.u_viewSi + 0x7a, 0x65, 0x2e, 0x78, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, // ze.x, 1.0);. + 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6f, 0x75, 0x74, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // return out;.}... + 0x02, 0x01, 0x00, 0x10, 0x00, 0x30, 0x00, // .....0. }; diff --git a/Polyfills/Canvas/Source/Shaders/spirv/fs_boxblur.h b/Polyfills/Canvas/Source/Shaders/spirv/fs_boxblur.h new file mode 100644 index 000000000..4cce74dc2 --- /dev/null +++ b/Polyfills/Canvas/Source/Shaders/spirv/fs_boxblur.h @@ -0,0 +1,154 @@ +static const uint8_t fs_boxblur_spv[2413] = +{ + 0x46, 0x53, 0x48, 0x0b, 0xcf, 0xda, 0x1b, 0x94, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x09, 0x75, // FSH............u + 0x5f, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x73, 0x12, 0x01, 0x20, 0x00, 0x01, 0x00, 0x00, 0x00, // _weights.. ..... + 0x00, 0x00, 0x0b, 0x75, 0x5f, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x01, // ...u_direction.. + 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x53, // .........u_viewS + 0x69, 0x7a, 0x65, 0x12, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x73, 0x5f, // ize...........s_ + 0x74, 0x65, 0x78, 0x30, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x02, 0x22, 0x00, 0x08, 0x09, 0x00, // tex0.......".... + 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0b, 0x00, 0x08, 0x00, 0x76, 0x01, 0x00, // ...#.........v.. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, // ................ + 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, // .....GLSL.std.45 + 0x30, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // 0............... + 0x00, 0x0f, 0x00, 0x07, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, // .............mai + 0x6e, 0x00, 0x00, 0x00, 0x00, 0xba, 0x00, 0x00, 0x00, 0xc7, 0x00, 0x00, 0x00, 0x10, 0x00, 0x03, // n............... + 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x05, 0x00, 0x00, // ................ + 0x00, 0xf4, 0x01, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, // .............mai + 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x27, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, // n........'...s_t + 0x65, 0x78, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, // exSampler....... + 0x00, 0x2a, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, // .*...s_texTextur + 0x65, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x53, 0x00, 0x00, 0x00, 0x55, 0x6e, 0x69, // e........S...Uni + 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x06, // formBlock....... + 0x00, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x53, // .S.......u_viewS + 0x69, 0x7a, 0x65, 0x00, 0x00, 0x06, 0x00, 0x06, 0x00, 0x53, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // ize......S...... + 0x00, 0x75, 0x5f, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x00, 0x06, 0x00, 0x06, // .u_direction.... + 0x00, 0x53, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x77, 0x65, 0x69, 0x67, 0x68, // .S.......u_weigh + 0x74, 0x73, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x00, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ts.......U...... + 0x00, 0x05, 0x00, 0x05, 0x00, 0xba, 0x00, 0x00, 0x00, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, // .........v_texco + 0x6f, 0x72, 0x64, 0x30, 0x00, 0x05, 0x00, 0x06, 0x00, 0xc7, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, // ord0.........bgf + 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x00, 0x00, 0x47, 0x00, 0x04, // x_FragData0..G.. + 0x00, 0x27, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, // .'...!.......G.. + 0x00, 0x27, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, // .'...".......G.. + 0x00, 0x2a, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, // .*...!.......G.. + 0x00, 0x2a, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, // .*...".......G.. + 0x00, 0x53, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x53, 0x00, 0x00, // .S.......H...S.. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, // .....#.......H.. + 0x00, 0x53, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, // .S.......#...... + 0x00, 0x48, 0x00, 0x05, 0x00, 0x53, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, // .H...S.......#.. + 0x00, 0x20, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x55, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, // . ...G...U...!.. + 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x55, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, // .....G...U...".. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xba, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, // .....G.......... + 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xc7, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, // .....G.......... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, // .............!.. + 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x02, 0x00, 0x06, 0x00, 0x00, // ................ + 0x00, 0x16, 0x00, 0x03, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x19, 0x00, 0x09, // ......... ...... + 0x00, 0x08, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x17, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, // ................ + 0x00, 0x17, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, // ................ + 0x00, 0x20, 0x00, 0x04, 0x00, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, // . ...&.......... + 0x00, 0x3b, 0x00, 0x04, 0x00, 0x26, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .;...&...'...... + 0x00, 0x20, 0x00, 0x04, 0x00, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, // . ...).......... + 0x00, 0x3b, 0x00, 0x04, 0x00, 0x29, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .;...)...*...... + 0x00, 0x15, 0x00, 0x04, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // .....-... ...... + 0x00, 0x2b, 0x00, 0x04, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // .+...-.......... + 0x00, 0x2b, 0x00, 0x04, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .+...-...2...... + 0x00, 0x1b, 0x00, 0x03, 0x00, 0x36, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, // .....6.......+.. + 0x00, 0x07, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x05, // .....E.......... + 0x00, 0x53, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, // .S.............. + 0x00, 0x20, 0x00, 0x04, 0x00, 0x54, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, // . ...T.......S.. + 0x00, 0x3b, 0x00, 0x04, 0x00, 0x54, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, // .;...T...U...... + 0x00, 0x2b, 0x00, 0x04, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, // .+...-...V...... + 0x00, 0x15, 0x00, 0x04, 0x00, 0x57, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .....W... ...... + 0x00, 0x2b, 0x00, 0x04, 0x00, 0x57, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, // .+...W...X...... + 0x00, 0x20, 0x00, 0x04, 0x00, 0x59, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, // . ...Y.......... + 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x5d, 0x00, 0x00, 0x00, 0x7a, 0x16, 0xa5, // .+.......]...z.. + 0x35, 0x14, 0x00, 0x02, 0x00, 0x5e, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x57, 0x00, 0x00, // 5....^...+...W.. + 0x00, 0x60, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x70, 0x00, 0x00, // .`....... ...p.. + 0x00, 0x02, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, // .........+...... + 0x00, 0x7b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x57, 0x00, 0x00, // .{......?+...W.. + 0x00, 0x8a, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x57, 0x00, 0x00, // .........+...W.. + 0x00, 0xab, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0xb6, 0x00, 0x00, // ......... ...... + 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0xb6, 0x00, 0x00, // .........;...... + 0x00, 0xba, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0xc6, 0x00, 0x00, // ......... ...... + 0x00, 0x03, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0xc6, 0x00, 0x00, // .........;...... + 0x00, 0xc7, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x07, 0x00, 0x0d, 0x00, 0x00, // .........,...... + 0x00, 0x70, 0x01, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, // .p...E...E...E.. + 0x00, 0x45, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x72, 0x01, 0x00, // .E...,.......r.. + 0x00, 0x7b, 0x00, 0x00, 0x00, 0x7b, 0x00, 0x00, 0x00, 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, // .{...{...6...... + 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, // ................ + 0x00, 0x05, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, // .....=.......(.. + 0x00, 0x27, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, // .'...=.......+.. + 0x00, 0x2a, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xbb, 0x00, 0x00, // .*...=.......... + 0x00, 0xba, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x59, 0x00, 0x00, 0x00, 0xf5, 0x00, 0x00, // .....A...Y...... + 0x00, 0x55, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, // .U...V...X...=.. + 0x00, 0x07, 0x00, 0x00, 0x00, 0xf6, 0x00, 0x00, 0x00, 0xf5, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x06, // ................ + 0x00, 0x07, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, // ................ + 0x00, 0xf6, 0x00, 0x00, 0x00, 0xb8, 0x00, 0x05, 0x00, 0x5e, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, // .........^...... + 0x00, 0xf7, 0x00, 0x00, 0x00, 0x5d, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x59, 0x00, 0x00, // .....]...A...Y.. + 0x00, 0xf9, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, // .....U...V...`.. + 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x00, 0x00, 0xf9, 0x00, 0x00, // .=.............. + 0x00, 0x0c, 0x00, 0x06, 0x00, 0x07, 0x00, 0x00, 0x00, 0xfb, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // ................ + 0x00, 0x04, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x00, 0x00, 0xb8, 0x00, 0x05, 0x00, 0x5e, 0x00, 0x00, // .............^.. + 0x00, 0xfc, 0x00, 0x00, 0x00, 0xfb, 0x00, 0x00, 0x00, 0x5d, 0x00, 0x00, 0x00, 0xa7, 0x00, 0x05, // .........]...... + 0x00, 0x5e, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, // .^.............. + 0x00, 0xf7, 0x00, 0x03, 0x00, 0x04, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, // ................ + 0x00, 0xfd, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x04, 0x01, 0x00, 0x00, 0xf8, 0x00, 0x02, // ................ + 0x00, 0xfe, 0x00, 0x00, 0x00, 0x56, 0x00, 0x05, 0x00, 0x36, 0x00, 0x00, 0x00, 0x4b, 0x01, 0x00, // .....V...6...K.. + 0x00, 0x2b, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x57, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, // .+...(...W...... + 0x00, 0x4d, 0x01, 0x00, 0x00, 0x4b, 0x01, 0x00, 0x00, 0xbb, 0x00, 0x00, 0x00, 0xf9, 0x00, 0x02, // .M...K.......... + 0x00, 0x04, 0x01, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x04, 0x01, 0x00, 0x00, 0xf5, 0x00, 0x07, // ................ + 0x00, 0x0d, 0x00, 0x00, 0x00, 0x75, 0x01, 0x00, 0x00, 0x70, 0x01, 0x00, 0x00, 0x05, 0x00, 0x00, // .....u...p...... + 0x00, 0x4d, 0x01, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x70, 0x00, 0x00, // .M.......A...p.. + 0x00, 0x05, 0x01, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, // .....U.......=.. + 0x00, 0x0d, 0x00, 0x00, 0x00, 0x06, 0x01, 0x00, 0x00, 0x05, 0x01, 0x00, 0x00, 0x4f, 0x00, 0x07, // .............O.. + 0x00, 0x0b, 0x00, 0x00, 0x00, 0x07, 0x01, 0x00, 0x00, 0x06, 0x01, 0x00, 0x00, 0x06, 0x01, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x59, 0x00, 0x00, // .........A...Y.. + 0x00, 0x08, 0x01, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, // .....U...V...X.. + 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x09, 0x01, 0x00, 0x00, 0x08, 0x01, 0x00, // .=.............. + 0x00, 0x41, 0x00, 0x06, 0x00, 0x59, 0x00, 0x00, 0x00, 0x0a, 0x01, 0x00, 0x00, 0x55, 0x00, 0x00, // .A...Y.......U.. + 0x00, 0x56, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, // .V...`...=...... + 0x00, 0x0b, 0x01, 0x00, 0x00, 0x0a, 0x01, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, // .........P...... + 0x00, 0x0c, 0x01, 0x00, 0x00, 0x09, 0x01, 0x00, 0x00, 0x0b, 0x01, 0x00, 0x00, 0x81, 0x00, 0x05, // ................ + 0x00, 0x0b, 0x00, 0x00, 0x00, 0x0d, 0x01, 0x00, 0x00, 0x07, 0x01, 0x00, 0x00, 0x0c, 0x01, 0x00, // ................ + 0x00, 0x41, 0x00, 0x05, 0x00, 0x70, 0x00, 0x00, 0x00, 0x0f, 0x01, 0x00, 0x00, 0x55, 0x00, 0x00, // .A...p.......U.. + 0x00, 0x32, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x10, 0x01, 0x00, // .2...=.......... + 0x00, 0x0f, 0x01, 0x00, 0x00, 0x4f, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x11, 0x01, 0x00, // .....O.......... + 0x00, 0x10, 0x01, 0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // ................ + 0x00, 0x88, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x12, 0x01, 0x00, 0x00, 0x72, 0x01, 0x00, // .............r.. + 0x00, 0x11, 0x01, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x13, 0x01, 0x00, 0x00, 0xf8, 0x00, 0x02, // ................ + 0x00, 0x13, 0x01, 0x00, 0x00, 0xf5, 0x00, 0x07, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x74, 0x01, 0x00, // .............t.. + 0x00, 0x75, 0x01, 0x00, 0x00, 0x04, 0x01, 0x00, 0x00, 0x2e, 0x01, 0x00, 0x00, 0x1a, 0x01, 0x00, // .u.............. + 0x00, 0xf5, 0x00, 0x07, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x73, 0x01, 0x00, 0x00, 0x2e, 0x00, 0x00, // .....-...s...... + 0x00, 0x04, 0x01, 0x00, 0x00, 0x31, 0x01, 0x00, 0x00, 0x1a, 0x01, 0x00, 0x00, 0x41, 0x00, 0x06, // .....1.......A.. + 0x00, 0x59, 0x00, 0x00, 0x00, 0x16, 0x01, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, // .Y.......U...V.. + 0x00, 0x8a, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x17, 0x01, 0x00, // .....=.......... + 0x00, 0x16, 0x01, 0x00, 0x00, 0x6e, 0x00, 0x04, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x18, 0x01, 0x00, // .....n...-...... + 0x00, 0x17, 0x01, 0x00, 0x00, 0xb3, 0x00, 0x05, 0x00, 0x5e, 0x00, 0x00, 0x00, 0x19, 0x01, 0x00, // .........^...... + 0x00, 0x73, 0x01, 0x00, 0x00, 0x18, 0x01, 0x00, 0x00, 0xf6, 0x00, 0x04, 0x00, 0x32, 0x01, 0x00, // .s...........2.. + 0x00, 0x1a, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0x19, 0x01, 0x00, // ................ + 0x00, 0x1a, 0x01, 0x00, 0x00, 0x32, 0x01, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x1a, 0x01, 0x00, // .....2.......... + 0x00, 0x85, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x1d, 0x01, 0x00, 0x00, 0x0d, 0x01, 0x00, // ................ + 0x00, 0x12, 0x01, 0x00, 0x00, 0x6f, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x1f, 0x01, 0x00, // .....o.......... + 0x00, 0x73, 0x01, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x20, 0x01, 0x00, // .s........... .. + 0x00, 0x1d, 0x01, 0x00, 0x00, 0x1f, 0x01, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, // ................ + 0x00, 0x23, 0x01, 0x00, 0x00, 0xbb, 0x00, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x56, 0x00, 0x05, // .#....... ...V.. + 0x00, 0x36, 0x00, 0x00, 0x00, 0x58, 0x01, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, // .6...X...+...(.. + 0x00, 0x57, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x5a, 0x01, 0x00, 0x00, 0x58, 0x01, 0x00, // .W.......Z...X.. + 0x00, 0x23, 0x01, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x27, 0x01, 0x00, // .#...........'.. + 0x00, 0x74, 0x01, 0x00, 0x00, 0x5a, 0x01, 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, // .t...Z.......... + 0x00, 0x2a, 0x01, 0x00, 0x00, 0xbb, 0x00, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x56, 0x00, 0x05, // .*....... ...V.. + 0x00, 0x36, 0x00, 0x00, 0x00, 0x61, 0x01, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, // .6...a...+...(.. + 0x00, 0x57, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x63, 0x01, 0x00, 0x00, 0x61, 0x01, 0x00, // .W.......c...a.. + 0x00, 0x2a, 0x01, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x2e, 0x01, 0x00, // .*.............. + 0x00, 0x27, 0x01, 0x00, 0x00, 0x63, 0x01, 0x00, 0x00, 0x80, 0x00, 0x05, 0x00, 0x2d, 0x00, 0x00, // .'...c.......-.. + 0x00, 0x31, 0x01, 0x00, 0x00, 0x73, 0x01, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0xf9, 0x00, 0x02, // .1...s.......... + 0x00, 0x13, 0x01, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x32, 0x01, 0x00, 0x00, 0x41, 0x00, 0x06, // .........2...A.. + 0x00, 0x59, 0x00, 0x00, 0x00, 0x34, 0x01, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, // .Y...4...U...V.. + 0x00, 0xab, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x35, 0x01, 0x00, // .....=.......5.. + 0x00, 0x34, 0x01, 0x00, 0x00, 0x50, 0x00, 0x07, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x36, 0x01, 0x00, // .4...P.......6.. + 0x00, 0x35, 0x01, 0x00, 0x00, 0x35, 0x01, 0x00, 0x00, 0x35, 0x01, 0x00, 0x00, 0x35, 0x01, 0x00, // .5...5...5...5.. + 0x00, 0x88, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x37, 0x01, 0x00, 0x00, 0x74, 0x01, 0x00, // .........7...t.. + 0x00, 0x36, 0x01, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0xc7, 0x00, 0x00, 0x00, 0x37, 0x01, 0x00, // .6...>.......7.. + 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x00, 0x30, 0x00, // .....8.....0. +}; diff --git a/Polyfills/Canvas/Source/Shaders/spirv/fs_gaussblur.h b/Polyfills/Canvas/Source/Shaders/spirv/fs_gaussblur.h new file mode 100644 index 000000000..8b6334dbf --- /dev/null +++ b/Polyfills/Canvas/Source/Shaders/spirv/fs_gaussblur.h @@ -0,0 +1,159 @@ +static const uint8_t fs_gaussblur_spv[2485] = +{ + 0x46, 0x53, 0x48, 0x0b, 0xcf, 0xda, 0x1b, 0x94, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x09, 0x75, // FSH............u + 0x5f, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x73, 0x12, 0x05, 0x20, 0x00, 0x05, 0x00, 0x00, 0x00, // _weights.. ..... + 0x00, 0x00, 0x0a, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x01, 0x00, // ...u_viewSize... + 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x75, 0x5f, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, // ........u_direct + 0x69, 0x6f, 0x6e, 0x12, 0x01, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x73, 0x5f, // ion...........s_ + 0x74, 0x65, 0x78, 0x30, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x02, 0x22, 0x00, 0x50, 0x09, 0x00, // tex0.......".P.. + 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0b, 0x00, 0x08, 0x00, 0xc2, 0x01, 0x00, // ...#............ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, // ................ + 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, // .....GLSL.std.45 + 0x30, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // 0............... + 0x00, 0x0f, 0x00, 0x07, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, // .............mai + 0x6e, 0x00, 0x00, 0x00, 0x00, 0xcb, 0x00, 0x00, 0x00, 0xd8, 0x00, 0x00, 0x00, 0x10, 0x00, 0x03, // n............... + 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x05, 0x00, 0x00, // ................ + 0x00, 0xf4, 0x01, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, // .............mai + 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x32, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, // n........2...s_t + 0x65, 0x78, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, // exSampler....... + 0x00, 0x35, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, // .5...s_texTextur + 0x65, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x67, 0x00, 0x00, 0x00, 0x55, 0x6e, 0x69, // e........g...Uni + 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x06, // formBlock....... + 0x00, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x53, // .g.......u_viewS + 0x69, 0x7a, 0x65, 0x00, 0x00, 0x06, 0x00, 0x06, 0x00, 0x67, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // ize......g...... + 0x00, 0x75, 0x5f, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x00, 0x06, 0x00, 0x06, // .u_direction.... + 0x00, 0x67, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x77, 0x65, 0x69, 0x67, 0x68, // .g.......u_weigh + 0x74, 0x73, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x00, 0x69, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ts.......i...... + 0x00, 0x05, 0x00, 0x05, 0x00, 0xcb, 0x00, 0x00, 0x00, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, // .........v_texco + 0x6f, 0x72, 0x64, 0x30, 0x00, 0x05, 0x00, 0x06, 0x00, 0xd8, 0x00, 0x00, 0x00, 0x62, 0x67, 0x66, // ord0.........bgf + 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x00, 0x00, 0x47, 0x00, 0x04, // x_FragData0..G.. + 0x00, 0x32, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, // .2...!.......G.. + 0x00, 0x32, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, // .2...".......G.. + 0x00, 0x35, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, // .5...!.......G.. + 0x00, 0x35, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, // .5...".......G.. + 0x00, 0x66, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, // .f...........G.. + 0x00, 0x67, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x67, 0x00, 0x00, // .g.......H...g.. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, // .....#.......H.. + 0x00, 0x67, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, // .g.......#...... + 0x00, 0x48, 0x00, 0x05, 0x00, 0x67, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, // .H...g.......#.. + 0x00, 0x20, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x69, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, // . ...G...i...!.. + 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x69, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, // .....G...i...".. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xcb, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, // .....G.......... + 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xd8, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, // .....G.......... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, // .............!.. + 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x02, 0x00, 0x06, 0x00, 0x00, // ................ + 0x00, 0x16, 0x00, 0x03, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x19, 0x00, 0x09, // ......... ...... + 0x00, 0x08, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x17, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, // ................ + 0x00, 0x17, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, // ................ + 0x00, 0x15, 0x00, 0x04, 0x00, 0x21, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // .....!... ...... + 0x00, 0x20, 0x00, 0x04, 0x00, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, // . ...1.......... + 0x00, 0x3b, 0x00, 0x04, 0x00, 0x31, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .;...1...2...... + 0x00, 0x20, 0x00, 0x04, 0x00, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, // . ...4.......... + 0x00, 0x3b, 0x00, 0x04, 0x00, 0x34, 0x00, 0x00, 0x00, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .;...4...5...... + 0x00, 0x2b, 0x00, 0x04, 0x00, 0x21, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // .+...!...8...... + 0x00, 0x2b, 0x00, 0x04, 0x00, 0x21, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .+...!...<...... + 0x00, 0x1b, 0x00, 0x03, 0x00, 0x40, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, // .....@.......+.. + 0x00, 0x21, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, // .!...Z.......+.. + 0x00, 0x07, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x15, 0x00, 0x04, // ....._......@... + 0x00, 0x64, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, // .d... .......+.. + 0x00, 0x64, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x04, // .d...e.......... + 0x00, 0x66, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x05, // .f.......e...... + 0x00, 0x67, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x66, 0x00, 0x00, // .g...........f.. + 0x00, 0x20, 0x00, 0x04, 0x00, 0x68, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, // . ...h.......g.. + 0x00, 0x3b, 0x00, 0x04, 0x00, 0x68, 0x00, 0x00, 0x00, 0x69, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, // .;...h...i...... + 0x00, 0x2b, 0x00, 0x04, 0x00, 0x21, 0x00, 0x00, 0x00, 0x6a, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, // .+...!...j...... + 0x00, 0x20, 0x00, 0x04, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, // . ...m.......... + 0x00, 0x2b, 0x00, 0x04, 0x00, 0x21, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, // .+...!.......... + 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x89, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, // .+.............. + 0x3f, 0x20, 0x00, 0x04, 0x00, 0x8c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, // ? .............. + 0x00, 0x14, 0x00, 0x02, 0x00, 0x98, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0xc7, 0x00, 0x00, // ......... ...... + 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0xc7, 0x00, 0x00, // .........;...... + 0x00, 0xcb, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0xd7, 0x00, 0x00, // ......... ...... + 0x00, 0x03, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0xd7, 0x00, 0x00, // .........;...... + 0x00, 0xd8, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, // .........+...... + 0x00, 0xbc, 0x01, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x40, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, // ........@+...... + 0x00, 0xbd, 0x01, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x3f, 0x2c, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, // ........?,...... + 0x00, 0xbe, 0x01, 0x00, 0x00, 0x89, 0x00, 0x00, 0x00, 0x89, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, // .............+.. + 0x00, 0x07, 0x00, 0x00, 0x00, 0xbf, 0x01, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3e, 0x36, 0x00, 0x05, // ............>6.. + 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, // ................ + 0x00, 0xf8, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, // .........=...... + 0x00, 0x33, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, // .3...2...=...... + 0x00, 0x36, 0x00, 0x00, 0x00, 0x35, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, // .6...5...=...... + 0x00, 0xcc, 0x00, 0x00, 0x00, 0xcb, 0x00, 0x00, 0x00, 0x56, 0x00, 0x05, 0x00, 0x40, 0x00, 0x00, // .........V...@.. + 0x00, 0x47, 0x01, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0x57, 0x00, 0x05, // .G...6...3...W.. + 0x00, 0x0d, 0x00, 0x00, 0x00, 0x49, 0x01, 0x00, 0x00, 0x47, 0x01, 0x00, 0x00, 0xcc, 0x00, 0x00, // .....I...G...... + 0x00, 0x0c, 0x00, 0x06, 0x00, 0x07, 0x00, 0x00, 0x00, 0x61, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, // .........a...... + 0x00, 0x08, 0x00, 0x00, 0x00, 0xbd, 0x01, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, // ................ + 0x00, 0x62, 0x01, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x00, 0x61, 0x01, 0x00, 0x00, 0x83, 0x00, 0x05, // .b..._...a...... + 0x00, 0x07, 0x00, 0x00, 0x00, 0x63, 0x01, 0x00, 0x00, 0xbc, 0x01, 0x00, 0x00, 0x62, 0x01, 0x00, // .....c.......b.. + 0x00, 0x6e, 0x00, 0x04, 0x00, 0x21, 0x00, 0x00, 0x00, 0x55, 0x01, 0x00, 0x00, 0x63, 0x01, 0x00, // .n...!...U...c.. + 0x00, 0x41, 0x00, 0x07, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x58, 0x01, 0x00, 0x00, 0x69, 0x00, 0x00, // .A...m...X...i.. + 0x00, 0x6a, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x55, 0x01, 0x00, 0x00, 0x3d, 0x00, 0x04, // .j...8...U...=.. + 0x00, 0x07, 0x00, 0x00, 0x00, 0x59, 0x01, 0x00, 0x00, 0x58, 0x01, 0x00, 0x00, 0x8e, 0x00, 0x05, // .....Y...X...... + 0x00, 0x0d, 0x00, 0x00, 0x00, 0x0b, 0x01, 0x00, 0x00, 0x49, 0x01, 0x00, 0x00, 0x59, 0x01, 0x00, // .........I...Y.. + 0x00, 0x41, 0x00, 0x05, 0x00, 0x8c, 0x00, 0x00, 0x00, 0x0d, 0x01, 0x00, 0x00, 0x69, 0x00, 0x00, // .A...........i.. + 0x00, 0x3c, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x0e, 0x01, 0x00, // .<...=.......... + 0x00, 0x0d, 0x01, 0x00, 0x00, 0x4f, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x0f, 0x01, 0x00, // .....O.......... + 0x00, 0x0e, 0x01, 0x00, 0x00, 0x0e, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // ................ + 0x00, 0x88, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0xbe, 0x01, 0x00, // ................ + 0x00, 0x0f, 0x01, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x11, 0x01, 0x00, 0x00, 0xf8, 0x00, 0x02, // ................ + 0x00, 0x11, 0x01, 0x00, 0x00, 0xf5, 0x00, 0x07, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xc1, 0x01, 0x00, // ................ + 0x00, 0x0b, 0x01, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x33, 0x01, 0x00, 0x00, 0x15, 0x01, 0x00, // .........3...... + 0x00, 0xf5, 0x00, 0x07, 0x00, 0x21, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x38, 0x00, 0x00, // .....!.......8.. + 0x00, 0x05, 0x00, 0x00, 0x00, 0x36, 0x01, 0x00, 0x00, 0x15, 0x01, 0x00, 0x00, 0xb3, 0x00, 0x05, // .....6.......... + 0x00, 0x98, 0x00, 0x00, 0x00, 0x14, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x84, 0x00, 0x00, // ................ + 0x00, 0xf6, 0x00, 0x04, 0x00, 0x37, 0x01, 0x00, 0x00, 0x15, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // .....7.......... + 0x00, 0xfa, 0x00, 0x04, 0x00, 0x14, 0x01, 0x00, 0x00, 0x15, 0x01, 0x00, 0x00, 0x37, 0x01, 0x00, // .............7.. + 0x00, 0xf8, 0x00, 0x02, 0x00, 0x15, 0x01, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x8c, 0x00, 0x00, // .........A...... + 0x00, 0x16, 0x01, 0x00, 0x00, 0x69, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, // .....i...8...=.. + 0x00, 0x0d, 0x00, 0x00, 0x00, 0x17, 0x01, 0x00, 0x00, 0x16, 0x01, 0x00, 0x00, 0x4f, 0x00, 0x07, // .............O.. + 0x00, 0x0b, 0x00, 0x00, 0x00, 0x18, 0x01, 0x00, 0x00, 0x17, 0x01, 0x00, 0x00, 0x17, 0x01, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, // ................ + 0x00, 0x1a, 0x01, 0x00, 0x00, 0x18, 0x01, 0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x6f, 0x00, 0x04, // .............o.. + 0x00, 0x07, 0x00, 0x00, 0x00, 0x1c, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x8e, 0x00, 0x05, // ................ + 0x00, 0x0b, 0x00, 0x00, 0x00, 0x1d, 0x01, 0x00, 0x00, 0x1a, 0x01, 0x00, 0x00, 0x1c, 0x01, 0x00, // ................ + 0x00, 0x81, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0xcc, 0x00, 0x00, // ......... ...... + 0x00, 0x1d, 0x01, 0x00, 0x00, 0x56, 0x00, 0x05, 0x00, 0x40, 0x00, 0x00, 0x00, 0x6e, 0x01, 0x00, // .....V...@...n.. + 0x00, 0x36, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0x57, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, // .6...3...W...... + 0x00, 0x70, 0x01, 0x00, 0x00, 0x6e, 0x01, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x80, 0x00, 0x05, // .p...n... ...... + 0x00, 0x21, 0x00, 0x00, 0x00, 0x24, 0x01, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x00, // .!...$.......... + 0x00, 0x87, 0x00, 0x05, 0x00, 0x21, 0x00, 0x00, 0x00, 0x78, 0x01, 0x00, 0x00, 0x24, 0x01, 0x00, // .....!...x...$.. + 0x00, 0x5a, 0x00, 0x00, 0x00, 0x6f, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x7a, 0x01, 0x00, // .Z...o.......z.. + 0x00, 0x24, 0x01, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x87, 0x01, 0x00, // .$.............. + 0x00, 0x7a, 0x01, 0x00, 0x00, 0xbf, 0x01, 0x00, 0x00, 0x0c, 0x00, 0x06, 0x00, 0x07, 0x00, 0x00, // .z.............. + 0x00, 0x88, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x87, 0x01, 0x00, // ................ + 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x89, 0x01, 0x00, 0x00, 0x5f, 0x00, 0x00, // ............._.. + 0x00, 0x88, 0x01, 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x8a, 0x01, 0x00, // ................ + 0x00, 0x7a, 0x01, 0x00, 0x00, 0x89, 0x01, 0x00, 0x00, 0x6e, 0x00, 0x04, 0x00, 0x21, 0x00, 0x00, // .z.......n...!.. + 0x00, 0x7c, 0x01, 0x00, 0x00, 0x8a, 0x01, 0x00, 0x00, 0x41, 0x00, 0x07, 0x00, 0x6d, 0x00, 0x00, // .|.......A...m.. + 0x00, 0x7f, 0x01, 0x00, 0x00, 0x69, 0x00, 0x00, 0x00, 0x6a, 0x00, 0x00, 0x00, 0x78, 0x01, 0x00, // .....i...j...x.. + 0x00, 0x7c, 0x01, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, // .|...=.......... + 0x00, 0x7f, 0x01, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x26, 0x01, 0x00, // .............&.. + 0x00, 0x70, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, // .p.............. + 0x00, 0x28, 0x01, 0x00, 0x00, 0xc1, 0x01, 0x00, 0x00, 0x26, 0x01, 0x00, 0x00, 0x83, 0x00, 0x05, // .(.......&...... + 0x00, 0x0b, 0x00, 0x00, 0x00, 0x2b, 0x01, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0x1d, 0x01, 0x00, // .....+.......... + 0x00, 0x56, 0x00, 0x05, 0x00, 0x40, 0x00, 0x00, 0x00, 0x91, 0x01, 0x00, 0x00, 0x36, 0x00, 0x00, // .V...@.......6.. + 0x00, 0x33, 0x00, 0x00, 0x00, 0x57, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x93, 0x01, 0x00, // .3...W.......... + 0x00, 0x91, 0x01, 0x00, 0x00, 0x2b, 0x01, 0x00, 0x00, 0x82, 0x00, 0x05, 0x00, 0x21, 0x00, 0x00, // .....+.......!.. + 0x00, 0x2f, 0x01, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x87, 0x00, 0x05, // ./.............. + 0x00, 0x21, 0x00, 0x00, 0x00, 0x9b, 0x01, 0x00, 0x00, 0x2f, 0x01, 0x00, 0x00, 0x5a, 0x00, 0x00, // .!......./...Z.. + 0x00, 0x6f, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x9d, 0x01, 0x00, 0x00, 0x2f, 0x01, 0x00, // .o.........../.. + 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xaa, 0x01, 0x00, 0x00, 0x9d, 0x01, 0x00, // ................ + 0x00, 0xbf, 0x01, 0x00, 0x00, 0x0c, 0x00, 0x06, 0x00, 0x07, 0x00, 0x00, 0x00, 0xab, 0x01, 0x00, // ................ + 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0xaa, 0x01, 0x00, 0x00, 0x85, 0x00, 0x05, // ................ + 0x00, 0x07, 0x00, 0x00, 0x00, 0xac, 0x01, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x00, 0xab, 0x01, 0x00, // ........._...... + 0x00, 0x83, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xad, 0x01, 0x00, 0x00, 0x9d, 0x01, 0x00, // ................ + 0x00, 0xac, 0x01, 0x00, 0x00, 0x6e, 0x00, 0x04, 0x00, 0x21, 0x00, 0x00, 0x00, 0x9f, 0x01, 0x00, // .....n...!...... + 0x00, 0xad, 0x01, 0x00, 0x00, 0x41, 0x00, 0x07, 0x00, 0x6d, 0x00, 0x00, 0x00, 0xa2, 0x01, 0x00, // .....A...m...... + 0x00, 0x69, 0x00, 0x00, 0x00, 0x6a, 0x00, 0x00, 0x00, 0x9b, 0x01, 0x00, 0x00, 0x9f, 0x01, 0x00, // .i...j.......... + 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xa3, 0x01, 0x00, 0x00, 0xa2, 0x01, 0x00, // .=.............. + 0x00, 0x8e, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x31, 0x01, 0x00, 0x00, 0x93, 0x01, 0x00, // .........1...... + 0x00, 0xa3, 0x01, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x33, 0x01, 0x00, // .............3.. + 0x00, 0x28, 0x01, 0x00, 0x00, 0x31, 0x01, 0x00, 0x00, 0x80, 0x00, 0x05, 0x00, 0x21, 0x00, 0x00, // .(...1.......!.. + 0x00, 0x36, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0xf9, 0x00, 0x02, // .6.......8...... + 0x00, 0x11, 0x01, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x37, 0x01, 0x00, 0x00, 0x3e, 0x00, 0x03, // .........7...>.. + 0x00, 0xd8, 0x00, 0x00, 0x00, 0xc1, 0x01, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, // .............8.. + 0x00, 0x00, 0x00, 0x70, 0x00, // ...p. +}; diff --git a/Polyfills/Canvas/Source/Shaders/spirv/fs_nanovg_fill.h b/Polyfills/Canvas/Source/Shaders/spirv/fs_nanovg_fill.h index fcc7ee97f..4c648b277 100644 --- a/Polyfills/Canvas/Source/Shaders/spirv/fs_nanovg_fill.h +++ b/Polyfills/Canvas/Source/Shaders/spirv/fs_nanovg_fill.h @@ -1,355 +1,481 @@ -static const uint8_t fs_nanovg_fill_spv[5628] = +static const uint8_t fs_nanovg_fill_spv[7645] = { - 0x46, 0x53, 0x48, 0x0b, 0xcf, 0xda, 0x1b, 0x94, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x0c, 0x75, // FSH............u + 0x46, 0x53, 0x48, 0x0b, 0x1e, 0x98, 0xde, 0xee, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x0c, 0x75, // FSH............u 0x5f, 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x4d, 0x61, 0x74, 0x13, 0x01, 0x00, 0x00, 0x03, // _scissorMat..... 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x75, 0x5f, 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x45, // ......u_scissorE 0x78, 0x74, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x12, 0x01, 0x80, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // xtScale......... 0x00, 0x08, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x01, 0xa0, 0x00, 0x01, 0x00, // ..u_params...... + 0x00, 0x00, 0x00, 0x00, 0x05, 0x75, 0x5f, 0x73, 0x64, 0x66, 0x12, 0x01, 0xb0, 0x00, 0x01, 0x00, // .....u_sdf...... 0x00, 0x00, 0x00, 0x00, 0x0a, 0x75, 0x5f, 0x70, 0x61, 0x69, 0x6e, 0x74, 0x4d, 0x61, 0x74, 0x13, // .....u_paintMat. 0x01, 0x30, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, // .0........u_exte 0x6e, 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x12, 0x01, 0x90, 0x00, 0x01, 0x00, 0x00, 0x00, // ntRadius........ 0x00, 0x00, 0x0a, 0x75, 0x5f, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x12, 0x01, 0x60, // ...u_innerCol..` 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x75, 0x5f, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x43, // ........u_outerC 0x6f, 0x6c, 0x12, 0x01, 0x70, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x73, 0x5f, 0x74, // ol..p........s_t - 0x65, 0x78, 0x30, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x02, 0x22, 0x00, 0x38, 0x15, 0x00, 0x00, // ex0.......".8... - 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0b, 0x00, 0x08, 0x00, 0xaf, 0x02, 0x00, 0x00, // ..#............. - 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, // ................ - 0x01, 0x00, 0x00, 0x00, 0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30, // ....GLSL.std.450 - 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // ................ - 0x0f, 0x00, 0x08, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, // ............main - 0x00, 0x00, 0x00, 0x00, 0x64, 0x01, 0x00, 0x00, 0x67, 0x01, 0x00, 0x00, 0x74, 0x01, 0x00, 0x00, // ....d...g...t... - 0x10, 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, // ................ - 0x05, 0x00, 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, // ................ - 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x36, 0x00, 0x00, 0x00, // main........6... - 0x73, 0x5f, 0x74, 0x65, 0x78, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x00, 0x00, 0x00, 0x00, // s_texSampler.... - 0x05, 0x00, 0x06, 0x00, 0x39, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x54, 0x65, 0x78, // ....9...s_texTex - 0x74, 0x75, 0x72, 0x65, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x7a, 0x00, 0x00, 0x00, // ture........z... - 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x00, 0x00, 0x00, 0x00, // UniformBlock.... - 0x06, 0x00, 0x07, 0x00, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x73, 0x63, // ....z.......u_sc - 0x69, 0x73, 0x73, 0x6f, 0x72, 0x4d, 0x61, 0x74, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x06, 0x00, // issorMat........ - 0x7a, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x70, 0x61, 0x69, 0x6e, 0x74, 0x4d, // z.......u_paintM - 0x61, 0x74, 0x00, 0x00, 0x06, 0x00, 0x06, 0x00, 0x7a, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, // at......z....... - 0x75, 0x5f, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x00, 0x00, 0x06, 0x00, 0x06, 0x00, // u_innerCol...... - 0x7a, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x43, // z.......u_outerC - 0x6f, 0x6c, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x7a, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, // ol......z....... - 0x75, 0x5f, 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x53, 0x63, 0x61, 0x6c, // u_scissorExtScal - 0x65, 0x00, 0x00, 0x00, 0x06, 0x00, 0x07, 0x00, 0x7a, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, // e.......z....... - 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x00, 0x00, // u_extentRadius.. - 0x06, 0x00, 0x06, 0x00, 0x7a, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x70, 0x61, // ....z.......u_pa - 0x72, 0x61, 0x6d, 0x73, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x00, 0x7c, 0x00, 0x00, 0x00, // rams........|... - 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x64, 0x01, 0x00, 0x00, 0x76, 0x5f, 0x70, 0x6f, // ........d...v_po - 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x67, 0x01, 0x00, 0x00, // sition......g... - 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x00, 0x05, 0x00, 0x06, 0x00, // v_texcoord0..... - 0x74, 0x01, 0x00, 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, // t...bgfx_FragDat - 0x61, 0x30, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x36, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, // a0..G...6...!... - 0x12, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x36, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, // ....G...6..."... - 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x39, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, // ....G...9...!... - 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x39, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, // ....G...9..."... - 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00, 0x7a, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, // ....G...z....... - 0x48, 0x00, 0x04, 0x00, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, // H...z........... - 0x48, 0x00, 0x05, 0x00, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, // H...z........... - 0x10, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ....H...z....... - 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x04, 0x00, 0x7a, 0x00, 0x00, 0x00, // #.......H...z... - 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x7a, 0x00, 0x00, 0x00, // ........H...z... - 0x01, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, // ............H... - 0x7a, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, // z.......#...0... - 0x48, 0x00, 0x05, 0x00, 0x7a, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, // H...z.......#... - 0x60, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x7a, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // `...H...z....... - 0x23, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x7a, 0x00, 0x00, 0x00, // #...p...H...z... - 0x04, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, // ....#.......H... - 0x7a, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0x00, // z.......#....... - 0x48, 0x00, 0x05, 0x00, 0x7a, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, // H...z.......#... - 0xa0, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, // ....G...|...!... - 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, // ....G...|..."... - 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x64, 0x01, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, // ....G...d....... - 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x67, 0x01, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, // ....G...g....... - 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x74, 0x01, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, // ....G...t....... - 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, // ............!... - 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x02, 0x00, 0x06, 0x00, 0x00, 0x00, // ................ - 0x16, 0x00, 0x03, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x19, 0x00, 0x09, 0x00, // ........ ....... - 0x08, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x17, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, // ................ - 0x17, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, // ................ - 0x20, 0x00, 0x04, 0x00, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, // ...5........... - 0x3b, 0x00, 0x04, 0x00, 0x35, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ;...5...6....... - 0x20, 0x00, 0x04, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, // ...8........... - 0x3b, 0x00, 0x04, 0x00, 0x38, 0x00, 0x00, 0x00, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ;...8...9....... - 0x15, 0x00, 0x04, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // ....<... ....... - 0x2b, 0x00, 0x04, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // +...<...=....... - 0x2b, 0x00, 0x04, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // +...<...A....... - 0x1b, 0x00, 0x03, 0x00, 0x45, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, // ....E........... - 0x5f, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, // _... .......+... - 0x5f, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, // _...`.......+... - 0x5f, 0x00, 0x00, 0x00, 0x63, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, // _...c.......+... - 0x07, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x05, 0x00, // ....g.......,... - 0x0b, 0x00, 0x00, 0x00, 0x6a, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x00, // ....j...g...g... - 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, // +.......t......? - 0x17, 0x00, 0x04, 0x00, 0x75, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // ....u........... - 0x18, 0x00, 0x04, 0x00, 0x79, 0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // ....y...u....... - 0x1e, 0x00, 0x09, 0x00, 0x7a, 0x00, 0x00, 0x00, 0x79, 0x00, 0x00, 0x00, 0x79, 0x00, 0x00, 0x00, // ....z...y...y... - 0x0d, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, // ................ - 0x0d, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x7b, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, // .... ...{....... - 0x7a, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x7b, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, // z...;...{...|... - 0x02, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x7d, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, // .... ...}....... - 0x79, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, // y...+...<....... - 0x04, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x84, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, // .... ........... - 0x0d, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x89, 0x00, 0x00, 0x00, // ....+........... - 0x00, 0x00, 0x00, 0x3f, 0x2c, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x8a, 0x00, 0x00, 0x00, // ...?,........... - 0x89, 0x00, 0x00, 0x00, 0x89, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, // ........+....... - 0x9c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x2b, 0x00, 0x04, 0x00, 0x3c, 0x00, 0x00, 0x00, // .......@+...<... - 0xa1, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0xa2, 0x00, 0x00, 0x00, // ........ ....... - 0x02, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x5f, 0x00, 0x00, 0x00, // ........+..._... - 0xb8, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, 0x00, 0xbb, 0x00, 0x00, 0x00, // ................ - 0x2b, 0x00, 0x04, 0x00, 0x3c, 0x00, 0x00, 0x00, 0xc9, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, // +...<........... - 0x2b, 0x00, 0x04, 0x00, 0x5f, 0x00, 0x00, 0x00, 0xd1, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, // +..._........... - 0x2b, 0x00, 0x04, 0x00, 0x3c, 0x00, 0x00, 0x00, 0xde, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, // +...<........... - 0x2b, 0x00, 0x04, 0x00, 0x3c, 0x00, 0x00, 0x00, 0xdf, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // +...<........... - 0x2c, 0x00, 0x07, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x31, 0x01, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, // ,.......1...t... - 0x74, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, // t...t...t...+... - 0x07, 0x00, 0x00, 0x00, 0x35, 0x01, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x20, 0x00, 0x04, 0x00, // ....5.....@@ ... - 0x63, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, // c...........;... - 0x63, 0x01, 0x00, 0x00, 0x64, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, // c...d.......;... - 0x63, 0x01, 0x00, 0x00, 0x67, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, // c...g....... ... - 0x73, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, // s...........;... - 0x73, 0x01, 0x00, 0x00, 0x74, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x00, // s...t........... - 0x0d, 0x00, 0x00, 0x00, 0xae, 0x02, 0x00, 0x00, 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, // ........6....... - 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, // ................ - 0x05, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00, // ....=.......7... - 0x36, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x00, 0x00, // 6...=.......:... - 0x39, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x65, 0x01, 0x00, 0x00, // 9...=.......e... - 0x64, 0x01, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x68, 0x01, 0x00, 0x00, // d...=.......h... - 0x67, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3a, 0x02, 0x00, 0x00, // g...Q.......:... - 0x65, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, // e.......Q....... - 0x3b, 0x02, 0x00, 0x00, 0x65, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x50, 0x00, 0x06, 0x00, // ;...e.......P... - 0x75, 0x00, 0x00, 0x00, 0x3c, 0x02, 0x00, 0x00, 0x3a, 0x02, 0x00, 0x00, 0x3b, 0x02, 0x00, 0x00, // u...<...:...;... - 0x74, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x7d, 0x00, 0x00, 0x00, 0x3d, 0x02, 0x00, 0x00, // t...A...}...=... - 0x7c, 0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x79, 0x00, 0x00, 0x00, // |...A...=...y... - 0x3e, 0x02, 0x00, 0x00, 0x3d, 0x02, 0x00, 0x00, 0x90, 0x00, 0x05, 0x00, 0x75, 0x00, 0x00, 0x00, // >...=.......u... - 0x3f, 0x02, 0x00, 0x00, 0x3c, 0x02, 0x00, 0x00, 0x3e, 0x02, 0x00, 0x00, 0x4f, 0x00, 0x07, 0x00, // ?...<...>...O... - 0x0b, 0x00, 0x00, 0x00, 0x40, 0x02, 0x00, 0x00, 0x3f, 0x02, 0x00, 0x00, 0x3f, 0x02, 0x00, 0x00, // ....@...?...?... - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, // ................ - 0x41, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x40, 0x02, 0x00, 0x00, // A...........@... - 0x41, 0x00, 0x05, 0x00, 0x84, 0x00, 0x00, 0x00, 0x42, 0x02, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, // A.......B...|... - 0x83, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x43, 0x02, 0x00, 0x00, // ....=.......C... - 0x42, 0x02, 0x00, 0x00, 0x4f, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x44, 0x02, 0x00, 0x00, // B...O.......D... - 0x43, 0x02, 0x00, 0x00, 0x43, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // C...C........... - 0x83, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x45, 0x02, 0x00, 0x00, 0x41, 0x02, 0x00, 0x00, // ........E...A... - 0x44, 0x02, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x84, 0x00, 0x00, 0x00, 0x47, 0x02, 0x00, 0x00, // D...A.......G... - 0x7c, 0x00, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, // |.......=....... - 0x48, 0x02, 0x00, 0x00, 0x47, 0x02, 0x00, 0x00, 0x4f, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, 0x00, // H...G...O....... - 0x49, 0x02, 0x00, 0x00, 0x48, 0x02, 0x00, 0x00, 0x48, 0x02, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, // I...H...H....... - 0x03, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x4a, 0x02, 0x00, 0x00, // ............J... - 0x45, 0x02, 0x00, 0x00, 0x49, 0x02, 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, // E...I........... - 0x4b, 0x02, 0x00, 0x00, 0x8a, 0x00, 0x00, 0x00, 0x4a, 0x02, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, // K.......J...Q... - 0x07, 0x00, 0x00, 0x00, 0x4d, 0x02, 0x00, 0x00, 0x4b, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ....M...K....... - 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0x4e, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // ........N....... - 0x2b, 0x00, 0x00, 0x00, 0x4d, 0x02, 0x00, 0x00, 0x67, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, // +...M...g...t... - 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x50, 0x02, 0x00, 0x00, 0x4b, 0x02, 0x00, 0x00, // Q.......P...K... - 0x01, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0x51, 0x02, 0x00, 0x00, // ............Q... - 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x50, 0x02, 0x00, 0x00, 0x67, 0x00, 0x00, 0x00, // ....+...P...g... - 0x74, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x52, 0x02, 0x00, 0x00, // t...........R... - 0x4e, 0x02, 0x00, 0x00, 0x51, 0x02, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, // N...Q...Q....... - 0x56, 0x02, 0x00, 0x00, 0x68, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, // V...h........... - 0x07, 0x00, 0x00, 0x00, 0x57, 0x02, 0x00, 0x00, 0x56, 0x02, 0x00, 0x00, 0x9c, 0x00, 0x00, 0x00, // ....W...V....... - 0x83, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x58, 0x02, 0x00, 0x00, 0x57, 0x02, 0x00, 0x00, // ........X...W... - 0x74, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x06, 0x00, 0x07, 0x00, 0x00, 0x00, 0x59, 0x02, 0x00, 0x00, // t...........Y... - 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x58, 0x02, 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, // ........X....... - 0x07, 0x00, 0x00, 0x00, 0x5a, 0x02, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x59, 0x02, 0x00, 0x00, // ....Z...t...Y... - 0x41, 0x00, 0x06, 0x00, 0xa2, 0x00, 0x00, 0x00, 0x5b, 0x02, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, // A.......[...|... - 0xa1, 0x00, 0x00, 0x00, 0x63, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, // ....c...=....... - 0x5c, 0x02, 0x00, 0x00, 0x5b, 0x02, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, // ....[........... - 0x5d, 0x02, 0x00, 0x00, 0x5a, 0x02, 0x00, 0x00, 0x5c, 0x02, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, // ]...Z........... - 0x07, 0x00, 0x00, 0x00, 0x5e, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, // ....^.......%... - 0x74, 0x00, 0x00, 0x00, 0x5d, 0x02, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, // t...]...Q....... - 0x60, 0x02, 0x00, 0x00, 0x68, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, // `...h........... - 0x07, 0x00, 0x00, 0x00, 0x61, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, // ....a.......%... - 0x74, 0x00, 0x00, 0x00, 0x60, 0x02, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, // t...`........... - 0x62, 0x02, 0x00, 0x00, 0x5e, 0x02, 0x00, 0x00, 0x61, 0x02, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, // b...^...a...A... - 0xa2, 0x00, 0x00, 0x00, 0xa5, 0x01, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0xa1, 0x00, 0x00, 0x00, // ........|....... - 0xb8, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xa6, 0x01, 0x00, 0x00, // ....=........... - 0xa5, 0x01, 0x00, 0x00, 0xb4, 0x00, 0x05, 0x00, 0xbb, 0x00, 0x00, 0x00, 0xa7, 0x01, 0x00, 0x00, // ................ - 0xa6, 0x01, 0x00, 0x00, 0x67, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x30, 0x02, 0x00, 0x00, // ....g.......0... - 0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0xa7, 0x01, 0x00, 0x00, 0xa8, 0x01, 0x00, 0x00, // ................ - 0xcd, 0x01, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0xa8, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, // ............Q... - 0x07, 0x00, 0x00, 0x00, 0xaa, 0x01, 0x00, 0x00, 0x65, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........e....... - 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xab, 0x01, 0x00, 0x00, 0x65, 0x01, 0x00, 0x00, // Q...........e... - 0x01, 0x00, 0x00, 0x00, 0x50, 0x00, 0x06, 0x00, 0x75, 0x00, 0x00, 0x00, 0xac, 0x01, 0x00, 0x00, // ....P...u....... - 0xaa, 0x01, 0x00, 0x00, 0xab, 0x01, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, // ........t...A... - 0x7d, 0x00, 0x00, 0x00, 0xad, 0x01, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x00, 0x00, // }.......|...=... - 0x3d, 0x00, 0x04, 0x00, 0x79, 0x00, 0x00, 0x00, 0xae, 0x01, 0x00, 0x00, 0xad, 0x01, 0x00, 0x00, // =...y........... - 0x90, 0x00, 0x05, 0x00, 0x75, 0x00, 0x00, 0x00, 0xaf, 0x01, 0x00, 0x00, 0xac, 0x01, 0x00, 0x00, // ....u........... - 0xae, 0x01, 0x00, 0x00, 0x4f, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xb0, 0x01, 0x00, 0x00, // ....O........... - 0xaf, 0x01, 0x00, 0x00, 0xaf, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // ................ - 0x41, 0x00, 0x05, 0x00, 0x84, 0x00, 0x00, 0x00, 0xb2, 0x01, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, // A...........|... - 0xc9, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xb3, 0x01, 0x00, 0x00, // ....=........... - 0xb2, 0x01, 0x00, 0x00, 0x4f, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xb4, 0x01, 0x00, 0x00, // ....O........... - 0xb3, 0x01, 0x00, 0x00, 0xb3, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // ................ - 0x41, 0x00, 0x06, 0x00, 0xa2, 0x00, 0x00, 0x00, 0xb5, 0x01, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, // A...........|... - 0xc9, 0x00, 0x00, 0x00, 0xd1, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, // ........=....... - 0xb6, 0x01, 0x00, 0x00, 0xb5, 0x01, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, // ........P....... - 0x69, 0x02, 0x00, 0x00, 0xb6, 0x01, 0x00, 0x00, 0xb6, 0x01, 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, // i............... - 0x0b, 0x00, 0x00, 0x00, 0x6a, 0x02, 0x00, 0x00, 0xb4, 0x01, 0x00, 0x00, 0x69, 0x02, 0x00, 0x00, // ....j.......i... - 0x0c, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x6c, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // ........l....... - 0x04, 0x00, 0x00, 0x00, 0xb0, 0x01, 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, // ................ - 0x6e, 0x02, 0x00, 0x00, 0x6c, 0x02, 0x00, 0x00, 0x6a, 0x02, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, // n...l...j...Q... - 0x07, 0x00, 0x00, 0x00, 0x70, 0x02, 0x00, 0x00, 0x6e, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ....p...n....... - 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x72, 0x02, 0x00, 0x00, 0x6e, 0x02, 0x00, 0x00, // Q.......r...n... - 0x01, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0x73, 0x02, 0x00, 0x00, // ............s... - 0x01, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x70, 0x02, 0x00, 0x00, 0x72, 0x02, 0x00, 0x00, // ....(...p...r... - 0x0c, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0x74, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // ........t....... - 0x25, 0x00, 0x00, 0x00, 0x73, 0x02, 0x00, 0x00, 0x67, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, // %...s...g....... - 0x0b, 0x00, 0x00, 0x00, 0x76, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, // ....v.......(... - 0x6e, 0x02, 0x00, 0x00, 0x6a, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x06, 0x00, 0x07, 0x00, 0x00, 0x00, // n...j........... - 0x77, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0x76, 0x02, 0x00, 0x00, // w.......B...v... - 0x81, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x78, 0x02, 0x00, 0x00, 0x74, 0x02, 0x00, 0x00, // ........x...t... - 0x77, 0x02, 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x7a, 0x02, 0x00, 0x00, // w...........z... - 0x78, 0x02, 0x00, 0x00, 0xb6, 0x01, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0xa2, 0x00, 0x00, 0x00, // x.......A....... - 0xb8, 0x01, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0xa1, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, // ....|.......`... - 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xb9, 0x01, 0x00, 0x00, 0xb8, 0x01, 0x00, 0x00, // =............... - 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xba, 0x01, 0x00, 0x00, 0xb9, 0x01, 0x00, 0x00, // ................ - 0x89, 0x00, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xbb, 0x01, 0x00, 0x00, // ................ - 0x7a, 0x02, 0x00, 0x00, 0xba, 0x01, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0xa2, 0x00, 0x00, 0x00, // z.......A....... - 0xbc, 0x01, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0xa1, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, // ....|.......`... - 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xbd, 0x01, 0x00, 0x00, 0xbc, 0x01, 0x00, 0x00, // =............... - 0x88, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xbe, 0x01, 0x00, 0x00, 0xbb, 0x01, 0x00, 0x00, // ................ - 0xbd, 0x01, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0xbf, 0x01, 0x00, 0x00, // ................ - 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, 0xbe, 0x01, 0x00, 0x00, 0x67, 0x00, 0x00, 0x00, // ....+.......g... - 0x74, 0x00, 0x00, 0x00, 0x50, 0x00, 0x07, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xc1, 0x01, 0x00, 0x00, // t...P........... - 0xbf, 0x01, 0x00, 0x00, 0xbf, 0x01, 0x00, 0x00, 0xbf, 0x01, 0x00, 0x00, 0xbf, 0x01, 0x00, 0x00, // ................ - 0x41, 0x00, 0x05, 0x00, 0x84, 0x00, 0x00, 0x00, 0xc2, 0x01, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, // A...........|... - 0xde, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xc3, 0x01, 0x00, 0x00, // ....=........... - 0xc2, 0x01, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x84, 0x00, 0x00, 0x00, 0xc4, 0x01, 0x00, 0x00, // ....A........... - 0x7c, 0x00, 0x00, 0x00, 0xdf, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, // |.......=....... - 0xc5, 0x01, 0x00, 0x00, 0xc4, 0x01, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x0d, 0x00, 0x00, 0x00, // ................ - 0x80, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0xc3, 0x01, 0x00, 0x00, // ................ - 0xc5, 0x01, 0x00, 0x00, 0xc1, 0x01, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, // ................ - 0xc9, 0x01, 0x00, 0x00, 0x62, 0x02, 0x00, 0x00, 0x52, 0x02, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, // ....b...R....... - 0x0d, 0x00, 0x00, 0x00, 0xcb, 0x01, 0x00, 0x00, 0x80, 0x02, 0x00, 0x00, 0xc9, 0x01, 0x00, 0x00, // ................ - 0xf9, 0x00, 0x02, 0x00, 0x30, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0xcd, 0x01, 0x00, 0x00, // ....0........... - 0x41, 0x00, 0x06, 0x00, 0xa2, 0x00, 0x00, 0x00, 0xce, 0x01, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, // A...........|... - 0xa1, 0x00, 0x00, 0x00, 0xb8, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, // ........=....... - 0xcf, 0x01, 0x00, 0x00, 0xce, 0x01, 0x00, 0x00, 0xb4, 0x00, 0x05, 0x00, 0xbb, 0x00, 0x00, 0x00, // ................ - 0xd0, 0x01, 0x00, 0x00, 0xcf, 0x01, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, // ........t....... - 0x2f, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0xd0, 0x01, 0x00, 0x00, // /............... - 0xd1, 0x01, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0xd1, 0x01, 0x00, 0x00, // ................ - 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xd3, 0x01, 0x00, 0x00, 0x65, 0x01, 0x00, 0x00, // Q...........e... - 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xd4, 0x01, 0x00, 0x00, // ....Q........... - 0x65, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x50, 0x00, 0x06, 0x00, 0x75, 0x00, 0x00, 0x00, // e.......P...u... - 0xd5, 0x01, 0x00, 0x00, 0xd3, 0x01, 0x00, 0x00, 0xd4, 0x01, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, // ............t... - 0x41, 0x00, 0x05, 0x00, 0x7d, 0x00, 0x00, 0x00, 0xd6, 0x01, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, // A...}.......|... - 0x3d, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x79, 0x00, 0x00, 0x00, 0xd7, 0x01, 0x00, 0x00, // =...=...y....... - 0xd6, 0x01, 0x00, 0x00, 0x90, 0x00, 0x05, 0x00, 0x75, 0x00, 0x00, 0x00, 0xd8, 0x01, 0x00, 0x00, // ........u....... - 0xd5, 0x01, 0x00, 0x00, 0xd7, 0x01, 0x00, 0x00, 0x4f, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, 0x00, // ........O....... - 0xd9, 0x01, 0x00, 0x00, 0xd8, 0x01, 0x00, 0x00, 0xd8, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x01, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x84, 0x00, 0x00, 0x00, 0xda, 0x01, 0x00, 0x00, // ....A........... - 0x7c, 0x00, 0x00, 0x00, 0xc9, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, // |.......=....... - 0xdb, 0x01, 0x00, 0x00, 0xda, 0x01, 0x00, 0x00, 0x4f, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, 0x00, // ........O....... - 0xdc, 0x01, 0x00, 0x00, 0xdb, 0x01, 0x00, 0x00, 0xdb, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x01, 0x00, 0x00, 0x00, 0x88, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xdd, 0x01, 0x00, 0x00, // ................ - 0xd9, 0x01, 0x00, 0x00, 0xdc, 0x01, 0x00, 0x00, 0x56, 0x00, 0x05, 0x00, 0x45, 0x00, 0x00, 0x00, // ........V...E... - 0x87, 0x02, 0x00, 0x00, 0x3a, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00, 0x57, 0x00, 0x05, 0x00, // ....:...7...W... - 0x0d, 0x00, 0x00, 0x00, 0x89, 0x02, 0x00, 0x00, 0x87, 0x02, 0x00, 0x00, 0xdd, 0x01, 0x00, 0x00, // ................ - 0x41, 0x00, 0x06, 0x00, 0xa2, 0x00, 0x00, 0x00, 0xe1, 0x01, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, // A...........|... - 0xa1, 0x00, 0x00, 0x00, 0xd1, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, // ........=....... - 0xe2, 0x01, 0x00, 0x00, 0xe1, 0x01, 0x00, 0x00, 0xb4, 0x00, 0x05, 0x00, 0xbb, 0x00, 0x00, 0x00, // ................ - 0xe3, 0x01, 0x00, 0x00, 0xe2, 0x01, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, // ........t....... - 0xf0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0xe3, 0x01, 0x00, 0x00, // ................ - 0xe4, 0x01, 0x00, 0x00, 0xf0, 0x01, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0xe4, 0x01, 0x00, 0x00, // ................ - 0x4f, 0x00, 0x08, 0x00, 0x75, 0x00, 0x00, 0x00, 0xe6, 0x01, 0x00, 0x00, 0x89, 0x02, 0x00, 0x00, // O...u........... - 0x89, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, // ................ - 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xe8, 0x01, 0x00, 0x00, 0x89, 0x02, 0x00, 0x00, // Q............... - 0x03, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x75, 0x00, 0x00, 0x00, 0xe9, 0x01, 0x00, 0x00, // ........u....... - 0xe6, 0x01, 0x00, 0x00, 0xe8, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, // ........Q....... - 0xeb, 0x01, 0x00, 0x00, 0x89, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, // ............Q... - 0x07, 0x00, 0x00, 0x00, 0xec, 0x01, 0x00, 0x00, 0xe9, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xed, 0x01, 0x00, 0x00, 0xe9, 0x01, 0x00, 0x00, // Q............... - 0x01, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xee, 0x01, 0x00, 0x00, // ....Q........... - 0xe9, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x50, 0x00, 0x07, 0x00, 0x0d, 0x00, 0x00, 0x00, // ........P....... - 0xef, 0x01, 0x00, 0x00, 0xec, 0x01, 0x00, 0x00, 0xed, 0x01, 0x00, 0x00, 0xee, 0x01, 0x00, 0x00, // ................ - 0xeb, 0x01, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0xf0, 0x01, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, // ................ - 0xf0, 0x01, 0x00, 0x00, 0xf5, 0x00, 0x07, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xa8, 0x02, 0x00, 0x00, // ................ - 0x89, 0x02, 0x00, 0x00, 0xd1, 0x01, 0x00, 0x00, 0xef, 0x01, 0x00, 0x00, 0xe4, 0x01, 0x00, 0x00, // ................ - 0x41, 0x00, 0x06, 0x00, 0xa2, 0x00, 0x00, 0x00, 0xf1, 0x01, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, // A...........|... - 0xa1, 0x00, 0x00, 0x00, 0xd1, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, // ........=....... - 0xf2, 0x01, 0x00, 0x00, 0xf1, 0x01, 0x00, 0x00, 0xb4, 0x00, 0x05, 0x00, 0xbb, 0x00, 0x00, 0x00, // ................ - 0xf3, 0x01, 0x00, 0x00, 0xf2, 0x01, 0x00, 0x00, 0x9c, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, // ................ - 0xf7, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0xf3, 0x01, 0x00, 0x00, // ................ - 0xf4, 0x01, 0x00, 0x00, 0xf7, 0x01, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0xf4, 0x01, 0x00, 0x00, // ................ - 0x4f, 0x00, 0x09, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xf6, 0x01, 0x00, 0x00, 0xa8, 0x02, 0x00, 0x00, // O............... - 0xa8, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x00, 0x00, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0xf7, 0x01, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, // ................ - 0xf7, 0x01, 0x00, 0x00, 0xf5, 0x00, 0x07, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xa9, 0x02, 0x00, 0x00, // ................ - 0xa8, 0x02, 0x00, 0x00, 0xf0, 0x01, 0x00, 0x00, 0xf6, 0x01, 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, // ................ - 0x41, 0x00, 0x05, 0x00, 0x84, 0x00, 0x00, 0x00, 0xf8, 0x01, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, // A...........|... - 0xde, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xf9, 0x01, 0x00, 0x00, // ....=........... - 0xf8, 0x01, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xfb, 0x01, 0x00, 0x00, // ................ - 0xa9, 0x02, 0x00, 0x00, 0xf9, 0x01, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, // ................ - 0xfe, 0x01, 0x00, 0x00, 0x62, 0x02, 0x00, 0x00, 0x52, 0x02, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, // ....b...R....... - 0x0d, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0xfb, 0x01, 0x00, 0x00, 0xfe, 0x01, 0x00, 0x00, // ................ - 0xf9, 0x00, 0x02, 0x00, 0x2f, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x02, 0x02, 0x00, 0x00, // ..../........... - 0x41, 0x00, 0x06, 0x00, 0xa2, 0x00, 0x00, 0x00, 0x03, 0x02, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, // A...........|... - 0xa1, 0x00, 0x00, 0x00, 0xb8, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, // ........=....... - 0x04, 0x02, 0x00, 0x00, 0x03, 0x02, 0x00, 0x00, 0xb4, 0x00, 0x05, 0x00, 0xbb, 0x00, 0x00, 0x00, // ................ - 0x05, 0x02, 0x00, 0x00, 0x04, 0x02, 0x00, 0x00, 0x9c, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, // ................ - 0x2e, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0x05, 0x02, 0x00, 0x00, // ................ - 0x06, 0x02, 0x00, 0x00, 0x07, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x06, 0x02, 0x00, 0x00, // ................ - 0xf9, 0x00, 0x02, 0x00, 0x2e, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x07, 0x02, 0x00, 0x00, // ................ - 0x41, 0x00, 0x06, 0x00, 0xa2, 0x00, 0x00, 0x00, 0x08, 0x02, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, // A...........|... - 0xa1, 0x00, 0x00, 0x00, 0xb8, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, // ........=....... - 0x09, 0x02, 0x00, 0x00, 0x08, 0x02, 0x00, 0x00, 0xb4, 0x00, 0x05, 0x00, 0xbb, 0x00, 0x00, 0x00, // ................ - 0x0a, 0x02, 0x00, 0x00, 0x09, 0x02, 0x00, 0x00, 0x35, 0x01, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, // ........5....... - 0x2d, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0x0a, 0x02, 0x00, 0x00, // -............... - 0x0b, 0x02, 0x00, 0x00, 0x2d, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x0b, 0x02, 0x00, 0x00, // ....-........... - 0x56, 0x00, 0x05, 0x00, 0x45, 0x00, 0x00, 0x00, 0x90, 0x02, 0x00, 0x00, 0x3a, 0x00, 0x00, 0x00, // V...E.......:... - 0x37, 0x00, 0x00, 0x00, 0x57, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x92, 0x02, 0x00, 0x00, // 7...W........... - 0x90, 0x02, 0x00, 0x00, 0x68, 0x01, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0xa2, 0x00, 0x00, 0x00, // ....h...A....... - 0x0f, 0x02, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0xa1, 0x00, 0x00, 0x00, 0xd1, 0x00, 0x00, 0x00, // ....|........... - 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x10, 0x02, 0x00, 0x00, 0x0f, 0x02, 0x00, 0x00, // =............... - 0xb4, 0x00, 0x05, 0x00, 0xbb, 0x00, 0x00, 0x00, 0x11, 0x02, 0x00, 0x00, 0x10, 0x02, 0x00, 0x00, // ................ - 0x74, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x1e, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // t............... - 0xfa, 0x00, 0x04, 0x00, 0x11, 0x02, 0x00, 0x00, 0x12, 0x02, 0x00, 0x00, 0x1e, 0x02, 0x00, 0x00, // ................ - 0xf8, 0x00, 0x02, 0x00, 0x12, 0x02, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x75, 0x00, 0x00, 0x00, // ........O...u... - 0x14, 0x02, 0x00, 0x00, 0x92, 0x02, 0x00, 0x00, 0x92, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, // ........Q....... - 0x16, 0x02, 0x00, 0x00, 0x92, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, // ................ - 0x75, 0x00, 0x00, 0x00, 0x17, 0x02, 0x00, 0x00, 0x14, 0x02, 0x00, 0x00, 0x16, 0x02, 0x00, 0x00, // u............... - 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x19, 0x02, 0x00, 0x00, 0x92, 0x02, 0x00, 0x00, // Q............... - 0x03, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x1a, 0x02, 0x00, 0x00, // ....Q........... - 0x17, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, // ........Q....... - 0x1b, 0x02, 0x00, 0x00, 0x17, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, // ............Q... - 0x07, 0x00, 0x00, 0x00, 0x1c, 0x02, 0x00, 0x00, 0x17, 0x02, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, // ................ - 0x50, 0x00, 0x07, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x1d, 0x02, 0x00, 0x00, 0x1a, 0x02, 0x00, 0x00, // P............... - 0x1b, 0x02, 0x00, 0x00, 0x1c, 0x02, 0x00, 0x00, 0x19, 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, // ................ - 0x1e, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x1e, 0x02, 0x00, 0x00, 0xf5, 0x00, 0x07, 0x00, // ................ - 0x0d, 0x00, 0x00, 0x00, 0xa6, 0x02, 0x00, 0x00, 0x92, 0x02, 0x00, 0x00, 0x0b, 0x02, 0x00, 0x00, // ................ - 0x1d, 0x02, 0x00, 0x00, 0x12, 0x02, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0xa2, 0x00, 0x00, 0x00, // ........A....... - 0x1f, 0x02, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0xa1, 0x00, 0x00, 0x00, 0xd1, 0x00, 0x00, 0x00, // ....|........... - 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x02, 0x00, 0x00, 0x1f, 0x02, 0x00, 0x00, // =....... ....... - 0xb4, 0x00, 0x05, 0x00, 0xbb, 0x00, 0x00, 0x00, 0x21, 0x02, 0x00, 0x00, 0x20, 0x02, 0x00, 0x00, // ........!... ... - 0x9c, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0x25, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........%....... - 0xfa, 0x00, 0x04, 0x00, 0x21, 0x02, 0x00, 0x00, 0x22, 0x02, 0x00, 0x00, 0x25, 0x02, 0x00, 0x00, // ....!..."...%... - 0xf8, 0x00, 0x02, 0x00, 0x22, 0x02, 0x00, 0x00, 0x4f, 0x00, 0x09, 0x00, 0x0d, 0x00, 0x00, 0x00, // ...."...O....... - 0x24, 0x02, 0x00, 0x00, 0xa6, 0x02, 0x00, 0x00, 0xa6, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // $............... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, // ................ - 0x25, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x25, 0x02, 0x00, 0x00, 0xf5, 0x00, 0x07, 0x00, // %.......%....... - 0x0d, 0x00, 0x00, 0x00, 0xa7, 0x02, 0x00, 0x00, 0xa6, 0x02, 0x00, 0x00, 0x1e, 0x02, 0x00, 0x00, // ................ - 0x24, 0x02, 0x00, 0x00, 0x22, 0x02, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, // $..."........... - 0x28, 0x02, 0x00, 0x00, 0xa7, 0x02, 0x00, 0x00, 0x52, 0x02, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, // (.......R...A... - 0x84, 0x00, 0x00, 0x00, 0x2a, 0x02, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0xde, 0x00, 0x00, 0x00, // ....*...|....... - 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x2b, 0x02, 0x00, 0x00, 0x2a, 0x02, 0x00, 0x00, // =.......+...*... - 0x85, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x2c, 0x02, 0x00, 0x00, 0x28, 0x02, 0x00, 0x00, // ........,...(... - 0x2b, 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x2d, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, // +.......-....... - 0x2d, 0x02, 0x00, 0x00, 0xf5, 0x00, 0x07, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xad, 0x02, 0x00, 0x00, // -............... - 0xae, 0x02, 0x00, 0x00, 0x07, 0x02, 0x00, 0x00, 0x2c, 0x02, 0x00, 0x00, 0x25, 0x02, 0x00, 0x00, // ........,...%... - 0xf9, 0x00, 0x02, 0x00, 0x2e, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x2e, 0x02, 0x00, 0x00, // ................ - 0xf5, 0x00, 0x07, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xac, 0x02, 0x00, 0x00, 0x31, 0x01, 0x00, 0x00, // ............1... - 0x06, 0x02, 0x00, 0x00, 0xad, 0x02, 0x00, 0x00, 0x2d, 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, // ........-....... - 0x2f, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x2f, 0x02, 0x00, 0x00, 0xf5, 0x00, 0x07, 0x00, // /......./....... - 0x0d, 0x00, 0x00, 0x00, 0xab, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0xf7, 0x01, 0x00, 0x00, // ................ - 0xac, 0x02, 0x00, 0x00, 0x2e, 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x30, 0x02, 0x00, 0x00, // ............0... - 0xf8, 0x00, 0x02, 0x00, 0x30, 0x02, 0x00, 0x00, 0xf5, 0x00, 0x07, 0x00, 0x0d, 0x00, 0x00, 0x00, // ....0........... - 0xaa, 0x02, 0x00, 0x00, 0xcb, 0x01, 0x00, 0x00, 0xa8, 0x01, 0x00, 0x00, 0xab, 0x02, 0x00, 0x00, // ................ - 0x2f, 0x02, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x74, 0x01, 0x00, 0x00, 0xaa, 0x02, 0x00, 0x00, // /...>...t....... - 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x00, 0xb0, 0x00, // ....8....... + 0x65, 0x78, 0x30, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x02, 0x22, 0x00, 0x06, 0x73, 0x5f, 0x74, // ex0......."..s_t + 0x65, 0x78, 0x32, 0x30, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x02, 0x22, 0x00, 0xf8, 0x1c, 0x00, // ex20.......".... + 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0b, 0x00, 0x08, 0x00, 0xcd, 0x03, 0x00, // ...#............ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, // ................ + 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, // .....GLSL.std.45 + 0x30, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // 0............... + 0x00, 0x0f, 0x00, 0x09, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, // .............mai + 0x6e, 0x00, 0x00, 0x00, 0x00, 0xd2, 0x01, 0x00, 0x00, 0xd5, 0x01, 0x00, 0x00, 0xd8, 0x01, 0x00, // n............... + 0x00, 0xe7, 0x01, 0x00, 0x00, 0x10, 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, // ................ + 0x00, 0x03, 0x00, 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, 0x05, 0x00, 0x04, // ................ + 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, // .....main....... + 0x00, 0x3c, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, // .<...s_texSample + 0x72, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, // r........?...s_t + 0x65, 0x78, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, // exTexture....... + 0x00, 0x43, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, 0x65, 0x78, 0x32, 0x53, 0x61, 0x6d, 0x70, 0x6c, // .C...s_tex2Sampl + 0x65, 0x72, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x45, 0x00, 0x00, 0x00, 0x73, 0x5f, 0x74, // er.......E...s_t + 0x65, 0x78, 0x32, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, // ex2Texture...... + 0x00, 0x86, 0x00, 0x00, 0x00, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x6c, 0x6f, 0x63, // .....UniformBloc + 0x6b, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x07, 0x00, 0x86, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // k............... + 0x00, 0x75, 0x5f, 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x4d, 0x61, 0x74, 0x00, 0x00, 0x00, // .u_scissorMat... + 0x00, 0x06, 0x00, 0x06, 0x00, 0x86, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x70, // .............u_p + 0x61, 0x69, 0x6e, 0x74, 0x4d, 0x61, 0x74, 0x00, 0x00, 0x06, 0x00, 0x06, 0x00, 0x86, 0x00, 0x00, // aintMat......... + 0x00, 0x02, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x00, // .....u_innerCol. + 0x00, 0x06, 0x00, 0x06, 0x00, 0x86, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x6f, // .............u_o + 0x75, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x86, 0x00, 0x00, // uterCol......... + 0x00, 0x04, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x73, 0x63, 0x69, 0x73, 0x73, 0x6f, 0x72, 0x45, 0x78, // .....u_scissorEx + 0x74, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x00, 0x00, 0x00, 0x06, 0x00, 0x07, 0x00, 0x86, 0x00, 0x00, // tScale.......... + 0x00, 0x05, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x64, // .....u_extentRad + 0x69, 0x75, 0x73, 0x00, 0x00, 0x06, 0x00, 0x06, 0x00, 0x86, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, // ius............. + 0x00, 0x75, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x05, // .u_params....... + 0x00, 0x86, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x73, 0x64, 0x66, 0x00, 0x00, // .........u_sdf.. + 0x00, 0x05, 0x00, 0x03, 0x00, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, // ................ + 0x00, 0xd2, 0x01, 0x00, 0x00, 0x76, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x00, // .....v_position. + 0x00, 0x05, 0x00, 0x05, 0x00, 0xd5, 0x01, 0x00, 0x00, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, // .........v_texco + 0x6f, 0x72, 0x64, 0x30, 0x00, 0x05, 0x00, 0x05, 0x00, 0xd8, 0x01, 0x00, 0x00, 0x76, 0x5f, 0x74, // ord0.........v_t + 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x31, 0x00, 0x05, 0x00, 0x06, 0x00, 0xe7, 0x01, 0x00, // excoord1........ + 0x00, 0x62, 0x67, 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x00, // .bgfx_FragData0. + 0x00, 0x47, 0x00, 0x04, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, // .G...<...!...... + 0x00, 0x47, 0x00, 0x04, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .G...<..."...... + 0x00, 0x47, 0x00, 0x04, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, // .G...?...!...... + 0x00, 0x47, 0x00, 0x04, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .G...?..."...... + 0x00, 0x47, 0x00, 0x04, 0x00, 0x43, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, // .G...C...!...... + 0x00, 0x47, 0x00, 0x04, 0x00, 0x43, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .G...C..."...... + 0x00, 0x47, 0x00, 0x04, 0x00, 0x45, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, // .G...E...!...... + 0x00, 0x47, 0x00, 0x04, 0x00, 0x45, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .G...E..."...... + 0x00, 0x47, 0x00, 0x03, 0x00, 0x86, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x48, 0x00, 0x04, // .G...........H.. + 0x00, 0x86, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, // .............H.. + 0x00, 0x86, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, // ................ + 0x00, 0x48, 0x00, 0x05, 0x00, 0x86, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, // .H...........#.. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x04, 0x00, 0x86, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // .....H.......... + 0x00, 0x04, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x86, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // .....H.......... + 0x00, 0x07, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x86, 0x00, 0x00, // .........H...... + 0x00, 0x01, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, // .....#...0...H.. + 0x00, 0x86, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, // .........#...`.. + 0x00, 0x48, 0x00, 0x05, 0x00, 0x86, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, // .H...........#.. + 0x00, 0x70, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x86, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, // .p...H.......... + 0x00, 0x23, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x86, 0x00, 0x00, // .#.......H...... + 0x00, 0x05, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, // .....#.......H.. + 0x00, 0x86, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, // .........#...... + 0x00, 0x48, 0x00, 0x05, 0x00, 0x86, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, // .H...........#.. + 0x00, 0xb0, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x88, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, // .....G.......!.. + 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x88, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, // .....G.......".. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xd2, 0x01, 0x00, 0x00, 0x1e, 0x00, 0x00, // .....G.......... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xd5, 0x01, 0x00, 0x00, 0x1e, 0x00, 0x00, // .....G.......... + 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xd8, 0x01, 0x00, 0x00, 0x1e, 0x00, 0x00, // .....G.......... + 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xe7, 0x01, 0x00, 0x00, 0x1e, 0x00, 0x00, // .....G.......... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, // .............!.. + 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x02, 0x00, 0x06, 0x00, 0x00, // ................ + 0x00, 0x16, 0x00, 0x03, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x19, 0x00, 0x09, // ......... ...... + 0x00, 0x08, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x17, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, // ................ + 0x00, 0x17, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, // ................ + 0x00, 0x20, 0x00, 0x04, 0x00, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, // . ...;.......... + 0x00, 0x3b, 0x00, 0x04, 0x00, 0x3b, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .;...;...<...... + 0x00, 0x20, 0x00, 0x04, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, // . ...>.......... + 0x00, 0x3b, 0x00, 0x04, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .;...>...?...... + 0x00, 0x3b, 0x00, 0x04, 0x00, 0x3b, 0x00, 0x00, 0x00, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .;...;...C...... + 0x00, 0x3b, 0x00, 0x04, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .;...>...E...... + 0x00, 0x15, 0x00, 0x04, 0x00, 0x48, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // .....H... ...... + 0x00, 0x2b, 0x00, 0x04, 0x00, 0x48, 0x00, 0x00, 0x00, 0x49, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // .+...H...I...... + 0x00, 0x2b, 0x00, 0x04, 0x00, 0x48, 0x00, 0x00, 0x00, 0x4d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .+...H...M...... + 0x00, 0x1b, 0x00, 0x03, 0x00, 0x51, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, // .....Q.......... + 0x00, 0x6b, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, // .k... .......+.. + 0x00, 0x6b, 0x00, 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, // .k...l.......+.. + 0x00, 0x6b, 0x00, 0x00, 0x00, 0x6f, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, // .k...o.......+.. + 0x00, 0x07, 0x00, 0x00, 0x00, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x05, // .....s.......,.. + 0x00, 0x0b, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x73, 0x00, 0x00, 0x00, 0x73, 0x00, 0x00, // .....v...s...s.. + 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, // .+.............. + 0x3f, 0x17, 0x00, 0x04, 0x00, 0x81, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, // ?............... + 0x00, 0x18, 0x00, 0x04, 0x00, 0x85, 0x00, 0x00, 0x00, 0x81, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, // ................ + 0x00, 0x1e, 0x00, 0x0a, 0x00, 0x86, 0x00, 0x00, 0x00, 0x85, 0x00, 0x00, 0x00, 0x85, 0x00, 0x00, // ................ + 0x00, 0x0d, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, // ................ + 0x00, 0x0d, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x87, 0x00, 0x00, // ......... ...... + 0x00, 0x02, 0x00, 0x00, 0x00, 0x86, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x87, 0x00, 0x00, // .........;...... + 0x00, 0x88, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x89, 0x00, 0x00, // ......... ...... + 0x00, 0x02, 0x00, 0x00, 0x00, 0x85, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x48, 0x00, 0x00, // .........+...H.. + 0x00, 0x8f, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x90, 0x00, 0x00, // ......... ...... + 0x00, 0x02, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, // .........+...... + 0x00, 0x95, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x2c, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, // ........?,...... + 0x00, 0x96, 0x00, 0x00, 0x00, 0x95, 0x00, 0x00, 0x00, 0x95, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, // .............+.. + 0x00, 0x07, 0x00, 0x00, 0x00, 0xa8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x2b, 0x00, 0x04, // ............@+.. + 0x00, 0x48, 0x00, 0x00, 0x00, 0xad, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, // .H........... .. + 0x00, 0xae, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, // .............+.. + 0x00, 0x48, 0x00, 0x00, 0x00, 0xbe, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, // .H...........+.. + 0x00, 0x6b, 0x00, 0x00, 0x00, 0xbf, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, // .k...........+.. + 0x00, 0x6b, 0x00, 0x00, 0x00, 0xd3, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, // .k.............. + 0x00, 0xd6, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x48, 0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, // .....+...H...... + 0x00, 0x05, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x48, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, // .....+...H...... + 0x00, 0x02, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x48, 0x00, 0x00, 0x00, 0xf9, 0x00, 0x00, // .....+...H...... + 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x07, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x4b, 0x01, 0x00, // .....,.......K.. + 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, // ................ + 0x00, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x4f, 0x01, 0x00, 0x00, 0x00, 0x00, 0x40, // .+.......O.....@ + 0x40, 0x2b, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x89, 0x01, 0x00, 0x00, 0x00, 0x00, 0x80, // @+.............. + 0x40, 0x20, 0x00, 0x04, 0x00, 0xd1, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, // @ .............. + 0x00, 0x3b, 0x00, 0x04, 0x00, 0xd1, 0x01, 0x00, 0x00, 0xd2, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, // .;.............. + 0x00, 0x3b, 0x00, 0x04, 0x00, 0xd1, 0x01, 0x00, 0x00, 0xd5, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, // .;.............. + 0x00, 0x3b, 0x00, 0x04, 0x00, 0xd1, 0x01, 0x00, 0x00, 0xd8, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, // .;.............. + 0x00, 0x20, 0x00, 0x04, 0x00, 0xe6, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, // . .............. + 0x00, 0x3b, 0x00, 0x04, 0x00, 0xe6, 0x01, 0x00, 0x00, 0xe7, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, // .;.............. + 0x00, 0x01, 0x00, 0x03, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xcc, 0x03, 0x00, 0x00, 0x36, 0x00, 0x05, // .............6.. + 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, // ................ + 0x00, 0xf8, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, // .........=...... + 0x00, 0x3d, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, // .=...<...=...... + 0x00, 0x40, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, // .@...?...=...... + 0x00, 0x44, 0x00, 0x00, 0x00, 0x43, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, // .D...C...=...... + 0x00, 0x46, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, // .F...E...=...... + 0x00, 0xd3, 0x01, 0x00, 0x00, 0xd2, 0x01, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, // .........=...... + 0x00, 0xd6, 0x01, 0x00, 0x00, 0xd5, 0x01, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, // .........=...... + 0x00, 0xd9, 0x01, 0x00, 0x00, 0xd8, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, // .........Q...... + 0x00, 0x01, 0x03, 0x00, 0x00, 0xd3, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, // .............Q.. + 0x00, 0x07, 0x00, 0x00, 0x00, 0x02, 0x03, 0x00, 0x00, 0xd3, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, // ................ + 0x00, 0x50, 0x00, 0x06, 0x00, 0x81, 0x00, 0x00, 0x00, 0x03, 0x03, 0x00, 0x00, 0x01, 0x03, 0x00, // .P.............. + 0x00, 0x02, 0x03, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x89, 0x00, 0x00, // .........A...... + 0x00, 0x04, 0x03, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x4d, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, // .........M...=.. + 0x00, 0x85, 0x00, 0x00, 0x00, 0x05, 0x03, 0x00, 0x00, 0x04, 0x03, 0x00, 0x00, 0x90, 0x00, 0x05, // ................ + 0x00, 0x81, 0x00, 0x00, 0x00, 0x06, 0x03, 0x00, 0x00, 0x03, 0x03, 0x00, 0x00, 0x05, 0x03, 0x00, // ................ + 0x00, 0x4f, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x07, 0x03, 0x00, 0x00, 0x06, 0x03, 0x00, // .O.............. + 0x00, 0x06, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x06, // ................ + 0x00, 0x0b, 0x00, 0x00, 0x00, 0x08, 0x03, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, // ................ + 0x00, 0x07, 0x03, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x90, 0x00, 0x00, 0x00, 0x09, 0x03, 0x00, // .....A.......... + 0x00, 0x88, 0x00, 0x00, 0x00, 0x8f, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, // .........=...... + 0x00, 0x0a, 0x03, 0x00, 0x00, 0x09, 0x03, 0x00, 0x00, 0x4f, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, // .........O...... + 0x00, 0x0b, 0x03, 0x00, 0x00, 0x0a, 0x03, 0x00, 0x00, 0x0a, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x01, 0x00, 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x0c, 0x03, 0x00, // ................ + 0x00, 0x08, 0x03, 0x00, 0x00, 0x0b, 0x03, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x90, 0x00, 0x00, // .........A...... + 0x00, 0x0e, 0x03, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x8f, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, // .............=.. + 0x00, 0x0d, 0x00, 0x00, 0x00, 0x0f, 0x03, 0x00, 0x00, 0x0e, 0x03, 0x00, 0x00, 0x4f, 0x00, 0x07, // .............O.. + 0x00, 0x0b, 0x00, 0x00, 0x00, 0x10, 0x03, 0x00, 0x00, 0x0f, 0x03, 0x00, 0x00, 0x0f, 0x03, 0x00, // ................ + 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, // ................ + 0x00, 0x11, 0x03, 0x00, 0x00, 0x0c, 0x03, 0x00, 0x00, 0x10, 0x03, 0x00, 0x00, 0x83, 0x00, 0x05, // ................ + 0x00, 0x0b, 0x00, 0x00, 0x00, 0x12, 0x03, 0x00, 0x00, 0x96, 0x00, 0x00, 0x00, 0x11, 0x03, 0x00, // ................ + 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x14, 0x03, 0x00, 0x00, 0x12, 0x03, 0x00, // .Q.............. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0x15, 0x03, 0x00, // ................ + 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x14, 0x03, 0x00, 0x00, 0x73, 0x00, 0x00, // .....+.......s.. + 0x00, 0x80, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x17, 0x03, 0x00, // .....Q.......... + 0x00, 0x12, 0x03, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, // ................ + 0x00, 0x18, 0x03, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x17, 0x03, 0x00, // .........+...... + 0x00, 0x73, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, // .s.............. + 0x00, 0x19, 0x03, 0x00, 0x00, 0x15, 0x03, 0x00, 0x00, 0x18, 0x03, 0x00, 0x00, 0x51, 0x00, 0x05, // .............Q.. + 0x00, 0x07, 0x00, 0x00, 0x00, 0x1d, 0x03, 0x00, 0x00, 0xd6, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x1e, 0x03, 0x00, 0x00, 0x1d, 0x03, 0x00, // ................ + 0x00, 0xa8, 0x00, 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x1f, 0x03, 0x00, // ................ + 0x00, 0x1e, 0x03, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x06, 0x00, 0x07, 0x00, 0x00, // ................ + 0x00, 0x20, 0x03, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x1f, 0x03, 0x00, // . .............. + 0x00, 0x83, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x21, 0x03, 0x00, 0x00, 0x80, 0x00, 0x00, // .........!...... + 0x00, 0x20, 0x03, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0xae, 0x00, 0x00, 0x00, 0x22, 0x03, 0x00, // . ...A.......".. + 0x00, 0x88, 0x00, 0x00, 0x00, 0xad, 0x00, 0x00, 0x00, 0x6f, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, // .........o...=.. + 0x00, 0x07, 0x00, 0x00, 0x00, 0x23, 0x03, 0x00, 0x00, 0x22, 0x03, 0x00, 0x00, 0x85, 0x00, 0x05, // .....#..."...... + 0x00, 0x07, 0x00, 0x00, 0x00, 0x24, 0x03, 0x00, 0x00, 0x21, 0x03, 0x00, 0x00, 0x23, 0x03, 0x00, // .....$...!...#.. + 0x00, 0x0c, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0x25, 0x03, 0x00, 0x00, 0x01, 0x00, 0x00, // .........%...... + 0x00, 0x25, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x24, 0x03, 0x00, 0x00, 0x51, 0x00, 0x05, // .%.......$...Q.. + 0x00, 0x07, 0x00, 0x00, 0x00, 0x27, 0x03, 0x00, 0x00, 0xd6, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, // .....'.......... + 0x00, 0x0c, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0x28, 0x03, 0x00, 0x00, 0x01, 0x00, 0x00, // .........(...... + 0x00, 0x25, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x27, 0x03, 0x00, 0x00, 0x85, 0x00, 0x05, // .%.......'...... + 0x00, 0x07, 0x00, 0x00, 0x00, 0x29, 0x03, 0x00, 0x00, 0x25, 0x03, 0x00, 0x00, 0x28, 0x03, 0x00, // .....)...%...(.. + 0x00, 0x41, 0x00, 0x06, 0x00, 0xae, 0x00, 0x00, 0x00, 0x2a, 0x02, 0x00, 0x00, 0x88, 0x00, 0x00, // .A.......*...... + 0x00, 0xad, 0x00, 0x00, 0x00, 0xd3, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, // .........=...... + 0x00, 0x2b, 0x02, 0x00, 0x00, 0x2a, 0x02, 0x00, 0x00, 0xb4, 0x00, 0x05, 0x00, 0xd6, 0x00, 0x00, // .+...*.......... + 0x00, 0x2c, 0x02, 0x00, 0x00, 0x2b, 0x02, 0x00, 0x00, 0x73, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, // .,...+...s...... + 0x00, 0xf7, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0x2c, 0x02, 0x00, // .............,.. + 0x00, 0x2d, 0x02, 0x00, 0x00, 0x52, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x2d, 0x02, 0x00, // .-...R.......-.. + 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x2f, 0x02, 0x00, 0x00, 0xd3, 0x01, 0x00, // .Q......./...... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x30, 0x02, 0x00, // .....Q.......0.. + 0x00, 0xd3, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x50, 0x00, 0x06, 0x00, 0x81, 0x00, 0x00, // .........P...... + 0x00, 0x31, 0x02, 0x00, 0x00, 0x2f, 0x02, 0x00, 0x00, 0x30, 0x02, 0x00, 0x00, 0x80, 0x00, 0x00, // .1.../...0...... + 0x00, 0x41, 0x00, 0x05, 0x00, 0x89, 0x00, 0x00, 0x00, 0x32, 0x02, 0x00, 0x00, 0x88, 0x00, 0x00, // .A.......2...... + 0x00, 0x49, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x85, 0x00, 0x00, 0x00, 0x33, 0x02, 0x00, // .I...=.......3.. + 0x00, 0x32, 0x02, 0x00, 0x00, 0x90, 0x00, 0x05, 0x00, 0x81, 0x00, 0x00, 0x00, 0x34, 0x02, 0x00, // .2...........4.. + 0x00, 0x31, 0x02, 0x00, 0x00, 0x33, 0x02, 0x00, 0x00, 0x4f, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, // .1...3...O...... + 0x00, 0x35, 0x02, 0x00, 0x00, 0x34, 0x02, 0x00, 0x00, 0x34, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // .5...4...4...... + 0x00, 0x01, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x90, 0x00, 0x00, 0x00, 0x37, 0x02, 0x00, // .....A.......7.. + 0x00, 0x88, 0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, // .........=...... + 0x00, 0x38, 0x02, 0x00, 0x00, 0x37, 0x02, 0x00, 0x00, 0x4f, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, // .8...7...O...... + 0x00, 0x39, 0x02, 0x00, 0x00, 0x38, 0x02, 0x00, 0x00, 0x38, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // .9...8...8...... + 0x00, 0x01, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0xae, 0x00, 0x00, 0x00, 0x3a, 0x02, 0x00, // .....A.......:.. + 0x00, 0x88, 0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, 0x00, 0xbf, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, // .............=.. + 0x00, 0x07, 0x00, 0x00, 0x00, 0x3b, 0x02, 0x00, 0x00, 0x3a, 0x02, 0x00, 0x00, 0x50, 0x00, 0x05, // .....;...:...P.. + 0x00, 0x0b, 0x00, 0x00, 0x00, 0x30, 0x03, 0x00, 0x00, 0x3b, 0x02, 0x00, 0x00, 0x3b, 0x02, 0x00, // .....0...;...;.. + 0x00, 0x83, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x31, 0x03, 0x00, 0x00, 0x39, 0x02, 0x00, // .........1...9.. + 0x00, 0x30, 0x03, 0x00, 0x00, 0x0c, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x33, 0x03, 0x00, // .0...........3.. + 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x35, 0x02, 0x00, 0x00, 0x83, 0x00, 0x05, // .........5...... + 0x00, 0x0b, 0x00, 0x00, 0x00, 0x35, 0x03, 0x00, 0x00, 0x33, 0x03, 0x00, 0x00, 0x31, 0x03, 0x00, // .....5...3...1.. + 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x37, 0x03, 0x00, 0x00, 0x35, 0x03, 0x00, // .Q.......7...5.. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x39, 0x03, 0x00, // .....Q.......9.. + 0x00, 0x35, 0x03, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, // .5.............. + 0x00, 0x3a, 0x03, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x37, 0x03, 0x00, // .:.......(...7.. + 0x00, 0x39, 0x03, 0x00, 0x00, 0x0c, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3b, 0x03, 0x00, // .9...........;.. + 0x00, 0x01, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x3a, 0x03, 0x00, 0x00, 0x73, 0x00, 0x00, // .....%...:...s.. + 0x00, 0x0c, 0x00, 0x07, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x3d, 0x03, 0x00, 0x00, 0x01, 0x00, 0x00, // .........=...... + 0x00, 0x28, 0x00, 0x00, 0x00, 0x35, 0x03, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x06, // .(...5...v...... + 0x00, 0x07, 0x00, 0x00, 0x00, 0x3e, 0x03, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, // .....>.......B.. + 0x00, 0x3d, 0x03, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3f, 0x03, 0x00, // .=...........?.. + 0x00, 0x3b, 0x03, 0x00, 0x00, 0x3e, 0x03, 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, // .;...>.......... + 0x00, 0x41, 0x03, 0x00, 0x00, 0x3f, 0x03, 0x00, 0x00, 0x3b, 0x02, 0x00, 0x00, 0x41, 0x00, 0x06, // .A...?...;...A.. + 0x00, 0xae, 0x00, 0x00, 0x00, 0x3d, 0x02, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0xad, 0x00, 0x00, // .....=.......... + 0x00, 0x6c, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3e, 0x02, 0x00, // .l...=.......>.. + 0x00, 0x3d, 0x02, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3f, 0x02, 0x00, // .=...........?.. + 0x00, 0x3e, 0x02, 0x00, 0x00, 0x95, 0x00, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, // .>.............. + 0x00, 0x40, 0x02, 0x00, 0x00, 0x41, 0x03, 0x00, 0x00, 0x3f, 0x02, 0x00, 0x00, 0x41, 0x00, 0x06, // .@...A...?...A.. + 0x00, 0xae, 0x00, 0x00, 0x00, 0x41, 0x02, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0xad, 0x00, 0x00, // .....A.......... + 0x00, 0x6c, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x42, 0x02, 0x00, // .l...=.......B.. + 0x00, 0x41, 0x02, 0x00, 0x00, 0x88, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x43, 0x02, 0x00, // .A...........C.. + 0x00, 0x40, 0x02, 0x00, 0x00, 0x42, 0x02, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, // .@...B.......... + 0x00, 0x44, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x43, 0x02, 0x00, // .D.......+...C.. + 0x00, 0x73, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x50, 0x00, 0x07, 0x00, 0x0d, 0x00, 0x00, // .s.......P...... + 0x00, 0x46, 0x02, 0x00, 0x00, 0x44, 0x02, 0x00, 0x00, 0x44, 0x02, 0x00, 0x00, 0x44, 0x02, 0x00, // .F...D...D...D.. + 0x00, 0x44, 0x02, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x90, 0x00, 0x00, 0x00, 0x47, 0x02, 0x00, // .D...A.......G.. + 0x00, 0x88, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, // .........=...... + 0x00, 0x48, 0x02, 0x00, 0x00, 0x47, 0x02, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x90, 0x00, 0x00, // .H...G...A...... + 0x00, 0x49, 0x02, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0xf9, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, // .I...........=.. + 0x00, 0x0d, 0x00, 0x00, 0x00, 0x4a, 0x02, 0x00, 0x00, 0x49, 0x02, 0x00, 0x00, 0x0c, 0x00, 0x08, // .....J...I...... + 0x00, 0x0d, 0x00, 0x00, 0x00, 0x47, 0x03, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, // .....G.......... + 0x00, 0x48, 0x02, 0x00, 0x00, 0x4a, 0x02, 0x00, 0x00, 0x46, 0x02, 0x00, 0x00, 0x85, 0x00, 0x05, // .H...J...F...... + 0x00, 0x07, 0x00, 0x00, 0x00, 0x4e, 0x02, 0x00, 0x00, 0x29, 0x03, 0x00, 0x00, 0x19, 0x03, 0x00, // .....N...)...... + 0x00, 0x8e, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x50, 0x02, 0x00, 0x00, 0x47, 0x03, 0x00, // .........P...G.. + 0x00, 0x4e, 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0xf7, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, // .N.............. + 0x00, 0x52, 0x02, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0xae, 0x00, 0x00, 0x00, 0x53, 0x02, 0x00, // .R...A.......S.. + 0x00, 0x88, 0x00, 0x00, 0x00, 0xad, 0x00, 0x00, 0x00, 0xd3, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, // .............=.. + 0x00, 0x07, 0x00, 0x00, 0x00, 0x54, 0x02, 0x00, 0x00, 0x53, 0x02, 0x00, 0x00, 0xb4, 0x00, 0x05, // .....T...S...... + 0x00, 0xd6, 0x00, 0x00, 0x00, 0x55, 0x02, 0x00, 0x00, 0x54, 0x02, 0x00, 0x00, 0x80, 0x00, 0x00, // .....U...T...... + 0x00, 0xf7, 0x00, 0x03, 0x00, 0xf6, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, // ................ + 0x00, 0x55, 0x02, 0x00, 0x00, 0x56, 0x02, 0x00, 0x00, 0x87, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, // .U...V.......... + 0x00, 0x56, 0x02, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x58, 0x02, 0x00, // .V...Q.......X.. + 0x00, 0xd3, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, // .........Q...... + 0x00, 0x59, 0x02, 0x00, 0x00, 0xd3, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x50, 0x00, 0x06, // .Y...........P.. + 0x00, 0x81, 0x00, 0x00, 0x00, 0x5a, 0x02, 0x00, 0x00, 0x58, 0x02, 0x00, 0x00, 0x59, 0x02, 0x00, // .....Z...X...Y.. + 0x00, 0x80, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x89, 0x00, 0x00, 0x00, 0x5b, 0x02, 0x00, // .....A.......[.. + 0x00, 0x88, 0x00, 0x00, 0x00, 0x49, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x85, 0x00, 0x00, // .....I...=...... + 0x00, 0x5c, 0x02, 0x00, 0x00, 0x5b, 0x02, 0x00, 0x00, 0x90, 0x00, 0x05, 0x00, 0x81, 0x00, 0x00, // .....[.......... + 0x00, 0x5d, 0x02, 0x00, 0x00, 0x5a, 0x02, 0x00, 0x00, 0x5c, 0x02, 0x00, 0x00, 0x4f, 0x00, 0x07, // .]...Z.......O.. + 0x00, 0x0b, 0x00, 0x00, 0x00, 0x5e, 0x02, 0x00, 0x00, 0x5d, 0x02, 0x00, 0x00, 0x5d, 0x02, 0x00, // .....^...]...].. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x90, 0x00, 0x00, // .........A...... + 0x00, 0x5f, 0x02, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, // ._...........=.. + 0x00, 0x0d, 0x00, 0x00, 0x00, 0x60, 0x02, 0x00, 0x00, 0x5f, 0x02, 0x00, 0x00, 0x4f, 0x00, 0x07, // .....`..._...O.. + 0x00, 0x0b, 0x00, 0x00, 0x00, 0x61, 0x02, 0x00, 0x00, 0x60, 0x02, 0x00, 0x00, 0x60, 0x02, 0x00, // .....a...`...`.. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x88, 0x00, 0x05, 0x00, 0x0b, 0x00, 0x00, // ................ + 0x00, 0x62, 0x02, 0x00, 0x00, 0x5e, 0x02, 0x00, 0x00, 0x61, 0x02, 0x00, 0x00, 0x56, 0x00, 0x05, // .b...^...a...V.. + 0x00, 0x51, 0x00, 0x00, 0x00, 0x4e, 0x03, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x00, // .Q...N...@...=.. + 0x00, 0x57, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x50, 0x03, 0x00, 0x00, 0x4e, 0x03, 0x00, // .W.......P...N.. + 0x00, 0x62, 0x02, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0xae, 0x00, 0x00, 0x00, 0x66, 0x02, 0x00, // .b...A.......f.. + 0x00, 0x88, 0x00, 0x00, 0x00, 0xad, 0x00, 0x00, 0x00, 0xbf, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, // .............=.. + 0x00, 0x07, 0x00, 0x00, 0x00, 0x67, 0x02, 0x00, 0x00, 0x66, 0x02, 0x00, 0x00, 0xb4, 0x00, 0x05, // .....g...f...... + 0x00, 0xd6, 0x00, 0x00, 0x00, 0x68, 0x02, 0x00, 0x00, 0x67, 0x02, 0x00, 0x00, 0x80, 0x00, 0x00, // .....h...g...... + 0x00, 0xf7, 0x00, 0x03, 0x00, 0x75, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, // .....u.......... + 0x00, 0x68, 0x02, 0x00, 0x00, 0x69, 0x02, 0x00, 0x00, 0x75, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, // .h...i...u...... + 0x00, 0x69, 0x02, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x81, 0x00, 0x00, 0x00, 0x6b, 0x02, 0x00, // .i...O.......k.. + 0x00, 0x50, 0x03, 0x00, 0x00, 0x50, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // .P...P.......... + 0x00, 0x02, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x6d, 0x02, 0x00, // .....Q.......m.. + 0x00, 0x50, 0x03, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x81, 0x00, 0x00, // .P.............. + 0x00, 0x6e, 0x02, 0x00, 0x00, 0x6b, 0x02, 0x00, 0x00, 0x6d, 0x02, 0x00, 0x00, 0x51, 0x00, 0x05, // .n...k...m...Q.. + 0x00, 0x07, 0x00, 0x00, 0x00, 0x70, 0x02, 0x00, 0x00, 0x50, 0x03, 0x00, 0x00, 0x03, 0x00, 0x00, // .....p...P...... + 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x71, 0x02, 0x00, 0x00, 0x6e, 0x02, 0x00, // .Q.......q...n.. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x72, 0x02, 0x00, // .....Q.......r.. + 0x00, 0x6e, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, // .n.......Q...... + 0x00, 0x73, 0x02, 0x00, 0x00, 0x6e, 0x02, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x50, 0x00, 0x07, // .s...n.......P.. + 0x00, 0x0d, 0x00, 0x00, 0x00, 0x74, 0x02, 0x00, 0x00, 0x71, 0x02, 0x00, 0x00, 0x72, 0x02, 0x00, // .....t...q...r.. + 0x00, 0x73, 0x02, 0x00, 0x00, 0x70, 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x75, 0x02, 0x00, // .s...p.......u.. + 0x00, 0xf8, 0x00, 0x02, 0x00, 0x75, 0x02, 0x00, 0x00, 0xf5, 0x00, 0x07, 0x00, 0x0d, 0x00, 0x00, // .....u.......... + 0x00, 0xc5, 0x03, 0x00, 0x00, 0x50, 0x03, 0x00, 0x00, 0x56, 0x02, 0x00, 0x00, 0x74, 0x02, 0x00, // .....P...V...t.. + 0x00, 0x69, 0x02, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0xae, 0x00, 0x00, 0x00, 0x76, 0x02, 0x00, // .i...A.......v.. + 0x00, 0x88, 0x00, 0x00, 0x00, 0xad, 0x00, 0x00, 0x00, 0xbf, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, // .............=.. + 0x00, 0x07, 0x00, 0x00, 0x00, 0x77, 0x02, 0x00, 0x00, 0x76, 0x02, 0x00, 0x00, 0xb4, 0x00, 0x05, // .....w...v...... + 0x00, 0xd6, 0x00, 0x00, 0x00, 0x78, 0x02, 0x00, 0x00, 0x77, 0x02, 0x00, 0x00, 0xa8, 0x00, 0x00, // .....x...w...... + 0x00, 0xf7, 0x00, 0x03, 0x00, 0x7c, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, // .....|.......... + 0x00, 0x78, 0x02, 0x00, 0x00, 0x79, 0x02, 0x00, 0x00, 0x7c, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, // .x...y...|...... + 0x00, 0x79, 0x02, 0x00, 0x00, 0x4f, 0x00, 0x09, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x7b, 0x02, 0x00, // .y...O.......{.. + 0x00, 0xc5, 0x03, 0x00, 0x00, 0xc5, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0x7c, 0x02, 0x00, // .............|.. + 0x00, 0xf8, 0x00, 0x02, 0x00, 0x7c, 0x02, 0x00, 0x00, 0xf5, 0x00, 0x07, 0x00, 0x0d, 0x00, 0x00, // .....|.......... + 0x00, 0xc6, 0x03, 0x00, 0x00, 0xc5, 0x03, 0x00, 0x00, 0x75, 0x02, 0x00, 0x00, 0x7b, 0x02, 0x00, // .........u...{.. + 0x00, 0x79, 0x02, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x90, 0x00, 0x00, 0x00, 0x7d, 0x02, 0x00, // .y...A.......}.. + 0x00, 0x88, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, // .........=...... + 0x00, 0x7e, 0x02, 0x00, 0x00, 0x7d, 0x02, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, // .~...}.......... + 0x00, 0x80, 0x02, 0x00, 0x00, 0xc6, 0x03, 0x00, 0x00, 0x7e, 0x02, 0x00, 0x00, 0x85, 0x00, 0x05, // .........~...... + 0x00, 0x07, 0x00, 0x00, 0x00, 0x83, 0x02, 0x00, 0x00, 0x29, 0x03, 0x00, 0x00, 0x19, 0x03, 0x00, // .........)...... + 0x00, 0x8e, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x85, 0x02, 0x00, 0x00, 0x80, 0x02, 0x00, // ................ + 0x00, 0x83, 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0xf6, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, // ................ + 0x00, 0x87, 0x02, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0xae, 0x00, 0x00, 0x00, 0x88, 0x02, 0x00, // .....A.......... + 0x00, 0x88, 0x00, 0x00, 0x00, 0xad, 0x00, 0x00, 0x00, 0xd3, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, // .............=.. + 0x00, 0x07, 0x00, 0x00, 0x00, 0x89, 0x02, 0x00, 0x00, 0x88, 0x02, 0x00, 0x00, 0xb4, 0x00, 0x05, // ................ + 0x00, 0xd6, 0x00, 0x00, 0x00, 0x8a, 0x02, 0x00, 0x00, 0x89, 0x02, 0x00, 0x00, 0xa8, 0x00, 0x00, // ................ + 0x00, 0xf7, 0x00, 0x03, 0x00, 0xf5, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, // ................ + 0x00, 0x8a, 0x02, 0x00, 0x00, 0x8b, 0x02, 0x00, 0x00, 0x8c, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, // ................ + 0x00, 0x8b, 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0xf5, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, // ................ + 0x00, 0x8c, 0x02, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0xae, 0x00, 0x00, 0x00, 0x8d, 0x02, 0x00, // .....A.......... + 0x00, 0x88, 0x00, 0x00, 0x00, 0xad, 0x00, 0x00, 0x00, 0xd3, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, // .............=.. + 0x00, 0x07, 0x00, 0x00, 0x00, 0x8e, 0x02, 0x00, 0x00, 0x8d, 0x02, 0x00, 0x00, 0xb4, 0x00, 0x05, // ................ + 0x00, 0xd6, 0x00, 0x00, 0x00, 0x8f, 0x02, 0x00, 0x00, 0x8e, 0x02, 0x00, 0x00, 0x4f, 0x01, 0x00, // .............O.. + 0x00, 0xf7, 0x00, 0x03, 0x00, 0xf4, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, // ................ + 0x00, 0x8f, 0x02, 0x00, 0x00, 0x90, 0x02, 0x00, 0x00, 0xbc, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, // ................ + 0x00, 0x90, 0x02, 0x00, 0x00, 0x56, 0x00, 0x05, 0x00, 0x51, 0x00, 0x00, 0x00, 0x57, 0x03, 0x00, // .....V...Q...W.. + 0x00, 0x40, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x00, 0x00, 0x57, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, // .@...=...W...... + 0x00, 0x59, 0x03, 0x00, 0x00, 0x57, 0x03, 0x00, 0x00, 0xd6, 0x01, 0x00, 0x00, 0x41, 0x00, 0x06, // .Y...W.......A.. + 0x00, 0xae, 0x00, 0x00, 0x00, 0x94, 0x02, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0xad, 0x00, 0x00, // ................ + 0x00, 0xbf, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x95, 0x02, 0x00, // .....=.......... + 0x00, 0x94, 0x02, 0x00, 0x00, 0xb4, 0x00, 0x05, 0x00, 0xd6, 0x00, 0x00, 0x00, 0x96, 0x02, 0x00, // ................ + 0x00, 0x95, 0x02, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0xa3, 0x02, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0x96, 0x02, 0x00, 0x00, 0x97, 0x02, 0x00, // ................ + 0x00, 0xa3, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x97, 0x02, 0x00, 0x00, 0x4f, 0x00, 0x08, // .............O.. + 0x00, 0x81, 0x00, 0x00, 0x00, 0x99, 0x02, 0x00, 0x00, 0x59, 0x03, 0x00, 0x00, 0x59, 0x03, 0x00, // .........Y...Y.. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, // .............Q.. + 0x00, 0x07, 0x00, 0x00, 0x00, 0x9b, 0x02, 0x00, 0x00, 0x59, 0x03, 0x00, 0x00, 0x03, 0x00, 0x00, // .........Y...... + 0x00, 0x8e, 0x00, 0x05, 0x00, 0x81, 0x00, 0x00, 0x00, 0x9c, 0x02, 0x00, 0x00, 0x99, 0x02, 0x00, // ................ + 0x00, 0x9b, 0x02, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x9e, 0x02, 0x00, // .....Q.......... + 0x00, 0x59, 0x03, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, // .Y.......Q...... + 0x00, 0x9f, 0x02, 0x00, 0x00, 0x9c, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, // .............Q.. + 0x00, 0x07, 0x00, 0x00, 0x00, 0xa0, 0x02, 0x00, 0x00, 0x9c, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, // ................ + 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xa1, 0x02, 0x00, 0x00, 0x9c, 0x02, 0x00, // .Q.............. + 0x00, 0x02, 0x00, 0x00, 0x00, 0x50, 0x00, 0x07, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xa2, 0x02, 0x00, // .....P.......... + 0x00, 0x9f, 0x02, 0x00, 0x00, 0xa0, 0x02, 0x00, 0x00, 0xa1, 0x02, 0x00, 0x00, 0x9e, 0x02, 0x00, // ................ + 0x00, 0xf9, 0x00, 0x02, 0x00, 0xa3, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0xa3, 0x02, 0x00, // ................ + 0x00, 0xf5, 0x00, 0x07, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xc3, 0x03, 0x00, 0x00, 0x59, 0x03, 0x00, // .............Y.. + 0x00, 0x90, 0x02, 0x00, 0x00, 0xa2, 0x02, 0x00, 0x00, 0x97, 0x02, 0x00, 0x00, 0x41, 0x00, 0x06, // .............A.. + 0x00, 0xae, 0x00, 0x00, 0x00, 0xa4, 0x02, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0xad, 0x00, 0x00, // ................ + 0x00, 0xbf, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xa5, 0x02, 0x00, // .....=.......... + 0x00, 0xa4, 0x02, 0x00, 0x00, 0xb4, 0x00, 0x05, 0x00, 0xd6, 0x00, 0x00, 0x00, 0xa6, 0x02, 0x00, // ................ + 0x00, 0xa5, 0x02, 0x00, 0x00, 0xa8, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0xb4, 0x02, 0x00, // ................ + 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x04, 0x00, 0xa6, 0x02, 0x00, 0x00, 0xa7, 0x02, 0x00, // ................ + 0x00, 0xb4, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0xa7, 0x02, 0x00, 0x00, 0x41, 0x00, 0x06, // .............A.. + 0x00, 0xae, 0x00, 0x00, 0x00, 0xa8, 0x02, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0xbe, 0x00, 0x00, // ................ + 0x00, 0x6c, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xa9, 0x02, 0x00, // .l...=.......... + 0x00, 0xa8, 0x02, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x5e, 0x03, 0x00, // .....Q.......^.. + 0x00, 0xc3, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, // ................ + 0x00, 0x60, 0x03, 0x00, 0x00, 0x5e, 0x03, 0x00, 0x00, 0xa9, 0x02, 0x00, 0x00, 0x41, 0x00, 0x06, // .`...^.......A.. + 0x00, 0xae, 0x00, 0x00, 0x00, 0x61, 0x03, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0xbe, 0x00, 0x00, // .....a.......... + 0x00, 0xbf, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x62, 0x03, 0x00, // .....=.......b.. + 0x00, 0x61, 0x03, 0x00, 0x00, 0x88, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x63, 0x03, 0x00, // .a...........c.. + 0x00, 0x60, 0x03, 0x00, 0x00, 0x62, 0x03, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, // .`...b.......... + 0x00, 0x64, 0x03, 0x00, 0x00, 0x63, 0x03, 0x00, 0x00, 0x95, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, // .d...c.......... + 0x00, 0x07, 0x00, 0x00, 0x00, 0x66, 0x03, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, // .....f.......+.. + 0x00, 0x64, 0x03, 0x00, 0x00, 0x73, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, // .d...s.......A.. + 0x00, 0xae, 0x00, 0x00, 0x00, 0xac, 0x02, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0xbe, 0x00, 0x00, // ................ + 0x00, 0x6f, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xad, 0x02, 0x00, // .o...=.......... + 0x00, 0xac, 0x02, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x6b, 0x03, 0x00, // .....Q.......k.. + 0x00, 0xc3, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, // ................ + 0x00, 0x6d, 0x03, 0x00, 0x00, 0x6b, 0x03, 0x00, 0x00, 0xad, 0x02, 0x00, 0x00, 0x41, 0x00, 0x06, // .m...k.......A.. + 0x00, 0xae, 0x00, 0x00, 0x00, 0x6e, 0x03, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0xbe, 0x00, 0x00, // .....n.......... + 0x00, 0xbf, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x6f, 0x03, 0x00, // .....=.......o.. + 0x00, 0x6e, 0x03, 0x00, 0x00, 0x88, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x70, 0x03, 0x00, // .n...........p.. + 0x00, 0x6d, 0x03, 0x00, 0x00, 0x6f, 0x03, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, // .m...o.......... + 0x00, 0x71, 0x03, 0x00, 0x00, 0x70, 0x03, 0x00, 0x00, 0x95, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, // .q...p.......... + 0x00, 0x07, 0x00, 0x00, 0x00, 0x73, 0x03, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, // .....s.......+.. + 0x00, 0x71, 0x03, 0x00, 0x00, 0x73, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x83, 0x00, 0x05, // .q...s.......... + 0x00, 0x07, 0x00, 0x00, 0x00, 0xb0, 0x02, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x73, 0x03, 0x00, // .............s.. + 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xb1, 0x02, 0x00, 0x00, 0x66, 0x03, 0x00, // .............f.. + 0x00, 0xb0, 0x02, 0x00, 0x00, 0x50, 0x00, 0x07, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xb3, 0x02, 0x00, // .....P.......... + 0x00, 0xb1, 0x02, 0x00, 0x00, 0xb1, 0x02, 0x00, 0x00, 0xb1, 0x02, 0x00, 0x00, 0xb1, 0x02, 0x00, // ................ + 0x00, 0xf9, 0x00, 0x02, 0x00, 0xb4, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0xb4, 0x02, 0x00, // ................ + 0x00, 0xf5, 0x00, 0x07, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xc4, 0x03, 0x00, 0x00, 0xc3, 0x03, 0x00, // ................ + 0x00, 0xa3, 0x02, 0x00, 0x00, 0xb3, 0x02, 0x00, 0x00, 0xa7, 0x02, 0x00, 0x00, 0x8e, 0x00, 0x05, // ................ + 0x00, 0x0d, 0x00, 0x00, 0x00, 0xb7, 0x02, 0x00, 0x00, 0xc4, 0x03, 0x00, 0x00, 0x19, 0x03, 0x00, // ................ + 0x00, 0x41, 0x00, 0x05, 0x00, 0x90, 0x00, 0x00, 0x00, 0xb9, 0x02, 0x00, 0x00, 0x88, 0x00, 0x00, // .A.............. + 0x00, 0xf8, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xba, 0x02, 0x00, // .....=.......... + 0x00, 0xb9, 0x02, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xbb, 0x02, 0x00, // ................ + 0x00, 0xb7, 0x02, 0x00, 0x00, 0xba, 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0xf4, 0x02, 0x00, // ................ + 0x00, 0xf8, 0x00, 0x02, 0x00, 0xbc, 0x02, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0xae, 0x00, 0x00, // .........A...... + 0x00, 0xbd, 0x02, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0xad, 0x00, 0x00, 0x00, 0xd3, 0x00, 0x00, // ................ + 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xbe, 0x02, 0x00, 0x00, 0xbd, 0x02, 0x00, // .=.............. + 0x00, 0xb4, 0x00, 0x05, 0x00, 0xd6, 0x00, 0x00, 0x00, 0xbf, 0x02, 0x00, 0x00, 0xbe, 0x02, 0x00, // ................ + 0x00, 0x89, 0x01, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0xf3, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0xfa, 0x00, 0x04, 0x00, 0xbf, 0x02, 0x00, 0x00, 0xc0, 0x02, 0x00, 0x00, 0xf3, 0x02, 0x00, // ................ + 0x00, 0xf8, 0x00, 0x02, 0x00, 0xc0, 0x02, 0x00, 0x00, 0x56, 0x00, 0x05, 0x00, 0x51, 0x00, 0x00, // .........V...Q.. + 0x00, 0x7a, 0x03, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x00, 0x00, 0x57, 0x00, 0x05, // .z...@...=...W.. + 0x00, 0x0d, 0x00, 0x00, 0x00, 0x7c, 0x03, 0x00, 0x00, 0x7a, 0x03, 0x00, 0x00, 0xd6, 0x01, 0x00, // .....|...z...... + 0x00, 0x56, 0x00, 0x05, 0x00, 0x51, 0x00, 0x00, 0x00, 0x83, 0x03, 0x00, 0x00, 0x46, 0x00, 0x00, // .V...Q.......F.. + 0x00, 0x44, 0x00, 0x00, 0x00, 0x57, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x85, 0x03, 0x00, // .D...W.......... + 0x00, 0x83, 0x03, 0x00, 0x00, 0xd9, 0x01, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0xae, 0x00, 0x00, // .........A...... + 0x00, 0xc8, 0x02, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0xad, 0x00, 0x00, 0x00, 0xbf, 0x00, 0x00, // ................ + 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc9, 0x02, 0x00, 0x00, 0xc8, 0x02, 0x00, // .=.............. + 0x00, 0xb4, 0x00, 0x05, 0x00, 0xd6, 0x00, 0x00, 0x00, 0xca, 0x02, 0x00, 0x00, 0xc9, 0x02, 0x00, // ................ + 0x00, 0x80, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0xd7, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0xfa, 0x00, 0x04, 0x00, 0xca, 0x02, 0x00, 0x00, 0xcb, 0x02, 0x00, 0x00, 0xd7, 0x02, 0x00, // ................ + 0x00, 0xf8, 0x00, 0x02, 0x00, 0xcb, 0x02, 0x00, 0x00, 0x4f, 0x00, 0x08, 0x00, 0x81, 0x00, 0x00, // .........O...... + 0x00, 0xcd, 0x02, 0x00, 0x00, 0x7c, 0x03, 0x00, 0x00, 0x7c, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, // .....|...|...... + 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, // .........Q...... + 0x00, 0xcf, 0x02, 0x00, 0x00, 0x7c, 0x03, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x05, // .....|.......... + 0x00, 0x81, 0x00, 0x00, 0x00, 0xd0, 0x02, 0x00, 0x00, 0xcd, 0x02, 0x00, 0x00, 0xcf, 0x02, 0x00, // ................ + 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xd2, 0x02, 0x00, 0x00, 0x7c, 0x03, 0x00, // .Q...........|.. + 0x00, 0x03, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xd3, 0x02, 0x00, // .....Q.......... + 0x00, 0xd0, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, // .........Q...... + 0x00, 0xd4, 0x02, 0x00, 0x00, 0xd0, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, // .............Q.. + 0x00, 0x07, 0x00, 0x00, 0x00, 0xd5, 0x02, 0x00, 0x00, 0xd0, 0x02, 0x00, 0x00, 0x02, 0x00, 0x00, // ................ + 0x00, 0x50, 0x00, 0x07, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xd6, 0x02, 0x00, 0x00, 0xd3, 0x02, 0x00, // .P.............. + 0x00, 0xd4, 0x02, 0x00, 0x00, 0xd5, 0x02, 0x00, 0x00, 0xd2, 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, // ................ + 0x00, 0xd7, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0xd7, 0x02, 0x00, 0x00, 0xf5, 0x00, 0x07, // ................ + 0x00, 0x0d, 0x00, 0x00, 0x00, 0xc1, 0x03, 0x00, 0x00, 0x7c, 0x03, 0x00, 0x00, 0xc0, 0x02, 0x00, // .........|...... + 0x00, 0xd6, 0x02, 0x00, 0x00, 0xcb, 0x02, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0xae, 0x00, 0x00, // .........A...... + 0x00, 0xd8, 0x02, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0xad, 0x00, 0x00, 0x00, 0xbf, 0x00, 0x00, // ................ + 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xd9, 0x02, 0x00, 0x00, 0xd8, 0x02, 0x00, // .=.............. + 0x00, 0xb4, 0x00, 0x05, 0x00, 0xd6, 0x00, 0x00, 0x00, 0xda, 0x02, 0x00, 0x00, 0xd9, 0x02, 0x00, // ................ + 0x00, 0xa8, 0x00, 0x00, 0x00, 0xf7, 0x00, 0x03, 0x00, 0xe8, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0xfa, 0x00, 0x04, 0x00, 0xda, 0x02, 0x00, 0x00, 0xdb, 0x02, 0x00, 0x00, 0xe8, 0x02, 0x00, // ................ + 0x00, 0xf8, 0x00, 0x02, 0x00, 0xdb, 0x02, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0xae, 0x00, 0x00, // .........A...... + 0x00, 0xdc, 0x02, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0xbe, 0x00, 0x00, 0x00, 0x6c, 0x00, 0x00, // .............l.. + 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xdd, 0x02, 0x00, 0x00, 0xdc, 0x02, 0x00, // .=.............. + 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x8a, 0x03, 0x00, 0x00, 0xc1, 0x03, 0x00, // .Q.............. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x8c, 0x03, 0x00, // ................ + 0x00, 0x8a, 0x03, 0x00, 0x00, 0xdd, 0x02, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0xae, 0x00, 0x00, // .........A...... + 0x00, 0x8d, 0x03, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0xbe, 0x00, 0x00, 0x00, 0xbf, 0x00, 0x00, // ................ + 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x8e, 0x03, 0x00, 0x00, 0x8d, 0x03, 0x00, // .=.............. + 0x00, 0x88, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x8f, 0x03, 0x00, 0x00, 0x8c, 0x03, 0x00, // ................ + 0x00, 0x8e, 0x03, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x90, 0x03, 0x00, // ................ + 0x00, 0x8f, 0x03, 0x00, 0x00, 0x95, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, // ................ + 0x00, 0x92, 0x03, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x90, 0x03, 0x00, // .........+...... + 0x00, 0x73, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0xae, 0x00, 0x00, // .s.......A...... + 0x00, 0xe0, 0x02, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0xbe, 0x00, 0x00, 0x00, 0x6f, 0x00, 0x00, // .............o.. + 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0xe1, 0x02, 0x00, 0x00, 0xe0, 0x02, 0x00, // .=.............. + 0x00, 0x51, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x97, 0x03, 0x00, 0x00, 0xc1, 0x03, 0x00, // .Q.............. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x99, 0x03, 0x00, // ................ + 0x00, 0x97, 0x03, 0x00, 0x00, 0xe1, 0x02, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0xae, 0x00, 0x00, // .........A...... + 0x00, 0x9a, 0x03, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0xbe, 0x00, 0x00, 0x00, 0xbf, 0x00, 0x00, // ................ + 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x9b, 0x03, 0x00, 0x00, 0x9a, 0x03, 0x00, // .=.............. + 0x00, 0x88, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x9c, 0x03, 0x00, 0x00, 0x99, 0x03, 0x00, // ................ + 0x00, 0x9b, 0x03, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x9d, 0x03, 0x00, // ................ + 0x00, 0x9c, 0x03, 0x00, 0x00, 0x95, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x07, 0x00, 0x00, // ................ + 0x00, 0x9f, 0x03, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x9d, 0x03, 0x00, // .........+...... + 0x00, 0x73, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, // .s.............. + 0x00, 0xe4, 0x02, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x9f, 0x03, 0x00, 0x00, 0x85, 0x00, 0x05, // ................ + 0x00, 0x07, 0x00, 0x00, 0x00, 0xe5, 0x02, 0x00, 0x00, 0x92, 0x03, 0x00, 0x00, 0xe4, 0x02, 0x00, // ................ + 0x00, 0x50, 0x00, 0x07, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xe7, 0x02, 0x00, 0x00, 0xe5, 0x02, 0x00, // .P.............. + 0x00, 0xe5, 0x02, 0x00, 0x00, 0xe5, 0x02, 0x00, 0x00, 0xe5, 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, // ................ + 0x00, 0xe8, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0xe8, 0x02, 0x00, 0x00, 0xf5, 0x00, 0x07, // ................ + 0x00, 0x0d, 0x00, 0x00, 0x00, 0xc2, 0x03, 0x00, 0x00, 0xc1, 0x03, 0x00, 0x00, 0xd7, 0x02, 0x00, // ................ + 0x00, 0xe7, 0x02, 0x00, 0x00, 0xdb, 0x02, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, // ................ + 0x00, 0xeb, 0x02, 0x00, 0x00, 0xc2, 0x03, 0x00, 0x00, 0x19, 0x03, 0x00, 0x00, 0x85, 0x00, 0x05, // ................ + 0x00, 0x0d, 0x00, 0x00, 0x00, 0xee, 0x02, 0x00, 0x00, 0xeb, 0x02, 0x00, 0x00, 0x85, 0x03, 0x00, // ................ + 0x00, 0x41, 0x00, 0x05, 0x00, 0x90, 0x00, 0x00, 0x00, 0xf0, 0x02, 0x00, 0x00, 0x88, 0x00, 0x00, // .A.............. + 0x00, 0xf8, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xf1, 0x02, 0x00, // .....=.......... + 0x00, 0xf0, 0x02, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xf2, 0x02, 0x00, // ................ + 0x00, 0xee, 0x02, 0x00, 0x00, 0xf1, 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0xf3, 0x02, 0x00, // ................ + 0x00, 0xf8, 0x00, 0x02, 0x00, 0xf3, 0x02, 0x00, 0x00, 0xf5, 0x00, 0x07, 0x00, 0x0d, 0x00, 0x00, // ................ + 0x00, 0xcb, 0x03, 0x00, 0x00, 0xcc, 0x03, 0x00, 0x00, 0xbc, 0x02, 0x00, 0x00, 0xf2, 0x02, 0x00, // ................ + 0x00, 0xe8, 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0xf4, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, // ................ + 0x00, 0xf4, 0x02, 0x00, 0x00, 0xf5, 0x00, 0x07, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xca, 0x03, 0x00, // ................ + 0x00, 0xbb, 0x02, 0x00, 0x00, 0xb4, 0x02, 0x00, 0x00, 0xcb, 0x03, 0x00, 0x00, 0xf3, 0x02, 0x00, // ................ + 0x00, 0xf9, 0x00, 0x02, 0x00, 0xf5, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0xf5, 0x02, 0x00, // ................ + 0x00, 0xf5, 0x00, 0x07, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xc9, 0x03, 0x00, 0x00, 0x4b, 0x01, 0x00, // .............K.. + 0x00, 0x8b, 0x02, 0x00, 0x00, 0xca, 0x03, 0x00, 0x00, 0xf4, 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, // ................ + 0x00, 0xf6, 0x02, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0xf6, 0x02, 0x00, 0x00, 0xf5, 0x00, 0x07, // ................ + 0x00, 0x0d, 0x00, 0x00, 0x00, 0xc8, 0x03, 0x00, 0x00, 0x85, 0x02, 0x00, 0x00, 0x7c, 0x02, 0x00, // .............|.. + 0x00, 0xc9, 0x03, 0x00, 0x00, 0xf5, 0x02, 0x00, 0x00, 0xf9, 0x00, 0x02, 0x00, 0xf7, 0x02, 0x00, // ................ + 0x00, 0xf8, 0x00, 0x02, 0x00, 0xf7, 0x02, 0x00, 0x00, 0xf5, 0x00, 0x07, 0x00, 0x0d, 0x00, 0x00, // ................ + 0x00, 0xc7, 0x03, 0x00, 0x00, 0x50, 0x02, 0x00, 0x00, 0x2d, 0x02, 0x00, 0x00, 0xc8, 0x03, 0x00, // .....P...-...... + 0x00, 0xf6, 0x02, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0xe7, 0x01, 0x00, 0x00, 0xc7, 0x03, 0x00, // .....>.......... + 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x00, 0xc0, 0x00, // .....8....... }; diff --git a/Polyfills/Canvas/Source/Shaders/spirv/vs_fspass.h b/Polyfills/Canvas/Source/Shaders/spirv/vs_fspass.h new file mode 100644 index 000000000..ced9913fe --- /dev/null +++ b/Polyfills/Canvas/Source/Shaders/spirv/vs_fspass.h @@ -0,0 +1,63 @@ +static const uint8_t vs_fspass_spv[954] = +{ + 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0xcf, 0xda, 0x1b, 0x94, 0x00, 0x00, 0xa0, 0x03, // VSH............. + 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0b, 0x00, 0x08, 0x00, 0x82, 0x00, // ....#........... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, // ................ + 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, // ......GLSL.std.4 + 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, // 50.............. + 0x00, 0x00, 0x0f, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, // ..............ma + 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x00, 0x00, 0x49, 0x00, 0x00, 0x00, 0x4d, 0x00, // in....=...I...M. + 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0xf4, 0x01, // ..P............. + 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, // ..........main.. + 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x3d, 0x00, 0x00, 0x00, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, // ......=...a_posi + 0x74, 0x69, 0x6f, 0x6e, 0x00, 0x00, 0x05, 0x00, 0x0a, 0x00, 0x49, 0x00, 0x00, 0x00, 0x40, 0x65, // tion......I...@e + 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2e, // ntryPointOutput. + 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x00, 0x00, 0x00, 0x05, 0x00, // gl_Position..... + 0x0a, 0x00, 0x4d, 0x00, 0x00, 0x00, 0x40, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, // ..M...@entryPoin + 0x74, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2e, 0x76, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, // tOutput.v_positi + 0x6f, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x0a, 0x00, 0x50, 0x00, 0x00, 0x00, 0x40, 0x65, // on........P...@e + 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2e, // ntryPointOutput. + 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x00, 0x00, 0x00, 0x47, 0x00, // v_texcoord0...G. + 0x04, 0x00, 0x3d, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, // ..=...........G. + 0x04, 0x00, 0x49, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, // ..I...........G. + 0x04, 0x00, 0x4d, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, // ..M...........G. + 0x04, 0x00, 0x50, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x13, 0x00, // ..P............. + 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, // ......!......... + 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x06, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x17, 0x00, // .......... ..... + 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x17, 0x00, // ................ + 0x04, 0x00, 0x09, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x2b, 0x00, // ..............+. + 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, // ..............+. + 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x2b, 0x00, // ............@@+. + 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x2c, 0x00, // .............?,. + 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x1f, 0x00, // ...... ......... + 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x00, // ..+.......,..... + 0x00, 0x3f, 0x2c, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x2c, 0x00, // .?,...........,. + 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x01, 0x00, // ...... ...<..... + 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x3d, 0x00, // ......;...<...=. + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x48, 0x00, 0x00, 0x00, 0x03, 0x00, // ...... ...H..... + 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x48, 0x00, 0x00, 0x00, 0x49, 0x00, // ......;...H...I. + 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x03, 0x00, // ...... ...L..... + 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x4d, 0x00, // ......;...L...M. + 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x50, 0x00, // ......;...L...P. + 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, // ......6......... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x05, 0x00, // ................ + 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x3d, 0x00, // ..=.......>...=. + 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x73, 0x00, 0x00, 0x00, 0x3e, 0x00, // ..........s...>. + 0x00, 0x00, 0x1d, 0x00, 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x74, 0x00, // ..............t. + 0x00, 0x00, 0x73, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, // ..s... ...Q..... + 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, // ..v...t.......Q. + 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x01, 0x00, // ......x...t..... + 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x79, 0x00, 0x00, 0x00, 0x1f, 0x00, // ..........y..... + 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x7a, 0x00, // ..x...P.......z. + 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x79, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x07, 0x00, // ..v...y......... + 0x00, 0x00, 0x7b, 0x00, 0x00, 0x00, 0x7a, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x81, 0x00, // ..{...z...,..... + 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x7b, 0x00, 0x00, 0x00, 0x2e, 0x00, // ......|...{..... + 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x74, 0x00, // ..Q...........t. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x80, 0x00, // ......Q......... + 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x50, 0x00, 0x07, 0x00, 0x09, 0x00, // ..t.......P..... + 0x00, 0x00, 0x81, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x2c, 0x00, // ..............,. + 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x49, 0x00, 0x00, 0x00, 0x81, 0x00, // ......>...I..... + 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x4d, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x3e, 0x00, // ..>...M...>...>. + 0x03, 0x00, 0x50, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, // ..P...|.......8. + 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x10, 0x00, 0x00, 0x00, // .......... +}; diff --git a/Polyfills/Canvas/Source/Shaders/spirv/vs_nanovg_fill.h b/Polyfills/Canvas/Source/Shaders/spirv/vs_nanovg_fill.h index af230402f..e94b033f3 100644 --- a/Polyfills/Canvas/Source/Shaders/spirv/vs_nanovg_fill.h +++ b/Polyfills/Canvas/Source/Shaders/spirv/vs_nanovg_fill.h @@ -1,96 +1,130 @@ -static const uint8_t vs_nanovg_fill_spv[1481] = +static const uint8_t vs_nanovg_fill_spv[2026] = { - 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0xcf, 0xda, 0x1b, 0x94, 0x02, 0x00, 0x0b, 0x75, // VSH............u - 0x5f, 0x68, 0x61, 0x6c, 0x66, 0x54, 0x65, 0x78, 0x65, 0x6c, 0x02, 0x01, 0x10, 0x00, 0x01, 0x00, // _halfTexel...... + 0x56, 0x53, 0x48, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x98, 0xde, 0xee, 0x03, 0x00, 0x0b, 0x75, // VSH............u + 0x5f, 0x68, 0x61, 0x6c, 0x66, 0x54, 0x65, 0x78, 0x65, 0x6c, 0x02, 0x01, 0x20, 0x00, 0x01, 0x00, // _halfTexel.. ... 0x00, 0x00, 0x00, 0x00, 0x0a, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x53, 0x69, 0x7a, 0x65, 0x02, // .....u_viewSize. - 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x84, 0x05, 0x00, 0x00, 0x03, 0x02, 0x23, // ...............# - 0x07, 0x00, 0x00, 0x01, 0x00, 0x0b, 0x00, 0x08, 0x00, 0x87, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ - 0x00, 0x11, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, // ................ - 0x00, 0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, // .GLSL.std.450... - 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x0a, // ................ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, // .........main... - 0x00, 0x43, 0x00, 0x00, 0x00, 0x46, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, // .C...F...O...S.. - 0x00, 0x56, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0xf4, 0x01, 0x00, // .V.............. - 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, // .........main... - 0x00, 0x05, 0x00, 0x06, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, // .........Uniform - 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x06, 0x00, 0x1c, 0x00, 0x00, // Block........... - 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x53, 0x69, 0x7a, 0x65, 0x00, // .....u_viewSize. - 0x00, 0x06, 0x00, 0x06, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x68, // .............u_h - 0x61, 0x6c, 0x66, 0x54, 0x65, 0x78, 0x65, 0x6c, 0x00, 0x05, 0x00, 0x03, 0x00, 0x1e, 0x00, 0x00, // alfTexel........ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x43, 0x00, 0x00, 0x00, 0x61, 0x5f, 0x70, // .........C...a_p - 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x46, 0x00, 0x00, // osition......F.. - 0x00, 0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x00, 0x05, 0x00, 0x0a, // .a_texcoord0.... - 0x00, 0x4f, 0x00, 0x00, 0x00, 0x40, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, // .O...@entryPoint - 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2e, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, // Output.gl_Positi - 0x6f, 0x6e, 0x00, 0x00, 0x00, 0x05, 0x00, 0x0a, 0x00, 0x53, 0x00, 0x00, 0x00, 0x40, 0x65, 0x6e, // on.......S...@en - 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2e, 0x76, // tryPointOutput.v - 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x0a, // _position....... - 0x00, 0x56, 0x00, 0x00, 0x00, 0x40, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, // .V...@entryPoint - 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, // Output.v_texcoor - 0x64, 0x30, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, // d0...G.......... - 0x00, 0x48, 0x00, 0x05, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, // .H...........#.. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // .....H.......... - 0x00, 0x23, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x1e, 0x00, 0x00, // .#.......G...... - 0x00, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x1e, 0x00, 0x00, // .!.......G...... - 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x43, 0x00, 0x00, // .".......G...C.. - 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x46, 0x00, 0x00, // .........G...F.. - 0x00, 0x1e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x4f, 0x00, 0x00, // .........G...O.. - 0x00, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x53, 0x00, 0x00, // .........G...S.. - 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x56, 0x00, 0x00, // .........G...V.. - 0x00, 0x1e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, // ................ - 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, // .!.............. - 0x00, 0x06, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, // ..... .......... - 0x00, 0x06, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x09, 0x00, 0x00, // ................ - 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x12, 0x00, 0x00, // ................ - 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x12, 0x00, 0x00, // . .......+...... - 0x00, 0x13, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, // .........+...... - 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x04, 0x00, 0x1c, 0x00, 0x00, // ................ - 0x00, 0x09, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x1d, 0x00, 0x00, // ......... ...... - 0x00, 0x02, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x1d, 0x00, 0x00, // .........;...... - 0x00, 0x1e, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x1f, 0x00, 0x00, // ......... ...... - 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x12, 0x00, 0x00, // .........+...... - 0x00, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, // .%.......+...... - 0x00, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x15, 0x00, 0x04, 0x00, 0x27, 0x00, 0x00, // .&......@....'.. - 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x27, 0x00, 0x00, // . .......+...'.. - 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x2d, 0x00, 0x00, // .(....... ...-.. - 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, // .........+...... - 0x00, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x27, 0x00, 0x00, // .1......?+...'.. - 0x00, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x42, 0x00, 0x00, // .3....... ...B.. - 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x42, 0x00, 0x00, // .........;...B.. - 0x00, 0x43, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x42, 0x00, 0x00, // .C.......;...B.. - 0x00, 0x46, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x4e, 0x00, 0x00, // .F....... ...N.. - 0x00, 0x03, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x4e, 0x00, 0x00, // .........;...N.. - 0x00, 0x4f, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x52, 0x00, 0x00, // .O....... ...R.. - 0x00, 0x03, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x52, 0x00, 0x00, // .........;...R.. - 0x00, 0x53, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x52, 0x00, 0x00, // .S.......;...R.. - 0x00, 0x56, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, // .V.......6...... - 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, // ................ - 0x00, 0x05, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, // .....=.......D.. - 0x00, 0x43, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x47, 0x00, 0x00, // .C...=.......G.. - 0x00, 0x46, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x73, 0x00, 0x00, // .F...A.......s.. - 0x00, 0x1e, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x09, 0x00, 0x00, // .........=...... - 0x00, 0x74, 0x00, 0x00, 0x00, 0x73, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, // .t...s...O...... - 0x00, 0x75, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .u...t...t...... - 0x00, 0x01, 0x00, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, // .............v.. - 0x00, 0x47, 0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, // .G...u...Q...... - 0x00, 0x79, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, // .y...D.......... - 0x00, 0x06, 0x00, 0x00, 0x00, 0x7a, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x79, 0x00, 0x00, // .....z...&...y.. - 0x00, 0x41, 0x00, 0x06, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x7b, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, // .A...-...{...... - 0x00, 0x25, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, // .%...(...=...... - 0x00, 0x7c, 0x00, 0x00, 0x00, 0x7b, 0x00, 0x00, 0x00, 0x88, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, // .|...{.......... - 0x00, 0x7d, 0x00, 0x00, 0x00, 0x7a, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x83, 0x00, 0x05, // .}...z...|...... - 0x00, 0x06, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x7d, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, // .....~...}...1.. - 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, // .Q...........D.. - 0x00, 0x01, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x81, 0x00, 0x00, // ................ - 0x00, 0x26, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x2d, 0x00, 0x00, // .&.......A...-.. - 0x00, 0x82, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, // .........%...3.. - 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x82, 0x00, 0x00, // .=.............. - 0x00, 0x88, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0x81, 0x00, 0x00, // ................ - 0x00, 0x83, 0x00, 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x85, 0x00, 0x00, // ................ - 0x00, 0x31, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0x50, 0x00, 0x07, 0x00, 0x09, 0x00, 0x00, // .1.......P...... - 0x00, 0x86, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x85, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, // .....~.......... - 0x00, 0x31, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x86, 0x00, 0x00, // .1...>...O...... - 0x00, 0x3e, 0x00, 0x03, 0x00, 0x53, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, // .>...S...D...>.. - 0x00, 0x56, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, // .V...v.......8.. - 0x00, 0x00, 0x02, 0x01, 0x00, 0x10, 0x00, 0x20, 0x00, // ....... . + 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, // ..........u_exte + 0x6e, 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x02, 0x01, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ntRadius........ + 0x00, 0x00, 0x8c, 0x07, 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0b, 0x00, // ........#....... + 0x08, 0x00, 0xb5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00, 0x01, 0x00, // ................ + 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, // ..........GLSL.s + 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, // td.450.......... + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, // ................ + 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x00, 0x5c, 0x00, // ..main....Y..... + 0x00, 0x00, 0x65, 0x00, 0x00, 0x00, 0x69, 0x00, 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x6f, 0x00, // ..e...i...l...o. + 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0xf4, 0x01, 0x00, 0x00, 0x05, 0x00, // ................ + 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, // ......main...... + 0x06, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x6c, 0x6f, // ......UniformBlo + 0x63, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x06, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, // ck.............. + 0x00, 0x00, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x53, 0x69, 0x7a, 0x65, 0x00, 0x00, 0x06, 0x00, // ..u_viewSize.... + 0x07, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x65, 0x78, 0x74, 0x65, // ..........u_exte + 0x6e, 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x00, 0x00, 0x06, 0x00, 0x06, 0x00, 0x1e, 0x00, // ntRadius........ + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x68, 0x61, 0x6c, 0x66, 0x54, 0x65, 0x78, 0x65, // ......u_halfTexe + 0x6c, 0x00, 0x05, 0x00, 0x03, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, // l..... ......... + 0x05, 0x00, 0x59, 0x00, 0x00, 0x00, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, // ..Y...a_position + 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, // ..........a_texc + 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x00, 0x05, 0x00, 0x0a, 0x00, 0x65, 0x00, 0x00, 0x00, 0x40, 0x65, // oord0.....e...@e + 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2e, // ntryPointOutput. + 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x00, 0x00, 0x00, 0x05, 0x00, // gl_Position..... + 0x0a, 0x00, 0x69, 0x00, 0x00, 0x00, 0x40, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, // ..i...@entryPoin + 0x74, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2e, 0x76, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, // tOutput.v_positi + 0x6f, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x0a, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x40, 0x65, // on........l...@e + 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2e, // ntryPointOutput. + 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x00, 0x00, 0x00, 0x05, 0x00, // v_texcoord0..... + 0x0a, 0x00, 0x6f, 0x00, 0x00, 0x00, 0x40, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, // ..o...@entryPoin + 0x74, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2e, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, // tOutput.v_texcoo + 0x72, 0x64, 0x31, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x02, 0x00, // rd1...G......... + 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x00, // ..H...........#. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x01, 0x00, // ......H......... + 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x1e, 0x00, // ..#.......H..... + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x47, 0x00, // ......#... ...G. + 0x04, 0x00, 0x20, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, // .. ...!.......G. + 0x04, 0x00, 0x20, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, // .. ...".......G. + 0x04, 0x00, 0x59, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, // ..Y...........G. + 0x04, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, // ..............G. + 0x04, 0x00, 0x65, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, // ..e...........G. + 0x04, 0x00, 0x69, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, // ..i...........G. + 0x04, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, // ..l...........G. + 0x04, 0x00, 0x6f, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x13, 0x00, // ..o............. + 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, // ......!......... + 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x06, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x17, 0x00, // .......... ..... + 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x17, 0x00, // ................ + 0x04, 0x00, 0x09, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x15, 0x00, // ................ + 0x04, 0x00, 0x12, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, // ...... .......+. + 0x04, 0x00, 0x12, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, // ..............+. + 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, // ..............+. + 0x04, 0x00, 0x12, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x1e, 0x00, // ................ + 0x05, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x09, 0x00, // ................ + 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x1e, 0x00, // .. ............. + 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x02, 0x00, // ..;....... ..... + 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x21, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0x00, // .. ...!......... + 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x12, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, // ..+.......(..... + 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // ......-... ..... + 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, // ..+...-......... + 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, // .. .../......... + 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, // ..+.......5..... + 0x80, 0x3f, 0x2b, 0x00, 0x04, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x01, 0x00, // .?+...-...8..... + 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, // ..+.......A..... + 0x00, 0x40, 0x20, 0x00, 0x04, 0x00, 0x58, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0x00, // .@ ...X......... + 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x58, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x00, 0x01, 0x00, // ..;...X...Y..... + 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x58, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x01, 0x00, // ..;...X......... + 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x64, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x09, 0x00, // .. ...d......... + 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x64, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x00, 0x03, 0x00, // ..;...d...e..... + 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x68, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x07, 0x00, // .. ...h......... + 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x68, 0x00, 0x00, 0x00, 0x69, 0x00, 0x00, 0x00, 0x03, 0x00, // ..;...h...i..... + 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x68, 0x00, 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x03, 0x00, // ..;...h...l..... + 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x68, 0x00, 0x00, 0x00, 0x6f, 0x00, 0x00, 0x00, 0x03, 0x00, // ..;...h...o..... + 0x00, 0x00, 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, // ..6............. + 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x3d, 0x00, // ..............=. + 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x00, 0x3d, 0x00, // ......Z...Y...=. + 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x5d, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x41, 0x00, // ......].......A. + 0x05, 0x00, 0x21, 0x00, 0x00, 0x00, 0x8d, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x17, 0x00, // ..!....... ..... + 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x09, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x8d, 0x00, // ..=............. + 0x00, 0x00, 0x4f, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0x8f, 0x00, 0x00, 0x00, 0x8e, 0x00, // ..O............. + 0x00, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x81, 0x00, // ................ + 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0x00, 0x5d, 0x00, 0x00, 0x00, 0x8f, 0x00, // ..........]..... + 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x21, 0x00, 0x00, 0x00, 0x93, 0x00, 0x00, 0x00, 0x20, 0x00, // ..A...!....... . + 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x09, 0x00, 0x00, 0x00, 0x94, 0x00, // ..(...=......... + 0x00, 0x00, 0x93, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0x95, 0x00, // ......O......... + 0x00, 0x00, 0x94, 0x00, 0x00, 0x00, 0x94, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, // ................ + 0x00, 0x00, 0x88, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x96, 0x00, 0x00, 0x00, 0x5a, 0x00, // ..............Z. + 0x00, 0x00, 0x95, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x97, 0x00, // ......A.../..... + 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x3d, 0x00, // .. ...........=. + 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x98, 0x00, 0x00, 0x00, 0x97, 0x00, 0x00, 0x00, 0x41, 0x00, // ..............A. + 0x06, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x99, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x28, 0x00, // ../....... ...(. + 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x9a, 0x00, // ......=......... + 0x00, 0x00, 0x99, 0x00, 0x00, 0x00, 0x88, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x9b, 0x00, // ................ + 0x00, 0x00, 0x98, 0x00, 0x00, 0x00, 0x9a, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x07, 0x00, // ..........P..... + 0x00, 0x00, 0x9c, 0x00, 0x00, 0x00, 0x9b, 0x00, 0x00, 0x00, 0x35, 0x00, 0x00, 0x00, 0x83, 0x00, // ..........5..... + 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x9d, 0x00, 0x00, 0x00, 0x96, 0x00, 0x00, 0x00, 0x9c, 0x00, // ................ + 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x9e, 0x00, 0x00, 0x00, 0x20, 0x00, // ..A.../....... . + 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, // ......8...=..... + 0x00, 0x00, 0x9f, 0x00, 0x00, 0x00, 0x9e, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x2f, 0x00, // ..........A.../. + 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x2e, 0x00, // ...... ...(..... + 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0xa1, 0x00, 0x00, 0x00, 0xa0, 0x00, // ..=............. + 0x00, 0x00, 0x88, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0xa2, 0x00, 0x00, 0x00, 0x9f, 0x00, // ................ + 0x00, 0x00, 0xa1, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0xa3, 0x00, // ......P......... + 0x00, 0x00, 0xa2, 0x00, 0x00, 0x00, 0x35, 0x00, 0x00, 0x00, 0x88, 0x00, 0x05, 0x00, 0x07, 0x00, // ......5......... + 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, 0x9d, 0x00, 0x00, 0x00, 0xa3, 0x00, 0x00, 0x00, 0x51, 0x00, // ..............Q. + 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0xa7, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x00, 0x00, 0x00, // ..........Z..... + 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0xa8, 0x00, 0x00, 0x00, 0x41, 0x00, // ..............A. + 0x00, 0x00, 0xa7, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x2f, 0x00, 0x00, 0x00, 0xa9, 0x00, // ......A.../..... + 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x3d, 0x00, // .. ...(.......=. + 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0xaa, 0x00, 0x00, 0x00, 0xa9, 0x00, 0x00, 0x00, 0x88, 0x00, // ................ + 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0xab, 0x00, 0x00, 0x00, 0xa8, 0x00, 0x00, 0x00, 0xaa, 0x00, // ................ + 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0xac, 0x00, 0x00, 0x00, 0xab, 0x00, // ................ + 0x00, 0x00, 0x35, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0xae, 0x00, // ..5...Q......... + 0x00, 0x00, 0x5a, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, // ..Z............. + 0x00, 0x00, 0xaf, 0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0xae, 0x00, 0x00, 0x00, 0x41, 0x00, // ......A.......A. + 0x06, 0x00, 0x2f, 0x00, 0x00, 0x00, 0xb0, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x28, 0x00, // ../....... ...(. + 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0xb1, 0x00, // ..8...=......... + 0x00, 0x00, 0xb0, 0x00, 0x00, 0x00, 0x88, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0xb2, 0x00, // ................ + 0x00, 0x00, 0xaf, 0x00, 0x00, 0x00, 0xb1, 0x00, 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, 0x06, 0x00, // ................ + 0x00, 0x00, 0xb3, 0x00, 0x00, 0x00, 0x35, 0x00, 0x00, 0x00, 0xb2, 0x00, 0x00, 0x00, 0x50, 0x00, // ......5.......P. + 0x07, 0x00, 0x09, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, 0xac, 0x00, 0x00, 0x00, 0xb3, 0x00, // ................ + 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x35, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x65, 0x00, // ......5...>...e. + 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x69, 0x00, 0x00, 0x00, 0x5a, 0x00, // ......>...i...Z. + 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0x00, 0x3e, 0x00, // ..>...l.......>. + 0x03, 0x00, 0x6f, 0x00, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, // ..o...........8. + 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x10, 0x00, 0x30, 0x00, // ........0. }; diff --git a/Polyfills/Canvas/Source/Shaders/varying.def.sc b/Polyfills/Canvas/Source/Shaders/varying.def.sc index f836bcf24..930f0b0a4 100644 --- a/Polyfills/Canvas/Source/Shaders/varying.def.sc +++ b/Polyfills/Canvas/Source/Shaders/varying.def.sc @@ -1,5 +1,6 @@ vec2 v_position : TEXCOORD0 = vec2(0.0, 0.0); vec2 v_texcoord0 : TEXCOORD1 = vec2(0.0, 0.0); +vec2 v_texcoord1 : TEXCOORD2 = vec2(0.0, 0.0); vec2 a_position : POSITION; vec2 a_texcoord0 : TEXCOORD0; diff --git a/Polyfills/Canvas/Source/Shaders/vs_fspass.sc b/Polyfills/Canvas/Source/Shaders/vs_fspass.sc new file mode 100644 index 000000000..751312665 --- /dev/null +++ b/Polyfills/Canvas/Source/Shaders/vs_fspass.sc @@ -0,0 +1,24 @@ +$input a_position, a_texcoord0 +$output v_position, v_texcoord0 + +#include "./common.sh" + +#define NEED_HALF_TEXEL (BGFX_SHADER_LANGUAGE_HLSL < 400) + +uniform vec4 u_viewSize; + +#if NEED_HALF_TEXEL +uniform vec4 u_halfTexel; +#endif // NEED_HALF_TEXEL + +void main() +{ +#if !NEED_HALF_TEXEL + const vec4 u_halfTexel = vec4_splat(0.0); +#endif // !NEED_HALF_TEXEL + + v_position = a_position; + vec2 uv = a_position.xy*3. - vec2(0.,1); + v_texcoord0 = vec2(uv.x, 1.-uv.y) * 0.5 + vec2(0.5,0.); + gl_Position = vec4(uv, 0.5, 1.0); +} diff --git a/Polyfills/Canvas/Source/Shaders/vs_nanovg_fill.sc b/Polyfills/Canvas/Source/Shaders/vs_nanovg_fill.sc index 681064f8a..17925749d 100644 --- a/Polyfills/Canvas/Source/Shaders/vs_nanovg_fill.sc +++ b/Polyfills/Canvas/Source/Shaders/vs_nanovg_fill.sc @@ -1,11 +1,12 @@ $input a_position, a_texcoord0 -$output v_position, v_texcoord0 +$output v_position, v_texcoord0, v_texcoord1 #include "./common.sh" #define NEED_HALF_TEXEL (BGFX_SHADER_LANGUAGE_HLSL < 400) uniform vec4 u_viewSize; +uniform vec4 u_extentRadius; #if NEED_HALF_TEXEL uniform vec4 u_halfTexel; @@ -19,5 +20,7 @@ void main() v_position = a_position; v_texcoord0 = a_texcoord0+u_halfTexel.xy; + // v_texcoord1 texture coordinate for second image used for gradient + v_texcoord1 = ((a_position.xy / u_viewSize.xy) - vec2(u_extentRadius.x / u_viewSize.x, 1.)) / vec2(u_extentRadius.y / u_viewSize.x,1.); gl_Position = vec4(2.0*v_position.x/u_viewSize.x - 1.0, 1.0 - 2.0*v_position.y/u_viewSize.y, 0.0, 1.0); } diff --git a/Polyfills/Canvas/Source/nanosvg.h b/Polyfills/Canvas/Source/nanosvg.h new file mode 100644 index 000000000..76e0dbebe --- /dev/null +++ b/Polyfills/Canvas/Source/nanosvg.h @@ -0,0 +1,3098 @@ +/* + * Copyright (c) 2013-14 Mikko Mononen memon@inside.org + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + * The SVG parser is based on Anti-Grain Geometry 2.4 SVG example + * Copyright (C) 2002-2004 Maxim Shemanarev (McSeem) (http://www.antigrain.com/) + * + * Arc calculation code based on canvg (https://code.google.com/p/canvg/) + * + * Bounding box calculation based on http://blog.hackers-cafe.net/2009/06/how-to-calculate-bezier-curves-bounding.html + * + */ + +#ifndef NANOSVG_H +#define NANOSVG_H + +#ifndef NANOSVG_CPLUSPLUS +#ifdef __cplusplus +extern "C" { +#endif +#endif + +// NanoSVG is a simple stupid single-header-file SVG parse. The output of the parser is a list of cubic bezier shapes. +// +// The library suits well for anything from rendering scalable icons in your editor application to prototyping a game. +// +// NanoSVG supports a wide range of SVG features, but something may be missing, feel free to create a pull request! +// +// The shapes in the SVG images are transformed by the viewBox and converted to specified units. +// That is, you should get the same looking data as your designed in your favorite app. +// +// NanoSVG can return the paths in few different units. For example if you want to render an image, you may choose +// to get the paths in pixels, or if you are feeding the data into a CNC-cutter, you may want to use millimeters. +// +// The units passed to NanoSVG should be one of: 'px', 'pt', 'pc' 'mm', 'cm', or 'in'. +// DPI (dots-per-inch) controls how the unit conversion is done. +// +// If you don't know or care about the units stuff, "px" and 96 should get you going. + + +/* Example Usage: + // Load SVG + NSVGimage* image; + image = nsvgParseFromFile("test.svg", "px", 96); + printf("size: %f x %f\n", image->width, image->height); + // Use... + for (NSVGshape *shape = image->shapes; shape != NULL; shape = shape->next) { + for (NSVGpath *path = shape->paths; path != NULL; path = path->next) { + for (int i = 0; i < path->npts-1; i += 3) { + float* p = &path->pts[i*2]; + drawCubicBez(p[0],p[1], p[2],p[3], p[4],p[5], p[6],p[7]); + } + } + } + // Delete + nsvgDelete(image); +*/ + +enum NSVGpaintType { + NSVG_PAINT_UNDEF = -1, + NSVG_PAINT_NONE = 0, + NSVG_PAINT_COLOR = 1, + NSVG_PAINT_LINEAR_GRADIENT = 2, + NSVG_PAINT_RADIAL_GRADIENT = 3 +}; + +enum NSVGspreadType { + NSVG_SPREAD_PAD = 0, + NSVG_SPREAD_REFLECT = 1, + NSVG_SPREAD_REPEAT = 2 +}; + +enum NSVGlineJoin { + NSVG_JOIN_MITER = 0, + NSVG_JOIN_ROUND = 1, + NSVG_JOIN_BEVEL = 2 +}; + +enum NSVGlineCap { + NSVG_CAP_BUTT = 0, + NSVG_CAP_ROUND = 1, + NSVG_CAP_SQUARE = 2 +}; + +enum NSVGfillRule { + NSVG_FILLRULE_NONZERO = 0, + NSVG_FILLRULE_EVENODD = 1 +}; + +enum NSVGflags { + NSVG_FLAGS_VISIBLE = 0x01 +}; + +typedef struct NSVGgradientStop { + unsigned int color; + float offset; +} NSVGgradientStop; + +typedef struct NSVGgradient { + float xform[6]; + char spread; + float fx, fy; + int nstops; + NSVGgradientStop stops[1]; +} NSVGgradient; + +typedef struct NSVGpaint { + signed char type; + union { + unsigned int color; + NSVGgradient* gradient; + }; +} NSVGpaint; + +typedef struct NSVGpath +{ + float* pts; // Cubic bezier points: x0,y0, [cpx1,cpx1,cpx2,cpy2,x1,y1], ... + int npts; // Total number of bezier points. + char closed; // Flag indicating if shapes should be treated as closed. + float bounds[4]; // Tight bounding box of the shape [minx,miny,maxx,maxy]. + struct NSVGpath* next; // Pointer to next path, or NULL if last element. +} NSVGpath; + +typedef struct NSVGshape +{ + char id[64]; // Optional 'id' attr of the shape or its group + NSVGpaint fill; // Fill paint + NSVGpaint stroke; // Stroke paint + float opacity; // Opacity of the shape. + float strokeWidth; // Stroke width (scaled). + float strokeDashOffset; // Stroke dash offset (scaled). + float strokeDashArray[8]; // Stroke dash array (scaled). + char strokeDashCount; // Number of dash values in dash array. + char strokeLineJoin; // Stroke join type. + char strokeLineCap; // Stroke cap type. + float miterLimit; // Miter limit + char fillRule; // Fill rule, see NSVGfillRule. + unsigned char flags; // Logical or of NSVG_FLAGS_* flags + float bounds[4]; // Tight bounding box of the shape [minx,miny,maxx,maxy]. + char fillGradient[64]; // Optional 'id' of fill gradient + char strokeGradient[64]; // Optional 'id' of stroke gradient + float xform[6]; // Root transformation for fill/stroke gradient + NSVGpath* paths; // Linked list of paths in the image. + struct NSVGshape* next; // Pointer to next shape, or NULL if last element. +} NSVGshape; + +typedef struct NSVGimage +{ + float width; // Width of the image. + float height; // Height of the image. + NSVGshape* shapes; // Linked list of shapes in the image. +} NSVGimage; + +// Parses SVG file from a file, returns SVG image as paths. +NSVGimage* nsvgParseFromFile(const char* filename, const char* units, float dpi); + +// Parses SVG file from a null terminated string, returns SVG image as paths. +// Important note: changes the string. +NSVGimage* nsvgParse(char* input, const char* units, float dpi); + +// Duplicates a path. +NSVGpath* nsvgDuplicatePath(NSVGpath* p); + +// Deletes an image. +void nsvgDelete(NSVGimage* image); + +#ifndef NANOSVG_CPLUSPLUS +#ifdef __cplusplus +} +#endif +#endif + +#ifdef NANOSVG_IMPLEMENTATION + +#include +#include +#include +#include + +#define NSVG_PI (3.14159265358979323846264338327f) +#define NSVG_KAPPA90 (0.5522847493f) // Length proportional to radius of a cubic bezier handle for 90deg arcs. + +#define NSVG_ALIGN_MIN 0 +#define NSVG_ALIGN_MID 1 +#define NSVG_ALIGN_MAX 2 +#define NSVG_ALIGN_NONE 0 +#define NSVG_ALIGN_MEET 1 +#define NSVG_ALIGN_SLICE 2 + +#define NSVG_NOTUSED(v) do { (void)(1 ? (void)0 : ( (void)(v) ) ); } while(0) +#define NSVG_RGB(r, g, b) (((unsigned int)r) | ((unsigned int)g << 8) | ((unsigned int)b << 16)) + +#ifdef _MSC_VER + #pragma warning (disable: 4996) // Switch off security warnings + #pragma warning (disable: 4100) // Switch off unreferenced formal parameter warnings + #ifdef __cplusplus + #define NSVG_INLINE inline + #else + #define NSVG_INLINE + #endif +#else + #define NSVG_INLINE inline +#endif + + +static int nsvg__isspace(char c) +{ + return strchr(" \t\n\v\f\r", c) != 0; +} + +static int nsvg__isdigit(char c) +{ + return c >= '0' && c <= '9'; +} + +static NSVG_INLINE float nsvg__minf(float a, float b) { return a < b ? a : b; } +static NSVG_INLINE float nsvg__maxf(float a, float b) { return a > b ? a : b; } + + +// Simple XML parser + +#define NSVG_XML_TAG 1 +#define NSVG_XML_CONTENT 2 +#define NSVG_XML_MAX_ATTRIBS 256 + +static void nsvg__parseContent(char* s, + void (*contentCb)(void* ud, const char* s), + void* ud) +{ + // Trim start white spaces + while (*s && nsvg__isspace(*s)) s++; + if (!*s) return; + + if (contentCb) + (*contentCb)(ud, s); +} + +static void nsvg__parseElement(char* s, + void (*startelCb)(void* ud, const char* el, const char** attr), + void (*endelCb)(void* ud, const char* el), + void* ud) +{ + const char* attr[NSVG_XML_MAX_ATTRIBS]; + int nattr = 0; + char* name; + int start = 0; + int end = 0; + char quote; + + // Skip white space after the '<' + while (*s && nsvg__isspace(*s)) s++; + + // Check if the tag is end tag + if (*s == '/') { + s++; + end = 1; + } else { + start = 1; + } + + // Skip comments, data and preprocessor stuff. + if (!*s || *s == '?' || *s == '!') + return; + + // Get tag name + name = s; + while (*s && !nsvg__isspace(*s)) s++; + if (*s) { *s++ = '\0'; } + + // Get attribs + while (!end && *s && nattr < NSVG_XML_MAX_ATTRIBS-3) { + char* name = NULL; + char* value = NULL; + + // Skip white space before the attrib name + while (*s && nsvg__isspace(*s)) s++; + if (!*s) break; + if (*s == '/') { + end = 1; + break; + } + name = s; + // Find end of the attrib name. + while (*s && !nsvg__isspace(*s) && *s != '=') s++; + if (*s) { *s++ = '\0'; } + // Skip until the beginning of the value. + while (*s && *s != '\"' && *s != '\'') s++; + if (!*s) break; + quote = *s; + s++; + // Store value and find the end of it. + value = s; + while (*s && *s != quote) s++; + if (*s) { *s++ = '\0'; } + + // Store only well formed attributes + if (name && value) { + attr[nattr++] = name; + attr[nattr++] = value; + } + } + + // List terminator + attr[nattr++] = 0; + attr[nattr++] = 0; + + // Call callbacks. + if (start && startelCb) + (*startelCb)(ud, name, attr); + if (end && endelCb) + (*endelCb)(ud, name); +} + +int nsvg__parseXML(char* input, + void (*startelCb)(void* ud, const char* el, const char** attr), + void (*endelCb)(void* ud, const char* el), + void (*contentCb)(void* ud, const char* s), + void* ud) +{ + char* s = input; + char* mark = s; + int state = NSVG_XML_CONTENT; + while (*s) { + if (*s == '<' && state == NSVG_XML_CONTENT) { + // Start of a tag + *s++ = '\0'; + nsvg__parseContent(mark, contentCb, ud); + mark = s; + state = NSVG_XML_TAG; + } else if (*s == '>' && state == NSVG_XML_TAG) { + // Start of a content or new tag. + *s++ = '\0'; + nsvg__parseElement(mark, startelCb, endelCb, ud); + mark = s; + state = NSVG_XML_CONTENT; + } else { + s++; + } + } + + return 1; +} + + +/* Simple SVG parser. */ + +#define NSVG_MAX_ATTR 128 + +enum NSVGgradientUnits { + NSVG_USER_SPACE = 0, + NSVG_OBJECT_SPACE = 1 +}; + +#define NSVG_MAX_DASHES 8 + +enum NSVGunits { + NSVG_UNITS_USER, + NSVG_UNITS_PX, + NSVG_UNITS_PT, + NSVG_UNITS_PC, + NSVG_UNITS_MM, + NSVG_UNITS_CM, + NSVG_UNITS_IN, + NSVG_UNITS_PERCENT, + NSVG_UNITS_EM, + NSVG_UNITS_EX +}; + +typedef struct NSVGcoordinate { + float value; + int units; +} NSVGcoordinate; + +typedef struct NSVGlinearData { + NSVGcoordinate x1, y1, x2, y2; +} NSVGlinearData; + +typedef struct NSVGradialData { + NSVGcoordinate cx, cy, r, fx, fy; +} NSVGradialData; + +typedef struct NSVGgradientData +{ + char id[64]; + char ref[64]; + signed char type; + union { + NSVGlinearData linear; + NSVGradialData radial; + }; + char spread; + char units; + float xform[6]; + int nstops; + NSVGgradientStop* stops; + struct NSVGgradientData* next; +} NSVGgradientData; + +typedef struct NSVGattrib +{ + char id[64]; + float xform[6]; + unsigned int fillColor; + unsigned int strokeColor; + float opacity; + float fillOpacity; + float strokeOpacity; + char fillGradient[64]; + char strokeGradient[64]; + float strokeWidth; + float strokeDashOffset; + float strokeDashArray[NSVG_MAX_DASHES]; + int strokeDashCount; + char strokeLineJoin; + char strokeLineCap; + float miterLimit; + char fillRule; + float fontSize; + unsigned int stopColor; + float stopOpacity; + float stopOffset; + char hasFill; + char hasStroke; + char visible; +} NSVGattrib; + +typedef struct NSVGparser +{ + NSVGattrib attr[NSVG_MAX_ATTR]; + int attrHead; + float* pts; + int npts; + int cpts; + NSVGpath* plist; + NSVGimage* image; + NSVGgradientData* gradients; + NSVGshape* shapesTail; + float viewMinx, viewMiny, viewWidth, viewHeight; + int alignX, alignY, alignType; + float dpi; + char pathFlag; + char defsFlag; +} NSVGparser; + +static void nsvg__xformIdentity(float* t) +{ + t[0] = 1.0f; t[1] = 0.0f; + t[2] = 0.0f; t[3] = 1.0f; + t[4] = 0.0f; t[5] = 0.0f; +} + +static void nsvg__xformSetTranslation(float* t, float tx, float ty) +{ + t[0] = 1.0f; t[1] = 0.0f; + t[2] = 0.0f; t[3] = 1.0f; + t[4] = tx; t[5] = ty; +} + +static void nsvg__xformSetScale(float* t, float sx, float sy) +{ + t[0] = sx; t[1] = 0.0f; + t[2] = 0.0f; t[3] = sy; + t[4] = 0.0f; t[5] = 0.0f; +} + +static void nsvg__xformSetSkewX(float* t, float a) +{ + t[0] = 1.0f; t[1] = 0.0f; + t[2] = tanf(a); t[3] = 1.0f; + t[4] = 0.0f; t[5] = 0.0f; +} + +static void nsvg__xformSetSkewY(float* t, float a) +{ + t[0] = 1.0f; t[1] = tanf(a); + t[2] = 0.0f; t[3] = 1.0f; + t[4] = 0.0f; t[5] = 0.0f; +} + +static void nsvg__xformSetRotation(float* t, float a) +{ + float cs = cosf(a), sn = sinf(a); + t[0] = cs; t[1] = sn; + t[2] = -sn; t[3] = cs; + t[4] = 0.0f; t[5] = 0.0f; +} + +static void nsvg__xformMultiply(float* t, float* s) +{ + float t0 = t[0] * s[0] + t[1] * s[2]; + float t2 = t[2] * s[0] + t[3] * s[2]; + float t4 = t[4] * s[0] + t[5] * s[2] + s[4]; + t[1] = t[0] * s[1] + t[1] * s[3]; + t[3] = t[2] * s[1] + t[3] * s[3]; + t[5] = t[4] * s[1] + t[5] * s[3] + s[5]; + t[0] = t0; + t[2] = t2; + t[4] = t4; +} + +static void nsvg__xformInverse(float* inv, float* t) +{ + double invdet, det = (double)t[0] * t[3] - (double)t[2] * t[1]; + if (det > -1e-6 && det < 1e-6) { + nsvg__xformIdentity(t); + return; + } + invdet = 1.0 / det; + inv[0] = (float)(t[3] * invdet); + inv[2] = (float)(-t[2] * invdet); + inv[4] = (float)(((double)t[2] * t[5] - (double)t[3] * t[4]) * invdet); + inv[1] = (float)(-t[1] * invdet); + inv[3] = (float)(t[0] * invdet); + inv[5] = (float)(((double)t[1] * t[4] - (double)t[0] * t[5]) * invdet); +} + +static void nsvg__xformPremultiply(float* t, float* s) +{ + float s2[6]; + memcpy(s2, s, sizeof(float)*6); + nsvg__xformMultiply(s2, t); + memcpy(t, s2, sizeof(float)*6); +} + +static void nsvg__xformPoint(float* dx, float* dy, float x, float y, float* t) +{ + *dx = x*t[0] + y*t[2] + t[4]; + *dy = x*t[1] + y*t[3] + t[5]; +} + +static void nsvg__xformVec(float* dx, float* dy, float x, float y, float* t) +{ + *dx = x*t[0] + y*t[2]; + *dy = x*t[1] + y*t[3]; +} + +#define NSVG_EPSILON (1e-12) + +static int nsvg__ptInBounds(float* pt, float* bounds) +{ + return pt[0] >= bounds[0] && pt[0] <= bounds[2] && pt[1] >= bounds[1] && pt[1] <= bounds[3]; +} + + +static double nsvg__evalBezier(double t, double p0, double p1, double p2, double p3) +{ + double it = 1.0-t; + return it*it*it*p0 + 3.0*it*it*t*p1 + 3.0*it*t*t*p2 + t*t*t*p3; +} + +static void nsvg__curveBounds(float* bounds, float* curve) +{ + int i, j, count; + double roots[2], a, b, c, b2ac, t, v; + float* v0 = &curve[0]; + float* v1 = &curve[2]; + float* v2 = &curve[4]; + float* v3 = &curve[6]; + + // Start the bounding box by end points + bounds[0] = nsvg__minf(v0[0], v3[0]); + bounds[1] = nsvg__minf(v0[1], v3[1]); + bounds[2] = nsvg__maxf(v0[0], v3[0]); + bounds[3] = nsvg__maxf(v0[1], v3[1]); + + // Bezier curve fits inside the convex hull of it's control points. + // If control points are inside the bounds, we're done. + if (nsvg__ptInBounds(v1, bounds) && nsvg__ptInBounds(v2, bounds)) + return; + + // Add bezier curve inflection points in X and Y. + for (i = 0; i < 2; i++) { + a = -3.0 * v0[i] + 9.0 * v1[i] - 9.0 * v2[i] + 3.0 * v3[i]; + b = 6.0 * v0[i] - 12.0 * v1[i] + 6.0 * v2[i]; + c = 3.0 * v1[i] - 3.0 * v0[i]; + count = 0; + if (fabs(a) < NSVG_EPSILON) { + if (fabs(b) > NSVG_EPSILON) { + t = -c / b; + if (t > NSVG_EPSILON && t < 1.0-NSVG_EPSILON) + roots[count++] = t; + } + } else { + b2ac = b*b - 4.0*c*a; + if (b2ac > NSVG_EPSILON) { + t = (-b + sqrt(b2ac)) / (2.0 * a); + if (t > NSVG_EPSILON && t < 1.0-NSVG_EPSILON) + roots[count++] = t; + t = (-b - sqrt(b2ac)) / (2.0 * a); + if (t > NSVG_EPSILON && t < 1.0-NSVG_EPSILON) + roots[count++] = t; + } + } + for (j = 0; j < count; j++) { + v = nsvg__evalBezier(roots[j], v0[i], v1[i], v2[i], v3[i]); + bounds[0+i] = nsvg__minf(bounds[0+i], (float)v); + bounds[2+i] = nsvg__maxf(bounds[2+i], (float)v); + } + } +} + +static NSVGparser* nsvg__createParser(void) +{ + NSVGparser* p; + p = (NSVGparser*)malloc(sizeof(NSVGparser)); + if (p == NULL) goto error; + memset(p, 0, sizeof(NSVGparser)); + + p->image = (NSVGimage*)malloc(sizeof(NSVGimage)); + if (p->image == NULL) goto error; + memset(p->image, 0, sizeof(NSVGimage)); + + // Init style + nsvg__xformIdentity(p->attr[0].xform); + memset(p->attr[0].id, 0, sizeof p->attr[0].id); + p->attr[0].fillColor = NSVG_RGB(0,0,0); + p->attr[0].strokeColor = NSVG_RGB(0,0,0); + p->attr[0].opacity = 1; + p->attr[0].fillOpacity = 1; + p->attr[0].strokeOpacity = 1; + p->attr[0].stopOpacity = 1; + p->attr[0].strokeWidth = 1; + p->attr[0].strokeLineJoin = NSVG_JOIN_MITER; + p->attr[0].strokeLineCap = NSVG_CAP_BUTT; + p->attr[0].miterLimit = 4; + p->attr[0].fillRule = NSVG_FILLRULE_NONZERO; + p->attr[0].hasFill = 1; + p->attr[0].visible = 1; + + return p; + +error: + if (p) { + if (p->image) free(p->image); + free(p); + } + return NULL; +} + +static void nsvg__deletePaths(NSVGpath* path) +{ + while (path) { + NSVGpath *next = path->next; + if (path->pts != NULL) + free(path->pts); + free(path); + path = next; + } +} + +static void nsvg__deletePaint(NSVGpaint* paint) +{ + if (paint->type == NSVG_PAINT_LINEAR_GRADIENT || paint->type == NSVG_PAINT_RADIAL_GRADIENT) + free(paint->gradient); +} + +static void nsvg__deleteGradientData(NSVGgradientData* grad) +{ + NSVGgradientData* next; + while (grad != NULL) { + next = grad->next; + free(grad->stops); + free(grad); + grad = next; + } +} + +static void nsvg__deleteParser(NSVGparser* p) +{ + if (p != NULL) { + nsvg__deletePaths(p->plist); + nsvg__deleteGradientData(p->gradients); + nsvgDelete(p->image); + free(p->pts); + free(p); + } +} + +static void nsvg__resetPath(NSVGparser* p) +{ + p->npts = 0; +} + +static void nsvg__addPoint(NSVGparser* p, float x, float y) +{ + if (p->npts+1 > p->cpts) { + p->cpts = p->cpts ? p->cpts*2 : 8; + p->pts = (float*)realloc(p->pts, p->cpts*2*sizeof(float)); + if (!p->pts) return; + } + p->pts[p->npts*2+0] = x; + p->pts[p->npts*2+1] = y; + p->npts++; +} + +static void nsvg__moveTo(NSVGparser* p, float x, float y) +{ + if (p->npts > 0) { + p->pts[(p->npts-1)*2+0] = x; + p->pts[(p->npts-1)*2+1] = y; + } else { + nsvg__addPoint(p, x, y); + } +} + +static void nsvg__lineTo(NSVGparser* p, float x, float y) +{ + float px,py, dx,dy; + if (p->npts > 0) { + px = p->pts[(p->npts-1)*2+0]; + py = p->pts[(p->npts-1)*2+1]; + dx = x - px; + dy = y - py; + nsvg__addPoint(p, px + dx/3.0f, py + dy/3.0f); + nsvg__addPoint(p, x - dx/3.0f, y - dy/3.0f); + nsvg__addPoint(p, x, y); + } +} + +static void nsvg__cubicBezTo(NSVGparser* p, float cpx1, float cpy1, float cpx2, float cpy2, float x, float y) +{ + if (p->npts > 0) { + nsvg__addPoint(p, cpx1, cpy1); + nsvg__addPoint(p, cpx2, cpy2); + nsvg__addPoint(p, x, y); + } +} + +static NSVGattrib* nsvg__getAttr(NSVGparser* p) +{ + return &p->attr[p->attrHead]; +} + +static void nsvg__pushAttr(NSVGparser* p) +{ + if (p->attrHead < NSVG_MAX_ATTR-1) { + p->attrHead++; + memcpy(&p->attr[p->attrHead], &p->attr[p->attrHead-1], sizeof(NSVGattrib)); + } +} + +static void nsvg__popAttr(NSVGparser* p) +{ + if (p->attrHead > 0) + p->attrHead--; +} + +static float nsvg__actualOrigX(NSVGparser* p) +{ + return p->viewMinx; +} + +static float nsvg__actualOrigY(NSVGparser* p) +{ + return p->viewMiny; +} + +static float nsvg__actualWidth(NSVGparser* p) +{ + return p->viewWidth; +} + +static float nsvg__actualHeight(NSVGparser* p) +{ + return p->viewHeight; +} + +static float nsvg__actualLength(NSVGparser* p) +{ + float w = nsvg__actualWidth(p), h = nsvg__actualHeight(p); + return sqrtf(w*w + h*h) / sqrtf(2.0f); +} + +static float nsvg__convertToPixels(NSVGparser* p, NSVGcoordinate c, float orig, float length) +{ + NSVGattrib* attr = nsvg__getAttr(p); + switch (c.units) { + case NSVG_UNITS_USER: return c.value; + case NSVG_UNITS_PX: return c.value; + case NSVG_UNITS_PT: return c.value / 72.0f * p->dpi; + case NSVG_UNITS_PC: return c.value / 6.0f * p->dpi; + case NSVG_UNITS_MM: return c.value / 25.4f * p->dpi; + case NSVG_UNITS_CM: return c.value / 2.54f * p->dpi; + case NSVG_UNITS_IN: return c.value * p->dpi; + case NSVG_UNITS_EM: return c.value * attr->fontSize; + case NSVG_UNITS_EX: return c.value * attr->fontSize * 0.52f; // x-height of Helvetica. + case NSVG_UNITS_PERCENT: return orig + c.value / 100.0f * length; + default: return c.value; + } + return c.value; +} + +static NSVGgradientData* nsvg__findGradientData(NSVGparser* p, const char* id) +{ + NSVGgradientData* grad = p->gradients; + if (id == NULL || *id == '\0') + return NULL; + while (grad != NULL) { + if (strcmp(grad->id, id) == 0) + return grad; + grad = grad->next; + } + return NULL; +} + +static NSVGgradient* nsvg__createGradient(NSVGparser* p, const char* id, const float* localBounds, float *xform, signed char* paintType) +{ + NSVGgradientData* data = NULL; + NSVGgradientData* ref = NULL; + NSVGgradientStop* stops = NULL; + NSVGgradient* grad; + float ox, oy, sw, sh, sl; + int nstops = 0; + int refIter; + + data = nsvg__findGradientData(p, id); + if (data == NULL) return NULL; + + // TODO: use ref to fill in all unset values too. + ref = data; + refIter = 0; + while (ref != NULL) { + NSVGgradientData* nextRef = NULL; + if (stops == NULL && ref->stops != NULL) { + stops = ref->stops; + nstops = ref->nstops; + break; + } + nextRef = nsvg__findGradientData(p, ref->ref); + if (nextRef == ref) break; // prevent infite loops on malformed data + ref = nextRef; + refIter++; + if (refIter > 32) break; // prevent infite loops on malformed data + } + if (stops == NULL) return NULL; + + grad = (NSVGgradient*)malloc(sizeof(NSVGgradient) + sizeof(NSVGgradientStop)*(nstops-1)); + if (grad == NULL) return NULL; + + // The shape width and height. + if (data->units == NSVG_OBJECT_SPACE) { + ox = localBounds[0]; + oy = localBounds[1]; + sw = localBounds[2] - localBounds[0]; + sh = localBounds[3] - localBounds[1]; + } else { + ox = nsvg__actualOrigX(p); + oy = nsvg__actualOrigY(p); + sw = nsvg__actualWidth(p); + sh = nsvg__actualHeight(p); + } + sl = sqrtf(sw*sw + sh*sh) / sqrtf(2.0f); + + if (data->type == NSVG_PAINT_LINEAR_GRADIENT) { + float x1, y1, x2, y2, dx, dy; + x1 = nsvg__convertToPixels(p, data->linear.x1, ox, sw); + y1 = nsvg__convertToPixels(p, data->linear.y1, oy, sh); + x2 = nsvg__convertToPixels(p, data->linear.x2, ox, sw); + y2 = nsvg__convertToPixels(p, data->linear.y2, oy, sh); + // Calculate transform aligned to the line + dx = x2 - x1; + dy = y2 - y1; + grad->xform[0] = dy; grad->xform[1] = -dx; + grad->xform[2] = dx; grad->xform[3] = dy; + grad->xform[4] = x1; grad->xform[5] = y1; + } else { + float cx, cy, fx, fy, r; + cx = nsvg__convertToPixels(p, data->radial.cx, ox, sw); + cy = nsvg__convertToPixels(p, data->radial.cy, oy, sh); + fx = nsvg__convertToPixels(p, data->radial.fx, ox, sw); + fy = nsvg__convertToPixels(p, data->radial.fy, oy, sh); + r = nsvg__convertToPixels(p, data->radial.r, 0, sl); + // Calculate transform aligned to the circle + grad->xform[0] = r; grad->xform[1] = 0; + grad->xform[2] = 0; grad->xform[3] = r; + grad->xform[4] = cx; grad->xform[5] = cy; + grad->fx = fx / r; + grad->fy = fy / r; + } + + nsvg__xformMultiply(grad->xform, data->xform); + nsvg__xformMultiply(grad->xform, xform); + + grad->spread = data->spread; + memcpy(grad->stops, stops, nstops*sizeof(NSVGgradientStop)); + grad->nstops = nstops; + + *paintType = data->type; + + return grad; +} + +static float nsvg__getAverageScale(float* t) +{ + float sx = sqrtf(t[0]*t[0] + t[2]*t[2]); + float sy = sqrtf(t[1]*t[1] + t[3]*t[3]); + return (sx + sy) * 0.5f; +} + +static void nsvg__getLocalBounds(float* bounds, NSVGshape *shape, float* xform) +{ + NSVGpath* path; + float curve[4*2], curveBounds[4]; + int i, first = 1; + for (path = shape->paths; path != NULL; path = path->next) { + nsvg__xformPoint(&curve[0], &curve[1], path->pts[0], path->pts[1], xform); + for (i = 0; i < path->npts-1; i += 3) { + nsvg__xformPoint(&curve[2], &curve[3], path->pts[(i+1)*2], path->pts[(i+1)*2+1], xform); + nsvg__xformPoint(&curve[4], &curve[5], path->pts[(i+2)*2], path->pts[(i+2)*2+1], xform); + nsvg__xformPoint(&curve[6], &curve[7], path->pts[(i+3)*2], path->pts[(i+3)*2+1], xform); + nsvg__curveBounds(curveBounds, curve); + if (first) { + bounds[0] = curveBounds[0]; + bounds[1] = curveBounds[1]; + bounds[2] = curveBounds[2]; + bounds[3] = curveBounds[3]; + first = 0; + } else { + bounds[0] = nsvg__minf(bounds[0], curveBounds[0]); + bounds[1] = nsvg__minf(bounds[1], curveBounds[1]); + bounds[2] = nsvg__maxf(bounds[2], curveBounds[2]); + bounds[3] = nsvg__maxf(bounds[3], curveBounds[3]); + } + curve[0] = curve[6]; + curve[1] = curve[7]; + } + } +} + +static void nsvg__addShape(NSVGparser* p) +{ + NSVGattrib* attr = nsvg__getAttr(p); + float scale = 1.0f; + NSVGshape* shape; + NSVGpath* path; + int i; + + if (p->plist == NULL) + return; + + shape = (NSVGshape*)malloc(sizeof(NSVGshape)); + if (shape == NULL) goto error; + memset(shape, 0, sizeof(NSVGshape)); + + memcpy(shape->id, attr->id, sizeof shape->id); + memcpy(shape->fillGradient, attr->fillGradient, sizeof shape->fillGradient); + memcpy(shape->strokeGradient, attr->strokeGradient, sizeof shape->strokeGradient); + memcpy(shape->xform, attr->xform, sizeof shape->xform); + scale = nsvg__getAverageScale(attr->xform); + shape->strokeWidth = attr->strokeWidth * scale; + shape->strokeDashOffset = attr->strokeDashOffset * scale; + shape->strokeDashCount = (char)attr->strokeDashCount; + for (i = 0; i < attr->strokeDashCount; i++) + shape->strokeDashArray[i] = attr->strokeDashArray[i] * scale; + shape->strokeLineJoin = attr->strokeLineJoin; + shape->strokeLineCap = attr->strokeLineCap; + shape->miterLimit = attr->miterLimit; + shape->fillRule = attr->fillRule; + shape->opacity = attr->opacity; + + shape->paths = p->plist; + p->plist = NULL; + + // Calculate shape bounds + shape->bounds[0] = shape->paths->bounds[0]; + shape->bounds[1] = shape->paths->bounds[1]; + shape->bounds[2] = shape->paths->bounds[2]; + shape->bounds[3] = shape->paths->bounds[3]; + for (path = shape->paths->next; path != NULL; path = path->next) { + shape->bounds[0] = nsvg__minf(shape->bounds[0], path->bounds[0]); + shape->bounds[1] = nsvg__minf(shape->bounds[1], path->bounds[1]); + shape->bounds[2] = nsvg__maxf(shape->bounds[2], path->bounds[2]); + shape->bounds[3] = nsvg__maxf(shape->bounds[3], path->bounds[3]); + } + + // Set fill + if (attr->hasFill == 0) { + shape->fill.type = NSVG_PAINT_NONE; + } else if (attr->hasFill == 1) { + shape->fill.type = NSVG_PAINT_COLOR; + shape->fill.color = attr->fillColor; + shape->fill.color |= (unsigned int)(attr->fillOpacity*255) << 24; + } else if (attr->hasFill == 2) { + shape->fill.type = NSVG_PAINT_UNDEF; + } + + // Set stroke + if (attr->hasStroke == 0) { + shape->stroke.type = NSVG_PAINT_NONE; + } else if (attr->hasStroke == 1) { + shape->stroke.type = NSVG_PAINT_COLOR; + shape->stroke.color = attr->strokeColor; + shape->stroke.color |= (unsigned int)(attr->strokeOpacity*255) << 24; + } else if (attr->hasStroke == 2) { + shape->stroke.type = NSVG_PAINT_UNDEF; + } + + // Set flags + shape->flags = (attr->visible ? NSVG_FLAGS_VISIBLE : 0x00); + + // Add to tail + if (p->image->shapes == NULL) + p->image->shapes = shape; + else + p->shapesTail->next = shape; + p->shapesTail = shape; + + return; + +error: + if (shape) free(shape); +} + +static void nsvg__addPath(NSVGparser* p, char closed) +{ + NSVGattrib* attr = nsvg__getAttr(p); + NSVGpath* path = NULL; + float bounds[4]; + float* curve; + int i; + + if (p->npts < 4) + return; + + if (closed) + nsvg__lineTo(p, p->pts[0], p->pts[1]); + + // Expect 1 + N*3 points (N = number of cubic bezier segments). + if ((p->npts % 3) != 1) + return; + + path = (NSVGpath*)malloc(sizeof(NSVGpath)); + if (path == NULL) goto error; + memset(path, 0, sizeof(NSVGpath)); + + path->pts = (float*)malloc(p->npts*2*sizeof(float)); + if (path->pts == NULL) goto error; + path->closed = closed; + path->npts = p->npts; + + // Transform path. + for (i = 0; i < p->npts; ++i) + nsvg__xformPoint(&path->pts[i*2], &path->pts[i*2+1], p->pts[i*2], p->pts[i*2+1], attr->xform); + + // Find bounds + for (i = 0; i < path->npts-1; i += 3) { + curve = &path->pts[i*2]; + nsvg__curveBounds(bounds, curve); + if (i == 0) { + path->bounds[0] = bounds[0]; + path->bounds[1] = bounds[1]; + path->bounds[2] = bounds[2]; + path->bounds[3] = bounds[3]; + } else { + path->bounds[0] = nsvg__minf(path->bounds[0], bounds[0]); + path->bounds[1] = nsvg__minf(path->bounds[1], bounds[1]); + path->bounds[2] = nsvg__maxf(path->bounds[2], bounds[2]); + path->bounds[3] = nsvg__maxf(path->bounds[3], bounds[3]); + } + } + + path->next = p->plist; + p->plist = path; + + return; + +error: + if (path != NULL) { + if (path->pts != NULL) free(path->pts); + free(path); + } +} + +// We roll our own string to float because the std library one uses locale and messes things up. +static double nsvg__atof(const char* s) +{ + char* cur = (char*)s; + char* end = NULL; + double res = 0.0, sign = 1.0; + long long intPart = 0, fracPart = 0; + char hasIntPart = 0, hasFracPart = 0; + + // Parse optional sign + if (*cur == '+') { + cur++; + } else if (*cur == '-') { + sign = -1; + cur++; + } + + // Parse integer part + if (nsvg__isdigit(*cur)) { + // Parse digit sequence + intPart = strtoll(cur, &end, 10); + if (cur != end) { + res = (double)intPart; + hasIntPart = 1; + cur = end; + } + } + + // Parse fractional part. + if (*cur == '.') { + cur++; // Skip '.' + if (nsvg__isdigit(*cur)) { + // Parse digit sequence + fracPart = strtoll(cur, &end, 10); + if (cur != end) { + res += (double)fracPart / pow(10.0, (double)(end - cur)); + hasFracPart = 1; + cur = end; + } + } + } + + // A valid number should have integer or fractional part. + if (!hasIntPart && !hasFracPart) + return 0.0; + + // Parse optional exponent + if (*cur == 'e' || *cur == 'E') { + long expPart = 0; + cur++; // skip 'E' + expPart = strtol(cur, &end, 10); // Parse digit sequence with sign + if (cur != end) { + res *= pow(10.0, (double)expPart); + } + } + + return res * sign; +} + + +static const char* nsvg__parseNumber(const char* s, char* it, const int size) +{ + const int last = size-1; + int i = 0; + + // sign + if (*s == '-' || *s == '+') { + if (i < last) it[i++] = *s; + s++; + } + // integer part + while (*s && nsvg__isdigit(*s)) { + if (i < last) it[i++] = *s; + s++; + } + if (*s == '.') { + // decimal point + if (i < last) it[i++] = *s; + s++; + // fraction part + while (*s && nsvg__isdigit(*s)) { + if (i < last) it[i++] = *s; + s++; + } + } + // exponent + if ((*s == 'e' || *s == 'E') && (s[1] != 'm' && s[1] != 'x')) { + if (i < last) it[i++] = *s; + s++; + if (*s == '-' || *s == '+') { + if (i < last) it[i++] = *s; + s++; + } + while (*s && nsvg__isdigit(*s)) { + if (i < last) it[i++] = *s; + s++; + } + } + it[i] = '\0'; + + return s; +} + +static const char* nsvg__getNextPathItemWhenArcFlag(const char* s, char* it) +{ + it[0] = '\0'; + while (*s && (nsvg__isspace(*s) || *s == ',')) s++; + if (!*s) return s; + if (*s == '0' || *s == '1') { + it[0] = *s++; + it[1] = '\0'; + return s; + } + return s; +} + +static const char* nsvg__getNextPathItem(const char* s, char* it) +{ + it[0] = '\0'; + // Skip white spaces and commas + while (*s && (nsvg__isspace(*s) || *s == ',')) s++; + if (!*s) return s; + if (*s == '-' || *s == '+' || *s == '.' || nsvg__isdigit(*s)) { + s = nsvg__parseNumber(s, it, 64); + } else { + // Parse command + it[0] = *s++; + it[1] = '\0'; + return s; + } + + return s; +} + +static unsigned int nsvg__parseColorHex(const char* str) +{ + unsigned int r=0, g=0, b=0; + if (sscanf(str, "#%2x%2x%2x", &r, &g, &b) == 3 ) // 2 digit hex + return NSVG_RGB(r, g, b); + if (sscanf(str, "#%1x%1x%1x", &r, &g, &b) == 3 ) // 1 digit hex, e.g. #abc -> 0xccbbaa + return NSVG_RGB(r*17, g*17, b*17); // same effect as (r<<4|r), (g<<4|g), .. + return NSVG_RGB(128, 128, 128); +} + +// Parse rgb color. The pointer 'str' must point at "rgb(" (4+ characters). +// This function returns gray (rgb(128, 128, 128) == '#808080') on parse errors +// for backwards compatibility. Note: other image viewers return black instead. + +static unsigned int nsvg__parseColorRGB(const char* str) +{ + int i; + unsigned int rgbi[3]; + float rgbf[3]; + // try decimal integers first + if (sscanf(str, "rgb(%u, %u, %u)", &rgbi[0], &rgbi[1], &rgbi[2]) != 3) { + // integers failed, try percent values (float, locale independent) + const char delimiter[3] = {',', ',', ')'}; + str += 4; // skip "rgb(" + for (i = 0; i < 3; i++) { + while (*str && (nsvg__isspace(*str))) str++; // skip leading spaces + if (*str == '+') str++; // skip '+' (don't allow '-') + if (!*str) break; + rgbf[i] = nsvg__atof(str); + + // Note 1: it would be great if nsvg__atof() returned how many + // bytes it consumed but it doesn't. We need to skip the number, + // the '%' character, spaces, and the delimiter ',' or ')'. + + // Note 2: The following code does not allow values like "33.%", + // i.e. a decimal point w/o fractional part, but this is consistent + // with other image viewers, e.g. firefox, chrome, eog, gimp. + + while (*str && nsvg__isdigit(*str)) str++; // skip integer part + if (*str == '.') { + str++; + if (!nsvg__isdigit(*str)) break; // error: no digit after '.' + while (*str && nsvg__isdigit(*str)) str++; // skip fractional part + } + if (*str == '%') str++; else break; + while (*str && nsvg__isspace(*str)) str++; + if (*str == delimiter[i]) str++; + else break; + } + if (i == 3) { + rgbi[0] = roundf(rgbf[0] * 2.55f); + rgbi[1] = roundf(rgbf[1] * 2.55f); + rgbi[2] = roundf(rgbf[2] * 2.55f); + } else { + rgbi[0] = rgbi[1] = rgbi[2] = 128; + } + } + // clip values as the CSS spec requires + for (i = 0; i < 3; i++) { + if (rgbi[i] > 255) rgbi[i] = 255; + } + return NSVG_RGB(rgbi[0], rgbi[1], rgbi[2]); +} + +typedef struct NSVGNamedColor { + const char* name; + unsigned int color; +} NSVGNamedColor; + +NSVGNamedColor nsvg__colors[] = { + + { "red", NSVG_RGB(255, 0, 0) }, + { "green", NSVG_RGB( 0, 128, 0) }, + { "blue", NSVG_RGB( 0, 0, 255) }, + { "yellow", NSVG_RGB(255, 255, 0) }, + { "cyan", NSVG_RGB( 0, 255, 255) }, + { "magenta", NSVG_RGB(255, 0, 255) }, + { "black", NSVG_RGB( 0, 0, 0) }, + { "grey", NSVG_RGB(128, 128, 128) }, + { "gray", NSVG_RGB(128, 128, 128) }, + { "white", NSVG_RGB(255, 255, 255) }, + +#ifdef NANOSVG_ALL_COLOR_KEYWORDS + { "aliceblue", NSVG_RGB(240, 248, 255) }, + { "antiquewhite", NSVG_RGB(250, 235, 215) }, + { "aqua", NSVG_RGB( 0, 255, 255) }, + { "aquamarine", NSVG_RGB(127, 255, 212) }, + { "azure", NSVG_RGB(240, 255, 255) }, + { "beige", NSVG_RGB(245, 245, 220) }, + { "bisque", NSVG_RGB(255, 228, 196) }, + { "blanchedalmond", NSVG_RGB(255, 235, 205) }, + { "blueviolet", NSVG_RGB(138, 43, 226) }, + { "brown", NSVG_RGB(165, 42, 42) }, + { "burlywood", NSVG_RGB(222, 184, 135) }, + { "cadetblue", NSVG_RGB( 95, 158, 160) }, + { "chartreuse", NSVG_RGB(127, 255, 0) }, + { "chocolate", NSVG_RGB(210, 105, 30) }, + { "coral", NSVG_RGB(255, 127, 80) }, + { "cornflowerblue", NSVG_RGB(100, 149, 237) }, + { "cornsilk", NSVG_RGB(255, 248, 220) }, + { "crimson", NSVG_RGB(220, 20, 60) }, + { "darkblue", NSVG_RGB( 0, 0, 139) }, + { "darkcyan", NSVG_RGB( 0, 139, 139) }, + { "darkgoldenrod", NSVG_RGB(184, 134, 11) }, + { "darkgray", NSVG_RGB(169, 169, 169) }, + { "darkgreen", NSVG_RGB( 0, 100, 0) }, + { "darkgrey", NSVG_RGB(169, 169, 169) }, + { "darkkhaki", NSVG_RGB(189, 183, 107) }, + { "darkmagenta", NSVG_RGB(139, 0, 139) }, + { "darkolivegreen", NSVG_RGB( 85, 107, 47) }, + { "darkorange", NSVG_RGB(255, 140, 0) }, + { "darkorchid", NSVG_RGB(153, 50, 204) }, + { "darkred", NSVG_RGB(139, 0, 0) }, + { "darksalmon", NSVG_RGB(233, 150, 122) }, + { "darkseagreen", NSVG_RGB(143, 188, 143) }, + { "darkslateblue", NSVG_RGB( 72, 61, 139) }, + { "darkslategray", NSVG_RGB( 47, 79, 79) }, + { "darkslategrey", NSVG_RGB( 47, 79, 79) }, + { "darkturquoise", NSVG_RGB( 0, 206, 209) }, + { "darkviolet", NSVG_RGB(148, 0, 211) }, + { "deeppink", NSVG_RGB(255, 20, 147) }, + { "deepskyblue", NSVG_RGB( 0, 191, 255) }, + { "dimgray", NSVG_RGB(105, 105, 105) }, + { "dimgrey", NSVG_RGB(105, 105, 105) }, + { "dodgerblue", NSVG_RGB( 30, 144, 255) }, + { "firebrick", NSVG_RGB(178, 34, 34) }, + { "floralwhite", NSVG_RGB(255, 250, 240) }, + { "forestgreen", NSVG_RGB( 34, 139, 34) }, + { "fuchsia", NSVG_RGB(255, 0, 255) }, + { "gainsboro", NSVG_RGB(220, 220, 220) }, + { "ghostwhite", NSVG_RGB(248, 248, 255) }, + { "gold", NSVG_RGB(255, 215, 0) }, + { "goldenrod", NSVG_RGB(218, 165, 32) }, + { "greenyellow", NSVG_RGB(173, 255, 47) }, + { "honeydew", NSVG_RGB(240, 255, 240) }, + { "hotpink", NSVG_RGB(255, 105, 180) }, + { "indianred", NSVG_RGB(205, 92, 92) }, + { "indigo", NSVG_RGB( 75, 0, 130) }, + { "ivory", NSVG_RGB(255, 255, 240) }, + { "khaki", NSVG_RGB(240, 230, 140) }, + { "lavender", NSVG_RGB(230, 230, 250) }, + { "lavenderblush", NSVG_RGB(255, 240, 245) }, + { "lawngreen", NSVG_RGB(124, 252, 0) }, + { "lemonchiffon", NSVG_RGB(255, 250, 205) }, + { "lightblue", NSVG_RGB(173, 216, 230) }, + { "lightcoral", NSVG_RGB(240, 128, 128) }, + { "lightcyan", NSVG_RGB(224, 255, 255) }, + { "lightgoldenrodyellow", NSVG_RGB(250, 250, 210) }, + { "lightgray", NSVG_RGB(211, 211, 211) }, + { "lightgreen", NSVG_RGB(144, 238, 144) }, + { "lightgrey", NSVG_RGB(211, 211, 211) }, + { "lightpink", NSVG_RGB(255, 182, 193) }, + { "lightsalmon", NSVG_RGB(255, 160, 122) }, + { "lightseagreen", NSVG_RGB( 32, 178, 170) }, + { "lightskyblue", NSVG_RGB(135, 206, 250) }, + { "lightslategray", NSVG_RGB(119, 136, 153) }, + { "lightslategrey", NSVG_RGB(119, 136, 153) }, + { "lightsteelblue", NSVG_RGB(176, 196, 222) }, + { "lightyellow", NSVG_RGB(255, 255, 224) }, + { "lime", NSVG_RGB( 0, 255, 0) }, + { "limegreen", NSVG_RGB( 50, 205, 50) }, + { "linen", NSVG_RGB(250, 240, 230) }, + { "maroon", NSVG_RGB(128, 0, 0) }, + { "mediumaquamarine", NSVG_RGB(102, 205, 170) }, + { "mediumblue", NSVG_RGB( 0, 0, 205) }, + { "mediumorchid", NSVG_RGB(186, 85, 211) }, + { "mediumpurple", NSVG_RGB(147, 112, 219) }, + { "mediumseagreen", NSVG_RGB( 60, 179, 113) }, + { "mediumslateblue", NSVG_RGB(123, 104, 238) }, + { "mediumspringgreen", NSVG_RGB( 0, 250, 154) }, + { "mediumturquoise", NSVG_RGB( 72, 209, 204) }, + { "mediumvioletred", NSVG_RGB(199, 21, 133) }, + { "midnightblue", NSVG_RGB( 25, 25, 112) }, + { "mintcream", NSVG_RGB(245, 255, 250) }, + { "mistyrose", NSVG_RGB(255, 228, 225) }, + { "moccasin", NSVG_RGB(255, 228, 181) }, + { "navajowhite", NSVG_RGB(255, 222, 173) }, + { "navy", NSVG_RGB( 0, 0, 128) }, + { "oldlace", NSVG_RGB(253, 245, 230) }, + { "olive", NSVG_RGB(128, 128, 0) }, + { "olivedrab", NSVG_RGB(107, 142, 35) }, + { "orange", NSVG_RGB(255, 165, 0) }, + { "orangered", NSVG_RGB(255, 69, 0) }, + { "orchid", NSVG_RGB(218, 112, 214) }, + { "palegoldenrod", NSVG_RGB(238, 232, 170) }, + { "palegreen", NSVG_RGB(152, 251, 152) }, + { "paleturquoise", NSVG_RGB(175, 238, 238) }, + { "palevioletred", NSVG_RGB(219, 112, 147) }, + { "papayawhip", NSVG_RGB(255, 239, 213) }, + { "peachpuff", NSVG_RGB(255, 218, 185) }, + { "peru", NSVG_RGB(205, 133, 63) }, + { "pink", NSVG_RGB(255, 192, 203) }, + { "plum", NSVG_RGB(221, 160, 221) }, + { "powderblue", NSVG_RGB(176, 224, 230) }, + { "purple", NSVG_RGB(128, 0, 128) }, + { "rosybrown", NSVG_RGB(188, 143, 143) }, + { "royalblue", NSVG_RGB( 65, 105, 225) }, + { "saddlebrown", NSVG_RGB(139, 69, 19) }, + { "salmon", NSVG_RGB(250, 128, 114) }, + { "sandybrown", NSVG_RGB(244, 164, 96) }, + { "seagreen", NSVG_RGB( 46, 139, 87) }, + { "seashell", NSVG_RGB(255, 245, 238) }, + { "sienna", NSVG_RGB(160, 82, 45) }, + { "silver", NSVG_RGB(192, 192, 192) }, + { "skyblue", NSVG_RGB(135, 206, 235) }, + { "slateblue", NSVG_RGB(106, 90, 205) }, + { "slategray", NSVG_RGB(112, 128, 144) }, + { "slategrey", NSVG_RGB(112, 128, 144) }, + { "snow", NSVG_RGB(255, 250, 250) }, + { "springgreen", NSVG_RGB( 0, 255, 127) }, + { "steelblue", NSVG_RGB( 70, 130, 180) }, + { "tan", NSVG_RGB(210, 180, 140) }, + { "teal", NSVG_RGB( 0, 128, 128) }, + { "thistle", NSVG_RGB(216, 191, 216) }, + { "tomato", NSVG_RGB(255, 99, 71) }, + { "turquoise", NSVG_RGB( 64, 224, 208) }, + { "violet", NSVG_RGB(238, 130, 238) }, + { "wheat", NSVG_RGB(245, 222, 179) }, + { "whitesmoke", NSVG_RGB(245, 245, 245) }, + { "yellowgreen", NSVG_RGB(154, 205, 50) }, +#endif +}; + +static unsigned int nsvg__parseColorName(const char* str) +{ + int i, ncolors = sizeof(nsvg__colors) / sizeof(NSVGNamedColor); + + for (i = 0; i < ncolors; i++) { + if (strcmp(nsvg__colors[i].name, str) == 0) { + return nsvg__colors[i].color; + } + } + + return NSVG_RGB(128, 128, 128); +} + +static unsigned int nsvg__parseColor(const char* str) +{ + size_t len = 0; + while(*str == ' ') ++str; + len = strlen(str); + if (len >= 1 && *str == '#') + return nsvg__parseColorHex(str); + else if (len >= 4 && str[0] == 'r' && str[1] == 'g' && str[2] == 'b' && str[3] == '(') + return nsvg__parseColorRGB(str); + return nsvg__parseColorName(str); +} + +static float nsvg__parseOpacity(const char* str) +{ + float val = nsvg__atof(str); + if (val < 0.0f) val = 0.0f; + if (val > 1.0f) val = 1.0f; + return val; +} + +static float nsvg__parseMiterLimit(const char* str) +{ + float val = nsvg__atof(str); + if (val < 0.0f) val = 0.0f; + return val; +} + +static int nsvg__parseUnits(const char* units) +{ + if (units[0] == 'p' && units[1] == 'x') + return NSVG_UNITS_PX; + else if (units[0] == 'p' && units[1] == 't') + return NSVG_UNITS_PT; + else if (units[0] == 'p' && units[1] == 'c') + return NSVG_UNITS_PC; + else if (units[0] == 'm' && units[1] == 'm') + return NSVG_UNITS_MM; + else if (units[0] == 'c' && units[1] == 'm') + return NSVG_UNITS_CM; + else if (units[0] == 'i' && units[1] == 'n') + return NSVG_UNITS_IN; + else if (units[0] == '%') + return NSVG_UNITS_PERCENT; + else if (units[0] == 'e' && units[1] == 'm') + return NSVG_UNITS_EM; + else if (units[0] == 'e' && units[1] == 'x') + return NSVG_UNITS_EX; + return NSVG_UNITS_USER; +} + +static int nsvg__isCoordinate(const char* s) +{ + // optional sign + if (*s == '-' || *s == '+') + s++; + // must have at least one digit, or start by a dot + return (nsvg__isdigit(*s) || *s == '.'); +} + +static NSVGcoordinate nsvg__parseCoordinateRaw(const char* str) +{ + NSVGcoordinate coord = {0, NSVG_UNITS_USER}; + char buf[64]; + coord.units = nsvg__parseUnits(nsvg__parseNumber(str, buf, 64)); + coord.value = nsvg__atof(buf); + return coord; +} + +static NSVGcoordinate nsvg__coord(float v, int units) +{ + NSVGcoordinate coord = {v, units}; + return coord; +} + +static float nsvg__parseCoordinate(NSVGparser* p, const char* str, float orig, float length) +{ + NSVGcoordinate coord = nsvg__parseCoordinateRaw(str); + return nsvg__convertToPixels(p, coord, orig, length); +} + +static int nsvg__parseTransformArgs(const char* str, float* args, int maxNa, int* na) +{ + const char* end; + const char* ptr; + char it[64]; + + *na = 0; + ptr = str; + while (*ptr && *ptr != '(') ++ptr; + if (*ptr == 0) + return 1; + end = ptr; + while (*end && *end != ')') ++end; + if (*end == 0) + return 1; + + while (ptr < end) { + if (*ptr == '-' || *ptr == '+' || *ptr == '.' || nsvg__isdigit(*ptr)) { + if (*na >= maxNa) return 0; + ptr = nsvg__parseNumber(ptr, it, 64); + args[(*na)++] = (float)nsvg__atof(it); + } else { + ++ptr; + } + } + return (int)(end - str); +} + + +static int nsvg__parseMatrix(float* xform, const char* str) +{ + float t[6]; + int na = 0; + int len = nsvg__parseTransformArgs(str, t, 6, &na); + if (na != 6) return len; + memcpy(xform, t, sizeof(float)*6); + return len; +} + +static int nsvg__parseTranslate(float* xform, const char* str) +{ + float args[2]; + float t[6]; + int na = 0; + int len = nsvg__parseTransformArgs(str, args, 2, &na); + if (na == 1) args[1] = 0.0; + + nsvg__xformSetTranslation(t, args[0], args[1]); + memcpy(xform, t, sizeof(float)*6); + return len; +} + +static int nsvg__parseScale(float* xform, const char* str) +{ + float args[2]; + int na = 0; + float t[6]; + int len = nsvg__parseTransformArgs(str, args, 2, &na); + if (na == 1) args[1] = args[0]; + nsvg__xformSetScale(t, args[0], args[1]); + memcpy(xform, t, sizeof(float)*6); + return len; +} + +static int nsvg__parseSkewX(float* xform, const char* str) +{ + float args[1]; + int na = 0; + float t[6]; + int len = nsvg__parseTransformArgs(str, args, 1, &na); + nsvg__xformSetSkewX(t, args[0]/180.0f*NSVG_PI); + memcpy(xform, t, sizeof(float)*6); + return len; +} + +static int nsvg__parseSkewY(float* xform, const char* str) +{ + float args[1]; + int na = 0; + float t[6]; + int len = nsvg__parseTransformArgs(str, args, 1, &na); + nsvg__xformSetSkewY(t, args[0]/180.0f*NSVG_PI); + memcpy(xform, t, sizeof(float)*6); + return len; +} + +static int nsvg__parseRotate(float* xform, const char* str) +{ + float args[3]; + int na = 0; + float m[6]; + float t[6]; + int len = nsvg__parseTransformArgs(str, args, 3, &na); + if (na == 1) + args[1] = args[2] = 0.0f; + nsvg__xformIdentity(m); + + if (na > 1) { + nsvg__xformSetTranslation(t, -args[1], -args[2]); + nsvg__xformMultiply(m, t); + } + + nsvg__xformSetRotation(t, args[0]/180.0f*NSVG_PI); + nsvg__xformMultiply(m, t); + + if (na > 1) { + nsvg__xformSetTranslation(t, args[1], args[2]); + nsvg__xformMultiply(m, t); + } + + memcpy(xform, m, sizeof(float)*6); + + return len; +} + +static void nsvg__parseTransform(float* xform, const char* str) +{ + float t[6]; + int len; + nsvg__xformIdentity(xform); + while (*str) + { + if (strncmp(str, "matrix", 6) == 0) + len = nsvg__parseMatrix(t, str); + else if (strncmp(str, "translate", 9) == 0) + len = nsvg__parseTranslate(t, str); + else if (strncmp(str, "scale", 5) == 0) + len = nsvg__parseScale(t, str); + else if (strncmp(str, "rotate", 6) == 0) + len = nsvg__parseRotate(t, str); + else if (strncmp(str, "skewX", 5) == 0) + len = nsvg__parseSkewX(t, str); + else if (strncmp(str, "skewY", 5) == 0) + len = nsvg__parseSkewY(t, str); + else{ + ++str; + continue; + } + if (len != 0) { + str += len; + } else { + ++str; + continue; + } + + nsvg__xformPremultiply(xform, t); + } +} + +static void nsvg__parseUrl(char* id, const char* str) +{ + int i = 0; + str += 4; // "url("; + if (*str && *str == '#') + str++; + while (i < 63 && *str && *str != ')') { + id[i] = *str++; + i++; + } + id[i] = '\0'; +} + +static char nsvg__parseLineCap(const char* str) +{ + if (strcmp(str, "butt") == 0) + return NSVG_CAP_BUTT; + else if (strcmp(str, "round") == 0) + return NSVG_CAP_ROUND; + else if (strcmp(str, "square") == 0) + return NSVG_CAP_SQUARE; + // TODO: handle inherit. + return NSVG_CAP_BUTT; +} + +static char nsvg__parseLineJoin(const char* str) +{ + if (strcmp(str, "miter") == 0) + return NSVG_JOIN_MITER; + else if (strcmp(str, "round") == 0) + return NSVG_JOIN_ROUND; + else if (strcmp(str, "bevel") == 0) + return NSVG_JOIN_BEVEL; + // TODO: handle inherit. + return NSVG_JOIN_MITER; +} + +static char nsvg__parseFillRule(const char* str) +{ + if (strcmp(str, "nonzero") == 0) + return NSVG_FILLRULE_NONZERO; + else if (strcmp(str, "evenodd") == 0) + return NSVG_FILLRULE_EVENODD; + // TODO: handle inherit. + return NSVG_FILLRULE_NONZERO; +} + +static const char* nsvg__getNextDashItem(const char* s, char* it) +{ + int n = 0; + it[0] = '\0'; + // Skip white spaces and commas + while (*s && (nsvg__isspace(*s) || *s == ',')) s++; + // Advance until whitespace, comma or end. + while (*s && (!nsvg__isspace(*s) && *s != ',')) { + if (n < 63) + it[n++] = *s; + s++; + } + it[n++] = '\0'; + return s; +} + +static int nsvg__parseStrokeDashArray(NSVGparser* p, const char* str, float* strokeDashArray) +{ + char item[64]; + int count = 0, i; + float sum = 0.0f; + + // Handle "none" + if (str[0] == 'n') + return 0; + + // Parse dashes + while (*str) { + str = nsvg__getNextDashItem(str, item); + if (!*item) break; + if (count < NSVG_MAX_DASHES) + strokeDashArray[count++] = fabsf(nsvg__parseCoordinate(p, item, 0.0f, nsvg__actualLength(p))); + } + + for (i = 0; i < count; i++) + sum += strokeDashArray[i]; + if (sum <= 1e-6f) + count = 0; + + return count; +} + +static void nsvg__parseStyle(NSVGparser* p, const char* str); + +static int nsvg__parseAttr(NSVGparser* p, const char* name, const char* value) +{ + float xform[6]; + NSVGattrib* attr = nsvg__getAttr(p); + if (!attr) return 0; + + if (strcmp(name, "style") == 0) { + nsvg__parseStyle(p, value); + } else if (strcmp(name, "display") == 0) { + if (strcmp(value, "none") == 0) + attr->visible = 0; + // Don't reset ->visible on display:inline, one display:none hides the whole subtree + + } else if (strcmp(name, "fill") == 0) { + if (strcmp(value, "none") == 0) { + attr->hasFill = 0; + } else if (strncmp(value, "url(", 4) == 0) { + attr->hasFill = 2; + nsvg__parseUrl(attr->fillGradient, value); + } else { + attr->hasFill = 1; + attr->fillColor = nsvg__parseColor(value); + } + } else if (strcmp(name, "opacity") == 0) { + attr->opacity = nsvg__parseOpacity(value); + } else if (strcmp(name, "fill-opacity") == 0) { + attr->fillOpacity = nsvg__parseOpacity(value); + } else if (strcmp(name, "stroke") == 0) { + if (strcmp(value, "none") == 0) { + attr->hasStroke = 0; + } else if (strncmp(value, "url(", 4) == 0) { + attr->hasStroke = 2; + nsvg__parseUrl(attr->strokeGradient, value); + } else { + attr->hasStroke = 1; + attr->strokeColor = nsvg__parseColor(value); + } + } else if (strcmp(name, "stroke-width") == 0) { + attr->strokeWidth = nsvg__parseCoordinate(p, value, 0.0f, nsvg__actualLength(p)); + } else if (strcmp(name, "stroke-dasharray") == 0) { + attr->strokeDashCount = nsvg__parseStrokeDashArray(p, value, attr->strokeDashArray); + } else if (strcmp(name, "stroke-dashoffset") == 0) { + attr->strokeDashOffset = nsvg__parseCoordinate(p, value, 0.0f, nsvg__actualLength(p)); + } else if (strcmp(name, "stroke-opacity") == 0) { + attr->strokeOpacity = nsvg__parseOpacity(value); + } else if (strcmp(name, "stroke-linecap") == 0) { + attr->strokeLineCap = nsvg__parseLineCap(value); + } else if (strcmp(name, "stroke-linejoin") == 0) { + attr->strokeLineJoin = nsvg__parseLineJoin(value); + } else if (strcmp(name, "stroke-miterlimit") == 0) { + attr->miterLimit = nsvg__parseMiterLimit(value); + } else if (strcmp(name, "fill-rule") == 0) { + attr->fillRule = nsvg__parseFillRule(value); + } else if (strcmp(name, "font-size") == 0) { + attr->fontSize = nsvg__parseCoordinate(p, value, 0.0f, nsvg__actualLength(p)); + } else if (strcmp(name, "transform") == 0) { + nsvg__parseTransform(xform, value); + nsvg__xformPremultiply(attr->xform, xform); + } else if (strcmp(name, "stop-color") == 0) { + attr->stopColor = nsvg__parseColor(value); + } else if (strcmp(name, "stop-opacity") == 0) { + attr->stopOpacity = nsvg__parseOpacity(value); + } else if (strcmp(name, "offset") == 0) { + attr->stopOffset = nsvg__parseCoordinate(p, value, 0.0f, 1.0f); + } else if (strcmp(name, "id") == 0) { + strncpy(attr->id, value, 63); + attr->id[63] = '\0'; + } else { + return 0; + } + return 1; +} + +static int nsvg__parseNameValue(NSVGparser* p, const char* start, const char* end) +{ + const char* str; + const char* val; + char name[512]; + char value[512]; + int n; + + str = start; + while (str < end && *str != ':') ++str; + + val = str; + + // Right Trim + while (str > start && (*str == ':' || nsvg__isspace(*str))) --str; + ++str; + + n = (int)(str - start); + if (n > 511) n = 511; + if (n) memcpy(name, start, n); + name[n] = 0; + + while (val < end && (*val == ':' || nsvg__isspace(*val))) ++val; + + n = (int)(end - val); + if (n > 511) n = 511; + if (n) memcpy(value, val, n); + value[n] = 0; + + return nsvg__parseAttr(p, name, value); +} + +static void nsvg__parseStyle(NSVGparser* p, const char* str) +{ + const char* start; + const char* end; + + while (*str) { + // Left Trim + while(*str && nsvg__isspace(*str)) ++str; + start = str; + while(*str && *str != ';') ++str; + end = str; + + // Right Trim + while (end > start && (*end == ';' || nsvg__isspace(*end))) --end; + ++end; + + nsvg__parseNameValue(p, start, end); + if (*str) ++str; + } +} + +static void nsvg__parseAttribs(NSVGparser* p, const char** attr) +{ + int i; + for (i = 0; attr[i]; i += 2) + { + if (strcmp(attr[i], "style") == 0) + nsvg__parseStyle(p, attr[i + 1]); + else + nsvg__parseAttr(p, attr[i], attr[i + 1]); + } +} + +static int nsvg__getArgsPerElement(char cmd) +{ + switch (cmd) { + case 'v': + case 'V': + case 'h': + case 'H': + return 1; + case 'm': + case 'M': + case 'l': + case 'L': + case 't': + case 'T': + return 2; + case 'q': + case 'Q': + case 's': + case 'S': + return 4; + case 'c': + case 'C': + return 6; + case 'a': + case 'A': + return 7; + case 'z': + case 'Z': + return 0; + } + return -1; +} + +static void nsvg__pathMoveTo(NSVGparser* p, float* cpx, float* cpy, float* args, int rel) +{ + if (rel) { + *cpx += args[0]; + *cpy += args[1]; + } else { + *cpx = args[0]; + *cpy = args[1]; + } + nsvg__moveTo(p, *cpx, *cpy); +} + +static void nsvg__pathLineTo(NSVGparser* p, float* cpx, float* cpy, float* args, int rel) +{ + if (rel) { + *cpx += args[0]; + *cpy += args[1]; + } else { + *cpx = args[0]; + *cpy = args[1]; + } + nsvg__lineTo(p, *cpx, *cpy); +} + +static void nsvg__pathHLineTo(NSVGparser* p, float* cpx, float* cpy, float* args, int rel) +{ + if (rel) + *cpx += args[0]; + else + *cpx = args[0]; + nsvg__lineTo(p, *cpx, *cpy); +} + +static void nsvg__pathVLineTo(NSVGparser* p, float* cpx, float* cpy, float* args, int rel) +{ + if (rel) + *cpy += args[0]; + else + *cpy = args[0]; + nsvg__lineTo(p, *cpx, *cpy); +} + +static void nsvg__pathCubicBezTo(NSVGparser* p, float* cpx, float* cpy, + float* cpx2, float* cpy2, float* args, int rel) +{ + float x2, y2, cx1, cy1, cx2, cy2; + + if (rel) { + cx1 = *cpx + args[0]; + cy1 = *cpy + args[1]; + cx2 = *cpx + args[2]; + cy2 = *cpy + args[3]; + x2 = *cpx + args[4]; + y2 = *cpy + args[5]; + } else { + cx1 = args[0]; + cy1 = args[1]; + cx2 = args[2]; + cy2 = args[3]; + x2 = args[4]; + y2 = args[5]; + } + + nsvg__cubicBezTo(p, cx1,cy1, cx2,cy2, x2,y2); + + *cpx2 = cx2; + *cpy2 = cy2; + *cpx = x2; + *cpy = y2; +} + +static void nsvg__pathCubicBezShortTo(NSVGparser* p, float* cpx, float* cpy, + float* cpx2, float* cpy2, float* args, int rel) +{ + float x1, y1, x2, y2, cx1, cy1, cx2, cy2; + + x1 = *cpx; + y1 = *cpy; + if (rel) { + cx2 = *cpx + args[0]; + cy2 = *cpy + args[1]; + x2 = *cpx + args[2]; + y2 = *cpy + args[3]; + } else { + cx2 = args[0]; + cy2 = args[1]; + x2 = args[2]; + y2 = args[3]; + } + + cx1 = 2*x1 - *cpx2; + cy1 = 2*y1 - *cpy2; + + nsvg__cubicBezTo(p, cx1,cy1, cx2,cy2, x2,y2); + + *cpx2 = cx2; + *cpy2 = cy2; + *cpx = x2; + *cpy = y2; +} + +static void nsvg__pathQuadBezTo(NSVGparser* p, float* cpx, float* cpy, + float* cpx2, float* cpy2, float* args, int rel) +{ + float x1, y1, x2, y2, cx, cy; + float cx1, cy1, cx2, cy2; + + x1 = *cpx; + y1 = *cpy; + if (rel) { + cx = *cpx + args[0]; + cy = *cpy + args[1]; + x2 = *cpx + args[2]; + y2 = *cpy + args[3]; + } else { + cx = args[0]; + cy = args[1]; + x2 = args[2]; + y2 = args[3]; + } + + // Convert to cubic bezier + cx1 = x1 + 2.0f/3.0f*(cx - x1); + cy1 = y1 + 2.0f/3.0f*(cy - y1); + cx2 = x2 + 2.0f/3.0f*(cx - x2); + cy2 = y2 + 2.0f/3.0f*(cy - y2); + + nsvg__cubicBezTo(p, cx1,cy1, cx2,cy2, x2,y2); + + *cpx2 = cx; + *cpy2 = cy; + *cpx = x2; + *cpy = y2; +} + +static void nsvg__pathQuadBezShortTo(NSVGparser* p, float* cpx, float* cpy, + float* cpx2, float* cpy2, float* args, int rel) +{ + float x1, y1, x2, y2, cx, cy; + float cx1, cy1, cx2, cy2; + + x1 = *cpx; + y1 = *cpy; + if (rel) { + x2 = *cpx + args[0]; + y2 = *cpy + args[1]; + } else { + x2 = args[0]; + y2 = args[1]; + } + + cx = 2*x1 - *cpx2; + cy = 2*y1 - *cpy2; + + // Convert to cubix bezier + cx1 = x1 + 2.0f/3.0f*(cx - x1); + cy1 = y1 + 2.0f/3.0f*(cy - y1); + cx2 = x2 + 2.0f/3.0f*(cx - x2); + cy2 = y2 + 2.0f/3.0f*(cy - y2); + + nsvg__cubicBezTo(p, cx1,cy1, cx2,cy2, x2,y2); + + *cpx2 = cx; + *cpy2 = cy; + *cpx = x2; + *cpy = y2; +} + +static float nsvg__sqr(float x) { return x*x; } +static float nsvg__vmag(float x, float y) { return sqrtf(x*x + y*y); } + +static float nsvg__vecrat(float ux, float uy, float vx, float vy) +{ + return (ux*vx + uy*vy) / (nsvg__vmag(ux,uy) * nsvg__vmag(vx,vy)); +} + +static float nsvg__vecang(float ux, float uy, float vx, float vy) +{ + float r = nsvg__vecrat(ux,uy, vx,vy); + if (r < -1.0f) r = -1.0f; + if (r > 1.0f) r = 1.0f; + return ((ux*vy < uy*vx) ? -1.0f : 1.0f) * acosf(r); +} + +static void nsvg__pathArcTo(NSVGparser* p, float* cpx, float* cpy, float* args, int rel) +{ + // Ported from canvg (https://code.google.com/p/canvg/) + float rx, ry, rotx; + float x1, y1, x2, y2, cx, cy, dx, dy, d; + float x1p, y1p, cxp, cyp, s, sa, sb; + float ux, uy, vx, vy, a1, da; + float x, y, tanx, tany, a, px = 0, py = 0, ptanx = 0, ptany = 0, t[6]; + float sinrx, cosrx; + int fa, fs; + int i, ndivs; + float hda, kappa; + + rx = fabsf(args[0]); // y radius + ry = fabsf(args[1]); // x radius + rotx = args[2] / 180.0f * NSVG_PI; // x rotation angle + fa = fabsf(args[3]) > 1e-6 ? 1 : 0; // Large arc + fs = fabsf(args[4]) > 1e-6 ? 1 : 0; // Sweep direction + x1 = *cpx; // start point + y1 = *cpy; + if (rel) { // end point + x2 = *cpx + args[5]; + y2 = *cpy + args[6]; + } else { + x2 = args[5]; + y2 = args[6]; + } + + dx = x1 - x2; + dy = y1 - y2; + d = sqrtf(dx*dx + dy*dy); + if (d < 1e-6f || rx < 1e-6f || ry < 1e-6f) { + // The arc degenerates to a line + nsvg__lineTo(p, x2, y2); + *cpx = x2; + *cpy = y2; + return; + } + + sinrx = sinf(rotx); + cosrx = cosf(rotx); + + // Convert to center point parameterization. + // http://www.w3.org/TR/SVG11/implnote.html#ArcImplementationNotes + // 1) Compute x1', y1' + x1p = cosrx * dx / 2.0f + sinrx * dy / 2.0f; + y1p = -sinrx * dx / 2.0f + cosrx * dy / 2.0f; + d = nsvg__sqr(x1p)/nsvg__sqr(rx) + nsvg__sqr(y1p)/nsvg__sqr(ry); + if (d > 1) { + d = sqrtf(d); + rx *= d; + ry *= d; + } + // 2) Compute cx', cy' + s = 0.0f; + sa = nsvg__sqr(rx)*nsvg__sqr(ry) - nsvg__sqr(rx)*nsvg__sqr(y1p) - nsvg__sqr(ry)*nsvg__sqr(x1p); + sb = nsvg__sqr(rx)*nsvg__sqr(y1p) + nsvg__sqr(ry)*nsvg__sqr(x1p); + if (sa < 0.0f) sa = 0.0f; + if (sb > 0.0f) + s = sqrtf(sa / sb); + if (fa == fs) + s = -s; + cxp = s * rx * y1p / ry; + cyp = s * -ry * x1p / rx; + + // 3) Compute cx,cy from cx',cy' + cx = (x1 + x2)/2.0f + cosrx*cxp - sinrx*cyp; + cy = (y1 + y2)/2.0f + sinrx*cxp + cosrx*cyp; + + // 4) Calculate theta1, and delta theta. + ux = (x1p - cxp) / rx; + uy = (y1p - cyp) / ry; + vx = (-x1p - cxp) / rx; + vy = (-y1p - cyp) / ry; + a1 = nsvg__vecang(1.0f,0.0f, ux,uy); // Initial angle + da = nsvg__vecang(ux,uy, vx,vy); // Delta angle + +// if (vecrat(ux,uy,vx,vy) <= -1.0f) da = NSVG_PI; +// if (vecrat(ux,uy,vx,vy) >= 1.0f) da = 0; + + if (fs == 0 && da > 0) + da -= 2 * NSVG_PI; + else if (fs == 1 && da < 0) + da += 2 * NSVG_PI; + + // Approximate the arc using cubic spline segments. + t[0] = cosrx; t[1] = sinrx; + t[2] = -sinrx; t[3] = cosrx; + t[4] = cx; t[5] = cy; + + // Split arc into max 90 degree segments. + // The loop assumes an iteration per end point (including start and end), this +1. + ndivs = (int)(fabsf(da) / (NSVG_PI*0.5f) + 1.0f); + hda = (da / (float)ndivs) / 2.0f; + // Fix for ticket #179: division by 0: avoid cotangens around 0 (infinite) + if ((hda < 1e-3f) && (hda > -1e-3f)) + hda *= 0.5f; + else + hda = (1.0f - cosf(hda)) / sinf(hda); + kappa = fabsf(4.0f / 3.0f * hda); + if (da < 0.0f) + kappa = -kappa; + + for (i = 0; i <= ndivs; i++) { + a = a1 + da * ((float)i/(float)ndivs); + dx = cosf(a); + dy = sinf(a); + nsvg__xformPoint(&x, &y, dx*rx, dy*ry, t); // position + nsvg__xformVec(&tanx, &tany, -dy*rx * kappa, dx*ry * kappa, t); // tangent + if (i > 0) + nsvg__cubicBezTo(p, px+ptanx,py+ptany, x-tanx, y-tany, x, y); + px = x; + py = y; + ptanx = tanx; + ptany = tany; + } + + *cpx = x2; + *cpy = y2; +} + +static void nsvg__parsePath(NSVGparser* p, const char** attr) +{ + const char* s = NULL; + char cmd = '\0'; + float args[10]; + int nargs; + int rargs = 0; + char initPoint; + float cpx, cpy, cpx2, cpy2; + const char* tmp[4]; + char closedFlag; + int i; + char item[64]; + + for (i = 0; attr[i]; i += 2) { + if (strcmp(attr[i], "d") == 0) { + s = attr[i + 1]; + } else { + tmp[0] = attr[i]; + tmp[1] = attr[i + 1]; + tmp[2] = 0; + tmp[3] = 0; + nsvg__parseAttribs(p, tmp); + } + } + + if (s) { + nsvg__resetPath(p); + cpx = 0; cpy = 0; + cpx2 = 0; cpy2 = 0; + initPoint = 0; + closedFlag = 0; + nargs = 0; + + while (*s) { + item[0] = '\0'; + if ((cmd == 'A' || cmd == 'a') && (nargs == 3 || nargs == 4)) + s = nsvg__getNextPathItemWhenArcFlag(s, item); + if (!*item) + s = nsvg__getNextPathItem(s, item); + if (!*item) break; + if (cmd != '\0' && nsvg__isCoordinate(item)) { + if (nargs < 10) + args[nargs++] = (float)nsvg__atof(item); + if (nargs >= rargs) { + switch (cmd) { + case 'm': + case 'M': + nsvg__pathMoveTo(p, &cpx, &cpy, args, cmd == 'm' ? 1 : 0); + // Moveto can be followed by multiple coordinate pairs, + // which should be treated as linetos. + cmd = (cmd == 'm') ? 'l' : 'L'; + rargs = nsvg__getArgsPerElement(cmd); + cpx2 = cpx; cpy2 = cpy; + initPoint = 1; + break; + case 'l': + case 'L': + nsvg__pathLineTo(p, &cpx, &cpy, args, cmd == 'l' ? 1 : 0); + cpx2 = cpx; cpy2 = cpy; + break; + case 'H': + case 'h': + nsvg__pathHLineTo(p, &cpx, &cpy, args, cmd == 'h' ? 1 : 0); + cpx2 = cpx; cpy2 = cpy; + break; + case 'V': + case 'v': + nsvg__pathVLineTo(p, &cpx, &cpy, args, cmd == 'v' ? 1 : 0); + cpx2 = cpx; cpy2 = cpy; + break; + case 'C': + case 'c': + nsvg__pathCubicBezTo(p, &cpx, &cpy, &cpx2, &cpy2, args, cmd == 'c' ? 1 : 0); + break; + case 'S': + case 's': + nsvg__pathCubicBezShortTo(p, &cpx, &cpy, &cpx2, &cpy2, args, cmd == 's' ? 1 : 0); + break; + case 'Q': + case 'q': + nsvg__pathQuadBezTo(p, &cpx, &cpy, &cpx2, &cpy2, args, cmd == 'q' ? 1 : 0); + break; + case 'T': + case 't': + nsvg__pathQuadBezShortTo(p, &cpx, &cpy, &cpx2, &cpy2, args, cmd == 't' ? 1 : 0); + break; + case 'A': + case 'a': + nsvg__pathArcTo(p, &cpx, &cpy, args, cmd == 'a' ? 1 : 0); + cpx2 = cpx; cpy2 = cpy; + break; + default: + if (nargs >= 2) { + cpx = args[nargs-2]; + cpy = args[nargs-1]; + cpx2 = cpx; cpy2 = cpy; + } + break; + } + nargs = 0; + } + } else { + cmd = item[0]; + if (cmd == 'M' || cmd == 'm') { + // Commit path. + if (p->npts > 0) + nsvg__addPath(p, closedFlag); + // Start new subpath. + nsvg__resetPath(p); + closedFlag = 0; + nargs = 0; + } else if (initPoint == 0) { + // Do not allow other commands until initial point has been set (moveTo called once). + cmd = '\0'; + } + if (cmd == 'Z' || cmd == 'z') { + closedFlag = 1; + // Commit path. + if (p->npts > 0) { + // Move current point to first point + cpx = p->pts[0]; + cpy = p->pts[1]; + cpx2 = cpx; cpy2 = cpy; + nsvg__addPath(p, closedFlag); + } + // Start new subpath. + nsvg__resetPath(p); + nsvg__moveTo(p, cpx, cpy); + closedFlag = 0; + nargs = 0; + } + rargs = nsvg__getArgsPerElement(cmd); + if (rargs == -1) { + // Command not recognized + cmd = '\0'; + rargs = 0; + } + } + } + // Commit path. + if (p->npts) + nsvg__addPath(p, closedFlag); + } + + nsvg__addShape(p); +} + +static void nsvg__parseRect(NSVGparser* p, const char** attr) +{ + float x = 0.0f; + float y = 0.0f; + float w = 0.0f; + float h = 0.0f; + float rx = -1.0f; // marks not set + float ry = -1.0f; + int i; + + for (i = 0; attr[i]; i += 2) { + if (!nsvg__parseAttr(p, attr[i], attr[i + 1])) { + if (strcmp(attr[i], "x") == 0) x = nsvg__parseCoordinate(p, attr[i+1], nsvg__actualOrigX(p), nsvg__actualWidth(p)); + if (strcmp(attr[i], "y") == 0) y = nsvg__parseCoordinate(p, attr[i+1], nsvg__actualOrigY(p), nsvg__actualHeight(p)); + if (strcmp(attr[i], "width") == 0) w = nsvg__parseCoordinate(p, attr[i+1], 0.0f, nsvg__actualWidth(p)); + if (strcmp(attr[i], "height") == 0) h = nsvg__parseCoordinate(p, attr[i+1], 0.0f, nsvg__actualHeight(p)); + if (strcmp(attr[i], "rx") == 0) rx = fabsf(nsvg__parseCoordinate(p, attr[i+1], 0.0f, nsvg__actualWidth(p))); + if (strcmp(attr[i], "ry") == 0) ry = fabsf(nsvg__parseCoordinate(p, attr[i+1], 0.0f, nsvg__actualHeight(p))); + } + } + + if (rx < 0.0f && ry > 0.0f) rx = ry; + if (ry < 0.0f && rx > 0.0f) ry = rx; + if (rx < 0.0f) rx = 0.0f; + if (ry < 0.0f) ry = 0.0f; + if (rx > w/2.0f) rx = w/2.0f; + if (ry > h/2.0f) ry = h/2.0f; + + if (w != 0.0f && h != 0.0f) { + nsvg__resetPath(p); + + if (rx < 0.00001f || ry < 0.0001f) { + nsvg__moveTo(p, x, y); + nsvg__lineTo(p, x+w, y); + nsvg__lineTo(p, x+w, y+h); + nsvg__lineTo(p, x, y+h); + } else { + // Rounded rectangle + nsvg__moveTo(p, x+rx, y); + nsvg__lineTo(p, x+w-rx, y); + nsvg__cubicBezTo(p, x+w-rx*(1-NSVG_KAPPA90), y, x+w, y+ry*(1-NSVG_KAPPA90), x+w, y+ry); + nsvg__lineTo(p, x+w, y+h-ry); + nsvg__cubicBezTo(p, x+w, y+h-ry*(1-NSVG_KAPPA90), x+w-rx*(1-NSVG_KAPPA90), y+h, x+w-rx, y+h); + nsvg__lineTo(p, x+rx, y+h); + nsvg__cubicBezTo(p, x+rx*(1-NSVG_KAPPA90), y+h, x, y+h-ry*(1-NSVG_KAPPA90), x, y+h-ry); + nsvg__lineTo(p, x, y+ry); + nsvg__cubicBezTo(p, x, y+ry*(1-NSVG_KAPPA90), x+rx*(1-NSVG_KAPPA90), y, x+rx, y); + } + + nsvg__addPath(p, 1); + + nsvg__addShape(p); + } +} + +static void nsvg__parseCircle(NSVGparser* p, const char** attr) +{ + float cx = 0.0f; + float cy = 0.0f; + float r = 0.0f; + int i; + + for (i = 0; attr[i]; i += 2) { + if (!nsvg__parseAttr(p, attr[i], attr[i + 1])) { + if (strcmp(attr[i], "cx") == 0) cx = nsvg__parseCoordinate(p, attr[i+1], nsvg__actualOrigX(p), nsvg__actualWidth(p)); + if (strcmp(attr[i], "cy") == 0) cy = nsvg__parseCoordinate(p, attr[i+1], nsvg__actualOrigY(p), nsvg__actualHeight(p)); + if (strcmp(attr[i], "r") == 0) r = fabsf(nsvg__parseCoordinate(p, attr[i+1], 0.0f, nsvg__actualLength(p))); + } + } + + if (r > 0.0f) { + nsvg__resetPath(p); + + nsvg__moveTo(p, cx+r, cy); + nsvg__cubicBezTo(p, cx+r, cy+r*NSVG_KAPPA90, cx+r*NSVG_KAPPA90, cy+r, cx, cy+r); + nsvg__cubicBezTo(p, cx-r*NSVG_KAPPA90, cy+r, cx-r, cy+r*NSVG_KAPPA90, cx-r, cy); + nsvg__cubicBezTo(p, cx-r, cy-r*NSVG_KAPPA90, cx-r*NSVG_KAPPA90, cy-r, cx, cy-r); + nsvg__cubicBezTo(p, cx+r*NSVG_KAPPA90, cy-r, cx+r, cy-r*NSVG_KAPPA90, cx+r, cy); + + nsvg__addPath(p, 1); + + nsvg__addShape(p); + } +} + +static void nsvg__parseEllipse(NSVGparser* p, const char** attr) +{ + float cx = 0.0f; + float cy = 0.0f; + float rx = 0.0f; + float ry = 0.0f; + int i; + + for (i = 0; attr[i]; i += 2) { + if (!nsvg__parseAttr(p, attr[i], attr[i + 1])) { + if (strcmp(attr[i], "cx") == 0) cx = nsvg__parseCoordinate(p, attr[i+1], nsvg__actualOrigX(p), nsvg__actualWidth(p)); + if (strcmp(attr[i], "cy") == 0) cy = nsvg__parseCoordinate(p, attr[i+1], nsvg__actualOrigY(p), nsvg__actualHeight(p)); + if (strcmp(attr[i], "rx") == 0) rx = fabsf(nsvg__parseCoordinate(p, attr[i+1], 0.0f, nsvg__actualWidth(p))); + if (strcmp(attr[i], "ry") == 0) ry = fabsf(nsvg__parseCoordinate(p, attr[i+1], 0.0f, nsvg__actualHeight(p))); + } + } + + if (rx > 0.0f && ry > 0.0f) { + + nsvg__resetPath(p); + + nsvg__moveTo(p, cx+rx, cy); + nsvg__cubicBezTo(p, cx+rx, cy+ry*NSVG_KAPPA90, cx+rx*NSVG_KAPPA90, cy+ry, cx, cy+ry); + nsvg__cubicBezTo(p, cx-rx*NSVG_KAPPA90, cy+ry, cx-rx, cy+ry*NSVG_KAPPA90, cx-rx, cy); + nsvg__cubicBezTo(p, cx-rx, cy-ry*NSVG_KAPPA90, cx-rx*NSVG_KAPPA90, cy-ry, cx, cy-ry); + nsvg__cubicBezTo(p, cx+rx*NSVG_KAPPA90, cy-ry, cx+rx, cy-ry*NSVG_KAPPA90, cx+rx, cy); + + nsvg__addPath(p, 1); + + nsvg__addShape(p); + } +} + +static void nsvg__parseLine(NSVGparser* p, const char** attr) +{ + float x1 = 0.0; + float y1 = 0.0; + float x2 = 0.0; + float y2 = 0.0; + int i; + + for (i = 0; attr[i]; i += 2) { + if (!nsvg__parseAttr(p, attr[i], attr[i + 1])) { + if (strcmp(attr[i], "x1") == 0) x1 = nsvg__parseCoordinate(p, attr[i + 1], nsvg__actualOrigX(p), nsvg__actualWidth(p)); + if (strcmp(attr[i], "y1") == 0) y1 = nsvg__parseCoordinate(p, attr[i + 1], nsvg__actualOrigY(p), nsvg__actualHeight(p)); + if (strcmp(attr[i], "x2") == 0) x2 = nsvg__parseCoordinate(p, attr[i + 1], nsvg__actualOrigX(p), nsvg__actualWidth(p)); + if (strcmp(attr[i], "y2") == 0) y2 = nsvg__parseCoordinate(p, attr[i + 1], nsvg__actualOrigY(p), nsvg__actualHeight(p)); + } + } + + nsvg__resetPath(p); + + nsvg__moveTo(p, x1, y1); + nsvg__lineTo(p, x2, y2); + + nsvg__addPath(p, 0); + + nsvg__addShape(p); +} + +static void nsvg__parsePoly(NSVGparser* p, const char** attr, int closeFlag) +{ + int i; + const char* s; + float args[2]; + int nargs, npts = 0; + char item[64]; + + nsvg__resetPath(p); + + for (i = 0; attr[i]; i += 2) { + if (!nsvg__parseAttr(p, attr[i], attr[i + 1])) { + if (strcmp(attr[i], "points") == 0) { + s = attr[i + 1]; + nargs = 0; + while (*s) { + s = nsvg__getNextPathItem(s, item); + args[nargs++] = (float)nsvg__atof(item); + if (nargs >= 2) { + if (npts == 0) + nsvg__moveTo(p, args[0], args[1]); + else + nsvg__lineTo(p, args[0], args[1]); + nargs = 0; + npts++; + } + } + } + } + } + + nsvg__addPath(p, (char)closeFlag); + + nsvg__addShape(p); +} + +static void nsvg__parseSVG(NSVGparser* p, const char** attr) +{ + int i; + for (i = 0; attr[i]; i += 2) { + if (!nsvg__parseAttr(p, attr[i], attr[i + 1])) { + if (strcmp(attr[i], "width") == 0) { + p->image->width = nsvg__parseCoordinate(p, attr[i + 1], 0.0f, 0.0f); + } else if (strcmp(attr[i], "height") == 0) { + p->image->height = nsvg__parseCoordinate(p, attr[i + 1], 0.0f, 0.0f); + } else if (strcmp(attr[i], "viewBox") == 0) { + const char *s = attr[i + 1]; + char buf[64]; + s = nsvg__parseNumber(s, buf, 64); + p->viewMinx = nsvg__atof(buf); + while (*s && (nsvg__isspace(*s) || *s == '%' || *s == ',')) s++; + if (!*s) return; + s = nsvg__parseNumber(s, buf, 64); + p->viewMiny = nsvg__atof(buf); + while (*s && (nsvg__isspace(*s) || *s == '%' || *s == ',')) s++; + if (!*s) return; + s = nsvg__parseNumber(s, buf, 64); + p->viewWidth = nsvg__atof(buf); + while (*s && (nsvg__isspace(*s) || *s == '%' || *s == ',')) s++; + if (!*s) return; + s = nsvg__parseNumber(s, buf, 64); + p->viewHeight = nsvg__atof(buf); + } else if (strcmp(attr[i], "preserveAspectRatio") == 0) { + if (strstr(attr[i + 1], "none") != 0) { + // No uniform scaling + p->alignType = NSVG_ALIGN_NONE; + } else { + // Parse X align + if (strstr(attr[i + 1], "xMin") != 0) + p->alignX = NSVG_ALIGN_MIN; + else if (strstr(attr[i + 1], "xMid") != 0) + p->alignX = NSVG_ALIGN_MID; + else if (strstr(attr[i + 1], "xMax") != 0) + p->alignX = NSVG_ALIGN_MAX; + // Parse X align + if (strstr(attr[i + 1], "yMin") != 0) + p->alignY = NSVG_ALIGN_MIN; + else if (strstr(attr[i + 1], "yMid") != 0) + p->alignY = NSVG_ALIGN_MID; + else if (strstr(attr[i + 1], "yMax") != 0) + p->alignY = NSVG_ALIGN_MAX; + // Parse meet/slice + p->alignType = NSVG_ALIGN_MEET; + if (strstr(attr[i + 1], "slice") != 0) + p->alignType = NSVG_ALIGN_SLICE; + } + } + } + } +} + +static void nsvg__parseGradient(NSVGparser* p, const char** attr, signed char type) +{ + int i; + NSVGgradientData* grad = (NSVGgradientData*)malloc(sizeof(NSVGgradientData)); + if (grad == NULL) return; + memset(grad, 0, sizeof(NSVGgradientData)); + grad->units = NSVG_OBJECT_SPACE; + grad->type = type; + if (grad->type == NSVG_PAINT_LINEAR_GRADIENT) { + grad->linear.x1 = nsvg__coord(0.0f, NSVG_UNITS_PERCENT); + grad->linear.y1 = nsvg__coord(0.0f, NSVG_UNITS_PERCENT); + grad->linear.x2 = nsvg__coord(100.0f, NSVG_UNITS_PERCENT); + grad->linear.y2 = nsvg__coord(0.0f, NSVG_UNITS_PERCENT); + } else if (grad->type == NSVG_PAINT_RADIAL_GRADIENT) { + grad->radial.cx = nsvg__coord(50.0f, NSVG_UNITS_PERCENT); + grad->radial.cy = nsvg__coord(50.0f, NSVG_UNITS_PERCENT); + grad->radial.r = nsvg__coord(50.0f, NSVG_UNITS_PERCENT); + } + + nsvg__xformIdentity(grad->xform); + + for (i = 0; attr[i]; i += 2) { + if (strcmp(attr[i], "id") == 0) { + strncpy(grad->id, attr[i+1], 63); + grad->id[63] = '\0'; + } else if (!nsvg__parseAttr(p, attr[i], attr[i + 1])) { + if (strcmp(attr[i], "gradientUnits") == 0) { + if (strcmp(attr[i+1], "objectBoundingBox") == 0) + grad->units = NSVG_OBJECT_SPACE; + else + grad->units = NSVG_USER_SPACE; + } else if (strcmp(attr[i], "gradientTransform") == 0) { + nsvg__parseTransform(grad->xform, attr[i + 1]); + } else if (strcmp(attr[i], "cx") == 0) { + grad->radial.cx = nsvg__parseCoordinateRaw(attr[i + 1]); + } else if (strcmp(attr[i], "cy") == 0) { + grad->radial.cy = nsvg__parseCoordinateRaw(attr[i + 1]); + } else if (strcmp(attr[i], "r") == 0) { + grad->radial.r = nsvg__parseCoordinateRaw(attr[i + 1]); + } else if (strcmp(attr[i], "fx") == 0) { + grad->radial.fx = nsvg__parseCoordinateRaw(attr[i + 1]); + } else if (strcmp(attr[i], "fy") == 0) { + grad->radial.fy = nsvg__parseCoordinateRaw(attr[i + 1]); + } else if (strcmp(attr[i], "x1") == 0) { + grad->linear.x1 = nsvg__parseCoordinateRaw(attr[i + 1]); + } else if (strcmp(attr[i], "y1") == 0) { + grad->linear.y1 = nsvg__parseCoordinateRaw(attr[i + 1]); + } else if (strcmp(attr[i], "x2") == 0) { + grad->linear.x2 = nsvg__parseCoordinateRaw(attr[i + 1]); + } else if (strcmp(attr[i], "y2") == 0) { + grad->linear.y2 = nsvg__parseCoordinateRaw(attr[i + 1]); + } else if (strcmp(attr[i], "spreadMethod") == 0) { + if (strcmp(attr[i+1], "pad") == 0) + grad->spread = NSVG_SPREAD_PAD; + else if (strcmp(attr[i+1], "reflect") == 0) + grad->spread = NSVG_SPREAD_REFLECT; + else if (strcmp(attr[i+1], "repeat") == 0) + grad->spread = NSVG_SPREAD_REPEAT; + } else if (strcmp(attr[i], "xlink:href") == 0) { + const char *href = attr[i+1]; + strncpy(grad->ref, href+1, 62); + grad->ref[62] = '\0'; + } + } + } + + grad->next = p->gradients; + p->gradients = grad; +} + +static void nsvg__parseGradientStop(NSVGparser* p, const char** attr) +{ + NSVGattrib* curAttr = nsvg__getAttr(p); + NSVGgradientData* grad; + NSVGgradientStop* stop; + int i, idx; + + curAttr->stopOffset = 0; + curAttr->stopColor = 0; + curAttr->stopOpacity = 1.0f; + + for (i = 0; attr[i]; i += 2) { + nsvg__parseAttr(p, attr[i], attr[i + 1]); + } + + // Add stop to the last gradient. + grad = p->gradients; + if (grad == NULL) return; + + grad->nstops++; + grad->stops = (NSVGgradientStop*)realloc(grad->stops, sizeof(NSVGgradientStop)*grad->nstops); + if (grad->stops == NULL) return; + + // Insert + idx = grad->nstops-1; + for (i = 0; i < grad->nstops-1; i++) { + if (curAttr->stopOffset < grad->stops[i].offset) { + idx = i; + break; + } + } + if (idx != grad->nstops-1) { + for (i = grad->nstops-1; i > idx; i--) + grad->stops[i] = grad->stops[i-1]; + } + + stop = &grad->stops[idx]; + stop->color = curAttr->stopColor; + stop->color |= (unsigned int)(curAttr->stopOpacity*255) << 24; + stop->offset = curAttr->stopOffset; +} + +static void nsvg__startElement(void* ud, const char* el, const char** attr) +{ + NSVGparser* p = (NSVGparser*)ud; + + if (p->defsFlag) { + // Skip everything but gradients in defs + if (strcmp(el, "linearGradient") == 0) { + nsvg__parseGradient(p, attr, NSVG_PAINT_LINEAR_GRADIENT); + } else if (strcmp(el, "radialGradient") == 0) { + nsvg__parseGradient(p, attr, NSVG_PAINT_RADIAL_GRADIENT); + } else if (strcmp(el, "stop") == 0) { + nsvg__parseGradientStop(p, attr); + } + return; + } + + if (strcmp(el, "g") == 0) { + nsvg__pushAttr(p); + nsvg__parseAttribs(p, attr); + } else if (strcmp(el, "path") == 0) { + if (p->pathFlag) // Do not allow nested paths. + return; + nsvg__pushAttr(p); + nsvg__parsePath(p, attr); + nsvg__popAttr(p); + } else if (strcmp(el, "rect") == 0) { + nsvg__pushAttr(p); + nsvg__parseRect(p, attr); + nsvg__popAttr(p); + } else if (strcmp(el, "circle") == 0) { + nsvg__pushAttr(p); + nsvg__parseCircle(p, attr); + nsvg__popAttr(p); + } else if (strcmp(el, "ellipse") == 0) { + nsvg__pushAttr(p); + nsvg__parseEllipse(p, attr); + nsvg__popAttr(p); + } else if (strcmp(el, "line") == 0) { + nsvg__pushAttr(p); + nsvg__parseLine(p, attr); + nsvg__popAttr(p); + } else if (strcmp(el, "polyline") == 0) { + nsvg__pushAttr(p); + nsvg__parsePoly(p, attr, 0); + nsvg__popAttr(p); + } else if (strcmp(el, "polygon") == 0) { + nsvg__pushAttr(p); + nsvg__parsePoly(p, attr, 1); + nsvg__popAttr(p); + } else if (strcmp(el, "linearGradient") == 0) { + nsvg__parseGradient(p, attr, NSVG_PAINT_LINEAR_GRADIENT); + } else if (strcmp(el, "radialGradient") == 0) { + nsvg__parseGradient(p, attr, NSVG_PAINT_RADIAL_GRADIENT); + } else if (strcmp(el, "stop") == 0) { + nsvg__parseGradientStop(p, attr); + } else if (strcmp(el, "defs") == 0) { + p->defsFlag = 1; + } else if (strcmp(el, "svg") == 0) { + nsvg__parseSVG(p, attr); + } +} + +static void nsvg__endElement(void* ud, const char* el) +{ + NSVGparser* p = (NSVGparser*)ud; + + if (strcmp(el, "g") == 0) { + nsvg__popAttr(p); + } else if (strcmp(el, "path") == 0) { + p->pathFlag = 0; + } else if (strcmp(el, "defs") == 0) { + p->defsFlag = 0; + } +} + +static void nsvg__content(void* ud, const char* s) +{ + NSVG_NOTUSED(ud); + NSVG_NOTUSED(s); + // empty +} + +static void nsvg__imageBounds(NSVGparser* p, float* bounds) +{ + NSVGshape* shape; + shape = p->image->shapes; + if (shape == NULL) { + bounds[0] = bounds[1] = bounds[2] = bounds[3] = 0.0; + return; + } + bounds[0] = shape->bounds[0]; + bounds[1] = shape->bounds[1]; + bounds[2] = shape->bounds[2]; + bounds[3] = shape->bounds[3]; + for (shape = shape->next; shape != NULL; shape = shape->next) { + bounds[0] = nsvg__minf(bounds[0], shape->bounds[0]); + bounds[1] = nsvg__minf(bounds[1], shape->bounds[1]); + bounds[2] = nsvg__maxf(bounds[2], shape->bounds[2]); + bounds[3] = nsvg__maxf(bounds[3], shape->bounds[3]); + } +} + +static float nsvg__viewAlign(float content, float container, int type) +{ + if (type == NSVG_ALIGN_MIN) + return 0; + else if (type == NSVG_ALIGN_MAX) + return container - content; + // mid + return (container - content) * 0.5f; +} + +static void nsvg__scaleGradient(NSVGgradient* grad, float tx, float ty, float sx, float sy) +{ + float t[6]; + nsvg__xformSetTranslation(t, tx, ty); + nsvg__xformMultiply (grad->xform, t); + + nsvg__xformSetScale(t, sx, sy); + nsvg__xformMultiply (grad->xform, t); +} + +static void nsvg__scaleToViewbox(NSVGparser* p, const char* units) +{ + NSVGshape* shape; + NSVGpath* path; + float tx, ty, sx, sy, us, bounds[4], t[6], avgs; + int i; + float* pt; + + // Guess image size if not set completely. + nsvg__imageBounds(p, bounds); + + if (p->viewWidth == 0) { + if (p->image->width > 0) { + p->viewWidth = p->image->width; + } else { + p->viewMinx = bounds[0]; + p->viewWidth = bounds[2] - bounds[0]; + } + } + if (p->viewHeight == 0) { + if (p->image->height > 0) { + p->viewHeight = p->image->height; + } else { + p->viewMiny = bounds[1]; + p->viewHeight = bounds[3] - bounds[1]; + } + } + if (p->image->width == 0) + p->image->width = p->viewWidth; + if (p->image->height == 0) + p->image->height = p->viewHeight; + + tx = -p->viewMinx; + ty = -p->viewMiny; + sx = p->viewWidth > 0 ? p->image->width / p->viewWidth : 0; + sy = p->viewHeight > 0 ? p->image->height / p->viewHeight : 0; + // Unit scaling + us = 1.0f / nsvg__convertToPixels(p, nsvg__coord(1.0f, nsvg__parseUnits(units)), 0.0f, 1.0f); + + // Fix aspect ratio + if (p->alignType == NSVG_ALIGN_MEET) { + // fit whole image into viewbox + sx = sy = nsvg__minf(sx, sy); + tx += nsvg__viewAlign(p->viewWidth*sx, p->image->width, p->alignX) / sx; + ty += nsvg__viewAlign(p->viewHeight*sy, p->image->height, p->alignY) / sy; + } else if (p->alignType == NSVG_ALIGN_SLICE) { + // fill whole viewbox with image + sx = sy = nsvg__maxf(sx, sy); + tx += nsvg__viewAlign(p->viewWidth*sx, p->image->width, p->alignX) / sx; + ty += nsvg__viewAlign(p->viewHeight*sy, p->image->height, p->alignY) / sy; + } + + // Transform + sx *= us; + sy *= us; + avgs = (sx+sy) / 2.0f; + for (shape = p->image->shapes; shape != NULL; shape = shape->next) { + shape->bounds[0] = (shape->bounds[0] + tx) * sx; + shape->bounds[1] = (shape->bounds[1] + ty) * sy; + shape->bounds[2] = (shape->bounds[2] + tx) * sx; + shape->bounds[3] = (shape->bounds[3] + ty) * sy; + for (path = shape->paths; path != NULL; path = path->next) { + path->bounds[0] = (path->bounds[0] + tx) * sx; + path->bounds[1] = (path->bounds[1] + ty) * sy; + path->bounds[2] = (path->bounds[2] + tx) * sx; + path->bounds[3] = (path->bounds[3] + ty) * sy; + for (i =0; i < path->npts; i++) { + pt = &path->pts[i*2]; + pt[0] = (pt[0] + tx) * sx; + pt[1] = (pt[1] + ty) * sy; + } + } + + if (shape->fill.type == NSVG_PAINT_LINEAR_GRADIENT || shape->fill.type == NSVG_PAINT_RADIAL_GRADIENT) { + nsvg__scaleGradient(shape->fill.gradient, tx,ty, sx,sy); + memcpy(t, shape->fill.gradient->xform, sizeof(float)*6); + nsvg__xformInverse(shape->fill.gradient->xform, t); + } + if (shape->stroke.type == NSVG_PAINT_LINEAR_GRADIENT || shape->stroke.type == NSVG_PAINT_RADIAL_GRADIENT) { + nsvg__scaleGradient(shape->stroke.gradient, tx,ty, sx,sy); + memcpy(t, shape->stroke.gradient->xform, sizeof(float)*6); + nsvg__xformInverse(shape->stroke.gradient->xform, t); + } + + shape->strokeWidth *= avgs; + shape->strokeDashOffset *= avgs; + for (i = 0; i < shape->strokeDashCount; i++) + shape->strokeDashArray[i] *= avgs; + } +} + +static void nsvg__createGradients(NSVGparser* p) +{ + NSVGshape* shape; + + for (shape = p->image->shapes; shape != NULL; shape = shape->next) { + if (shape->fill.type == NSVG_PAINT_UNDEF) { + if (shape->fillGradient[0] != '\0') { + float inv[6], localBounds[4]; + nsvg__xformInverse(inv, shape->xform); + nsvg__getLocalBounds(localBounds, shape, inv); + shape->fill.gradient = nsvg__createGradient(p, shape->fillGradient, localBounds, shape->xform, &shape->fill.type); + } + if (shape->fill.type == NSVG_PAINT_UNDEF) { + shape->fill.type = NSVG_PAINT_NONE; + } + } + if (shape->stroke.type == NSVG_PAINT_UNDEF) { + if (shape->strokeGradient[0] != '\0') { + float inv[6], localBounds[4]; + nsvg__xformInverse(inv, shape->xform); + nsvg__getLocalBounds(localBounds, shape, inv); + shape->stroke.gradient = nsvg__createGradient(p, shape->strokeGradient, localBounds, shape->xform, &shape->stroke.type); + } + if (shape->stroke.type == NSVG_PAINT_UNDEF) { + shape->stroke.type = NSVG_PAINT_NONE; + } + } + } +} + +NSVGimage* nsvgParse(char* input, const char* units, float dpi) +{ + NSVGparser* p; + NSVGimage* ret = 0; + + p = nsvg__createParser(); + if (p == NULL) { + return NULL; + } + p->dpi = dpi; + + nsvg__parseXML(input, nsvg__startElement, nsvg__endElement, nsvg__content, p); + + // Create gradients after all definitions have been parsed + nsvg__createGradients(p); + + // Scale to viewBox + nsvg__scaleToViewbox(p, units); + + ret = p->image; + p->image = NULL; + + nsvg__deleteParser(p); + + return ret; +} + +NSVGimage* nsvgParseFromFile(const char* filename, const char* units, float dpi) +{ + FILE* fp = NULL; + size_t size; + char* data = NULL; + NSVGimage* image = NULL; + + fp = fopen(filename, "rb"); + if (!fp) goto error; + fseek(fp, 0, SEEK_END); + size = ftell(fp); + fseek(fp, 0, SEEK_SET); + data = (char*)malloc(size+1); + if (data == NULL) goto error; + if (fread(data, 1, size, fp) != size) goto error; + data[size] = '\0'; // Must be null terminated. + fclose(fp); + image = nsvgParse(data, units, dpi); + free(data); + + return image; + +error: + if (fp) fclose(fp); + if (data) free(data); + if (image) nsvgDelete(image); + return NULL; +} + +NSVGpath* nsvgDuplicatePath(NSVGpath* p) +{ + NSVGpath* res = NULL; + + if (p == NULL) + return NULL; + + res = (NSVGpath*)malloc(sizeof(NSVGpath)); + if (res == NULL) goto error; + memset(res, 0, sizeof(NSVGpath)); + + res->pts = (float*)malloc(p->npts*2*sizeof(float)); + if (res->pts == NULL) goto error; + memcpy(res->pts, p->pts, p->npts * sizeof(float) * 2); + res->npts = p->npts; + + memcpy(res->bounds, p->bounds, sizeof(p->bounds)); + + res->closed = p->closed; + + return res; + +error: + if (res != NULL) { + free(res->pts); + free(res); + } + return NULL; +} + +void nsvgDelete(NSVGimage* image) +{ + NSVGshape *snext, *shape; + if (image == NULL) return; + shape = image->shapes; + while (shape != NULL) { + snext = shape->next; + nsvg__deletePaths(shape->paths); + nsvg__deletePaint(&shape->fill); + nsvg__deletePaint(&shape->stroke); + free(shape); + shape = snext; + } + free(image); +} + +#endif // NANOSVG_IMPLEMENTATION + +#endif // NANOSVG_H diff --git a/Polyfills/Canvas/Source/nanovg/fontstash.h b/Polyfills/Canvas/Source/nanovg/fontstash.h new file mode 100644 index 000000000..a66849611 --- /dev/null +++ b/Polyfills/Canvas/Source/nanovg/fontstash.h @@ -0,0 +1,1798 @@ +// +// Copyright (c) 2009-2013 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#ifndef FONS_H +#define FONS_H + +#define FONS_INVALID -1 + +enum FONSflags { + FONS_ZERO_TOPLEFT = 1, + FONS_ZERO_BOTTOMLEFT = 2, +}; + +enum FONSalign { + // Horizontal align + FONS_ALIGN_LEFT = 1<<0, // Default + FONS_ALIGN_CENTER = 1<<1, + FONS_ALIGN_RIGHT = 1<<2, + // Vertical align + FONS_ALIGN_TOP = 1<<3, + FONS_ALIGN_MIDDLE = 1<<4, + FONS_ALIGN_BOTTOM = 1<<5, + FONS_ALIGN_BASELINE = 1<<6, // Default +}; + +enum FONSglyphBitmap { + FONS_GLYPH_BITMAP_OPTIONAL = 1, + FONS_GLYPH_BITMAP_REQUIRED = 2, +}; + +enum FONSerrorCode { + // Font atlas is full. + FONS_ATLAS_FULL = 1, + // Scratch memory used to render glyphs is full, requested size reported in 'val', you may need to bump up FONS_SCRATCH_BUF_SIZE. + FONS_SCRATCH_FULL = 2, + // Calls to fonsPushState has created too large stack, if you need deep state stack bump up FONS_MAX_STATES. + FONS_STATES_OVERFLOW = 3, + // Trying to pop too many states fonsPopState(). + FONS_STATES_UNDERFLOW = 4, +}; + +struct FONSparams { + int width, height; + unsigned char flags; + void* userPtr; + int (*renderCreate)(void* uptr, int width, int height); + int (*renderResize)(void* uptr, int width, int height); + void (*renderUpdate)(void* uptr, int* rect, const unsigned char* data); + void (*renderDraw)(void* uptr, const float* verts, const float* tcoords, const unsigned int* colors, int nverts); + void (*renderDelete)(void* uptr); +}; +typedef struct FONSparams FONSparams; + +struct FONSquad +{ + float x0,y0,s0,t0; + float x1,y1,s1,t1; +}; +typedef struct FONSquad FONSquad; + +struct FONStextIter { + float x, y, nextx, nexty, scale, spacing; + unsigned int codepoint; + short isize, iblur; + struct FONSfont* font; + int prevGlyphIndex; + const char* str; + const char* next; + const char* end; + unsigned int utf8state; + int bitmapOption; +}; +typedef struct FONStextIter FONStextIter; + +typedef struct FONScontext FONScontext; + +// Constructor and destructor. +FONScontext* fonsCreateInternal(FONSparams* params); +void fonsDeleteInternal(FONScontext* s); + +void fonsSetErrorCallback(FONScontext* s, void (*callback)(void* uptr, int error, int val), void* uptr); +// Returns current atlas size. +void fonsGetAtlasSize(FONScontext* s, int* width, int* height); +// Expands the atlas size. +int fonsExpandAtlas(FONScontext* s, int width, int height); +// Resets the whole stash. +int fonsResetAtlas(FONScontext* stash, int width, int height); + +// Add fonts +int fonsAddFont(FONScontext* s, const char* name, const char* path); +int fonsAddFontMem(FONScontext* s, const char* name, unsigned char* data, int ndata, int freeData); +int fonsGetFontByName(FONScontext* s, const char* name); + +// State handling +void fonsPushState(FONScontext* s); +void fonsPopState(FONScontext* s); +void fonsClearState(FONScontext* s); + +// State setting +void fonsSetSize(FONScontext* s, float size); +void fonsSetColor(FONScontext* s, unsigned int color); +void fonsSetSpacing(FONScontext* s, float spacing); +void fonsSetBlur(FONScontext* s, float blur); +void fonsSetAlign(FONScontext* s, int align); +void fonsSetFont(FONScontext* s, int font); + +// Draw text +float fonsDrawText(FONScontext* s, float x, float y, const char* string, const char* end); + +// Measure text +float fonsTextBounds(FONScontext* s, float x, float y, const char* string, const char* end, float* bounds); +void fonsLineBounds(FONScontext* s, float y, float* miny, float* maxy); +void fonsVertMetrics(FONScontext* s, float* ascender, float* descender, float* lineh); + +// Text iterator +int fonsTextIterInit(FONScontext* stash, FONStextIter* iter, float x, float y, const char* str, const char* end, int bitmapOption); +int fonsTextIterNext(FONScontext* stash, FONStextIter* iter, struct FONSquad* quad); + +// Pull texture changes +const unsigned char* fonsGetTextureData(FONScontext* stash, int* width, int* height); +int fonsValidateTexture(FONScontext* s, int* dirty); + +// Draws the stash texture for debugging +void fonsDrawDebug(FONScontext* s, float x, float y); + +#endif // FONTSTASH_H + + +#ifdef FONTSTASH_IMPLEMENTATION + +#define FONS_NOTUSED(v) BX_UNUSED(v) + +#ifndef FONS_SDF_EDGE +# define FONS_SDF_EDGE 128 +#endif + +#ifdef FONS_USE_FREETYPE + +#include +#include FT_FREETYPE_H +#include FT_ADVANCES_H +#include + +struct FONSttFontImpl { + FT_Face font; +}; +typedef struct FONSttFontImpl FONSttFontImpl; + +static FT_Library ftLibrary; + +int fons__tt_init(FONScontext *context) +{ + FT_Error ftError; + FONS_NOTUSED(context); + ftError = FT_Init_FreeType(&ftLibrary); + return ftError == 0; +} + +int fons__tt_done(FONScontext *context) +{ + FT_Error ftError; + FONS_NOTUSED(context); + ftError = FT_Done_FreeType(ftLibrary); + return ftError == 0; +} + +int fons__tt_loadFont(FONScontext *context, FONSttFontImpl *font, unsigned char *data, int dataSize) +{ + FT_Error ftError; + FONS_NOTUSED(context); + + //font->font.userdata = stash; + ftError = FT_New_Memory_Face(ftLibrary, (const FT_Byte*)data, dataSize, 0, &font->font); + return ftError == 0; +} + +void fons__tt_getFontVMetrics(FONSttFontImpl *font, int *ascent, int *descent, int *lineGap) +{ + *ascent = font->font->ascender; + *descent = font->font->descender; + *lineGap = font->font->height - (*ascent - *descent); +} + +float fons__tt_getPixelHeightScale(FONSttFontImpl *font, float size) +{ + return size / (font->font->ascender - font->font->descender); +} + +int fons__tt_getGlyphIndex(FONSttFontImpl *font, int codepoint) +{ + return FT_Get_Char_Index(font->font, codepoint); +} + +int fons__tt_buildGlyphBitmap(FONSttFontImpl *font, int glyph, float size, float scale, + int *advance, int *lsb, int *x0, int *y0, int *x1, int *y1) +{ + FT_Error ftError; + FT_GlyphSlot ftGlyph; + FT_Fixed advFixed; + FONS_NOTUSED(scale); + + ftError = FT_Set_Pixel_Sizes(font->font, 0, (FT_UInt)(size * (float)font->font->units_per_EM / (float)(font->font->ascender - font->font->descender))); + if (ftError) return 0; + ftError = FT_Load_Glyph(font->font, glyph, FT_LOAD_RENDER | FT_LOAD_FORCE_AUTOHINT); + if (ftError) return 0; + ftError = FT_Get_Advance(font->font, glyph, FT_LOAD_NO_SCALE, &advFixed); + if (ftError) return 0; + ftGlyph = font->font->glyph; + *advance = (int)advFixed; + *lsb = (int)ftGlyph->metrics.horiBearingX; + *x0 = ftGlyph->bitmap_left; + *x1 = *x0 + ftGlyph->bitmap.width; + *y0 = -ftGlyph->bitmap_top; + *y1 = *y0 + ftGlyph->bitmap.rows; + return 1; +} + +void fons__tt_renderGlyphBitmap(FONSttFontImpl *font, unsigned char *output, int outWidth, int outHeight, int outStride, + float scaleX, float scaleY, int glyph) +{ + FT_GlyphSlot ftGlyph = font->font->glyph; + int ftGlyphOffset = 0; + unsigned int x, y; + FONS_NOTUSED(outWidth); + FONS_NOTUSED(outHeight); + FONS_NOTUSED(scaleX); + FONS_NOTUSED(scaleY); + FONS_NOTUSED(glyph); // glyph has already been loaded by fons__tt_buildGlyphBitmap + + for ( y = 0; y < ftGlyph->bitmap.rows; y++ ) { + for ( x = 0; x < ftGlyph->bitmap.width; x++ ) { + output[(y * outStride) + x] = ftGlyph->bitmap.buffer[ftGlyphOffset++]; + } + } +} + +int fons__tt_getGlyphKernAdvance(FONSttFontImpl *font, int glyph1, int glyph2) +{ + FT_Vector ftKerning; + FT_Get_Kerning(font->font, glyph1, glyph2, FT_KERNING_DEFAULT, &ftKerning); + return (int)((ftKerning.x + 32) >> 6); // Round up and convert to integer +} + +#else + +#if 0 +#define STB_TRUETYPE_IMPLEMENTATION +# define STBTT_malloc(x,u) fons__tmpalloc(x,u) +# define STBTT_free(x,u) fons__tmpfree(x,u) +static void* fons__tmpalloc(size_t size, void* up); +static void fons__tmpfree(void* ptr, void* up); +#else +# include +# include +#endif // 0 + +#define STBTT_DEF extern +#include + +struct FONSttFontImpl { + stbtt_fontinfo font; +}; +typedef struct FONSttFontImpl FONSttFontImpl; + +int fons__tt_init(FONScontext *context) +{ + FONS_NOTUSED(context); + return 1; +} + +int fons__tt_done(FONScontext *context) +{ + FONS_NOTUSED(context); + return 1; +} + +int fons__tt_loadFont(FONScontext *context, FONSttFontImpl *font, unsigned char *data, int dataSize) +{ + int stbError; + FONS_NOTUSED(dataSize); + + font->font.userdata = context; + stbError = stbtt_InitFont(&font->font, data, 0); + return stbError; +} + +void fons__tt_getFontVMetrics(FONSttFontImpl *font, int *ascent, int *descent, int *lineGap) +{ + stbtt_GetFontVMetrics(&font->font, ascent, descent, lineGap); +} + +float fons__tt_getPixelHeightScale(FONSttFontImpl *font, float size) +{ + return stbtt_ScaleForPixelHeight(&font->font, size); +} + +int fons__tt_getGlyphIndex(FONSttFontImpl *font, int codepoint) +{ + return stbtt_FindGlyphIndex(&font->font, codepoint); +} + +int fons__tt_buildGlyphBitmap(FONSttFontImpl *font, int glyph, float size, float scale, + int *advance, int *lsb, int *x0, int *y0, int *x1, int *y1) +{ + FONS_NOTUSED(size); + stbtt_GetGlyphHMetrics(&font->font, glyph, advance, lsb); + stbtt_GetGlyphBitmapBox(&font->font, glyph, scale, scale, x0, y0, x1, y1); +#ifdef FONS_SDF_PADDING + *x0 -= FONS_SDF_PADDING; + *y0 -= FONS_SDF_PADDING; + *x1 += FONS_SDF_PADDING; + *y1 += FONS_SDF_PADDING; +#endif + return 1; +} + +void fons__tt_renderGlyphBitmap(FONSttFontImpl *font, unsigned char *output, int outWidth, int outHeight, int outStride, + float scaleX, float scaleY, int glyph) +{ +#ifdef FONS_SDF_PADDING + float pixelDist = (float)FONS_SDF_EDGE/FONS_SDF_PADDING; + int y; + FONS_NOTUSED(scaleY); + + unsigned char *sdf = stbtt_GetGlyphSDF(&font->font, scaleX, glyph, FONS_SDF_PADDING, FONS_SDF_EDGE, pixelDist, NULL, NULL, NULL, NULL); + if (!sdf) return; + for (y = 0; y < outHeight; y++) { + memcpy(&output[y * outStride], &sdf[y * outWidth], outWidth); + } + stbtt_FreeSDF(sdf, font->font.userdata); +#else + stbtt_MakeGlyphBitmap(&font->font, output, outWidth, outHeight, outStride, scaleX, scaleY, glyph); +#endif +} + +int fons__tt_getGlyphKernAdvance(FONSttFontImpl *font, int glyph1, int glyph2) +{ + return stbtt_GetGlyphKernAdvance(&font->font, glyph1, glyph2); +} + +#endif + +#ifndef FONS_SCRATCH_BUF_SIZE +# define FONS_SCRATCH_BUF_SIZE 96000 +#endif +#ifndef FONS_HASH_LUT_SIZE +# define FONS_HASH_LUT_SIZE 256 +#endif +#ifndef FONS_INIT_FONTS +# define FONS_INIT_FONTS 4 +#endif +#ifndef FONS_INIT_GLYPHS +# define FONS_INIT_GLYPHS 256 +#endif +#ifndef FONS_INIT_ATLAS_NODES +# define FONS_INIT_ATLAS_NODES 256 +#endif +#ifndef FONS_VERTEX_COUNT +# define FONS_VERTEX_COUNT 1024 +#endif +#ifndef FONS_MAX_STATES +# define FONS_MAX_STATES 20 +#endif +#ifndef FONS_MAX_FALLBACKS +# define FONS_MAX_FALLBACKS 20 +#endif + +static unsigned int fons__hashint(unsigned int a) +{ + a += ~(a<<15); + a ^= (a>>10); + a += (a<<3); + a ^= (a>>6); + a += ~(a<<11); + a ^= (a>>16); + return a; +} + +static int fons__mini(int a, int b) +{ + return a < b ? a : b; +} + +static int fons__maxi(int a, int b) +{ + return a > b ? a : b; +} + +struct FONSglyph +{ + unsigned int codepoint; + int index; + int next; + short size, blur; + short x0,y0,x1,y1; + short xadv,xoff,yoff; +}; +typedef struct FONSglyph FONSglyph; + +struct FONSfont +{ + FONSttFontImpl font; + char name[64]; + unsigned char* data; + int dataSize; + unsigned char freeData; + float ascender; + float descender; + float lineh; + FONSglyph* glyphs; + int cglyphs; + int nglyphs; + int lut[FONS_HASH_LUT_SIZE]; + int fallbacks[FONS_MAX_FALLBACKS]; + int nfallbacks; +}; +typedef struct FONSfont FONSfont; + +struct FONSstate +{ + int font; + int align; + float size; + unsigned int color; + float blur; + float spacing; +}; +typedef struct FONSstate FONSstate; + +struct FONSatlasNode { + short x, y, width; +}; +typedef struct FONSatlasNode FONSatlasNode; + +struct FONSatlas +{ + int width, height; + FONSatlasNode* nodes; + int nnodes; + int cnodes; +}; +typedef struct FONSatlas FONSatlas; + +struct FONScontext +{ + FONSparams params; + float itw,ith; + unsigned char* texData; + int dirtyRect[4]; + FONSfont** fonts; + FONSatlas* atlas; + int cfonts; + int nfonts; + float verts[FONS_VERTEX_COUNT*2]; + float tcoords[FONS_VERTEX_COUNT*2]; + unsigned int colors[FONS_VERTEX_COUNT]; + int nverts; + unsigned char* scratch; + int nscratch; + FONSstate states[FONS_MAX_STATES]; + int nstates; + void (*handleError)(void* uptr, int error, int val); + void* errorUptr; +}; + +#if 0 // defined(STB_TRUETYPE_IMPLEMENTATION) + +static void* fons__tmpalloc(size_t size, void* up) +{ + unsigned char* ptr; + FONScontext* stash = (FONScontext*)up; + + // 16-byte align the returned pointer + size = (size + 0xf) & ~0xf; + + if (stash->nscratch+(int)size > FONS_SCRATCH_BUF_SIZE) { + if (stash->handleError) + stash->handleError(stash->errorUptr, FONS_SCRATCH_FULL, stash->nscratch+(int)size); + return NULL; + } + ptr = stash->scratch + stash->nscratch; + stash->nscratch += (int)size; + return ptr; +} + +static void fons__tmpfree(void* ptr, void* up) +{ + (void)ptr; + (void)up; + // empty +} + +#endif // STB_TRUETYPE_IMPLEMENTATION + +// Copyright (c) 2008-2010 Bjoern Hoehrmann +// See http://bjoern.hoehrmann.de/utf-8/decoder/dfa/ for details. + +#define FONS_UTF8_ACCEPT 0 +#define FONS_UTF8_REJECT 12 + +static unsigned int fons__decutf8(unsigned int* state, unsigned int* codep, unsigned int byte) +{ + static const unsigned char utf8d[] = { + // The first part of the table maps bytes to character classes that + // to reduce the size of the transition table and create bitmasks. + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, + 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, + 8,8,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, + 10,3,3,3,3,3,3,3,3,3,3,3,3,4,3,3, 11,6,6,6,5,8,8,8,8,8,8,8,8,8,8,8, + + // The second part is a transition table that maps a combination + // of a state of the automaton and a character class to a state. + 0,12,24,36,60,96,84,12,12,12,48,72, 12,12,12,12,12,12,12,12,12,12,12,12, + 12, 0,12,12,12,12,12, 0,12, 0,12,12, 12,24,12,12,12,12,12,24,12,24,12,12, + 12,12,12,12,12,12,12,24,12,12,12,12, 12,24,12,12,12,12,12,12,12,24,12,12, + 12,12,12,12,12,12,12,36,12,36,12,12, 12,36,12,12,12,12,12,36,12,36,12,12, + 12,36,12,12,12,12,12,12,12,12,12,12, + }; + + unsigned int type = utf8d[byte]; + + *codep = (*state != FONS_UTF8_ACCEPT) ? + (byte & 0x3fu) | (*codep << 6) : + (0xff >> type) & (byte); + + *state = utf8d[256 + *state + type]; + return *state; +} + +// Atlas based on Skyline Bin Packer by Jukka Jylänki + +static void fons__deleteAtlas(FONSatlas* atlas) +{ + if (atlas == NULL) return; + if (atlas->nodes != NULL) free(atlas->nodes); + free(atlas); +} + +static FONSatlas* fons__allocAtlas(int w, int h, int nnodes) +{ + FONSatlas* atlas = NULL; + + // Allocate memory for the font stash. + atlas = (FONSatlas*)malloc(sizeof(FONSatlas)); + if (atlas == NULL) goto error; + memset(atlas, 0, sizeof(FONSatlas)); + + atlas->width = w; + atlas->height = h; + + // Allocate space for skyline nodes + atlas->nodes = (FONSatlasNode*)malloc(sizeof(FONSatlasNode) * nnodes); + if (atlas->nodes == NULL) goto error; + memset(atlas->nodes, 0, sizeof(FONSatlasNode) * nnodes); + atlas->nnodes = 0; + atlas->cnodes = nnodes; + + // Init root node. + atlas->nodes[0].x = 0; + atlas->nodes[0].y = 0; + atlas->nodes[0].width = (short)w; + atlas->nnodes++; + + return atlas; + +error: + if (atlas) fons__deleteAtlas(atlas); + return NULL; +} + +static int fons__atlasInsertNode(FONSatlas* atlas, int idx, int x, int y, int w) +{ + int i; + // Insert node + if (atlas->nnodes+1 > atlas->cnodes) { + atlas->cnodes = atlas->cnodes == 0 ? 8 : atlas->cnodes * 2; + atlas->nodes = (FONSatlasNode*)realloc(atlas->nodes, sizeof(FONSatlasNode) * atlas->cnodes); + if (atlas->nodes == NULL) + return 0; + } + for (i = atlas->nnodes; i > idx; i--) + atlas->nodes[i] = atlas->nodes[i-1]; + atlas->nodes[idx].x = (short)x; + atlas->nodes[idx].y = (short)y; + atlas->nodes[idx].width = (short)w; + atlas->nnodes++; + + return 1; +} + +static void fons__atlasRemoveNode(FONSatlas* atlas, int idx) +{ + int i; + if (atlas->nnodes == 0) return; + for (i = idx; i < atlas->nnodes-1; i++) + atlas->nodes[i] = atlas->nodes[i+1]; + atlas->nnodes--; +} + +static void fons__atlasExpand(FONSatlas* atlas, int w, int h) +{ + // Insert node for empty space + if (w > atlas->width) + fons__atlasInsertNode(atlas, atlas->nnodes, atlas->width, 0, w - atlas->width); + atlas->width = w; + atlas->height = h; +} + +static void fons__atlasReset(FONSatlas* atlas, int w, int h) +{ + atlas->width = w; + atlas->height = h; + atlas->nnodes = 0; + + // Init root node. + atlas->nodes[0].x = 0; + atlas->nodes[0].y = 0; + atlas->nodes[0].width = (short)w; + atlas->nnodes++; +} + +static int fons__atlasAddSkylineLevel(FONSatlas* atlas, int idx, int x, int y, int w, int h) +{ + int i; + + // Insert new node + if (fons__atlasInsertNode(atlas, idx, x, y+h, w) == 0) + return 0; + + // Delete skyline segments that fall under the shadow of the new segment. + for (i = idx+1; i < atlas->nnodes; i++) { + if (atlas->nodes[i].x < atlas->nodes[i-1].x + atlas->nodes[i-1].width) { + int shrink = atlas->nodes[i-1].x + atlas->nodes[i-1].width - atlas->nodes[i].x; + atlas->nodes[i].x += (short)shrink; + atlas->nodes[i].width -= (short)shrink; + if (atlas->nodes[i].width <= 0) { + fons__atlasRemoveNode(atlas, i); + i--; + } else { + break; + } + } else { + break; + } + } + + // Merge same height skyline segments that are next to each other. + for (i = 0; i < atlas->nnodes-1; i++) { + if (atlas->nodes[i].y == atlas->nodes[i+1].y) { + atlas->nodes[i].width += atlas->nodes[i+1].width; + fons__atlasRemoveNode(atlas, i+1); + i--; + } + } + + return 1; +} + +static int fons__atlasRectFits(FONSatlas* atlas, int i, int w, int h) +{ + // Checks if there is enough space at the location of skyline span 'i', + // and return the max height of all skyline spans under that at that location, + // (think tetris block being dropped at that position). Or -1 if no space found. + int x = atlas->nodes[i].x; + int y = atlas->nodes[i].y; + int spaceLeft; + if (x + w > atlas->width) + return -1; + spaceLeft = w; + while (spaceLeft > 0) { + if (i == atlas->nnodes) return -1; + y = fons__maxi(y, atlas->nodes[i].y); + if (y + h > atlas->height) return -1; + spaceLeft -= atlas->nodes[i].width; + ++i; + } + return y; +} + +static int fons__atlasAddRect(FONSatlas* atlas, int rw, int rh, int* rx, int* ry) +{ + int besth = atlas->height, bestw = atlas->width, besti = -1; + int bestx = -1, besty = -1, i; + + // Bottom left fit heuristic. + for (i = 0; i < atlas->nnodes; i++) { + int y = fons__atlasRectFits(atlas, i, rw, rh); + if (y != -1) { + if (y + rh < besth || (y + rh == besth && atlas->nodes[i].width < bestw)) { + besti = i; + bestw = atlas->nodes[i].width; + besth = y + rh; + bestx = atlas->nodes[i].x; + besty = y; + } + } + } + + if (besti == -1) + return 0; + + // Perform the actual packing. + if (fons__atlasAddSkylineLevel(atlas, besti, bestx, besty, rw, rh) == 0) + return 0; + + *rx = bestx; + *ry = besty; + + return 1; +} + +static void fons__addWhiteRect(FONScontext* stash, int w, int h) +{ + int x, y, gx, gy; + unsigned char* dst; + if (fons__atlasAddRect(stash->atlas, w, h, &gx, &gy) == 0) + return; + + // Rasterize + dst = &stash->texData[gx + gy * stash->params.width]; + for (y = 0; y < h; y++) { + for (x = 0; x < w; x++) + dst[x] = 0xff; + dst += stash->params.width; + } + + stash->dirtyRect[0] = fons__mini(stash->dirtyRect[0], gx); + stash->dirtyRect[1] = fons__mini(stash->dirtyRect[1], gy); + stash->dirtyRect[2] = fons__maxi(stash->dirtyRect[2], gx+w); + stash->dirtyRect[3] = fons__maxi(stash->dirtyRect[3], gy+h); +} + +FONScontext* fonsCreateInternal(FONSparams* params) +{ + FONScontext* stash = NULL; + + // Allocate memory for the font stash. + stash = (FONScontext*)malloc(sizeof(FONScontext)); + if (stash == NULL) goto error; + memset(stash, 0, sizeof(FONScontext)); + + stash->params = *params; + + // Allocate scratch buffer. + stash->scratch = (unsigned char*)malloc(FONS_SCRATCH_BUF_SIZE); + if (stash->scratch == NULL) goto error; + + // Initialize implementation library + if (!fons__tt_init(stash)) goto error; + + if (stash->params.renderCreate != NULL) { + if (stash->params.renderCreate(stash->params.userPtr, stash->params.width, stash->params.height) == 0) + goto error; + } + + stash->atlas = fons__allocAtlas(stash->params.width, stash->params.height, FONS_INIT_ATLAS_NODES); + if (stash->atlas == NULL) goto error; + + // Allocate space for fonts. + stash->fonts = (FONSfont**)malloc(sizeof(FONSfont*) * FONS_INIT_FONTS); + if (stash->fonts == NULL) goto error; + memset(stash->fonts, 0, sizeof(FONSfont*) * FONS_INIT_FONTS); + stash->cfonts = FONS_INIT_FONTS; + stash->nfonts = 0; + + // Create texture for the cache. + stash->itw = 1.0f/stash->params.width; + stash->ith = 1.0f/stash->params.height; + stash->texData = (unsigned char*)malloc(stash->params.width * stash->params.height); + if (stash->texData == NULL) goto error; + memset(stash->texData, 0, stash->params.width * stash->params.height); + + stash->dirtyRect[0] = stash->params.width; + stash->dirtyRect[1] = stash->params.height; + stash->dirtyRect[2] = 0; + stash->dirtyRect[3] = 0; + + // Add white rect at 0,0 for debug drawing. + fons__addWhiteRect(stash, 2,2); + + fonsPushState(stash); + fonsClearState(stash); + + return stash; + +error: + fonsDeleteInternal(stash); + return NULL; +} + +static FONSstate* fons__getState(FONScontext* stash) +{ + return &stash->states[stash->nstates-1]; +} + +int fonsAddFallbackFont(FONScontext* stash, int base, int fallback) +{ + FONSfont* baseFont = stash->fonts[base]; + if (baseFont->nfallbacks < FONS_MAX_FALLBACKS) { + baseFont->fallbacks[baseFont->nfallbacks++] = fallback; + return 1; + } + return 0; +} + +void fonsSetSize(FONScontext* stash, float size) +{ + fons__getState(stash)->size = size; +} + +void fonsSetColor(FONScontext* stash, unsigned int color) +{ + fons__getState(stash)->color = color; +} + +void fonsSetSpacing(FONScontext* stash, float spacing) +{ + fons__getState(stash)->spacing = spacing; +} + +void fonsSetBlur(FONScontext* stash, float blur) +{ + fons__getState(stash)->blur = blur; +} + +void fonsSetAlign(FONScontext* stash, int align) +{ + fons__getState(stash)->align = align; +} + +void fonsSetFont(FONScontext* stash, int font) +{ + fons__getState(stash)->font = font; +} + +void fonsPushState(FONScontext* stash) +{ + if (stash->nstates >= FONS_MAX_STATES) { + if (stash->handleError) + stash->handleError(stash->errorUptr, FONS_STATES_OVERFLOW, 0); + return; + } + if (stash->nstates > 0) + memcpy(&stash->states[stash->nstates], &stash->states[stash->nstates-1], sizeof(FONSstate)); + stash->nstates++; +} + +void fonsPopState(FONScontext* stash) +{ + if (stash->nstates <= 1) { + if (stash->handleError) + stash->handleError(stash->errorUptr, FONS_STATES_UNDERFLOW, 0); + return; + } + stash->nstates--; +} + +void fonsClearState(FONScontext* stash) +{ + FONSstate* state = fons__getState(stash); + state->size = 12.0f; + state->color = 0xffffffff; + state->font = 0; + state->blur = 0; + state->spacing = 0; + state->align = FONS_ALIGN_LEFT | FONS_ALIGN_BASELINE; +} + +static void fons__freeFont(FONSfont* font) +{ + if (font == NULL) return; + if (font->glyphs) free(font->glyphs); + if (font->freeData && font->data) free(font->data); + free(font); +} + +static int fons__allocFont(FONScontext* stash) +{ + FONSfont* font = NULL; + if (stash->nfonts+1 > stash->cfonts) { + stash->cfonts = stash->cfonts == 0 ? 8 : stash->cfonts * 2; + stash->fonts = (FONSfont**)realloc(stash->fonts, sizeof(FONSfont*) * stash->cfonts); + if (stash->fonts == NULL) + return -1; + } + font = (FONSfont*)malloc(sizeof(FONSfont)); + if (font == NULL) goto error; + memset(font, 0, sizeof(FONSfont)); + + font->glyphs = (FONSglyph*)malloc(sizeof(FONSglyph) * FONS_INIT_GLYPHS); + if (font->glyphs == NULL) goto error; + font->cglyphs = FONS_INIT_GLYPHS; + font->nglyphs = 0; + + stash->fonts[stash->nfonts++] = font; + return stash->nfonts-1; + +error: + fons__freeFont(font); + + return FONS_INVALID; +} + +int fonsAddFont(FONScontext* stash, const char* name, const char* path) +{ + FILE* fp = 0; + int dataSize = 0; + size_t readed; + unsigned char* data = NULL; + + // Read in the font data. + fp = fopen(path, "rb"); + if (fp == NULL) goto error; + fseek(fp,0,SEEK_END); + dataSize = (int)ftell(fp); + fseek(fp,0,SEEK_SET); + data = (unsigned char*)malloc(dataSize); + if (data == NULL) goto error; + readed = fread(data, 1, dataSize, fp); + fclose(fp); + fp = 0; + if ((int)readed != dataSize) goto error; + + return fonsAddFontMem(stash, name, data, dataSize, 1); + +error: + if (data) free(data); + if (fp) fclose(fp); + return FONS_INVALID; +} + +int fonsAddFontMem(FONScontext* stash, const char* name, unsigned char* data, int dataSize, int freeData) +{ + int i, ascent, descent, fh, lineGap; + FONSfont* font; + + int idx = fons__allocFont(stash); + if (idx == FONS_INVALID) + return FONS_INVALID; + + font = stash->fonts[idx]; + + strncpy(font->name, name, sizeof(font->name)); + font->name[sizeof(font->name)-1] = '\0'; + + // Init hash lookup. + for (i = 0; i < FONS_HASH_LUT_SIZE; ++i) + font->lut[i] = -1; + + // Read in the font data. + font->dataSize = dataSize; + font->data = data; + font->freeData = (unsigned char)freeData; + + // Init font + stash->nscratch = 0; + if (!fons__tt_loadFont(stash, &font->font, data, dataSize)) goto error; + + // Store normalized line height. The real line height is got + // by multiplying the lineh by font size. + fons__tt_getFontVMetrics( &font->font, &ascent, &descent, &lineGap); + fh = ascent - descent; + font->ascender = (float)ascent / (float)fh; + font->descender = (float)descent / (float)fh; + font->lineh = (float)(fh + lineGap) / (float)fh; + + return idx; + +error: + fons__freeFont(font); + stash->nfonts--; + return FONS_INVALID; +} + +int fonsGetFontByName(FONScontext* s, const char* name) +{ + int i; + for (i = 0; i < s->nfonts; i++) { + if (strcmp(s->fonts[i]->name, name) == 0) + return i; + } + return FONS_INVALID; +} + + +static FONSglyph* fons__allocGlyph(FONSfont* font) +{ + if (font->nglyphs+1 > font->cglyphs) { + font->cglyphs = font->cglyphs == 0 ? 8 : font->cglyphs * 2; + font->glyphs = (FONSglyph*)realloc(font->glyphs, sizeof(FONSglyph) * font->cglyphs); + if (font->glyphs == NULL) return NULL; + } + font->nglyphs++; + return &font->glyphs[font->nglyphs-1]; +} + + +// Based on Exponential blur, Jani Huhtanen, 2006 + +#define APREC 16 +#define ZPREC 7 + +static void fons__blurCols(unsigned char* dst, int w, int h, int dstStride, int alpha) +{ + int x, y; + for (y = 0; y < h; y++) { + int z = 0; // force zero border + for (x = 1; x < w; x++) { + z += (alpha * (((int)(dst[x]) << ZPREC) - z)) >> APREC; + dst[x] = (unsigned char)(z >> ZPREC); + } + dst[w-1] = 0; // force zero border + z = 0; + for (x = w-2; x >= 0; x--) { + z += (alpha * (((int)(dst[x]) << ZPREC) - z)) >> APREC; + dst[x] = (unsigned char)(z >> ZPREC); + } + dst[0] = 0; // force zero border + dst += dstStride; + } +} + +static void fons__blurRows(unsigned char* dst, int w, int h, int dstStride, int alpha) +{ + int x, y; + for (x = 0; x < w; x++) { + int z = 0; // force zero border + for (y = dstStride; y < h*dstStride; y += dstStride) { + z += (alpha * (((int)(dst[y]) << ZPREC) - z)) >> APREC; + dst[y] = (unsigned char)(z >> ZPREC); + } + dst[(h-1)*dstStride] = 0; // force zero border + z = 0; + for (y = (h-2)*dstStride; y >= 0; y -= dstStride) { + z += (alpha * (((int)(dst[y]) << ZPREC) - z)) >> APREC; + dst[y] = (unsigned char)(z >> ZPREC); + } + dst[0] = 0; // force zero border + dst++; + } +} + + +static void fons__blur(FONScontext* stash, unsigned char* dst, int w, int h, int dstStride, int blur) +{ + int alpha; + float sigma; + (void)stash; + + if (blur < 1) + return; + // Calculate the alpha such that 90% of the kernel is within the radius. (Kernel extends to infinity) + sigma = (float)blur * 0.57735f; // 1 / sqrt(3) + alpha = (int)((1< 20) iblur = 20; + pad = iblur+2; + + // Reset allocator. + stash->nscratch = 0; + + // Find code point and size. + h = fons__hashint(codepoint) & (FONS_HASH_LUT_SIZE-1); + i = font->lut[h]; + while (i != -1) { + if (font->glyphs[i].codepoint == codepoint && font->glyphs[i].size == isize && font->glyphs[i].blur == iblur) { + glyph = &font->glyphs[i]; + if (bitmapOption == FONS_GLYPH_BITMAP_OPTIONAL || (glyph->x0 >= 0 && glyph->y0 >= 0)) { + return glyph; + } + // At this point, glyph exists but the bitmap data is not yet created. + break; + } + i = font->glyphs[i].next; + } + + // Create a new glyph or rasterize bitmap data for a cached glyph. + g = fons__tt_getGlyphIndex(&font->font, codepoint); + // Try to find the glyph in fallback fonts. + if (g == 0) { + for (i = 0; i < font->nfallbacks; ++i) { + FONSfont* fallbackFont = stash->fonts[font->fallbacks[i]]; + int fallbackIndex = fons__tt_getGlyphIndex(&fallbackFont->font, codepoint); + if (fallbackIndex != 0) { + g = fallbackIndex; + renderFont = fallbackFont; + break; + } + } + // It is possible that we did not find a fallback glyph. + // In that case the glyph index 'g' is 0, and we'll proceed below and cache empty glyph. + } + scale = fons__tt_getPixelHeightScale(&renderFont->font, size); + fons__tt_buildGlyphBitmap(&renderFont->font, g, size, scale, &advance, &lsb, &x0, &y0, &x1, &y1); + gw = x1-x0 + pad*2; + gh = y1-y0 + pad*2; + + // Determines the spot to draw glyph in the atlas. + if (bitmapOption == FONS_GLYPH_BITMAP_REQUIRED) { + // Find free spot for the rect in the atlas + added = fons__atlasAddRect(stash->atlas, gw, gh, &gx, &gy); + if (added == 0 && stash->handleError != NULL) { + // Atlas is full, let the user to resize the atlas (or not), and try again. + stash->handleError(stash->errorUptr, FONS_ATLAS_FULL, 0); + added = fons__atlasAddRect(stash->atlas, gw, gh, &gx, &gy); + } + if (added == 0) return NULL; + } else { + // Negative coordinate indicates there is no bitmap data created. + gx = -1; + gy = -1; + } + + // Init glyph. + if (glyph == NULL) { + glyph = fons__allocGlyph(font); + glyph->codepoint = codepoint; + glyph->size = isize; + glyph->blur = iblur; + glyph->next = 0; + + // Insert char to hash lookup. + glyph->next = font->lut[h]; + font->lut[h] = font->nglyphs-1; + } + glyph->index = g; + glyph->x0 = (short)gx; + glyph->y0 = (short)gy; + glyph->x1 = (short)(glyph->x0+gw); + glyph->y1 = (short)(glyph->y0+gh); + glyph->xadv = (short)(scale * advance * 10.0f); + glyph->xoff = (short)(x0 - pad); + glyph->yoff = (short)(y0 - pad); + + if (bitmapOption == FONS_GLYPH_BITMAP_OPTIONAL) { + return glyph; + } + + // Rasterize + dst = &stash->texData[(glyph->x0+pad) + (glyph->y0+pad) * stash->params.width]; + fons__tt_renderGlyphBitmap(&renderFont->font, dst, gw-pad*2,gh-pad*2, stash->params.width, scale, scale, g); + + // Make sure there is one pixel empty border. + dst = &stash->texData[glyph->x0 + glyph->y0 * stash->params.width]; + for (y = 0; y < gh; y++) { + dst[y*stash->params.width] = 0; + dst[gw-1 + y*stash->params.width] = 0; + } + for (x = 0; x < gw; x++) { + dst[x] = 0; + dst[x + (gh-1)*stash->params.width] = 0; + } + + // Debug code to color the glyph background +/* unsigned char* fdst = &stash->texData[glyph->x0 + glyph->y0 * stash->params.width]; + for (y = 0; y < gh; y++) { + for (x = 0; x < gw; x++) { + int a = (int)fdst[x+y*stash->params.width] + 20; + if (a > 255) a = 255; + fdst[x+y*stash->params.width] = a; + } + }*/ + + // Blur + if (iblur > 0) { + stash->nscratch = 0; + bdst = &stash->texData[glyph->x0 + glyph->y0 * stash->params.width]; + fons__blur(stash, bdst, gw, gh, stash->params.width, iblur); + } + + stash->dirtyRect[0] = fons__mini(stash->dirtyRect[0], glyph->x0); + stash->dirtyRect[1] = fons__mini(stash->dirtyRect[1], glyph->y0); + stash->dirtyRect[2] = fons__maxi(stash->dirtyRect[2], glyph->x1); + stash->dirtyRect[3] = fons__maxi(stash->dirtyRect[3], glyph->y1); + + return glyph; +} + +static void fons__getQuad(FONScontext* stash, FONSfont* font, + int prevGlyphIndex, FONSglyph* glyph, + float scale, float spacing, float* x, float* y, FONSquad* q) +{ + float rx,ry,xoff,yoff,x0,y0,x1,y1; + + if (prevGlyphIndex != -1) { + float adv = fons__tt_getGlyphKernAdvance(&font->font, prevGlyphIndex, glyph->index) * scale; + *x += (int)(adv + spacing + 0.5f); + } + + // Each glyph has 2px border to allow good interpolation, + // one pixel to prevent leaking, and one to allow good interpolation for rendering. + // Inset the texture region by one pixel for correct interpolation. + xoff = (short)(glyph->xoff+1); + yoff = (short)(glyph->yoff+1); + x0 = (float)(glyph->x0+1); + y0 = (float)(glyph->y0+1); + x1 = (float)(glyph->x1-1); + y1 = (float)(glyph->y1-1); + + if (stash->params.flags & FONS_ZERO_TOPLEFT) { + rx = (float)(int)(*x + xoff); + ry = (float)(int)(*y + yoff); + + q->x0 = rx; + q->y0 = ry; + q->x1 = rx + x1 - x0; + q->y1 = ry + y1 - y0; + + q->s0 = x0 * stash->itw; + q->t0 = y0 * stash->ith; + q->s1 = x1 * stash->itw; + q->t1 = y1 * stash->ith; + } else { + rx = (float)(int)(*x + xoff); + ry = (float)(int)(*y - yoff); + + q->x0 = rx; + q->y0 = ry; + q->x1 = rx + x1 - x0; + q->y1 = ry - y1 + y0; + + q->s0 = x0 * stash->itw; + q->t0 = y0 * stash->ith; + q->s1 = x1 * stash->itw; + q->t1 = y1 * stash->ith; + } + + *x += (int)(glyph->xadv / 10.0f + 0.5f); +} + +static void fons__flush(FONScontext* stash) +{ + // Flush texture + if (stash->dirtyRect[0] < stash->dirtyRect[2] && stash->dirtyRect[1] < stash->dirtyRect[3]) { + if (stash->params.renderUpdate != NULL) + stash->params.renderUpdate(stash->params.userPtr, stash->dirtyRect, stash->texData); + // Reset dirty rect + stash->dirtyRect[0] = stash->params.width; + stash->dirtyRect[1] = stash->params.height; + stash->dirtyRect[2] = 0; + stash->dirtyRect[3] = 0; + } + + // Flush triangles + if (stash->nverts > 0) { + if (stash->params.renderDraw != NULL) + stash->params.renderDraw(stash->params.userPtr, stash->verts, stash->tcoords, stash->colors, stash->nverts); + stash->nverts = 0; + } +} + +static __inline void fons__vertex(FONScontext* stash, float x, float y, float s, float t, unsigned int c) +{ + stash->verts[stash->nverts*2+0] = x; + stash->verts[stash->nverts*2+1] = y; + stash->tcoords[stash->nverts*2+0] = s; + stash->tcoords[stash->nverts*2+1] = t; + stash->colors[stash->nverts] = c; + stash->nverts++; +} + +static float fons__getVertAlign(FONScontext* stash, FONSfont* font, int align, short isize) +{ + if (stash->params.flags & FONS_ZERO_TOPLEFT) { + if (align & FONS_ALIGN_TOP) { + return font->ascender * (float)isize/10.0f; + } else if (align & FONS_ALIGN_MIDDLE) { + return (font->ascender + font->descender) / 2.0f * (float)isize/10.0f; + } else if (align & FONS_ALIGN_BASELINE) { + return 0.0f; + } else if (align & FONS_ALIGN_BOTTOM) { + return font->descender * (float)isize/10.0f; + } + } else { + if (align & FONS_ALIGN_TOP) { + return -font->ascender * (float)isize/10.0f; + } else if (align & FONS_ALIGN_MIDDLE) { + return -(font->ascender + font->descender) / 2.0f * (float)isize/10.0f; + } else if (align & FONS_ALIGN_BASELINE) { + return 0.0f; + } else if (align & FONS_ALIGN_BOTTOM) { + return -font->descender * (float)isize/10.0f; + } + } + return 0.0; +} + +float fonsDrawText(FONScontext* stash, + float x, float y, + const char* str, const char* end) +{ + FONSstate* state = fons__getState(stash); + unsigned int codepoint; + unsigned int utf8state = 0; + FONSglyph* glyph = NULL; + FONSquad q; + int prevGlyphIndex = -1; + short isize = (short)(state->size*10.0f); + short iblur = (short)state->blur; + float scale; + FONSfont* font; + float width; + + if (stash == NULL) return x; + if (state->font < 0 || state->font >= stash->nfonts) return x; + font = stash->fonts[state->font]; + if (font->data == NULL) return x; + + scale = fons__tt_getPixelHeightScale(&font->font, (float)isize/10.0f); + + if (end == NULL) + end = str + strlen(str); + + // Align horizontally + if (state->align & FONS_ALIGN_LEFT) { + // empty + } else if (state->align & FONS_ALIGN_RIGHT) { + width = fonsTextBounds(stash, x,y, str, end, NULL); + x -= width; + } else if (state->align & FONS_ALIGN_CENTER) { + width = fonsTextBounds(stash, x,y, str, end, NULL); + x -= width * 0.5f; + } + // Align vertically. + y += fons__getVertAlign(stash, font, state->align, isize); + + for (; str != end; ++str) { + if (fons__decutf8(&utf8state, &codepoint, *(const unsigned char*)str)) + continue; + glyph = fons__getGlyph(stash, font, codepoint, isize, iblur, FONS_GLYPH_BITMAP_REQUIRED); + if (glyph != NULL) { + fons__getQuad(stash, font, prevGlyphIndex, glyph, scale, state->spacing, &x, &y, &q); + + if (stash->nverts+6 > FONS_VERTEX_COUNT) + fons__flush(stash); + + fons__vertex(stash, q.x0, q.y0, q.s0, q.t0, state->color); + fons__vertex(stash, q.x1, q.y1, q.s1, q.t1, state->color); + fons__vertex(stash, q.x1, q.y0, q.s1, q.t0, state->color); + + fons__vertex(stash, q.x0, q.y0, q.s0, q.t0, state->color); + fons__vertex(stash, q.x0, q.y1, q.s0, q.t1, state->color); + fons__vertex(stash, q.x1, q.y1, q.s1, q.t1, state->color); + } + prevGlyphIndex = glyph != NULL ? glyph->index : -1; + } + fons__flush(stash); + + return x; +} + +int fonsTextIterInit(FONScontext* stash, FONStextIter* iter, + float x, float y, const char* str, const char* end, int bitmapOption) +{ + FONSstate* state = fons__getState(stash); + float width; + + memset(iter, 0, sizeof(*iter)); + + if (stash == NULL) return 0; + if (state->font < 0 || state->font >= stash->nfonts) return 0; + iter->font = stash->fonts[state->font]; + if (iter->font->data == NULL) return 0; + + iter->isize = (short)(state->size*10.0f); + iter->iblur = (short)state->blur; + iter->scale = fons__tt_getPixelHeightScale(&iter->font->font, (float)iter->isize/10.0f); + + // Align horizontally + if (state->align & FONS_ALIGN_LEFT) { + // empty + } else if (state->align & FONS_ALIGN_RIGHT) { + width = fonsTextBounds(stash, x,y, str, end, NULL); + x -= width; + } else if (state->align & FONS_ALIGN_CENTER) { + width = fonsTextBounds(stash, x,y, str, end, NULL); + x -= width * 0.5f; + } + // Align vertically. + y += fons__getVertAlign(stash, iter->font, state->align, iter->isize); + + if (end == NULL) + end = str + strlen(str); + + iter->x = iter->nextx = x; + iter->y = iter->nexty = y; + iter->spacing = state->spacing; + iter->str = str; + iter->next = str; + iter->end = end; + iter->codepoint = 0; + iter->prevGlyphIndex = -1; + iter->bitmapOption = bitmapOption; + + return 1; +} + +int fonsTextIterNext(FONScontext* stash, FONStextIter* iter, FONSquad* quad) +{ + FONSglyph* glyph = NULL; + const char* str = iter->next; + iter->str = iter->next; + + if (str == iter->end) + return 0; + + for (; str != iter->end; str++) { + if (fons__decutf8(&iter->utf8state, &iter->codepoint, *(const unsigned char*)str)) + continue; + str++; + // Get glyph and quad + iter->x = iter->nextx; + iter->y = iter->nexty; + glyph = fons__getGlyph(stash, iter->font, iter->codepoint, iter->isize, iter->iblur, iter->bitmapOption); + // If the iterator was initialized with FONS_GLYPH_BITMAP_OPTIONAL, then the UV coordinates of the quad will be invalid. + if (glyph != NULL) + fons__getQuad(stash, iter->font, iter->prevGlyphIndex, glyph, iter->scale, iter->spacing, &iter->nextx, &iter->nexty, quad); + iter->prevGlyphIndex = glyph != NULL ? glyph->index : -1; + break; + } + iter->next = str; + + return 1; +} + +void fonsDrawDebug(FONScontext* stash, float x, float y) +{ + int i; + int w = stash->params.width; + int h = stash->params.height; + float u = w == 0 ? 0 : (1.0f / w); + float v = h == 0 ? 0 : (1.0f / h); + + if (stash->nverts+6+6 > FONS_VERTEX_COUNT) + fons__flush(stash); + + // Draw background + fons__vertex(stash, x+0, y+0, u, v, 0x0fffffff); + fons__vertex(stash, x+w, y+h, u, v, 0x0fffffff); + fons__vertex(stash, x+w, y+0, u, v, 0x0fffffff); + + fons__vertex(stash, x+0, y+0, u, v, 0x0fffffff); + fons__vertex(stash, x+0, y+h, u, v, 0x0fffffff); + fons__vertex(stash, x+w, y+h, u, v, 0x0fffffff); + + // Draw texture + fons__vertex(stash, x+0, y+0, 0, 0, 0xffffffff); + fons__vertex(stash, x+w, y+h, 1, 1, 0xffffffff); + fons__vertex(stash, x+w, y+0, 1, 0, 0xffffffff); + + fons__vertex(stash, x+0, y+0, 0, 0, 0xffffffff); + fons__vertex(stash, x+0, y+h, 0, 1, 0xffffffff); + fons__vertex(stash, x+w, y+h, 1, 1, 0xffffffff); + + // Drawbug draw atlas + for (i = 0; i < stash->atlas->nnodes; i++) { + FONSatlasNode* n = &stash->atlas->nodes[i]; + + if (stash->nverts+6 > FONS_VERTEX_COUNT) + fons__flush(stash); + + fons__vertex(stash, x+n->x+0, y+n->y+0, u, v, 0xc00000ff); + fons__vertex(stash, x+n->x+n->width, y+n->y+1, u, v, 0xc00000ff); + fons__vertex(stash, x+n->x+n->width, y+n->y+0, u, v, 0xc00000ff); + + fons__vertex(stash, x+n->x+0, y+n->y+0, u, v, 0xc00000ff); + fons__vertex(stash, x+n->x+0, y+n->y+1, u, v, 0xc00000ff); + fons__vertex(stash, x+n->x+n->width, y+n->y+1, u, v, 0xc00000ff); + } + + fons__flush(stash); +} + +float fonsTextBounds(FONScontext* stash, + float x, float y, + const char* str, const char* end, + float* bounds) +{ + FONSstate* state = fons__getState(stash); + unsigned int codepoint; + unsigned int utf8state = 0; + FONSquad q; + FONSglyph* glyph = NULL; + int prevGlyphIndex = -1; + short isize = (short)(state->size*10.0f); + short iblur = (short)state->blur; + float scale; + FONSfont* font; + float startx, advance; + float minx, miny, maxx, maxy; + + if (stash == NULL) return 0; + if (state->font < 0 || state->font >= stash->nfonts) return 0; + font = stash->fonts[state->font]; + if (font->data == NULL) return 0; + + scale = fons__tt_getPixelHeightScale(&font->font, (float)isize/10.0f); + + // Align vertically. + y += fons__getVertAlign(stash, font, state->align, isize); + + minx = maxx = x; + miny = maxy = y; + startx = x; + + if (end == NULL) + end = str + strlen(str); + + for (; str != end; ++str) { + if (fons__decutf8(&utf8state, &codepoint, *(const unsigned char*)str)) + continue; + glyph = fons__getGlyph(stash, font, codepoint, isize, iblur, FONS_GLYPH_BITMAP_OPTIONAL); + if (glyph != NULL) { + fons__getQuad(stash, font, prevGlyphIndex, glyph, scale, state->spacing, &x, &y, &q); + if (q.x0 < minx) minx = q.x0; + if (q.x1 > maxx) maxx = q.x1; + if (stash->params.flags & FONS_ZERO_TOPLEFT) { + if (q.y0 < miny) miny = q.y0; + if (q.y1 > maxy) maxy = q.y1; + } else { + if (q.y1 < miny) miny = q.y1; + if (q.y0 > maxy) maxy = q.y0; + } + } + prevGlyphIndex = glyph != NULL ? glyph->index : -1; + } + + advance = x - startx; + + // Align horizontally + if (state->align & FONS_ALIGN_LEFT) { + // empty + } else if (state->align & FONS_ALIGN_RIGHT) { + minx -= advance; + maxx -= advance; + } else if (state->align & FONS_ALIGN_CENTER) { + minx -= advance * 0.5f; + maxx -= advance * 0.5f; + } + + if (bounds) { + bounds[0] = minx; + bounds[1] = miny; + bounds[2] = maxx; + bounds[3] = maxy; + } + + return advance; +} + +void fonsVertMetrics(FONScontext* stash, + float* ascender, float* descender, float* lineh) +{ + FONSfont* font; + FONSstate* state = fons__getState(stash); + short isize; + + if (stash == NULL) return; + if (state->font < 0 || state->font >= stash->nfonts) return; + font = stash->fonts[state->font]; + isize = (short)(state->size*10.0f); + if (font->data == NULL) return; + + if (ascender) + *ascender = font->ascender*isize/10.0f; + if (descender) + *descender = font->descender*isize/10.0f; + if (lineh) + *lineh = font->lineh*isize/10.0f; +} + +void fonsLineBounds(FONScontext* stash, float y, float* miny, float* maxy) +{ + FONSfont* font; + FONSstate* state = fons__getState(stash); + short isize; + + if (stash == NULL) return; + if (state->font < 0 || state->font >= stash->nfonts) return; + font = stash->fonts[state->font]; + isize = (short)(state->size*10.0f); + if (font->data == NULL) return; + + y += fons__getVertAlign(stash, font, state->align, isize); + + if (stash->params.flags & FONS_ZERO_TOPLEFT) { + *miny = y - font->ascender * (float)isize/10.0f; + *maxy = *miny + font->lineh*isize/10.0f; + } else { + *maxy = y + font->descender * (float)isize/10.0f; + *miny = *maxy - font->lineh*isize/10.0f; + } +} + +const unsigned char* fonsGetTextureData(FONScontext* stash, int* width, int* height) +{ + if (width != NULL) + *width = stash->params.width; + if (height != NULL) + *height = stash->params.height; + return stash->texData; +} + +int fonsValidateTexture(FONScontext* stash, int* dirty) +{ + if (stash->dirtyRect[0] < stash->dirtyRect[2] && stash->dirtyRect[1] < stash->dirtyRect[3]) { + dirty[0] = stash->dirtyRect[0]; + dirty[1] = stash->dirtyRect[1]; + dirty[2] = stash->dirtyRect[2]; + dirty[3] = stash->dirtyRect[3]; + // Reset dirty rect + stash->dirtyRect[0] = stash->params.width; + stash->dirtyRect[1] = stash->params.height; + stash->dirtyRect[2] = 0; + stash->dirtyRect[3] = 0; + return 1; + } + return 0; +} + +void fonsDeleteInternal(FONScontext* stash) +{ + int i; + if (stash == NULL) return; + + if (stash->params.renderDelete) + stash->params.renderDelete(stash->params.userPtr); + + for (i = 0; i < stash->nfonts; ++i) + fons__freeFont(stash->fonts[i]); + + if (stash->atlas) fons__deleteAtlas(stash->atlas); + if (stash->fonts) free(stash->fonts); + if (stash->texData) free(stash->texData); + if (stash->scratch) free(stash->scratch); + free(stash); + fons__tt_done(stash); +} + +void fonsSetErrorCallback(FONScontext* stash, void (*callback)(void* uptr, int error, int val), void* uptr) +{ + if (stash == NULL) return; + stash->handleError = callback; + stash->errorUptr = uptr; +} + +void fonsGetAtlasSize(FONScontext* stash, int* width, int* height) +{ + if (stash == NULL) return; + *width = stash->params.width; + *height = stash->params.height; +} + +int fonsExpandAtlas(FONScontext* stash, int width, int height) +{ + int i, maxy = 0; + unsigned char* data = NULL; + if (stash == NULL) return 0; + + width = fons__maxi(width, stash->params.width); + height = fons__maxi(height, stash->params.height); + + if (width == stash->params.width && height == stash->params.height) + return 1; + + // Flush pending glyphs. + fons__flush(stash); + + // Create new texture + if (stash->params.renderResize != NULL) { + if (stash->params.renderResize(stash->params.userPtr, width, height) == 0) + return 0; + } + // Copy old texture data over. + data = (unsigned char*)malloc(width * height); + if (data == NULL) + return 0; + for (i = 0; i < stash->params.height; i++) { + unsigned char* dst = &data[i*width]; + unsigned char* src = &stash->texData[i*stash->params.width]; + memcpy(dst, src, stash->params.width); + if (width > stash->params.width) + memset(dst+stash->params.width, 0, width - stash->params.width); + } + if (height > stash->params.height) + memset(&data[stash->params.height * width], 0, (height - stash->params.height) * width); + + free(stash->texData); + stash->texData = data; + + // Increase atlas size + fons__atlasExpand(stash->atlas, width, height); + + // Add existing data as dirty. + for (i = 0; i < stash->atlas->nnodes; i++) + maxy = fons__maxi(maxy, stash->atlas->nodes[i].y); + stash->dirtyRect[0] = 0; + stash->dirtyRect[1] = 0; + stash->dirtyRect[2] = stash->params.width; + stash->dirtyRect[3] = maxy; + + stash->params.width = width; + stash->params.height = height; + stash->itw = 1.0f/stash->params.width; + stash->ith = 1.0f/stash->params.height; + + return 1; +} + +int fonsResetAtlas(FONScontext* stash, int width, int height) +{ + int i, j; + if (stash == NULL) return 0; + + // Flush pending glyphs. + fons__flush(stash); + + // Create new texture + if (stash->params.renderResize != NULL) { + if (stash->params.renderResize(stash->params.userPtr, width, height) == 0) + return 0; + } + + // Reset atlas + fons__atlasReset(stash->atlas, width, height); + + // Clear texture data. + stash->texData = (unsigned char*)realloc(stash->texData, width * height); + if (stash->texData == NULL) return 0; + memset(stash->texData, 0, width * height); + + // Reset dirty rect + stash->dirtyRect[0] = width; + stash->dirtyRect[1] = height; + stash->dirtyRect[2] = 0; + stash->dirtyRect[3] = 0; + + // Reset cached glyphs + for (i = 0; i < stash->nfonts; i++) { + FONSfont* font = stash->fonts[i]; + font->nglyphs = 0; + for (j = 0; j < FONS_HASH_LUT_SIZE; j++) + font->lut[j] = -1; + } + + stash->params.width = width; + stash->params.height = height; + stash->itw = 1.0f/stash->params.width; + stash->ith = 1.0f/stash->params.height; + + // Add white rect at 0,0 for debug drawing. + fons__addWhiteRect(stash, 2,2); + + return 1; +} + + +#endif diff --git a/Polyfills/Canvas/Source/nanovg/nanovg.cpp b/Polyfills/Canvas/Source/nanovg/nanovg.cpp new file mode 100644 index 000000000..541ea0faf --- /dev/null +++ b/Polyfills/Canvas/Source/nanovg/nanovg.cpp @@ -0,0 +1,2971 @@ +// +// Copyright (c) 2013 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#include +#include +#include +#include + +#include "nanovg.h" + +#include +#include "nanovg_filterstack.h" + +BX_PRAGMA_DIAGNOSTIC_IGNORED_MSVC(4701) // error C4701: potentially uninitialized local variable 'cint' used +// -Wunused-function and 4505 must be file scope, can't be disabled between push/pop. +BX_PRAGMA_DIAGNOSTIC_IGNORED_CLANG_GCC("-Wunused-function"); +BX_PRAGMA_DIAGNOSTIC_IGNORED_MSVC(4505) // error C4505: '' : unreferenced local function has been removed + +BX_PRAGMA_DIAGNOSTIC_PUSH(); +BX_PRAGMA_DIAGNOSTIC_IGNORED_CLANG_GCC("-Wunused-parameter"); +BX_PRAGMA_DIAGNOSTIC_IGNORED_GCC("-Wunused-result"); +#define FONTSTASH_IMPLEMENTATION +#define FONS_SDF_PADDING 32 +#include "fontstash.h" +BX_PRAGMA_DIAGNOSTIC_POP(); + +#ifdef _MSC_VER +#pragma warning(disable: 4100) // unreferenced formal parameter +#pragma warning(disable: 4127) // conditional expression is constant +#pragma warning(disable: 4204) // nonstandard extension used : non-constant aggregate initializer +#pragma warning(disable: 4706) // assignment within conditional expression +#endif + +#define NVG_INIT_FONTIMAGE_SIZE 512 +#define NVG_MAX_FONTIMAGE_SIZE 2048 +#define NVG_MAX_FONTIMAGES 4 + +#define NVG_INIT_COMMANDS_SIZE 256 +#define NVG_INIT_POINTS_SIZE 128 +#define NVG_INIT_PATHS_SIZE 16 +#define NVG_INIT_VERTS_SIZE 256 +#define NVG_MAX_STATES 32 + +#define NVG_KAPPA90 0.5522847493f // Length proportional to radius of a cubic bezier handle for 90deg arcs. + +#define NVG_COUNTOF(arr) (sizeof(arr) / sizeof(0[arr])) + + +enum NVGcommands { + NVG_MOVETO = 0, + NVG_LINETO = 1, + NVG_BEZIERTO = 2, + NVG_CLOSE = 3, + NVG_WINDING = 4, +}; + +enum NVGpointFlags +{ + NVG_PT_CORNER = 0x01, + NVG_PT_LEFT = 0x02, + NVG_PT_BEVEL = 0x04, + NVG_PR_INNERBEVEL = 0x08, +}; + +struct NVGstate { + NVGcompositeOperationState compositeOperation; + int shapeAntiAlias; + NVGpaint fill; + NVGpaint stroke; + float strokeWidth; + float miterLimit; + int lineJoin; + int lineCap; + float alpha; + float xform[6]; + NVGscissor scissor; + float fontSize; + float letterSpacing; + float lineHeight; + float fontBlur; + int textAlign; + int fontId; + nanovg_filterstack m_filterStack; +}; +typedef struct NVGstate NVGstate; + +struct NVGpoint { + float x,y; + float dx, dy; + float len; + float dmx, dmy; + unsigned char flags; +}; +typedef struct NVGpoint NVGpoint; + +struct NVGpathCache { + NVGpoint* points; + int npoints; + int cpoints; + NVGpath* paths; + int npaths; + int cpaths; + NVGvertex* verts; + int nverts; + int cverts; + float bounds[4]; +}; +typedef struct NVGpathCache NVGpathCache; + +struct NVGcontext { + NVGparams params; + float* commands; + int ccommands; + int ncommands; + float commandx, commandy; + NVGstate states[NVG_MAX_STATES]; + int nstates; + NVGpathCache* cache; + float tessTol; + float distTol; + float fringeWidth; + float devicePxRatio; + struct FONScontext* fs; + int fontImages[NVG_MAX_FONTIMAGES]; + int fontImageIdx; + int drawCallCount; + int fillTriCount; + int strokeTriCount; + int textTriCount; +}; + +static float nvg__sqrtf(float a) { return sqrtf(a); } +static float nvg__modf(float a, float b) { return fmodf(a, b); } +static float nvg__sinf(float a) { return sinf(a); } +static float nvg__cosf(float a) { return cosf(a); } +static float nvg__tanf(float a) { return tanf(a); } +static float nvg__atan2f(float a,float b) { return atan2f(a, b); } +static float nvg__acosf(float a) { return acosf(a); } + +static int nvg__mini(int a, int b) { return a < b ? a : b; } +static int nvg__maxi(int a, int b) { return a > b ? a : b; } +static int nvg__clampi(int a, int mn, int mx) { return a < mn ? mn : (a > mx ? mx : a); } +static float nvg__minf(float a, float b) { return a < b ? a : b; } +static float nvg__maxf(float a, float b) { return a > b ? a : b; } +static float nvg__absf(float a) { return a >= 0.0f ? a : -a; } +static float nvg__signf(float a) { return a >= 0.0f ? 1.0f : -1.0f; } +static float nvg__clampf(float a, float mn, float mx) { return a < mn ? mn : (a > mx ? mx : a); } +static float nvg__cross(float dx0, float dy0, float dx1, float dy1) { return dx1*dy0 - dx0*dy1; } + +static float nvg__normalize(float *x, float* y) +{ + float d = nvg__sqrtf((*x)*(*x) + (*y)*(*y)); + if (d > 1e-6f) { + float id = 1.0f / d; + *x *= id; + *y *= id; + } + return d; +} + + +static void nvg__deletePathCache(NVGpathCache* c) +{ + if (c == NULL) return; + if (c->points != NULL) free(c->points); + if (c->paths != NULL) free(c->paths); + if (c->verts != NULL) free(c->verts); + free(c); +} + +static NVGpathCache* nvg__allocPathCache(void) +{ + NVGpathCache* c = (NVGpathCache*)malloc(sizeof(NVGpathCache)); + if (c == NULL) goto error; + memset(c, 0, sizeof(NVGpathCache)); + + c->points = (NVGpoint*)malloc(sizeof(NVGpoint)*NVG_INIT_POINTS_SIZE); + if (!c->points) goto error; + c->npoints = 0; + c->cpoints = NVG_INIT_POINTS_SIZE; + + c->paths = (NVGpath*)malloc(sizeof(NVGpath)*NVG_INIT_PATHS_SIZE); + if (!c->paths) goto error; + c->npaths = 0; + c->cpaths = NVG_INIT_PATHS_SIZE; + + c->verts = (NVGvertex*)malloc(sizeof(NVGvertex)*NVG_INIT_VERTS_SIZE); + if (!c->verts) goto error; + c->nverts = 0; + c->cverts = NVG_INIT_VERTS_SIZE; + + return c; +error: + nvg__deletePathCache(c); + return NULL; +} + +static void nvg__setDevicePixelRatio(NVGcontext* ctx, float ratio) +{ + ctx->tessTol = 0.25f / ratio; + ctx->distTol = 0.01f / ratio; + ctx->fringeWidth = 1.0f / ratio; + ctx->devicePxRatio = ratio; +} + +static NVGcompositeOperationState nvg__compositeOperationState(int op) +{ + int sfactor, dfactor; + + if (op == NVG_SOURCE_OVER) + { + sfactor = NVG_ONE; + dfactor = NVG_ONE_MINUS_SRC_ALPHA; + } + else if (op == NVG_SOURCE_IN) + { + sfactor = NVG_DST_ALPHA; + dfactor = NVG_ZERO; + } + else if (op == NVG_SOURCE_OUT) + { + sfactor = NVG_ONE_MINUS_DST_ALPHA; + dfactor = NVG_ZERO; + } + else if (op == NVG_ATOP) + { + sfactor = NVG_DST_ALPHA; + dfactor = NVG_ONE_MINUS_SRC_ALPHA; + } + else if (op == NVG_DESTINATION_OVER) + { + sfactor = NVG_ONE_MINUS_DST_ALPHA; + dfactor = NVG_ONE; + } + else if (op == NVG_DESTINATION_IN) + { + sfactor = NVG_ZERO; + dfactor = NVG_SRC_ALPHA; + } + else if (op == NVG_DESTINATION_OUT) + { + sfactor = NVG_ZERO; + dfactor = NVG_ONE_MINUS_SRC_ALPHA; + } + else if (op == NVG_DESTINATION_ATOP) + { + sfactor = NVG_ONE_MINUS_DST_ALPHA; + dfactor = NVG_SRC_ALPHA; + } + else if (op == NVG_LIGHTER) + { + sfactor = NVG_ONE; + dfactor = NVG_ONE; + } + else if (op == NVG_COPY) + { + sfactor = NVG_ONE; + dfactor = NVG_ZERO; + } + else if (op == NVG_XOR) + { + sfactor = NVG_ONE_MINUS_DST_ALPHA; + dfactor = NVG_ONE_MINUS_SRC_ALPHA; + } + else + { + sfactor = NVG_ONE; + dfactor = NVG_ZERO; + } + + NVGcompositeOperationState state; + state.srcRGB = sfactor; + state.dstRGB = dfactor; + state.srcAlpha = sfactor; + state.dstAlpha = dfactor; + return state; +} + +static NVGstate* nvg__getState(NVGcontext* ctx) +{ + return &ctx->states[ctx->nstates-1]; +} + +NVGcontext* nvgCreateInternal(NVGparams* params) +{ + FONSparams fontParams; + NVGcontext* ctx = (NVGcontext*)malloc(sizeof(NVGcontext)); + int i; + if (ctx == NULL) goto error; + memset(ctx, 0, sizeof(NVGcontext)); + + ctx->params = *params; + for (i = 0; i < NVG_MAX_FONTIMAGES; i++) + ctx->fontImages[i] = 0; + + ctx->commands = (float*)malloc(sizeof(float)*NVG_INIT_COMMANDS_SIZE); + if (!ctx->commands) goto error; + ctx->ncommands = 0; + ctx->ccommands = NVG_INIT_COMMANDS_SIZE; + + ctx->cache = nvg__allocPathCache(); + if (ctx->cache == NULL) goto error; + + nvgSave(ctx); + nvgReset(ctx); + + nvg__setDevicePixelRatio(ctx, 1.0f); + + if (ctx->params.renderCreate(ctx->params.userPtr) == 0) goto error; + + // Init font rendering + memset(&fontParams, 0, sizeof(fontParams)); + fontParams.width = NVG_INIT_FONTIMAGE_SIZE; + fontParams.height = NVG_INIT_FONTIMAGE_SIZE; + fontParams.flags = FONS_ZERO_TOPLEFT; + fontParams.renderCreate = NULL; + fontParams.renderUpdate = NULL; + fontParams.renderDraw = NULL; + fontParams.renderDelete = NULL; + fontParams.userPtr = NULL; + ctx->fs = fonsCreateInternal(&fontParams); + if (ctx->fs == NULL) goto error; + + // Create font texture + ctx->fontImages[0] = ctx->params.renderCreateTexture(ctx->params.userPtr, NVG_TEXTURE_ALPHA, fontParams.width, fontParams.height, 0, NULL); + if (ctx->fontImages[0] == 0) goto error; + ctx->fontImageIdx = 0; + + return ctx; + +error: + nvgDeleteInternal(ctx); + return 0; +} + +NVGparams* nvgInternalParams(NVGcontext* ctx) +{ + return &ctx->params; +} + +void nvgDeleteInternal(NVGcontext* ctx) +{ + int i; + if (ctx == NULL) return; + if (ctx->commands != NULL) free(ctx->commands); + if (ctx->cache != NULL) nvg__deletePathCache(ctx->cache); + + if (ctx->fs) + fonsDeleteInternal(ctx->fs); + + for (i = 0; i < NVG_MAX_FONTIMAGES; i++) { + if (ctx->fontImages[i] != 0) { + nvgDeleteImage(ctx, ctx->fontImages[i]); + ctx->fontImages[i] = 0; + } + } + + if (ctx->params.renderDelete != NULL) + ctx->params.renderDelete(ctx->params.userPtr); + + free(ctx); +} + +void nvgBeginFrame(NVGcontext* ctx, float windowWidth, float windowHeight, float devicePixelRatio) +{ +/* printf("Tris: draws:%d fill:%d stroke:%d text:%d TOT:%d\n", + ctx->drawCallCount, ctx->fillTriCount, ctx->strokeTriCount, ctx->textTriCount, + ctx->fillTriCount+ctx->strokeTriCount+ctx->textTriCount);*/ + + ctx->nstates = 0; + nvgSave(ctx); + nvgReset(ctx); + + nvg__setDevicePixelRatio(ctx, devicePixelRatio); + + ctx->params.renderViewport(ctx->params.userPtr, windowWidth, windowHeight, devicePixelRatio); + + ctx->drawCallCount = 0; + ctx->fillTriCount = 0; + ctx->strokeTriCount = 0; + ctx->textTriCount = 0; +} + +void nvgCancelFrame(NVGcontext* ctx) +{ + ctx->params.renderCancel(ctx->params.userPtr); +} + +void nvgEndFrame(NVGcontext* ctx) +{ + ctx->params.renderFlush(ctx->params.userPtr); + if (ctx->fontImageIdx != 0) { + int fontImage = ctx->fontImages[ctx->fontImageIdx]; + int i, j, iw, ih; + // delete images that smaller than current one + if (fontImage == 0) + return; + nvgImageSize(ctx, fontImage, &iw, &ih); + for (i = j = 0; i < ctx->fontImageIdx; i++) { + if (ctx->fontImages[i] != 0) { + int nw, nh; + nvgImageSize(ctx, ctx->fontImages[i], &nw, &nh); + if (nw < iw || nh < ih) + nvgDeleteImage(ctx, ctx->fontImages[i]); + else + ctx->fontImages[j++] = ctx->fontImages[i]; + } + } + // make current font image to first + ctx->fontImages[j++] = ctx->fontImages[0]; + ctx->fontImages[0] = fontImage; + ctx->fontImageIdx = 0; + // clear all images after j + for (i = j; i < NVG_MAX_FONTIMAGES; i++) + ctx->fontImages[i] = 0; + } +} + +NVGcolor nvgRGB(unsigned char r, unsigned char g, unsigned char b) +{ + return nvgRGBA(r,g,b,255); +} + +NVGcolor nvgRGBf(float r, float g, float b) +{ + return nvgRGBAf(r,g,b,1.0f); +} + +NVGcolor nvgRGBA(unsigned char r, unsigned char g, unsigned char b, unsigned char a) +{ + NVGcolor color; + // Use longer initialization to suppress warning. + color.r = r / 255.0f; + color.g = g / 255.0f; + color.b = b / 255.0f; + color.a = a / 255.0f; + return color; +} + +NVGcolor nvgRGBAf(float r, float g, float b, float a) +{ + NVGcolor color; + // Use longer initialization to suppress warning. + color.r = r; + color.g = g; + color.b = b; + color.a = a; + return color; +} + +NVGcolor nvgTransRGBA(NVGcolor c, unsigned char a) +{ + c.a = a / 255.0f; + return c; +} + +NVGcolor nvgTransRGBAf(NVGcolor c, float a) +{ + c.a = a; + return c; +} + +NVGcolor nvgLerpRGBA(NVGcolor c0, NVGcolor c1, float u) +{ + int i; + float oneminu; + NVGcolor cint = {{{0}}}; + + u = nvg__clampf(u, 0.0f, 1.0f); + oneminu = 1.0f - u; + for( i = 0; i <4; i++ ) + { + cint.rgba[i] = c0.rgba[i] * oneminu + c1.rgba[i] * u; + } + + return cint; +} + +NVGcolor nvgHSL(float h, float s, float l) +{ + return nvgHSLA(h,s,l,255); +} + +static float nvg__hue(float h, float m1, float m2) +{ + if (h < 0) h += 1; + if (h > 1) h -= 1; + if (h < 1.0f/6.0f) + return m1 + (m2 - m1) * h * 6.0f; + else if (h < 3.0f/6.0f) + return m2; + else if (h < 4.0f/6.0f) + return m1 + (m2 - m1) * (2.0f/3.0f - h) * 6.0f; + return m1; +} + +NVGcolor nvgHSLA(float h, float s, float l, unsigned char a) +{ + float m1, m2; + NVGcolor col; + h = nvg__modf(h, 1.0f); + if (h < 0.0f) h += 1.0f; + s = nvg__clampf(s, 0.0f, 1.0f); + l = nvg__clampf(l, 0.0f, 1.0f); + m2 = l <= 0.5f ? (l * (1 + s)) : (l + s - l * s); + m1 = 2 * l - m2; + col.r = nvg__clampf(nvg__hue(h + 1.0f/3.0f, m1, m2), 0.0f, 1.0f); + col.g = nvg__clampf(nvg__hue(h, m1, m2), 0.0f, 1.0f); + col.b = nvg__clampf(nvg__hue(h - 1.0f/3.0f, m1, m2), 0.0f, 1.0f); + col.a = a/255.0f; + return col; +} + +void nvgTransformIdentity(float* t) +{ + t[0] = 1.0f; t[1] = 0.0f; + t[2] = 0.0f; t[3] = 1.0f; + t[4] = 0.0f; t[5] = 0.0f; +} + +void nvgTransformTranslate(float* t, float tx, float ty) +{ + t[0] = 1.0f; t[1] = 0.0f; + t[2] = 0.0f; t[3] = 1.0f; + t[4] = tx; t[5] = ty; +} + +void nvgTransformScale(float* t, float sx, float sy) +{ + t[0] = sx; t[1] = 0.0f; + t[2] = 0.0f; t[3] = sy; + t[4] = 0.0f; t[5] = 0.0f; +} + +void nvgTransformRotate(float* t, float a) +{ + float cs = nvg__cosf(a), sn = nvg__sinf(a); + t[0] = cs; t[1] = sn; + t[2] = -sn; t[3] = cs; + t[4] = 0.0f; t[5] = 0.0f; +} + +void nvgTransformSkewX(float* t, float a) +{ + t[0] = 1.0f; t[1] = 0.0f; + t[2] = nvg__tanf(a); t[3] = 1.0f; + t[4] = 0.0f; t[5] = 0.0f; +} + +void nvgTransformSkewY(float* t, float a) +{ + t[0] = 1.0f; t[1] = nvg__tanf(a); + t[2] = 0.0f; t[3] = 1.0f; + t[4] = 0.0f; t[5] = 0.0f; +} + +void nvgTransformMultiply(float* t, const float* s) +{ + float t0 = t[0] * s[0] + t[1] * s[2]; + float t2 = t[2] * s[0] + t[3] * s[2]; + float t4 = t[4] * s[0] + t[5] * s[2] + s[4]; + t[1] = t[0] * s[1] + t[1] * s[3]; + t[3] = t[2] * s[1] + t[3] * s[3]; + t[5] = t[4] * s[1] + t[5] * s[3] + s[5]; + t[0] = t0; + t[2] = t2; + t[4] = t4; +} + +void nvgTransformPremultiply(float* t, const float* s) +{ + float s2[6]; + memcpy(s2, s, sizeof(float)*6); + nvgTransformMultiply(s2, t); + memcpy(t, s2, sizeof(float)*6); +} + +int nvgTransformInverse(float* inv, const float* t) +{ + double invdet, det = (double)t[0] * t[3] - (double)t[2] * t[1]; + if (det > -1e-6 && det < 1e-6) { + nvgTransformIdentity(inv); + return 0; + } + invdet = 1.0 / det; + inv[0] = (float)(t[3] * invdet); + inv[2] = (float)(-t[2] * invdet); + inv[4] = (float)(((double)t[2] * t[5] - (double)t[3] * t[4]) * invdet); + inv[1] = (float)(-t[1] * invdet); + inv[3] = (float)(t[0] * invdet); + inv[5] = (float)(((double)t[1] * t[4] - (double)t[0] * t[5]) * invdet); + return 1; +} + +void nvgTransformPoint(float* dx, float* dy, const float* t, float sx, float sy) +{ + *dx = sx*t[0] + sy*t[2] + t[4]; + *dy = sx*t[1] + sy*t[3] + t[5]; +} + +float nvgDegToRad(float deg) +{ + return deg / 180.0f * NVG_PI; +} + +float nvgRadToDeg(float rad) +{ + return rad / NVG_PI * 180.0f; +} + +static void nvg__setPaintColor(NVGpaint* p, NVGcolor color) +{ + memset(p, 0, sizeof(*p)); + nvgTransformIdentity(p->xform); + p->radius = 0.0f; + p->feather = 1.0f; + p->innerColor = color; + p->outerColor = color; +} + + +// State handling +void nvgSave(NVGcontext* ctx) +{ + if (ctx->nstates >= NVG_MAX_STATES) + return; + if (ctx->nstates > 0) + memcpy(&ctx->states[ctx->nstates], &ctx->states[ctx->nstates-1], sizeof(NVGstate)); + ctx->nstates++; +} + +void nvgRestore(NVGcontext* ctx) +{ + if (ctx->nstates <= 1) + return; + ctx->nstates--; +} + +void nvgReset(NVGcontext* ctx) +{ + NVGstate* state = nvg__getState(ctx); + memset(state, 0, sizeof(*state)); + + nvg__setPaintColor(&state->fill, nvgRGBA(255,255,255,255)); + nvg__setPaintColor(&state->stroke, nvgRGBA(0,0,0,255)); + state->compositeOperation = nvg__compositeOperationState(NVG_SOURCE_OVER); + state->shapeAntiAlias = 1; + state->strokeWidth = 1.0f; + state->miterLimit = 10.0f; + state->lineCap = NVG_BUTT; + state->lineJoin = NVG_MITER; + state->alpha = 1.0f; + nvgTransformIdentity(state->xform); + + state->scissor.extent[0] = -1.0f; + state->scissor.extent[1] = -1.0f; + + state->fontSize = 16.0f; + state->letterSpacing = 0.0f; + state->lineHeight = 1.0f; + state->fontBlur = 0.0f; + state->textAlign = NVG_ALIGN_LEFT | NVG_ALIGN_BASELINE; + state->fontId = 0; + state->m_filterStack.Clear(); +} + +// State setting +void nvgShapeAntiAlias(NVGcontext* ctx, int enabled) +{ + NVGstate* state = nvg__getState(ctx); + state->shapeAntiAlias = enabled; +} + +void nvgStrokeWidth(NVGcontext* ctx, float width) +{ + NVGstate* state = nvg__getState(ctx); + state->strokeWidth = width; +} + +void nvgMiterLimit(NVGcontext* ctx, float limit) +{ + NVGstate* state = nvg__getState(ctx); + state->miterLimit = limit; +} + +void nvgLineCap(NVGcontext* ctx, int cap) +{ + NVGstate* state = nvg__getState(ctx); + state->lineCap = cap; +} + +void nvgLineJoin(NVGcontext* ctx, int join) +{ + NVGstate* state = nvg__getState(ctx); + state->lineJoin = join; +} + +void nvgGlobalAlpha(NVGcontext* ctx, float alpha) +{ + NVGstate* state = nvg__getState(ctx); + state->alpha = alpha; +} + +void nvgTransform(NVGcontext* ctx, float a, float b, float c, float d, float e, float f) +{ + NVGstate* state = nvg__getState(ctx); + float t[6] = { a, b, c, d, e, f }; + nvgTransformPremultiply(state->xform, t); +} + +void nvgResetTransform(NVGcontext* ctx) +{ + NVGstate* state = nvg__getState(ctx); + nvgTransformIdentity(state->xform); +} + +void nvgTranslate(NVGcontext* ctx, float x, float y) +{ + NVGstate* state = nvg__getState(ctx); + float t[6]; + nvgTransformTranslate(t, x,y); + nvgTransformPremultiply(state->xform, t); +} + +void nvgRotate(NVGcontext* ctx, float angle) +{ + NVGstate* state = nvg__getState(ctx); + float t[6]; + nvgTransformRotate(t, angle); + nvgTransformPremultiply(state->xform, t); +} + +void nvgSkewX(NVGcontext* ctx, float angle) +{ + NVGstate* state = nvg__getState(ctx); + float t[6]; + nvgTransformSkewX(t, angle); + nvgTransformPremultiply(state->xform, t); +} + +void nvgSkewY(NVGcontext* ctx, float angle) +{ + NVGstate* state = nvg__getState(ctx); + float t[6]; + nvgTransformSkewY(t, angle); + nvgTransformPremultiply(state->xform, t); +} + +void nvgScale(NVGcontext* ctx, float x, float y) +{ + NVGstate* state = nvg__getState(ctx); + float t[6]; + nvgTransformScale(t, x,y); + nvgTransformPremultiply(state->xform, t); +} + +void nvgCurrentTransform(NVGcontext* ctx, float* xform) +{ + NVGstate* state = nvg__getState(ctx); + if (xform == NULL) return; + memcpy(xform, state->xform, sizeof(float)*6); +} + +void nvgStrokeColor(NVGcontext* ctx, NVGcolor color) +{ + NVGstate* state = nvg__getState(ctx); + nvg__setPaintColor(&state->stroke, color); +} + +void nvgStrokePaint(NVGcontext* ctx, NVGpaint paint) +{ + NVGstate* state = nvg__getState(ctx); + state->stroke = paint; + nvgTransformMultiply(state->stroke.xform, state->xform); +} + +void nvgFillColor(NVGcontext* ctx, NVGcolor color) +{ + NVGstate* state = nvg__getState(ctx); + nvg__setPaintColor(&state->fill, color); +} + +// should be set before a draw (eg. stroke, fill). a copy of filter stack is attached to the draw call for drawing filters +void nvgFilterStack(NVGcontext* ctx, nanovg_filterstack& filterStack) +{ + NVGstate* state = nvg__getState(ctx); + state->m_filterStack = filterStack; +} + +void nvgFillPaint(NVGcontext* ctx, NVGpaint paint) +{ + NVGstate* state = nvg__getState(ctx); + state->fill = paint; + nvgTransformMultiply(state->fill.xform, state->xform); +} + +int nvgCreateImageRGBA(NVGcontext* ctx, int w, int h, int imageFlags, const unsigned char* data) +{ + return ctx->params.renderCreateTexture(ctx->params.userPtr, NVG_TEXTURE_RGBA, w, h, imageFlags, data); +} + +void nvgUpdateImage(NVGcontext* ctx, int image, const unsigned char* data) +{ + int w, h; + ctx->params.renderGetTextureSize(ctx->params.userPtr, image, &w, &h); + ctx->params.renderUpdateTexture(ctx->params.userPtr, image, 0,0, w,h, data); +} + +void nvgImageSize(NVGcontext* ctx, int image, int* w, int* h) +{ + ctx->params.renderGetTextureSize(ctx->params.userPtr, image, w, h); +} + +void nvgDeleteImage(NVGcontext* ctx, int image) +{ + ctx->params.renderDeleteTexture(ctx->params.userPtr, image); +} + +NVGpaint nvgLinearGradient(NVGcontext* ctx, + float sx, float sy, float ex, float ey, + NVGcolor icol, NVGcolor ocol) +{ + NVGpaint p; + float dx, dy, d; + const float large = 1e5; + NVG_NOTUSED(ctx); + memset(&p, 0, sizeof(p)); + + // Calculate transform aligned to the line + dx = ex - sx; + dy = ey - sy; + d = sqrtf(dx*dx + dy*dy); + if (d > 0.0001f) { + dx /= d; + dy /= d; + } else { + dx = 0; + dy = 1; + } + + p.xform[0] = dy; p.xform[1] = -dx; + p.xform[2] = dx; p.xform[3] = dy; + p.xform[4] = sx - dx*large; p.xform[5] = sy - dy*large; + + p.extent[0] = large; + p.extent[1] = large + d*0.5f; + + p.radius = 0.0f; + + p.feather = nvg__maxf(1.0f, d); + + p.innerColor = icol; + p.outerColor = ocol; + + return p; +} + +NVGpaint nvgRadialGradient(NVGcontext* ctx, + float cx, float cy, float inr, float outr, + NVGcolor icol, NVGcolor ocol) +{ + NVGpaint p; + float r = (inr+outr)*0.5f; + float f = (outr-inr); + NVG_NOTUSED(ctx); + memset(&p, 0, sizeof(p)); + + nvgTransformIdentity(p.xform); + p.xform[4] = cx; + p.xform[5] = cy; + + p.extent[0] = r; + p.extent[1] = r; + + p.radius = r; + + p.feather = nvg__maxf(1.0f, f); + + p.innerColor = icol; + p.outerColor = ocol; + + return p; +} + +NVGpaint nvgBoxGradient(NVGcontext* ctx, + float x, float y, float w, float h, float r, float f, + NVGcolor icol, NVGcolor ocol) +{ + NVGpaint p; + NVG_NOTUSED(ctx); + memset(&p, 0, sizeof(p)); + + nvgTransformIdentity(p.xform); + p.xform[4] = x+w*0.5f; + p.xform[5] = y+h*0.5f; + + p.extent[0] = w*0.5f; + p.extent[1] = h*0.5f; + + p.radius = r; + + p.feather = nvg__maxf(1.0f, f); + + p.innerColor = icol; + p.outerColor = ocol; + + return p; +} + + +NVGpaint nvgImagePattern(NVGcontext* ctx, + float cx, float cy, float w, float h, float angle, + int image, float alpha) +{ + NVGpaint p; + NVG_NOTUSED(ctx); + memset(&p, 0, sizeof(p)); + + nvgTransformRotate(p.xform, angle); + p.xform[4] = cx; + p.xform[5] = cy; + + p.extent[0] = w; + p.extent[1] = h; + + p.image = image; + p.image2 = 0; + + p.innerColor = p.outerColor = nvgRGBAf(1,1,1,alpha); + + return p; +} + +// Scissoring +void nvgScissor(NVGcontext* ctx, float x, float y, float w, float h) +{ + NVGstate* state = nvg__getState(ctx); + + w = nvg__maxf(0.0f, w); + h = nvg__maxf(0.0f, h); + + nvgTransformIdentity(state->scissor.xform); + state->scissor.xform[4] = x+w*0.5f; + state->scissor.xform[5] = y+h*0.5f; + nvgTransformMultiply(state->scissor.xform, state->xform); + + state->scissor.extent[0] = w*0.5f; + state->scissor.extent[1] = h*0.5f; +} + +static void nvg__isectRects(float* dst, + float ax, float ay, float aw, float ah, + float bx, float by, float bw, float bh) +{ + float minx = nvg__maxf(ax, bx); + float miny = nvg__maxf(ay, by); + float maxx = nvg__minf(ax+aw, bx+bw); + float maxy = nvg__minf(ay+ah, by+bh); + dst[0] = minx; + dst[1] = miny; + dst[2] = nvg__maxf(0.0f, maxx - minx); + dst[3] = nvg__maxf(0.0f, maxy - miny); +} + +void nvgIntersectScissor(NVGcontext* ctx, float x, float y, float w, float h) +{ + NVGstate* state = nvg__getState(ctx); + float pxform[6], invxorm[6]; + float rect[4]; + float ex, ey, tex, tey; + + // If no previous scissor has been set, set the scissor as current scissor. + if (state->scissor.extent[0] < 0) { + nvgScissor(ctx, x, y, w, h); + return; + } + + // Transform the current scissor rect into current transform space. + // If there is difference in rotation, this will be approximation. + memcpy(pxform, state->scissor.xform, sizeof(float)*6); + ex = state->scissor.extent[0]; + ey = state->scissor.extent[1]; + nvgTransformInverse(invxorm, state->xform); + nvgTransformMultiply(pxform, invxorm); + tex = ex*nvg__absf(pxform[0]) + ey*nvg__absf(pxform[2]); + tey = ex*nvg__absf(pxform[1]) + ey*nvg__absf(pxform[3]); + + // Intersect rects. + nvg__isectRects(rect, pxform[4]-tex,pxform[5]-tey,tex*2,tey*2, x,y,w,h); + + nvgScissor(ctx, rect[0], rect[1], rect[2], rect[3]); +} + +void nvgResetScissor(NVGcontext* ctx) +{ + NVGstate* state = nvg__getState(ctx); + memset(state->scissor.xform, 0, sizeof(state->scissor.xform)); + state->scissor.extent[0] = -1.0f; + state->scissor.extent[1] = -1.0f; +} + +// Global composite operation. +void nvgGlobalCompositeOperation(NVGcontext* ctx, int op) +{ + NVGstate* state = nvg__getState(ctx); + state->compositeOperation = nvg__compositeOperationState(op); +} + +void nvgGlobalCompositeBlendFunc(NVGcontext* ctx, int sfactor, int dfactor) +{ + nvgGlobalCompositeBlendFuncSeparate(ctx, sfactor, dfactor, sfactor, dfactor); +} + +void nvgGlobalCompositeBlendFuncSeparate(NVGcontext* ctx, int srcRGB, int dstRGB, int srcAlpha, int dstAlpha) +{ + NVGcompositeOperationState op; + op.srcRGB = srcRGB; + op.dstRGB = dstRGB; + op.srcAlpha = srcAlpha; + op.dstAlpha = dstAlpha; + + NVGstate* state = nvg__getState(ctx); + state->compositeOperation = op; +} + +static int nvg__ptEquals(float x1, float y1, float x2, float y2, float tol) +{ + float dx = x2 - x1; + float dy = y2 - y1; + return dx*dx + dy*dy < tol*tol; +} + +static float nvg__distPtSeg(float x, float y, float px, float py, float qx, float qy) +{ + float pqx, pqy, dx, dy, d, t; + pqx = qx-px; + pqy = qy-py; + dx = x-px; + dy = y-py; + d = pqx*pqx + pqy*pqy; + t = pqx*dx + pqy*dy; + if (d > 0) t /= d; + if (t < 0) t = 0; + else if (t > 1) t = 1; + dx = px + t*pqx - x; + dy = py + t*pqy - y; + return dx*dx + dy*dy; +} + +static void nvg__appendCommands(NVGcontext* ctx, float* vals, int nvals) +{ + NVGstate* state = nvg__getState(ctx); + int i; + + if (ctx->ncommands+nvals > ctx->ccommands) { + float* commands; + int ccommands = ctx->ncommands+nvals + ctx->ccommands/2; + commands = (float*)realloc(ctx->commands, sizeof(float)*ccommands); + if (commands == NULL) return; + ctx->commands = commands; + ctx->ccommands = ccommands; + } + + if ((int)vals[0] != NVG_CLOSE && (int)vals[0] != NVG_WINDING) { + ctx->commandx = vals[nvals-2]; + ctx->commandy = vals[nvals-1]; + } + + // transform commands + i = 0; + while (i < nvals) { + int cmd = (int)vals[i]; + switch (cmd) { + case NVG_MOVETO: + nvgTransformPoint(&vals[i+1],&vals[i+2], state->xform, vals[i+1],vals[i+2]); + i += 3; + break; + case NVG_LINETO: + nvgTransformPoint(&vals[i+1],&vals[i+2], state->xform, vals[i+1],vals[i+2]); + i += 3; + break; + case NVG_BEZIERTO: + nvgTransformPoint(&vals[i+1],&vals[i+2], state->xform, vals[i+1],vals[i+2]); + nvgTransformPoint(&vals[i+3],&vals[i+4], state->xform, vals[i+3],vals[i+4]); + nvgTransformPoint(&vals[i+5],&vals[i+6], state->xform, vals[i+5],vals[i+6]); + i += 7; + break; + case NVG_CLOSE: + i++; + break; + case NVG_WINDING: + i += 2; + break; + default: + i++; + } + } + + memcpy(&ctx->commands[ctx->ncommands], vals, nvals*sizeof(float)); + + ctx->ncommands += nvals; +} + + +static void nvg__clearPathCache(NVGcontext* ctx) +{ + ctx->cache->npoints = 0; + ctx->cache->npaths = 0; +} + +static NVGpath* nvg__lastPath(NVGcontext* ctx) +{ + if (ctx->cache->npaths > 0) + return &ctx->cache->paths[ctx->cache->npaths-1]; + return NULL; +} + +static void nvg__addPath(NVGcontext* ctx) +{ + NVGpath* path; + if (ctx->cache->npaths+1 > ctx->cache->cpaths) { + NVGpath* paths; + int cpaths = ctx->cache->npaths+1 + ctx->cache->cpaths/2; + paths = (NVGpath*)realloc(ctx->cache->paths, sizeof(NVGpath)*cpaths); + if (paths == NULL) return; + ctx->cache->paths = paths; + ctx->cache->cpaths = cpaths; + } + path = &ctx->cache->paths[ctx->cache->npaths]; + memset(path, 0, sizeof(*path)); + path->first = ctx->cache->npoints; + path->winding = NVG_CCW; + + ctx->cache->npaths++; +} + +static NVGpoint* nvg__lastPoint(NVGcontext* ctx) +{ + if (ctx->cache->npoints > 0) + return &ctx->cache->points[ctx->cache->npoints-1]; + return NULL; +} + +static void nvg__addPoint(NVGcontext* ctx, float x, float y, int flags) +{ + NVGpath* path = nvg__lastPath(ctx); + NVGpoint* pt; + if (path == NULL) return; + + if (path->count > 0 && ctx->cache->npoints > 0) { + pt = nvg__lastPoint(ctx); + if (nvg__ptEquals(pt->x,pt->y, x,y, ctx->distTol)) { + pt->flags |= flags; + return; + } + } + + if (ctx->cache->npoints+1 > ctx->cache->cpoints) { + NVGpoint* points; + int cpoints = ctx->cache->npoints+1 + ctx->cache->cpoints/2; + points = (NVGpoint*)realloc(ctx->cache->points, sizeof(NVGpoint)*cpoints); + if (points == NULL) return; + ctx->cache->points = points; + ctx->cache->cpoints = cpoints; + } + + pt = &ctx->cache->points[ctx->cache->npoints]; + memset(pt, 0, sizeof(*pt)); + pt->x = x; + pt->y = y; + pt->flags = (unsigned char)flags; + + ctx->cache->npoints++; + path->count++; +} + +static void nvg__closePath(NVGcontext* ctx) +{ + NVGpath* path = nvg__lastPath(ctx); + if (path == NULL) return; + path->closed = 1; +} + +static void nvg__pathWinding(NVGcontext* ctx, int winding) +{ + NVGpath* path = nvg__lastPath(ctx); + if (path == NULL) return; + path->winding = winding; +} + +static float nvg__getAverageScale(float *t) +{ + float sx = sqrtf(t[0]*t[0] + t[2]*t[2]); + float sy = sqrtf(t[1]*t[1] + t[3]*t[3]); + return (sx + sy) * 0.5f; +} + +static NVGvertex* nvg__allocTempVerts(NVGcontext* ctx, int nverts) +{ + if (nverts > ctx->cache->cverts) { + NVGvertex* verts; + int cverts = (nverts + 0xff) & ~0xff; // Round up to prevent allocations when things change just slightly. + verts = (NVGvertex*)realloc(ctx->cache->verts, sizeof(NVGvertex)*cverts); + if (verts == NULL) return NULL; + ctx->cache->verts = verts; + ctx->cache->cverts = cverts; + } + + return ctx->cache->verts; +} + +static float nvg__triarea2(float ax, float ay, float bx, float by, float cx, float cy) +{ + float abx = bx - ax; + float aby = by - ay; + float acx = cx - ax; + float acy = cy - ay; + return acx*aby - abx*acy; +} + +static float nvg__polyArea(NVGpoint* pts, int npts) +{ + int i; + float area = 0; + for (i = 2; i < npts; i++) { + NVGpoint* a = &pts[0]; + NVGpoint* b = &pts[i-1]; + NVGpoint* c = &pts[i]; + area += nvg__triarea2(a->x,a->y, b->x,b->y, c->x,c->y); + } + return area * 0.5f; +} + +static void nvg__polyReverse(NVGpoint* pts, int npts) +{ + NVGpoint tmp; + int i = 0, j = npts-1; + while (i < j) { + tmp = pts[i]; + pts[i] = pts[j]; + pts[j] = tmp; + i++; + j--; + } +} + + +static void nvg__vset(NVGvertex* vtx, float x, float y, float u, float v) +{ + vtx->x = x; + vtx->y = y; + vtx->u = u; + vtx->v = v; +} + +static void nvg__tesselateBezier(NVGcontext* ctx, + float x1, float y1, float x2, float y2, + float x3, float y3, float x4, float y4, + int level, int type) +{ + float x12,y12,x23,y23,x34,y34,x123,y123,x234,y234,x1234,y1234; + float dx,dy,d2,d3; + + if (level > 10) return; + + x12 = (x1+x2)*0.5f; + y12 = (y1+y2)*0.5f; + x23 = (x2+x3)*0.5f; + y23 = (y2+y3)*0.5f; + x34 = (x3+x4)*0.5f; + y34 = (y3+y4)*0.5f; + x123 = (x12+x23)*0.5f; + y123 = (y12+y23)*0.5f; + + dx = x4 - x1; + dy = y4 - y1; + d2 = nvg__absf(((x2 - x4) * dy - (y2 - y4) * dx)); + d3 = nvg__absf(((x3 - x4) * dy - (y3 - y4) * dx)); + + if ((d2 + d3)*(d2 + d3) < ctx->tessTol * (dx*dx + dy*dy)) { + nvg__addPoint(ctx, x4, y4, type); + return; + } + +/* if (nvg__absf(x1+x3-x2-x2) + nvg__absf(y1+y3-y2-y2) + nvg__absf(x2+x4-x3-x3) + nvg__absf(y2+y4-y3-y3) < ctx->tessTol) { + nvg__addPoint(ctx, x4, y4, type); + return; + }*/ + + x234 = (x23+x34)*0.5f; + y234 = (y23+y34)*0.5f; + x1234 = (x123+x234)*0.5f; + y1234 = (y123+y234)*0.5f; + + nvg__tesselateBezier(ctx, x1,y1, x12,y12, x123,y123, x1234,y1234, level+1, 0); + nvg__tesselateBezier(ctx, x1234,y1234, x234,y234, x34,y34, x4,y4, level+1, type); +} + +static void nvg__flattenPaths(NVGcontext* ctx) +{ + NVGpathCache* cache = ctx->cache; +// NVGstate* state = nvg__getState(ctx); + NVGpoint* last; + NVGpoint* p0; + NVGpoint* p1; + NVGpoint* pts; + NVGpath* path; + int i, j; + float* cp1; + float* cp2; + float* p; + float area; + + if (cache->npaths > 0) + return; + + // Flatten + i = 0; + while (i < ctx->ncommands) { + int cmd = (int)ctx->commands[i]; + switch (cmd) { + case NVG_MOVETO: + nvg__addPath(ctx); + p = &ctx->commands[i+1]; + nvg__addPoint(ctx, p[0], p[1], NVG_PT_CORNER); + i += 3; + break; + case NVG_LINETO: + p = &ctx->commands[i+1]; + nvg__addPoint(ctx, p[0], p[1], NVG_PT_CORNER); + i += 3; + break; + case NVG_BEZIERTO: + last = nvg__lastPoint(ctx); + if (last != NULL) { + cp1 = &ctx->commands[i+1]; + cp2 = &ctx->commands[i+3]; + p = &ctx->commands[i+5]; + nvg__tesselateBezier(ctx, last->x,last->y, cp1[0],cp1[1], cp2[0],cp2[1], p[0],p[1], 0, NVG_PT_CORNER); + } + i += 7; + break; + case NVG_CLOSE: + nvg__closePath(ctx); + i++; + break; + case NVG_WINDING: + nvg__pathWinding(ctx, (int)ctx->commands[i+1]); + i += 2; + break; + default: + i++; + } + } + + cache->bounds[0] = cache->bounds[1] = 1e6f; + cache->bounds[2] = cache->bounds[3] = -1e6f; + + // Calculate the direction and length of line segments. + for (j = 0; j < cache->npaths; j++) { + path = &cache->paths[j]; + pts = &cache->points[path->first]; + + // If the first and last points are the same, remove the last, mark as closed path. + p0 = &pts[path->count-1]; + p1 = &pts[0]; + if (nvg__ptEquals(p0->x,p0->y, p1->x,p1->y, ctx->distTol)) { + path->count--; + p0 = &pts[path->count-1]; + path->closed = 1; + } + + // Enforce winding. + if (path->count > 2) { + area = nvg__polyArea(pts, path->count); + if (path->winding == NVG_CCW && area < 0.0f) + nvg__polyReverse(pts, path->count); + if (path->winding == NVG_CW && area > 0.0f) + nvg__polyReverse(pts, path->count); + } + + for(i = 0; i < path->count; i++) { + // Calculate segment direction and length + p0->dx = p1->x - p0->x; + p0->dy = p1->y - p0->y; + p0->len = nvg__normalize(&p0->dx, &p0->dy); + // Update bounds + cache->bounds[0] = nvg__minf(cache->bounds[0], p0->x); + cache->bounds[1] = nvg__minf(cache->bounds[1], p0->y); + cache->bounds[2] = nvg__maxf(cache->bounds[2], p0->x); + cache->bounds[3] = nvg__maxf(cache->bounds[3], p0->y); + // Advance + p0 = p1++; + } + } +} + +static int nvg__curveDivs(float r, float arc, float tol) +{ + float da = acosf(r / (r + tol)) * 2.0f; + return nvg__maxi(2, (int)ceilf(arc / da)); +} + +static void nvg__chooseBevel(int bevel, NVGpoint* p0, NVGpoint* p1, float w, + float* x0, float* y0, float* x1, float* y1) +{ + if (bevel) { + *x0 = p1->x + p0->dy * w; + *y0 = p1->y - p0->dx * w; + *x1 = p1->x + p1->dy * w; + *y1 = p1->y - p1->dx * w; + } else { + *x0 = p1->x + p1->dmx * w; + *y0 = p1->y + p1->dmy * w; + *x1 = p1->x + p1->dmx * w; + *y1 = p1->y + p1->dmy * w; + } +} + +static NVGvertex* nvg__roundJoin(NVGvertex* dst, NVGpoint* p0, NVGpoint* p1, + float lw, float rw, float lu, float ru, int ncap, + float fringe) +{ + int i, n; + float dlx0 = p0->dy; + float dly0 = -p0->dx; + float dlx1 = p1->dy; + float dly1 = -p1->dx; + NVG_NOTUSED(fringe); + + if (p1->flags & NVG_PT_LEFT) { + float lx0,ly0,lx1,ly1,a0,a1; + nvg__chooseBevel(p1->flags & NVG_PR_INNERBEVEL, p0, p1, lw, &lx0,&ly0, &lx1,&ly1); + a0 = atan2f(-dly0, -dlx0); + a1 = atan2f(-dly1, -dlx1); + if (a1 > a0) a1 -= NVG_PI*2; + + nvg__vset(dst, lx0, ly0, lu,1); dst++; + nvg__vset(dst, p1->x - dlx0*rw, p1->y - dly0*rw, ru,1); dst++; + + n = nvg__clampi((int)ceilf(((a0 - a1) / NVG_PI) * ncap), 2, ncap); + for (i = 0; i < n; i++) { + float u = i/(float)(n-1); + float a = a0 + u*(a1-a0); + float rx = p1->x + cosf(a) * rw; + float ry = p1->y + sinf(a) * rw; + nvg__vset(dst, p1->x, p1->y, 0.5f,1); dst++; + nvg__vset(dst, rx, ry, ru,1); dst++; + } + + nvg__vset(dst, lx1, ly1, lu,1); dst++; + nvg__vset(dst, p1->x - dlx1*rw, p1->y - dly1*rw, ru,1); dst++; + + } else { + float rx0,ry0,rx1,ry1,a0,a1; + nvg__chooseBevel(p1->flags & NVG_PR_INNERBEVEL, p0, p1, -rw, &rx0,&ry0, &rx1,&ry1); + a0 = atan2f(dly0, dlx0); + a1 = atan2f(dly1, dlx1); + if (a1 < a0) a1 += NVG_PI*2; + + nvg__vset(dst, p1->x + dlx0*rw, p1->y + dly0*rw, lu,1); dst++; + nvg__vset(dst, rx0, ry0, ru,1); dst++; + + n = nvg__clampi((int)ceilf(((a1 - a0) / NVG_PI) * ncap), 2, ncap); + for (i = 0; i < n; i++) { + float u = i/(float)(n-1); + float a = a0 + u*(a1-a0); + float lx = p1->x + cosf(a) * lw; + float ly = p1->y + sinf(a) * lw; + nvg__vset(dst, lx, ly, lu,1); dst++; + nvg__vset(dst, p1->x, p1->y, 0.5f,1); dst++; + } + + nvg__vset(dst, p1->x + dlx1*rw, p1->y + dly1*rw, lu,1); dst++; + nvg__vset(dst, rx1, ry1, ru,1); dst++; + + } + return dst; +} + +static NVGvertex* nvg__bevelJoin(NVGvertex* dst, NVGpoint* p0, NVGpoint* p1, + float lw, float rw, float lu, float ru, float fringe) +{ + float rx0,ry0,rx1,ry1; + float lx0,ly0,lx1,ly1; + float dlx0 = p0->dy; + float dly0 = -p0->dx; + float dlx1 = p1->dy; + float dly1 = -p1->dx; + NVG_NOTUSED(fringe); + + if (p1->flags & NVG_PT_LEFT) { + nvg__chooseBevel(p1->flags & NVG_PR_INNERBEVEL, p0, p1, lw, &lx0,&ly0, &lx1,&ly1); + + nvg__vset(dst, lx0, ly0, lu,1); dst++; + nvg__vset(dst, p1->x - dlx0*rw, p1->y - dly0*rw, ru,1); dst++; + + if (p1->flags & NVG_PT_BEVEL) { + nvg__vset(dst, lx0, ly0, lu,1); dst++; + nvg__vset(dst, p1->x - dlx0*rw, p1->y - dly0*rw, ru,1); dst++; + + nvg__vset(dst, lx1, ly1, lu,1); dst++; + nvg__vset(dst, p1->x - dlx1*rw, p1->y - dly1*rw, ru,1); dst++; + } else { + rx0 = p1->x - p1->dmx * rw; + ry0 = p1->y - p1->dmy * rw; + + nvg__vset(dst, p1->x, p1->y, 0.5f,1); dst++; + nvg__vset(dst, p1->x - dlx0*rw, p1->y - dly0*rw, ru,1); dst++; + + nvg__vset(dst, rx0, ry0, ru,1); dst++; + nvg__vset(dst, rx0, ry0, ru,1); dst++; + + nvg__vset(dst, p1->x, p1->y, 0.5f,1); dst++; + nvg__vset(dst, p1->x - dlx1*rw, p1->y - dly1*rw, ru,1); dst++; + } + + nvg__vset(dst, lx1, ly1, lu,1); dst++; + nvg__vset(dst, p1->x - dlx1*rw, p1->y - dly1*rw, ru,1); dst++; + + } else { + nvg__chooseBevel(p1->flags & NVG_PR_INNERBEVEL, p0, p1, -rw, &rx0,&ry0, &rx1,&ry1); + + nvg__vset(dst, p1->x + dlx0*lw, p1->y + dly0*lw, lu,1); dst++; + nvg__vset(dst, rx0, ry0, ru,1); dst++; + + if (p1->flags & NVG_PT_BEVEL) { + nvg__vset(dst, p1->x + dlx0*lw, p1->y + dly0*lw, lu,1); dst++; + nvg__vset(dst, rx0, ry0, ru,1); dst++; + + nvg__vset(dst, p1->x + dlx1*lw, p1->y + dly1*lw, lu,1); dst++; + nvg__vset(dst, rx1, ry1, ru,1); dst++; + } else { + lx0 = p1->x + p1->dmx * lw; + ly0 = p1->y + p1->dmy * lw; + + nvg__vset(dst, p1->x + dlx0*lw, p1->y + dly0*lw, lu,1); dst++; + nvg__vset(dst, p1->x, p1->y, 0.5f,1); dst++; + + nvg__vset(dst, lx0, ly0, lu,1); dst++; + nvg__vset(dst, lx0, ly0, lu,1); dst++; + + nvg__vset(dst, p1->x + dlx1*lw, p1->y + dly1*lw, lu,1); dst++; + nvg__vset(dst, p1->x, p1->y, 0.5f,1); dst++; + } + + nvg__vset(dst, p1->x + dlx1*lw, p1->y + dly1*lw, lu,1); dst++; + nvg__vset(dst, rx1, ry1, ru,1); dst++; + } + + return dst; +} + +static NVGvertex* nvg__buttCapStart(NVGvertex* dst, NVGpoint* p, + float dx, float dy, float w, float d, + float aa, float u0, float u1) +{ + float px = p->x - dx*d; + float py = p->y - dy*d; + float dlx = dy; + float dly = -dx; + nvg__vset(dst, px + dlx*w - dx*aa, py + dly*w - dy*aa, u0,0); dst++; + nvg__vset(dst, px - dlx*w - dx*aa, py - dly*w - dy*aa, u1,0); dst++; + nvg__vset(dst, px + dlx*w, py + dly*w, u0,1); dst++; + nvg__vset(dst, px - dlx*w, py - dly*w, u1,1); dst++; + return dst; +} + +static NVGvertex* nvg__buttCapEnd(NVGvertex* dst, NVGpoint* p, + float dx, float dy, float w, float d, + float aa, float u0, float u1) +{ + float px = p->x + dx*d; + float py = p->y + dy*d; + float dlx = dy; + float dly = -dx; + nvg__vset(dst, px + dlx*w, py + dly*w, u0,1); dst++; + nvg__vset(dst, px - dlx*w, py - dly*w, u1,1); dst++; + nvg__vset(dst, px + dlx*w + dx*aa, py + dly*w + dy*aa, u0,0); dst++; + nvg__vset(dst, px - dlx*w + dx*aa, py - dly*w + dy*aa, u1,0); dst++; + return dst; +} + + +static NVGvertex* nvg__roundCapStart(NVGvertex* dst, NVGpoint* p, + float dx, float dy, float w, int ncap, + float aa, float u0, float u1) +{ + int i; + float px = p->x; + float py = p->y; + float dlx = dy; + float dly = -dx; + NVG_NOTUSED(aa); + for (i = 0; i < ncap; i++) { + float a = i/(float)(ncap-1)*NVG_PI; + float ax = cosf(a) * w, ay = sinf(a) * w; + nvg__vset(dst, px - dlx*ax - dx*ay, py - dly*ax - dy*ay, u0,1); dst++; + nvg__vset(dst, px, py, 0.5f,1); dst++; + } + nvg__vset(dst, px + dlx*w, py + dly*w, u0,1); dst++; + nvg__vset(dst, px - dlx*w, py - dly*w, u1,1); dst++; + return dst; +} + +static NVGvertex* nvg__roundCapEnd(NVGvertex* dst, NVGpoint* p, + float dx, float dy, float w, int ncap, + float aa, float u0, float u1) +{ + int i; + float px = p->x; + float py = p->y; + float dlx = dy; + float dly = -dx; + NVG_NOTUSED(aa); + nvg__vset(dst, px + dlx*w, py + dly*w, u0,1); dst++; + nvg__vset(dst, px - dlx*w, py - dly*w, u1,1); dst++; + for (i = 0; i < ncap; i++) { + float a = i/(float)(ncap-1)*NVG_PI; + float ax = cosf(a) * w, ay = sinf(a) * w; + nvg__vset(dst, px, py, 0.5f,1); dst++; + nvg__vset(dst, px - dlx*ax + dx*ay, py - dly*ax + dy*ay, u0,1); dst++; + } + return dst; +} + + +static void nvg__calculateJoins(NVGcontext* ctx, float w, int lineJoin, float miterLimit) +{ + NVGpathCache* cache = ctx->cache; + int i, j; + float iw = 0.0f; + + if (w > 0.0f) iw = 1.0f / w; + + // Calculate which joins needs extra vertices to append, and gather vertex count. + for (i = 0; i < cache->npaths; i++) { + NVGpath* path = &cache->paths[i]; + NVGpoint* pts = &cache->points[path->first]; + NVGpoint* p0 = &pts[path->count-1]; + NVGpoint* p1 = &pts[0]; + int nleft = 0; + + path->nbevel = 0; + + for (j = 0; j < path->count; j++) { + float dlx0, dly0, dlx1, dly1, dmr2, cross, limit; + dlx0 = p0->dy; + dly0 = -p0->dx; + dlx1 = p1->dy; + dly1 = -p1->dx; + // Calculate extrusions + p1->dmx = (dlx0 + dlx1) * 0.5f; + p1->dmy = (dly0 + dly1) * 0.5f; + dmr2 = p1->dmx*p1->dmx + p1->dmy*p1->dmy; + if (dmr2 > 0.000001f) { + float scale = 1.0f / dmr2; + if (scale > 600.0f) { + scale = 600.0f; + } + p1->dmx *= scale; + p1->dmy *= scale; + } + + // Clear flags, but keep the corner. + p1->flags = (p1->flags & NVG_PT_CORNER) ? NVG_PT_CORNER : 0; + + // Keep track of left turns. + cross = p1->dx * p0->dy - p0->dx * p1->dy; + if (cross > 0.0f) { + nleft++; + p1->flags |= NVG_PT_LEFT; + } + + // Calculate if we should use bevel or miter for inner join. + limit = nvg__maxf(1.01f, nvg__minf(p0->len, p1->len) * iw); + if ((dmr2 * limit*limit) < 1.0f) + p1->flags |= NVG_PR_INNERBEVEL; + + // Check to see if the corner needs to be beveled. + if (p1->flags & NVG_PT_CORNER) { + if ((dmr2 * miterLimit*miterLimit) < 1.0f || lineJoin == NVG_BEVEL || lineJoin == NVG_ROUND) { + p1->flags |= NVG_PT_BEVEL; + } + } + + if ((p1->flags & (NVG_PT_BEVEL | NVG_PR_INNERBEVEL)) != 0) + path->nbevel++; + + p0 = p1++; + } + + path->convex = (nleft == path->count) ? 1 : 0; + } +} + + +static int nvg__expandStroke(NVGcontext* ctx, float w, float fringe, int lineCap, int lineJoin, float miterLimit) +{ + NVGpathCache* cache = ctx->cache; + NVGvertex* verts; + NVGvertex* dst; + int cverts, i, j; + float aa = fringe;//ctx->fringeWidth; + float u0 = 0.0f, u1 = 1.0f; + int ncap = nvg__curveDivs(w, NVG_PI, ctx->tessTol); // Calculate divisions per half circle. + + w += aa * 0.5f; + + // Disable the gradient used for antialiasing when antialiasing is not used. + if (aa == 0.0f) { + u0 = 0.5f; + u1 = 0.5f; + } + + nvg__calculateJoins(ctx, w, lineJoin, miterLimit); + + // Calculate max vertex usage. + cverts = 0; + for (i = 0; i < cache->npaths; i++) { + NVGpath* path = &cache->paths[i]; + int loop = (path->closed == 0) ? 0 : 1; + if (lineJoin == NVG_ROUND) + cverts += (path->count + path->nbevel*(ncap+2) + 1) * 2; // plus one for loop + else + cverts += (path->count + path->nbevel*5 + 1) * 2; // plus one for loop + if (loop == 0) { + // space for caps + if (lineCap == NVG_ROUND) { + cverts += (ncap*2 + 2)*2; + } else { + cverts += (3+3)*2; + } + } + } + + verts = nvg__allocTempVerts(ctx, cverts); + if (verts == NULL) return 0; + + for (i = 0; i < cache->npaths; i++) { + NVGpath* path = &cache->paths[i]; + NVGpoint* pts = &cache->points[path->first]; + NVGpoint* p0; + NVGpoint* p1; + int s, e, loop; + float dx, dy; + + path->fill = 0; + path->nfill = 0; + + // Calculate fringe or stroke + loop = (path->closed == 0) ? 0 : 1; + dst = verts; + path->stroke = dst; + + if (loop) { + // Looping + p0 = &pts[path->count-1]; + p1 = &pts[0]; + s = 0; + e = path->count; + } else { + // Add cap + p0 = &pts[0]; + p1 = &pts[1]; + s = 1; + e = path->count-1; + } + + if (loop == 0) { + // Add cap + dx = p1->x - p0->x; + dy = p1->y - p0->y; + nvg__normalize(&dx, &dy); + if (lineCap == NVG_BUTT) + dst = nvg__buttCapStart(dst, p0, dx, dy, w, -aa*0.5f, aa, u0, u1); + else if (lineCap == NVG_BUTT || lineCap == NVG_SQUARE) + dst = nvg__buttCapStart(dst, p0, dx, dy, w, w-aa, aa, u0, u1); + else if (lineCap == NVG_ROUND) + dst = nvg__roundCapStart(dst, p0, dx, dy, w, ncap, aa, u0, u1); + } + + for (j = s; j < e; ++j) { + if ((p1->flags & (NVG_PT_BEVEL | NVG_PR_INNERBEVEL)) != 0) { + if (lineJoin == NVG_ROUND) { + dst = nvg__roundJoin(dst, p0, p1, w, w, u0, u1, ncap, aa); + } else { + dst = nvg__bevelJoin(dst, p0, p1, w, w, u0, u1, aa); + } + } else { + nvg__vset(dst, p1->x + (p1->dmx * w), p1->y + (p1->dmy * w), u0,1); dst++; + nvg__vset(dst, p1->x - (p1->dmx * w), p1->y - (p1->dmy * w), u1,1); dst++; + } + p0 = p1++; + } + + if (loop) { + // Loop it + nvg__vset(dst, verts[0].x, verts[0].y, u0,1); dst++; + nvg__vset(dst, verts[1].x, verts[1].y, u1,1); dst++; + } else { + // Add cap + dx = p1->x - p0->x; + dy = p1->y - p0->y; + nvg__normalize(&dx, &dy); + if (lineCap == NVG_BUTT) + dst = nvg__buttCapEnd(dst, p1, dx, dy, w, -aa*0.5f, aa, u0, u1); + else if (lineCap == NVG_BUTT || lineCap == NVG_SQUARE) + dst = nvg__buttCapEnd(dst, p1, dx, dy, w, w-aa, aa, u0, u1); + else if (lineCap == NVG_ROUND) + dst = nvg__roundCapEnd(dst, p1, dx, dy, w, ncap, aa, u0, u1); + } + + path->nstroke = (int)(dst - verts); + + verts = dst; + } + + return 1; +} + +static int nvg__expandFill(NVGcontext* ctx, float w, int lineJoin, float miterLimit) +{ + NVGpathCache* cache = ctx->cache; + NVGvertex* verts; + NVGvertex* dst; + int cverts, convex, i, j; + float aa = ctx->fringeWidth; + int fringe = w > 0.0f; + + nvg__calculateJoins(ctx, w, lineJoin, miterLimit); + + // Calculate max vertex usage. + cverts = 0; + for (i = 0; i < cache->npaths; i++) { + NVGpath* path = &cache->paths[i]; + cverts += path->count + path->nbevel + 1; + if (fringe) + cverts += (path->count + path->nbevel*5 + 1) * 2; // plus one for loop + } + + verts = nvg__allocTempVerts(ctx, cverts); + if (verts == NULL) return 0; + + convex = cache->npaths == 1 && cache->paths[0].convex; + + for (i = 0; i < cache->npaths; i++) { + NVGpath* path = &cache->paths[i]; + NVGpoint* pts = &cache->points[path->first]; + NVGpoint* p0; + NVGpoint* p1; + float rw, lw, woff; + float ru, lu; + + // Calculate shape vertices. + woff = 0.5f*aa; + dst = verts; + path->fill = dst; + + if (fringe) { + // Looping + p0 = &pts[path->count-1]; + p1 = &pts[0]; + for (j = 0; j < path->count; ++j) { + if (p1->flags & NVG_PT_BEVEL) { + float dlx0 = p0->dy; + float dly0 = -p0->dx; + float dlx1 = p1->dy; + float dly1 = -p1->dx; + if (p1->flags & NVG_PT_LEFT) { + float lx = p1->x + p1->dmx * woff; + float ly = p1->y + p1->dmy * woff; + nvg__vset(dst, lx, ly, 0.5f,1); dst++; + } else { + float lx0 = p1->x + dlx0 * woff; + float ly0 = p1->y + dly0 * woff; + float lx1 = p1->x + dlx1 * woff; + float ly1 = p1->y + dly1 * woff; + nvg__vset(dst, lx0, ly0, 0.5f,1); dst++; + nvg__vset(dst, lx1, ly1, 0.5f,1); dst++; + } + } else { + nvg__vset(dst, p1->x + (p1->dmx * woff), p1->y + (p1->dmy * woff), 0.5f,1); dst++; + } + p0 = p1++; + } + } else { + for (j = 0; j < path->count; ++j) { + nvg__vset(dst, pts[j].x, pts[j].y, 0.5f,1); + dst++; + } + } + + path->nfill = (int)(dst - verts); + verts = dst; + + // Calculate fringe + if (fringe) { + lw = w + woff; + rw = w - woff; + lu = 0; + ru = 1; + dst = verts; + path->stroke = dst; + + // Create only half a fringe for convex shapes so that + // the shape can be rendered without stenciling. + if (convex) { + lw = woff; // This should generate the same vertex as fill inset above. + lu = 0.5f; // Set outline fade at middle. + } + + // Looping + p0 = &pts[path->count-1]; + p1 = &pts[0]; + + for (j = 0; j < path->count; ++j) { + if ((p1->flags & (NVG_PT_BEVEL | NVG_PR_INNERBEVEL)) != 0) { + dst = nvg__bevelJoin(dst, p0, p1, lw, rw, lu, ru, ctx->fringeWidth); + } else { + nvg__vset(dst, p1->x + (p1->dmx * lw), p1->y + (p1->dmy * lw), lu,1); dst++; + nvg__vset(dst, p1->x - (p1->dmx * rw), p1->y - (p1->dmy * rw), ru,1); dst++; + } + p0 = p1++; + } + + // Loop it + nvg__vset(dst, verts[0].x, verts[0].y, lu,1); dst++; + nvg__vset(dst, verts[1].x, verts[1].y, ru,1); dst++; + + path->nstroke = (int)(dst - verts); + verts = dst; + } else { + path->stroke = NULL; + path->nstroke = 0; + } + } + + return 1; +} + + +// Draw +void nvgBeginPath(NVGcontext* ctx) +{ + ctx->ncommands = 0; + nvg__clearPathCache(ctx); +} + +void nvgMoveTo(NVGcontext* ctx, float x, float y) +{ + float vals[] = { NVG_MOVETO, x, y }; + nvg__appendCommands(ctx, vals, NVG_COUNTOF(vals)); +} + +void nvgLineTo(NVGcontext* ctx, float x, float y) +{ + float vals[] = { NVG_LINETO, x, y }; + nvg__appendCommands(ctx, vals, NVG_COUNTOF(vals)); +} + +void nvgBezierTo(NVGcontext* ctx, float c1x, float c1y, float c2x, float c2y, float x, float y) +{ + float vals[] = { NVG_BEZIERTO, c1x, c1y, c2x, c2y, x, y }; + nvg__appendCommands(ctx, vals, NVG_COUNTOF(vals)); +} + +void nvgQuadTo(NVGcontext* ctx, float cx, float cy, float x, float y) +{ + float x0 = ctx->commandx; + float y0 = ctx->commandy; + float vals[] = { NVG_BEZIERTO, + x0 + 2.0f/3.0f*(cx - x0), y0 + 2.0f/3.0f*(cy - y0), + x + 2.0f/3.0f*(cx - x), y + 2.0f/3.0f*(cy - y), + x, y }; + nvg__appendCommands(ctx, vals, NVG_COUNTOF(vals)); +} + +void nvgArcTo(NVGcontext* ctx, float x1, float y1, float x2, float y2, float radius) +{ + float x0 = ctx->commandx; + float y0 = ctx->commandy; + float dx0,dy0, dx1,dy1, a, d, cx,cy, a0,a1; + int dir; + + if (ctx->ncommands == 0) { + return; + } + + // Handle degenerate cases. + if (nvg__ptEquals(x0,y0, x1,y1, ctx->distTol) || + nvg__ptEquals(x1,y1, x2,y2, ctx->distTol) || + nvg__distPtSeg(x1,y1, x0,y0, x2,y2) < ctx->distTol*ctx->distTol || + radius < ctx->distTol) { + nvgLineTo(ctx, x1,y1); + return; + } + + // Calculate tangential circle to lines (x0,y0)-(x1,y1) and (x1,y1)-(x2,y2). + dx0 = x0-x1; + dy0 = y0-y1; + dx1 = x2-x1; + dy1 = y2-y1; + nvg__normalize(&dx0,&dy0); + nvg__normalize(&dx1,&dy1); + a = nvg__acosf(dx0*dx1 + dy0*dy1); + d = radius / nvg__tanf(a/2.0f); + +// printf("a=%f° d=%f\n", a/NVG_PI*180.0f, d); + + if (d > 10000.0f) { + nvgLineTo(ctx, x1,y1); + return; + } + + if (nvg__cross(dx0,dy0, dx1,dy1) > 0.0f) { + cx = x1 + dx0*d + dy0*radius; + cy = y1 + dy0*d + -dx0*radius; + a0 = nvg__atan2f(dx0, -dy0); + a1 = nvg__atan2f(-dx1, dy1); + dir = NVG_CW; +// printf("CW c=(%f, %f) a0=%f° a1=%f°\n", cx, cy, a0/NVG_PI*180.0f, a1/NVG_PI*180.0f); + } else { + cx = x1 + dx0*d + -dy0*radius; + cy = y1 + dy0*d + dx0*radius; + a0 = nvg__atan2f(-dx0, dy0); + a1 = nvg__atan2f(dx1, -dy1); + dir = NVG_CCW; +// printf("CCW c=(%f, %f) a0=%f° a1=%f°\n", cx, cy, a0/NVG_PI*180.0f, a1/NVG_PI*180.0f); + } + + nvgArc(ctx, cx, cy, radius, a0, a1, dir); +} + +void nvgClosePath(NVGcontext* ctx) +{ + float vals[] = { NVG_CLOSE }; + nvg__appendCommands(ctx, vals, NVG_COUNTOF(vals)); +} + +void nvgPathWinding(NVGcontext* ctx, int dir) +{ + float vals[] = { NVG_WINDING, (float)dir }; + nvg__appendCommands(ctx, vals, NVG_COUNTOF(vals)); +} + +void nvgArc(NVGcontext* ctx, float cx, float cy, float r, float a0, float a1, int dir) +{ + float a = 0, da = 0, hda = 0, kappa = 0; + float dx = 0, dy = 0, x = 0, y = 0, tanx = 0, tany = 0; + float px = 0, py = 0, ptanx = 0, ptany = 0; + float vals[3 + 5*7 + 100]; + int i, ndivs, nvals; + int move = ctx->ncommands > 0 ? NVG_LINETO : NVG_MOVETO; + + // Clamp angles + da = a1 - a0; + if (dir == NVG_CW) { + if (nvg__absf(da) >= NVG_PI*2) { + da = NVG_PI*2; + } else { + while (da < 0.0f) da += NVG_PI*2; + } + } else { + if (nvg__absf(da) >= NVG_PI*2) { + da = -NVG_PI*2; + } else { + while (da > 0.0f) da -= NVG_PI*2; + } + } + + // Split arc into max 90 degree segments. + ndivs = nvg__maxi(1, nvg__mini((int)(nvg__absf(da) / (NVG_PI*0.5f) + 0.5f), 5)); + hda = (da / (float)ndivs) / 2.0f; + kappa = nvg__absf(4.0f / 3.0f * (1.0f - nvg__cosf(hda)) / nvg__sinf(hda)); + + if (dir == NVG_CCW) + kappa = -kappa; + + nvals = 0; + for (i = 0; i <= ndivs; i++) { + a = a0 + da * (i/(float)ndivs); + dx = nvg__cosf(a); + dy = nvg__sinf(a); + x = cx + dx*r; + y = cy + dy*r; + tanx = -dy*r*kappa; + tany = dx*r*kappa; + + if (i == 0) { + vals[nvals++] = (float)move; + vals[nvals++] = x; + vals[nvals++] = y; + } else { + vals[nvals++] = NVG_BEZIERTO; + vals[nvals++] = px+ptanx; + vals[nvals++] = py+ptany; + vals[nvals++] = x-tanx; + vals[nvals++] = y-tany; + vals[nvals++] = x; + vals[nvals++] = y; + } + px = x; + py = y; + ptanx = tanx; + ptany = tany; + } + + nvg__appendCommands(ctx, vals, nvals); +} + +void nvgRect(NVGcontext* ctx, float x, float y, float w, float h) +{ + float vals[] = { + NVG_MOVETO, x,y, + NVG_LINETO, x,y+h, + NVG_LINETO, x+w,y+h, + NVG_LINETO, x+w,y, + NVG_CLOSE + }; + nvg__appendCommands(ctx, vals, NVG_COUNTOF(vals)); +} + +void nvgRoundedRect(NVGcontext* ctx, float x, float y, float w, float h, float r) +{ + nvgRoundedRectElliptic(ctx, x, y, w, h, r, r, r, r, r, r, r, r); +} + +void nvgRoundedRectVarying(NVGcontext* ctx, float x, float y, float w, float h, float radTopLeft, float radTopRight, float radBottomRight, float radBottomLeft) +{ + nvgRoundedRectElliptic(ctx, x, y, w, h, radTopLeft, radTopLeft, radTopRight, radTopRight, radBottomRight, radBottomRight, radBottomLeft, radBottomLeft); +} + +void nvgRoundedRectElliptic(NVGcontext* ctx, float x, float y, float w, float h, float rxTopLeft, float ryTopLeft, float rxTopRight, float ryTopRight, float rxBottomRight, float ryBottomRight, float rxBottomLeft, float ryBottomLeft) +{ + if (rxTopLeft < 0.1f && ryTopLeft < 0.1f && rxTopRight < 0.1f && ryTopRight < 0.1f && rxBottomRight < 0.1f && ryBottomRight < 0.1f && rxBottomLeft < 0.1f && ryBottomLeft < 0.1f) + { + nvgRect(ctx, x, y, w, h); + return; + } + else + { + float halfw = nvg__absf(w)*0.5f; + float halfh = nvg__absf(h)*0.5f; + float rxBL = nvg__minf(rxBottomLeft, halfw) * nvg__signf(w), ryBL = nvg__minf(ryBottomLeft, halfh) * nvg__signf(h); + float rxBR = nvg__minf(rxBottomRight, halfw) * nvg__signf(w), ryBR = nvg__minf(ryBottomRight, halfh) * nvg__signf(h); + float rxTR = nvg__minf(rxTopRight, halfw) * nvg__signf(w), ryTR = nvg__minf(ryTopRight, halfh) * nvg__signf(h); + float rxTL = nvg__minf(rxTopLeft, halfw) * nvg__signf(w), ryTL = nvg__minf(ryTopRight, halfh) * nvg__signf(h); + float vals[] = { + NVG_MOVETO, x, y + ryTL, + NVG_LINETO, x, y + h - ryBL, + NVG_BEZIERTO, x, y + h - ryBL*(1 - NVG_KAPPA90), x + rxBL*(1 - NVG_KAPPA90), y + h, x + rxBL, y + h, + NVG_LINETO, x + w - rxBR, y + h, + NVG_BEZIERTO, x + w - rxBR*(1 - NVG_KAPPA90), y + h, x + w, y + h - ryBR*(1 - NVG_KAPPA90), x + w, y + h - ryBR, + NVG_LINETO, x + w, y + ryTR, + NVG_BEZIERTO, x + w, y + ryTR*(1 - NVG_KAPPA90), x + w - rxTR*(1 - NVG_KAPPA90), y, x + w - rxTR, y, + NVG_LINETO, x + rxTL, y, + NVG_BEZIERTO, x + rxTL*(1 - NVG_KAPPA90), y, x, y + ryTL*(1 - NVG_KAPPA90), x, y + ryTL, + NVG_CLOSE + }; + nvg__appendCommands(ctx, vals, NVG_COUNTOF(vals)); + } +} + +void nvgEllipse(NVGcontext* ctx, float cx, float cy, float rx, float ry) +{ + float vals[] = { + NVG_MOVETO, cx-rx, cy, + NVG_BEZIERTO, cx-rx, cy+ry*NVG_KAPPA90, cx-rx*NVG_KAPPA90, cy+ry, cx, cy+ry, + NVG_BEZIERTO, cx+rx*NVG_KAPPA90, cy+ry, cx+rx, cy+ry*NVG_KAPPA90, cx+rx, cy, + NVG_BEZIERTO, cx+rx, cy-ry*NVG_KAPPA90, cx+rx*NVG_KAPPA90, cy-ry, cx, cy-ry, + NVG_BEZIERTO, cx-rx*NVG_KAPPA90, cy-ry, cx-rx, cy-ry*NVG_KAPPA90, cx-rx, cy, + NVG_CLOSE + }; + nvg__appendCommands(ctx, vals, NVG_COUNTOF(vals)); +} + +void nvgCircle(NVGcontext* ctx, float cx, float cy, float r) +{ + nvgEllipse(ctx, cx,cy, r,r); +} + +void nvgDebugDumpPathCache(NVGcontext* ctx) +{ + const NVGpath* path; + int i, j; + + printf("Dumping %d cached paths\n", ctx->cache->npaths); + for (i = 0; i < ctx->cache->npaths; i++) { + path = &ctx->cache->paths[i]; + printf(" - Path %d\n", i); + if (path->nfill) { + printf(" - fill: %d\n", path->nfill); + for (j = 0; j < path->nfill; j++) + printf("%f\t%f\n", path->fill[j].x, path->fill[j].y); + } + if (path->nstroke) { + printf(" - stroke: %d\n", path->nstroke); + for (j = 0; j < path->nstroke; j++) + printf("%f\t%f\n", path->stroke[j].x, path->stroke[j].y); + } + } +} + +void nvgFill(NVGcontext* ctx) +{ + NVGstate* state = nvg__getState(ctx); + const NVGpath* path; + NVGpaint fillPaint = state->fill; + int i; + + nvg__flattenPaths(ctx); + if (ctx->params.edgeAntiAlias && state->shapeAntiAlias) + nvg__expandFill(ctx, ctx->fringeWidth, NVG_MITER, 2.4f); + else + nvg__expandFill(ctx, 0.0f, NVG_MITER, 2.4f); + + // Apply global alpha + fillPaint.innerColor.a *= state->alpha; + fillPaint.outerColor.a *= state->alpha; + fillPaint.image2 = 0; + + ctx->params.renderFill(ctx->params.userPtr, &fillPaint, state->compositeOperation, &state->scissor, ctx->fringeWidth, + ctx->cache->bounds, ctx->cache->paths, ctx->cache->npaths, state->m_filterStack); + + // Count triangles + for (i = 0; i < ctx->cache->npaths; i++) { + path = &ctx->cache->paths[i]; + ctx->fillTriCount += path->nfill-2; + ctx->fillTriCount += path->nstroke-2; + ctx->drawCallCount += 2; + } +} + +void nvgStroke(NVGcontext* ctx) +{ + NVGstate* state = nvg__getState(ctx); + float scale = nvg__getAverageScale(state->xform); + float strokeWidth = nvg__clampf(state->strokeWidth * scale, 0.0f, 200.0f); + NVGpaint strokePaint = state->stroke; + const NVGpath* path; + int i; + + + if (strokeWidth < ctx->fringeWidth) { + // If the stroke width is less than pixel size, use alpha to emulate coverage. + // Since coverage is area, scale by alpha*alpha. + float alpha = nvg__clampf(strokeWidth / ctx->fringeWidth, 0.0f, 1.0f); + strokePaint.innerColor.a *= alpha*alpha; + strokePaint.outerColor.a *= alpha*alpha; + strokeWidth = ctx->fringeWidth; + } + + // Apply global alpha + strokePaint.innerColor.a *= state->alpha; + strokePaint.outerColor.a *= state->alpha; + strokePaint.image2 = 0; + + nvg__flattenPaths(ctx); + + if (ctx->params.edgeAntiAlias && state->shapeAntiAlias) + nvg__expandStroke(ctx, strokeWidth*0.5f, ctx->fringeWidth, state->lineCap, state->lineJoin, state->miterLimit); + else + nvg__expandStroke(ctx, strokeWidth*0.5f, 0.0f, state->lineCap, state->lineJoin, state->miterLimit); + + ctx->params.renderStroke(ctx->params.userPtr, &strokePaint, state->compositeOperation, &state->scissor, ctx->fringeWidth, + strokeWidth, ctx->cache->paths, ctx->cache->npaths, state->m_filterStack); + + // Count triangles + for (i = 0; i < ctx->cache->npaths; i++) { + path = &ctx->cache->paths[i]; + ctx->strokeTriCount += path->nstroke-2; + ctx->drawCallCount++; + } +} + +// Add fonts +int nvgCreateFont(NVGcontext* ctx, const char* name, const char* path) +{ + return fonsAddFont(ctx->fs, name, path); +} + +int nvgCreateFontMem(NVGcontext* ctx, const char* name, unsigned char* data, int ndata, int freeData) +{ + return fonsAddFontMem(ctx->fs, name, data, ndata, freeData); +} + +int nvgFindFont(NVGcontext* ctx, const char* name) +{ + if (name == NULL) return -1; + return fonsGetFontByName(ctx->fs, name); +} + + +int nvgAddFallbackFontId(NVGcontext* ctx, int baseFont, int fallbackFont) +{ + if(baseFont == -1 || fallbackFont == -1) return 0; + return fonsAddFallbackFont(ctx->fs, baseFont, fallbackFont); +} + +int nvgAddFallbackFont(NVGcontext* ctx, const char* baseFont, const char* fallbackFont) +{ + return nvgAddFallbackFontId(ctx, nvgFindFont(ctx, baseFont), nvgFindFont(ctx, fallbackFont)); +} + +// State setting +void nvgFontSize(NVGcontext* ctx, float size) +{ + NVGstate* state = nvg__getState(ctx); + state->fontSize = size; +} + +void nvgFontBlur(NVGcontext* ctx, float blur) +{ + NVGstate* state = nvg__getState(ctx); + state->fontBlur = blur; +} + +void nvgTextLetterSpacing(NVGcontext* ctx, float spacing) +{ + NVGstate* state = nvg__getState(ctx); + state->letterSpacing = spacing; +} + +void nvgTextLineHeight(NVGcontext* ctx, float lineHeight) +{ + NVGstate* state = nvg__getState(ctx); + state->lineHeight = lineHeight; +} + +void nvgTextAlign(NVGcontext* ctx, int align) +{ + NVGstate* state = nvg__getState(ctx); + state->textAlign = align; +} + +void nvgFontFaceId(NVGcontext* ctx, int font) +{ + NVGstate* state = nvg__getState(ctx); + state->fontId = font; +} + +void nvgFontFace(NVGcontext* ctx, const char* font) +{ + NVGstate* state = nvg__getState(ctx); + state->fontId = fonsGetFontByName(ctx->fs, font); +} + +static float nvg__quantize(float a, float d) +{ + return ((int)(a / d + 0.5f)) * d; +} + +static float nvg__getFontScale(NVGstate* state) +{ + return nvg__minf(nvg__quantize(nvg__getAverageScale(state->xform), 0.01f), 4.0f); +} + +static void nvg__flushTextTexture(NVGcontext* ctx) +{ + int dirty[4]; + + if (fonsValidateTexture(ctx->fs, dirty)) { + int fontImage = ctx->fontImages[ctx->fontImageIdx]; + // Update texture + if (fontImage != 0) { + int iw, ih; + const unsigned char* data = fonsGetTextureData(ctx->fs, &iw, &ih); + int x = dirty[0]; + int y = dirty[1]; + int w = dirty[2] - dirty[0]; + int h = dirty[3] - dirty[1]; + ctx->params.renderUpdateTexture(ctx->params.userPtr, fontImage, x,y, w,h, data); + } + } +} + +static int nvg__allocTextAtlas(NVGcontext* ctx) +{ + int iw, ih; + nvg__flushTextTexture(ctx); + if (ctx->fontImageIdx >= NVG_MAX_FONTIMAGES-1) + return 0; + // if next fontImage already have a texture + if (ctx->fontImages[ctx->fontImageIdx+1] != 0) + nvgImageSize(ctx, ctx->fontImages[ctx->fontImageIdx+1], &iw, &ih); + else { // calculate the new font image size and create it. + nvgImageSize(ctx, ctx->fontImages[ctx->fontImageIdx], &iw, &ih); + if (iw > ih) + ih *= 2; + else + iw *= 2; + if (iw > NVG_MAX_FONTIMAGE_SIZE || ih > NVG_MAX_FONTIMAGE_SIZE) + iw = ih = NVG_MAX_FONTIMAGE_SIZE; + ctx->fontImages[ctx->fontImageIdx+1] = ctx->params.renderCreateTexture(ctx->params.userPtr, NVG_TEXTURE_ALPHA, iw, ih, 0, NULL); + } + ++ctx->fontImageIdx; + fonsResetAtlas(ctx->fs, iw, ih); + return 1; +} + +static void nvg__renderText(NVGcontext* ctx, NVGpaint* paint, NVGvertex* verts, int nverts) +{ + NVGstate* state = nvg__getState(ctx); + + // Render triangles. + if (paint->image) + { + // if an image (gradient) has already been bound, then use image for font image and move previous image to image2 + paint->image2 = paint->image; + } + paint->image = ctx->fontImages[ctx->fontImageIdx]; + + // Apply global alpha + paint->innerColor.a *= state->alpha; + paint->outerColor.a *= state->alpha; + + ctx->params.renderTriangles(ctx->params.userPtr, paint, state->compositeOperation, &state->scissor, verts, nverts, state->m_filterStack); + + ctx->drawCallCount++; + ctx->textTriCount += nverts/3; +} + +static float nvg__getSdfFontSize(NVGstate* state, float scale) +{ + int fontSize = state->fontSize*scale; + int sdfFontSize = 32; + + // We double the font size so that SDFs are also used for smaller font sizes + // For instance an SDF font size of 128 is used for the target font size range of 64-256 + fontSize *= 2; + // Reduce the font size to a powers of 4 after 32 (e.g. 32, 32*4, 32*4*4) + fontSize /= sdfFontSize; + while (fontSize /= 4) sdfFontSize *= 4; + return sdfFontSize; +} + +// Computes the distance in SDF values of a single pixel +static float nvg__getSdfPixelDist(NVGstate* state, float scale) +{ + // Get the distance for a single pixel when the SDF is rendered without scaling + float pixelDist = (float)FONS_SDF_EDGE/FONS_SDF_PADDING; + // Scale it by the size of rendered pixels relative to SDF pixels + // (e.g. if there are 2 rendered pixels for each SDF pixel, then we want to half the distance) + pixelDist *= nvg__getSdfFontSize(state, scale) / (state->fontSize*scale); + // Scale it to a 0-1 range (rather than 0-255) + return pixelDist / 255; +} + +float nvg__text(NVGcontext* ctx, NVGpaint* paint, float scale, float x, float y, const char* string, const char* end) +{ + NVGstate* state = nvg__getState(ctx); + FONStextIter iter, prevIter; + FONSquad q; + NVGvertex* verts; + float sdfFontSize = nvg__getSdfFontSize(state, scale); + float vtxscale = state->fontSize/sdfFontSize; + int cverts = 0; + int nverts = 0; + + if (end == NULL) + end = string + strlen(string); + + if (state->fontId == FONS_INVALID) return x; + + fonsSetSize(ctx->fs, sdfFontSize); + fonsSetSpacing(ctx->fs, state->letterSpacing*scale); + fonsSetBlur(ctx->fs, state->fontBlur*scale); + fonsSetAlign(ctx->fs, state->textAlign); + fonsSetFont(ctx->fs, state->fontId); + + cverts = nvg__maxi(2, (int)(end - string)) * 6; // conservative estimate. + verts = nvg__allocTempVerts(ctx, cverts); + if (verts == NULL) return x; + + fonsTextIterInit(ctx->fs, &iter, 0, 0, string, end, FONS_GLYPH_BITMAP_REQUIRED); + prevIter = iter; + while (fonsTextIterNext(ctx->fs, &iter, &q)) { + float c[4*2]; + if (iter.prevGlyphIndex == -1) { // can not retrieve glyph? + if (nverts != 0) { + nvg__renderText(ctx, paint, verts, nverts); + nverts = 0; + } + if (!nvg__allocTextAtlas(ctx)) + break; // no memory :( + iter = prevIter; + fonsTextIterNext(ctx->fs, &iter, &q); // try again + if (iter.prevGlyphIndex == -1) // still can not find glyph? + break; + } + prevIter = iter; + // Transform corners. + nvgTransformPoint(&c[0],&c[1], state->xform, q.x0*vtxscale+x, q.y0*vtxscale+y); + nvgTransformPoint(&c[2],&c[3], state->xform, q.x1*vtxscale+x, q.y0*vtxscale+y); + nvgTransformPoint(&c[4],&c[5], state->xform, q.x1*vtxscale+x, q.y1*vtxscale+y); + nvgTransformPoint(&c[6],&c[7], state->xform, q.x0*vtxscale+x, q.y1*vtxscale+y); + // Create triangles + if (nverts+6 <= cverts) { + nvg__vset(&verts[nverts], c[0], c[1], q.s0, q.t0); nverts++; + nvg__vset(&verts[nverts], c[4], c[5], q.s1, q.t1); nverts++; + nvg__vset(&verts[nverts], c[2], c[3], q.s1, q.t0); nverts++; + nvg__vset(&verts[nverts], c[0], c[1], q.s0, q.t0); nverts++; + nvg__vset(&verts[nverts], c[6], c[7], q.s0, q.t1); nverts++; + nvg__vset(&verts[nverts], c[4], c[5], q.s1, q.t1); nverts++; + } + } + + // TODO: add back-end bit to do this just once per frame. + nvg__flushTextTexture(ctx); + + nvg__renderText(ctx, paint, verts, nverts); + + return iter.nextx * vtxscale; +} + +float nvgText(NVGcontext* ctx, float x, float y, const char* string, const char* end) +{ + NVGstate* state = nvg__getState(ctx); + NVGpaint paint = state->fill; + float scale = nvg__getFontScale(state) * ctx->devicePxRatio; + float pixelDist = nvg__getSdfPixelDist(state, scale); + + paint.sdfMin = 0.5; + // Add an extra pixel so it doesn't start fading out in the middle of the text + paint.sdfMax = 1.0 + pixelDist; + // TODO: handle text blurring + paint.sdfBlur = pixelDist; + return nvg__text(ctx, &paint, scale, x, y, string, end); +} + +float nvgStrokeText(NVGcontext* ctx, float x, float y, const char* string, const char* end) +{ + NVGstate* state = nvg__getState(ctx); + NVGpaint paint = state->stroke; + float scale = nvg__getFontScale(state) * ctx->devicePxRatio; + float pixelDist = nvg__getSdfPixelDist(state, scale); + float strokeScale = nvg__getAverageScale(state->xform); + // The distance in SDF values to get the required stroke width + float strokeDist = state->strokeWidth * strokeScale * pixelDist; + + paint.sdfMin = 0.5 - strokeDist / 2; + paint.sdfMax = 0.5 + strokeDist / 2; + // TODO: handle text blurring + paint.sdfBlur = pixelDist; + return nvg__text(ctx, &paint, scale, x, y, string, end); +} + +void nvgTextBox(NVGcontext* ctx, float x, float y, float breakRowWidth, const char* string, const char* end) +{ + NVGstate* state = nvg__getState(ctx); + NVGtextRow rows[2]; + int nrows = 0, i; + int oldAlign = state->textAlign; + int haling = state->textAlign & (NVG_ALIGN_LEFT | NVG_ALIGN_CENTER | NVG_ALIGN_RIGHT); + int valign = state->textAlign & (NVG_ALIGN_TOP | NVG_ALIGN_MIDDLE | NVG_ALIGN_BOTTOM | NVG_ALIGN_BASELINE); + float lineh = 0; + + if (state->fontId == FONS_INVALID) return; + + nvgTextMetrics(ctx, NULL, NULL, &lineh); + + state->textAlign = NVG_ALIGN_LEFT | valign; + + while ((nrows = nvgTextBreakLines(ctx, string, end, breakRowWidth, rows, 2))) { + for (i = 0; i < nrows; i++) { + NVGtextRow* row = &rows[i]; + if (haling & NVG_ALIGN_LEFT) + nvgText(ctx, x, y, row->start, row->end); + else if (haling & NVG_ALIGN_CENTER) + nvgText(ctx, x + breakRowWidth*0.5f - row->width*0.5f, y, row->start, row->end); + else if (haling & NVG_ALIGN_RIGHT) + nvgText(ctx, x + breakRowWidth - row->width, y, row->start, row->end); + y += lineh * state->lineHeight; + } + string = rows[nrows-1].next; + } + + state->textAlign = oldAlign; +} + +int nvgTextGlyphPositions(NVGcontext* ctx, float x, float y, const char* string, const char* end, NVGglyphPosition* positions, int maxPositions) +{ + NVGstate* state = nvg__getState(ctx); + float scale = nvg__getFontScale(state) * ctx->devicePxRatio; + float invscale = 1.0f / scale; + FONStextIter iter, prevIter; + FONSquad q; + int npos = 0; + + if (state->fontId == FONS_INVALID) return 0; + + if (end == NULL) + end = string + strlen(string); + + if (string == end) + return 0; + + fonsSetSize(ctx->fs, state->fontSize*scale); + fonsSetSpacing(ctx->fs, state->letterSpacing*scale); + fonsSetBlur(ctx->fs, state->fontBlur*scale); + fonsSetAlign(ctx->fs, state->textAlign); + fonsSetFont(ctx->fs, state->fontId); + + fonsTextIterInit(ctx->fs, &iter, x*scale, y*scale, string, end, FONS_GLYPH_BITMAP_OPTIONAL); + prevIter = iter; + while (fonsTextIterNext(ctx->fs, &iter, &q)) { + if (iter.prevGlyphIndex < 0 && nvg__allocTextAtlas(ctx)) { // can not retrieve glyph? + iter = prevIter; + fonsTextIterNext(ctx->fs, &iter, &q); // try again + } + prevIter = iter; + positions[npos].str = iter.str; + positions[npos].x = iter.x * invscale; + positions[npos].minx = nvg__minf(iter.x, q.x0) * invscale; + positions[npos].maxx = nvg__maxf(iter.nextx, q.x1) * invscale; + npos++; + if (npos >= maxPositions) + break; + } + + return npos; +} + +enum NVGcodepointType { + NVG_SPACE, + NVG_NEWLINE, + NVG_CHAR, + NVG_CJK_CHAR, +}; + +int nvgTextBreakLines(NVGcontext* ctx, const char* string, const char* end, float breakRowWidth, NVGtextRow* rows, int maxRows) +{ + NVGstate* state = nvg__getState(ctx); + float scale = nvg__getFontScale(state) * ctx->devicePxRatio; + float invscale = 1.0f / scale; + FONStextIter iter, prevIter; + FONSquad q; + int nrows = 0; + float rowStartX = 0; + float rowWidth = 0; + float rowMinX = 0; + float rowMaxX = 0; + const char* rowStart = NULL; + const char* rowEnd = NULL; + const char* wordStart = NULL; + float wordStartX = 0; + float wordMinX = 0; + const char* breakEnd = NULL; + float breakWidth = 0; + float breakMaxX = 0; + int type = NVG_SPACE, ptype = NVG_SPACE; + unsigned int pcodepoint = 0; + + if (maxRows == 0) return 0; + if (state->fontId == FONS_INVALID) return 0; + + if (end == NULL) + end = string + strlen(string); + + if (string == end) return 0; + + fonsSetSize(ctx->fs, state->fontSize*scale); + fonsSetSpacing(ctx->fs, state->letterSpacing*scale); + fonsSetBlur(ctx->fs, state->fontBlur*scale); + fonsSetAlign(ctx->fs, state->textAlign); + fonsSetFont(ctx->fs, state->fontId); + + breakRowWidth *= scale; + + fonsTextIterInit(ctx->fs, &iter, 0, 0, string, end, FONS_GLYPH_BITMAP_OPTIONAL); + prevIter = iter; + while (fonsTextIterNext(ctx->fs, &iter, &q)) { + if (iter.prevGlyphIndex < 0 && nvg__allocTextAtlas(ctx)) { // can not retrieve glyph? + iter = prevIter; + fonsTextIterNext(ctx->fs, &iter, &q); // try again + } + prevIter = iter; + switch (iter.codepoint) { + case 9: // \t + case 11: // \v + case 12: // \f + case 32: // space + case 0x00a0: // NBSP + type = NVG_SPACE; + break; + case 10: // \n + type = pcodepoint == 13 ? NVG_SPACE : NVG_NEWLINE; + break; + case 13: // \r + type = pcodepoint == 10 ? NVG_SPACE : NVG_NEWLINE; + break; + case 0x0085: // NEL + type = NVG_NEWLINE; + break; + default: + if ((iter.codepoint >= 0x4E00 && iter.codepoint <= 0x9FFF) || + (iter.codepoint >= 0x3000 && iter.codepoint <= 0x30FF) || + (iter.codepoint >= 0xFF00 && iter.codepoint <= 0xFFEF) || + (iter.codepoint >= 0x1100 && iter.codepoint <= 0x11FF) || + (iter.codepoint >= 0x3130 && iter.codepoint <= 0x318F) || + (iter.codepoint >= 0xAC00 && iter.codepoint <= 0xD7AF)) + type = NVG_CJK_CHAR; + else + type = NVG_CHAR; + break; + } + + if (type == NVG_NEWLINE) { + // Always handle new lines. + rows[nrows].start = rowStart != NULL ? rowStart : iter.str; + rows[nrows].end = rowEnd != NULL ? rowEnd : iter.str; + rows[nrows].width = rowWidth * invscale; + rows[nrows].minx = rowMinX * invscale; + rows[nrows].maxx = rowMaxX * invscale; + rows[nrows].next = iter.next; + nrows++; + if (nrows >= maxRows) + return nrows; + // Set null break point + breakEnd = rowStart; + breakWidth = 0.0; + breakMaxX = 0.0; + // Indicate to skip the white space at the beginning of the row. + rowStart = NULL; + rowEnd = NULL; + rowWidth = 0; + rowMinX = rowMaxX = 0; + } else { + if (rowStart == NULL) { + // Skip white space until the beginning of the line + if (type == NVG_CHAR || type == NVG_CJK_CHAR) { + // The current char is the row so far + rowStartX = iter.x; + rowStart = iter.str; + rowEnd = iter.next; + rowWidth = iter.nextx - rowStartX; // q.x1 - rowStartX; + rowMinX = q.x0 - rowStartX; + rowMaxX = q.x1 - rowStartX; + wordStart = iter.str; + wordStartX = iter.x; + wordMinX = q.x0 - rowStartX; + // Set null break point + breakEnd = rowStart; + breakWidth = 0.0; + breakMaxX = 0.0; + } + } else { + float nextWidth = iter.nextx - rowStartX; + + // track last non-white space character + if (type == NVG_CHAR || type == NVG_CJK_CHAR) { + rowEnd = iter.next; + rowWidth = iter.nextx - rowStartX; + rowMaxX = q.x1 - rowStartX; + } + // track last end of a word + if (((ptype == NVG_CHAR || ptype == NVG_CJK_CHAR) && type == NVG_SPACE) || type == NVG_CJK_CHAR) { + breakEnd = iter.str; + breakWidth = rowWidth; + breakMaxX = rowMaxX; + } + // track last beginning of a word + if ((ptype == NVG_SPACE && (type == NVG_CHAR || type == NVG_CJK_CHAR)) || type == NVG_CJK_CHAR) { + wordStart = iter.str; + wordStartX = iter.x; + wordMinX = q.x0 - rowStartX; + } + + // Break to new line when a character is beyond break width. + if ((type == NVG_CHAR || type == NVG_CJK_CHAR) && nextWidth > breakRowWidth) { + // The run length is too long, need to break to new line. + if (breakEnd == rowStart) { + // The current word is longer than the row length, just break it from here. + rows[nrows].start = rowStart; + rows[nrows].end = iter.str; + rows[nrows].width = rowWidth * invscale; + rows[nrows].minx = rowMinX * invscale; + rows[nrows].maxx = rowMaxX * invscale; + rows[nrows].next = iter.str; + nrows++; + if (nrows >= maxRows) + return nrows; + rowStartX = iter.x; + rowStart = iter.str; + rowEnd = iter.next; + rowWidth = iter.nextx - rowStartX; + rowMinX = q.x0 - rowStartX; + rowMaxX = q.x1 - rowStartX; + wordStart = iter.str; + wordStartX = iter.x; + wordMinX = q.x0 - rowStartX; + } else { + // Break the line from the end of the last word, and start new line from the beginning of the new. + rows[nrows].start = rowStart; + rows[nrows].end = breakEnd; + rows[nrows].width = breakWidth * invscale; + rows[nrows].minx = rowMinX * invscale; + rows[nrows].maxx = breakMaxX * invscale; + rows[nrows].next = wordStart; + nrows++; + if (nrows >= maxRows) + return nrows; + rowStartX = wordStartX; + rowStart = wordStart; + rowEnd = iter.next; + rowWidth = iter.nextx - rowStartX; + rowMinX = wordMinX; + rowMaxX = q.x1 - rowStartX; + // No change to the word start + } + // Set null break point + breakEnd = rowStart; + breakWidth = 0.0; + breakMaxX = 0.0; + } + } + } + + pcodepoint = iter.codepoint; + ptype = type; + } + + // Break the line from the end of the last word, and start new line from the beginning of the new. + if (rowStart != NULL) { + rows[nrows].start = rowStart; + rows[nrows].end = rowEnd; + rows[nrows].width = rowWidth * invscale; + rows[nrows].minx = rowMinX * invscale; + rows[nrows].maxx = rowMaxX * invscale; + rows[nrows].next = end; + nrows++; + } + + return nrows; +} + +float nvgTextBounds(NVGcontext* ctx, float x, float y, const char* string, const char* end, float* bounds) +{ + NVGstate* state = nvg__getState(ctx); + float scale = nvg__getFontScale(state) * ctx->devicePxRatio; + float invscale = 1.0f / scale; + float width; + + if (state->fontId == FONS_INVALID) return 0; + + fonsSetSize(ctx->fs, state->fontSize*scale); + fonsSetSpacing(ctx->fs, state->letterSpacing*scale); + fonsSetBlur(ctx->fs, state->fontBlur*scale); + fonsSetAlign(ctx->fs, state->textAlign); + fonsSetFont(ctx->fs, state->fontId); + + width = fonsTextBounds(ctx->fs, x*scale, y*scale, string, end, bounds); + if (bounds != NULL) { + // Use line bounds for height. + fonsLineBounds(ctx->fs, y*scale, &bounds[1], &bounds[3]); + bounds[0] *= invscale; + bounds[1] *= invscale; + bounds[2] *= invscale; + bounds[3] *= invscale; + } + return width * invscale; +} + +void nvgTextBoxBounds(NVGcontext* ctx, float x, float y, float breakRowWidth, const char* string, const char* end, float* bounds) +{ + NVGstate* state = nvg__getState(ctx); + NVGtextRow rows[2]; + float scale = nvg__getFontScale(state) * ctx->devicePxRatio; + float invscale = 1.0f / scale; + int nrows = 0, i; + int oldAlign = state->textAlign; + int haling = state->textAlign & (NVG_ALIGN_LEFT | NVG_ALIGN_CENTER | NVG_ALIGN_RIGHT); + int valign = state->textAlign & (NVG_ALIGN_TOP | NVG_ALIGN_MIDDLE | NVG_ALIGN_BOTTOM | NVG_ALIGN_BASELINE); + float lineh = 0, rminy = 0, rmaxy = 0; + float minx, miny, maxx, maxy; + + if (state->fontId == FONS_INVALID) { + if (bounds != NULL) + bounds[0] = bounds[1] = bounds[2] = bounds[3] = 0.0f; + return; + } + + nvgTextMetrics(ctx, NULL, NULL, &lineh); + + state->textAlign = NVG_ALIGN_LEFT | valign; + + minx = maxx = x; + miny = maxy = y; + + fonsSetSize(ctx->fs, state->fontSize*scale); + fonsSetSpacing(ctx->fs, state->letterSpacing*scale); + fonsSetBlur(ctx->fs, state->fontBlur*scale); + fonsSetAlign(ctx->fs, state->textAlign); + fonsSetFont(ctx->fs, state->fontId); + fonsLineBounds(ctx->fs, 0, &rminy, &rmaxy); + rminy *= invscale; + rmaxy *= invscale; + + while ((nrows = nvgTextBreakLines(ctx, string, end, breakRowWidth, rows, 2))) { + for (i = 0; i < nrows; i++) { + NVGtextRow* row = &rows[i]; + float rminx, rmaxx, dx = 0; + // Horizontal bounds + if (haling & NVG_ALIGN_LEFT) + dx = 0; + else if (haling & NVG_ALIGN_CENTER) + dx = breakRowWidth*0.5f - row->width*0.5f; + else if (haling & NVG_ALIGN_RIGHT) + dx = breakRowWidth - row->width; + rminx = x + row->minx + dx; + rmaxx = x + row->maxx + dx; + minx = nvg__minf(minx, rminx); + maxx = nvg__maxf(maxx, rmaxx); + // Vertical bounds. + miny = nvg__minf(miny, y + rminy); + maxy = nvg__maxf(maxy, y + rmaxy); + + y += lineh * state->lineHeight; + } + string = rows[nrows-1].next; + } + + state->textAlign = oldAlign; + + if (bounds != NULL) { + bounds[0] = minx; + bounds[1] = miny; + bounds[2] = maxx; + bounds[3] = maxy; + } +} + +void nvgTextMetrics(NVGcontext* ctx, float* ascender, float* descender, float* lineh) +{ + NVGstate* state = nvg__getState(ctx); + float scale = nvg__getFontScale(state) * ctx->devicePxRatio; + float invscale = 1.0f / scale; + + if (state->fontId == FONS_INVALID) return; + + fonsSetSize(ctx->fs, state->fontSize*scale); + fonsSetSpacing(ctx->fs, state->letterSpacing*scale); + fonsSetBlur(ctx->fs, state->fontBlur*scale); + fonsSetAlign(ctx->fs, state->textAlign); + fonsSetFont(ctx->fs, state->fontId); + + fonsVertMetrics(ctx->fs, ascender, descender, lineh); + if (ascender != NULL) + *ascender *= invscale; + if (descender != NULL) + *descender *= invscale; + if (lineh != NULL) + *lineh *= invscale; +} +// vim: ft=c nu noet ts=4 diff --git a/Polyfills/Canvas/Source/nanovg/nanovg.h b/Polyfills/Canvas/Source/nanovg/nanovg.h new file mode 100644 index 000000000..14989ffba --- /dev/null +++ b/Polyfills/Canvas/Source/nanovg/nanovg.h @@ -0,0 +1,687 @@ +// +// Copyright (c) 2013 Mikko Mononen memon@inside.org +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// + +#ifndef NANOVG_H +#define NANOVG_H + +#ifdef __cplusplus +extern "C" { +#endif + +#define NVG_PI 3.14159265358979323846264338327f + +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable: 4201) // nonstandard extension used : nameless struct/union +#endif + +class nanovg_filterstack; +typedef struct NVGcontext NVGcontext; + +struct NVGcolor { + union { + float rgba[4]; + struct { + float r,g,b,a; + }; + }; +}; +typedef struct NVGcolor NVGcolor; + +struct NVGpaint { + float xform[6]; + float extent[2]; + float radius; + float feather; + NVGcolor innerColor; + NVGcolor outerColor; + int image; + int image2; + float sdfMin; + float sdfMax; + float sdfBlur; +}; +typedef struct NVGpaint NVGpaint; + +enum NVGwinding { + NVG_CCW = 1, // Winding for solid shapes + NVG_CW = 2, // Winding for holes +}; + +enum NVGsolidity { + NVG_SOLID = 1, // CCW + NVG_HOLE = 2, // CW +}; + +enum NVGlineCap { + NVG_BUTT, + NVG_ROUND, + NVG_SQUARE, + NVG_BEVEL, + NVG_MITER, +}; + +enum NVGalign { + // Horizontal align + NVG_ALIGN_LEFT = 1<<0, // Default, align text horizontally to left. + NVG_ALIGN_CENTER = 1<<1, // Align text horizontally to center. + NVG_ALIGN_RIGHT = 1<<2, // Align text horizontally to right. + // Vertical align + NVG_ALIGN_TOP = 1<<3, // Align text vertically to top. + NVG_ALIGN_MIDDLE = 1<<4, // Align text vertically to middle. + NVG_ALIGN_BOTTOM = 1<<5, // Align text vertically to bottom. + NVG_ALIGN_BASELINE = 1<<6, // Default, align text vertically to baseline. +}; + +enum NVGblendFactor { + NVG_ZERO = 1<<0, + NVG_ONE = 1<<1, + NVG_SRC_COLOR = 1<<2, + NVG_ONE_MINUS_SRC_COLOR = 1<<3, + NVG_DST_COLOR = 1<<4, + NVG_ONE_MINUS_DST_COLOR = 1<<5, + NVG_SRC_ALPHA = 1<<6, + NVG_ONE_MINUS_SRC_ALPHA = 1<<7, + NVG_DST_ALPHA = 1<<8, + NVG_ONE_MINUS_DST_ALPHA = 1<<9, + NVG_SRC_ALPHA_SATURATE = 1<<10, +}; + +enum NVGcompositeOperation { + NVG_SOURCE_OVER, + NVG_SOURCE_IN, + NVG_SOURCE_OUT, + NVG_ATOP, + NVG_DESTINATION_OVER, + NVG_DESTINATION_IN, + NVG_DESTINATION_OUT, + NVG_DESTINATION_ATOP, + NVG_LIGHTER, + NVG_COPY, + NVG_XOR, +}; + +struct NVGcompositeOperationState { + int srcRGB; + int dstRGB; + int srcAlpha; + int dstAlpha; +}; +typedef struct NVGcompositeOperationState NVGcompositeOperationState; + +struct NVGglyphPosition { + const char* str; // Position of the glyph in the input string. + float x; // The x-coordinate of the logical glyph position. + float minx, maxx; // The bounds of the glyph shape. +}; +typedef struct NVGglyphPosition NVGglyphPosition; + +struct NVGtextRow { + const char* start; // Pointer to the input text where the row starts. + const char* end; // Pointer to the input text where the row ends (one past the last character). + const char* next; // Pointer to the beginning of the next row. + float width; // Logical width of the row. + float minx, maxx; // Actual bounds of the row. Logical with and bounds can differ because of kerning and some parts over extending. +}; +typedef struct NVGtextRow NVGtextRow; + +enum NVGimageFlags { + NVG_IMAGE_GENERATE_MIPMAPS = 1<<0, // Generate mipmaps during creation of the image. + NVG_IMAGE_REPEATX = 1<<1, // Repeat image in X direction. + NVG_IMAGE_REPEATY = 1<<2, // Repeat image in Y direction. + NVG_IMAGE_FLIPY = 1<<3, // Flips (inverses) image in Y direction when rendered. + NVG_IMAGE_PREMULTIPLIED = 1<<4, // Image data has premultiplied alpha. + NVG_IMAGE_NEAREST = 1<<5, // Image interpolation is Nearest instead Linear +}; + +// Begin drawing a new frame +// Calls to nanovg drawing API should be wrapped in nvgBeginFrame() & nvgEndFrame() +// nvgBeginFrame() defines the size of the window to render to in relation currently +// set viewport (i.e. glViewport on GL backends). Device pixel ration allows to +// control the rendering on Hi-DPI devices. +// For example, GLFW returns two dimension for an opened window: window size and +// frame buffer size. In that case you would set windowWidth/Height to the window size +// devicePixelRatio to: frameBufferWidth / windowWidth. +void nvgBeginFrame(NVGcontext* ctx, float windowWidth, float windowHeight, float devicePixelRatio); + +// Cancels drawing the current frame. +void nvgCancelFrame(NVGcontext* ctx); + +// Ends drawing flushing remaining render state. +void nvgEndFrame(NVGcontext* ctx); + +// +// Composite operation +// +// The composite operations in NanoVG are modeled after HTML Canvas API, and +// the blend func is based on OpenGL (see corresponding manuals for more info). +// The colors in the blending state have premultiplied alpha. + +// Sets the composite operation. The op parameter should be one of NVGcompositeOperation. +void nvgGlobalCompositeOperation(NVGcontext* ctx, int op); + +// Sets the composite operation with custom pixel arithmetic. The parameters should be one of NVGblendFactor. +void nvgGlobalCompositeBlendFunc(NVGcontext* ctx, int sfactor, int dfactor); + +// Sets the composite operation with custom pixel arithmetic for RGB and alpha components separately. The parameters should be one of NVGblendFactor. +void nvgGlobalCompositeBlendFuncSeparate(NVGcontext* ctx, int srcRGB, int dstRGB, int srcAlpha, int dstAlpha); + +// +// Color utils +// +// Colors in NanoVG are stored as unsigned ints in ABGR format. + +// Returns a color value from red, green, blue values. Alpha will be set to 255 (1.0f). +NVGcolor nvgRGB(unsigned char r, unsigned char g, unsigned char b); + +// Returns a color value from red, green, blue values. Alpha will be set to 1.0f. +NVGcolor nvgRGBf(float r, float g, float b); + + +// Returns a color value from red, green, blue and alpha values. +NVGcolor nvgRGBA(unsigned char r, unsigned char g, unsigned char b, unsigned char a); + +// Returns a color value from red, green, blue and alpha values. +NVGcolor nvgRGBAf(float r, float g, float b, float a); + + +// Linearly interpolates from color c0 to c1, and returns resulting color value. +NVGcolor nvgLerpRGBA(NVGcolor c0, NVGcolor c1, float u); + +// Sets transparency of a color value. +NVGcolor nvgTransRGBA(NVGcolor c0, unsigned char a); + +// Sets transparency of a color value. +NVGcolor nvgTransRGBAf(NVGcolor c0, float a); + +// Returns color value specified by hue, saturation and lightness. +// HSL values are all in range [0..1], alpha will be set to 255. +NVGcolor nvgHSL(float h, float s, float l); + +// Returns color value specified by hue, saturation and lightness and alpha. +// HSL values are all in range [0..1], alpha in range [0..255] +NVGcolor nvgHSLA(float h, float s, float l, unsigned char a); + +// +// State Handling +// +// NanoVG contains state which represents how paths will be rendered. +// The state contains transform, fill and stroke styles, text and font styles, +// and scissor clipping. + +// Pushes and saves the current render state into a state stack. +// A matching nvgRestore() must be used to restore the state. +void nvgSave(NVGcontext* ctx); + +// Pops and restores current render state. +void nvgRestore(NVGcontext* ctx); + +// Resets current render state to default values. Does not affect the render state stack. +void nvgReset(NVGcontext* ctx); + +// +// Render styles +// +// Fill and stroke render style can be either a solid color or a paint which is a gradient or a pattern. +// Solid color is simply defined as a color value, different kinds of paints can be created +// using nvgLinearGradient(), nvgBoxGradient(), nvgRadialGradient() and nvgImagePattern(). +// +// Current render style can be saved and restored using nvgSave() and nvgRestore(). + +// Sets whether to draw antialias for nvgStroke() and nvgFill(). It's enabled by default. +void nvgShapeAntiAlias(NVGcontext* ctx, int enabled); + +// Sets current stroke style to a solid color. +void nvgStrokeColor(NVGcontext* ctx, NVGcolor color); + +// Sets current stroke style to a paint, which can be a one of the gradients or a pattern. +void nvgStrokePaint(NVGcontext* ctx, NVGpaint paint); + +// Sets current fill style to a solid color. +void nvgFillColor(NVGcontext* ctx, NVGcolor color); + +// Sets current fill style to a paint, which can be a one of the gradients or a pattern. +void nvgFillPaint(NVGcontext* ctx, NVGpaint paint); + +// Sets the miter limit of the stroke style. +// Miter limit controls when a sharp corner is beveled. +void nvgMiterLimit(NVGcontext* ctx, float limit); + +// Sets the stroke width of the stroke style. +void nvgStrokeWidth(NVGcontext* ctx, float size); + +// Sets how the end of the line (cap) is drawn, +// Can be one of: NVG_BUTT (default), NVG_ROUND, NVG_SQUARE. +void nvgLineCap(NVGcontext* ctx, int cap); + +// Sets how sharp path corners are drawn. +// Can be one of NVG_MITER (default), NVG_ROUND, NVG_BEVEL. +void nvgLineJoin(NVGcontext* ctx, int join); + +// Sets the transparency applied to all rendered shapes. +// Already transparent paths will get proportionally more transparent as well. +void nvgGlobalAlpha(NVGcontext* ctx, float alpha); + +// +// Transforms +// +// The paths, gradients, patterns and scissor region are transformed by an transformation +// matrix at the time when they are passed to the API. +// The current transformation matrix is a affine matrix: +// [sx kx tx] +// [ky sy ty] +// [ 0 0 1] +// Where: sx,sy define scaling, kx,ky skewing, and tx,ty translation. +// The last row is assumed to be 0,0,1 and is not stored. +// +// Apart from nvgResetTransform(), each transformation function first creates +// specific transformation matrix and pre-multiplies the current transformation by it. +// +// Current coordinate system (transformation) can be saved and restored using nvgSave() and nvgRestore(). + +// Resets current transform to a identity matrix. +void nvgResetTransform(NVGcontext* ctx); + +// Premultiplies current coordinate system by specified matrix. +// The parameters are interpreted as matrix as follows: +// [a c e] +// [b d f] +// [0 0 1] +void nvgTransform(NVGcontext* ctx, float a, float b, float c, float d, float e, float f); + +// Translates current coordinate system. +void nvgTranslate(NVGcontext* ctx, float x, float y); + +// Rotates current coordinate system. Angle is specified in radians. +void nvgRotate(NVGcontext* ctx, float angle); + +// Skews the current coordinate system along X axis. Angle is specified in radians. +void nvgSkewX(NVGcontext* ctx, float angle); + +// Skews the current coordinate system along Y axis. Angle is specified in radians. +void nvgSkewY(NVGcontext* ctx, float angle); + +// Scales the current coordinate system. +void nvgScale(NVGcontext* ctx, float x, float y); + +// Stores the top part (a-f) of the current transformation matrix in to the specified buffer. +// [a c e] +// [b d f] +// [0 0 1] +// There should be space for 6 floats in the return buffer for the values a-f. +void nvgCurrentTransform(NVGcontext* ctx, float* xform); + + +// The following functions can be used to make calculations on 2x3 transformation matrices. +// A 2x3 matrix is represented as float[6]. + +// Sets the transform to identity matrix. +void nvgTransformIdentity(float* dst); + +// Sets the transform to translation matrix matrix. +void nvgTransformTranslate(float* dst, float tx, float ty); + +// Sets the transform to scale matrix. +void nvgTransformScale(float* dst, float sx, float sy); + +// Sets the transform to rotate matrix. Angle is specified in radians. +void nvgTransformRotate(float* dst, float a); + +// Sets the transform to skew-x matrix. Angle is specified in radians. +void nvgTransformSkewX(float* dst, float a); + +// Sets the transform to skew-y matrix. Angle is specified in radians. +void nvgTransformSkewY(float* dst, float a); + +// Sets the transform to the result of multiplication of two transforms, of A = A*B. +void nvgTransformMultiply(float* dst, const float* src); + +// Sets the transform to the result of multiplication of two transforms, of A = B*A. +void nvgTransformPremultiply(float* dst, const float* src); + +// Sets the destination to inverse of specified transform. +// Returns 1 if the inverse could be calculated, else 0. +int nvgTransformInverse(float* dst, const float* src); + +// Transform a point by given transform. +void nvgTransformPoint(float* dstx, float* dsty, const float* xform, float srcx, float srcy); + +// Converts degrees to radians and vice versa. +float nvgDegToRad(float deg); +float nvgRadToDeg(float rad); + +// +// Images +// +// NanoVG allows you to load jpg, png, psd, tga, pic and gif files to be used for rendering. +// In addition you can upload your own image. The image loading is provided by stb_image. +// The parameter imageFlags is combination of flags defined in NVGimageFlags. + +// Creates image from specified image data. +// Returns handle to the image. +int nvgCreateImageRGBA(NVGcontext* ctx, int w, int h, int imageFlags, const unsigned char* data); + +// Updates image data specified by image handle. +void nvgUpdateImage(NVGcontext* ctx, int image, const unsigned char* data); + +// Returns the dimensions of a created image. +void nvgImageSize(NVGcontext* ctx, int image, int* w, int* h); + +// Deletes created image. +void nvgDeleteImage(NVGcontext* ctx, int image); + +// +// Paints +// +// NanoVG supports four types of paints: linear gradient, box gradient, radial gradient and image pattern. +// These can be used as paints for strokes and fills. + +// Creates and returns a linear gradient. Parameters (sx,sy)-(ex,ey) specify the start and end coordinates +// of the linear gradient, icol specifies the start color and ocol the end color. +// The gradient is transformed by the current transform when it is passed to nvgFillPaint() or nvgStrokePaint(). +NVGpaint nvgLinearGradient(NVGcontext* ctx, float sx, float sy, float ex, float ey, + NVGcolor icol, NVGcolor ocol); + +// Creates and returns a box gradient. Box gradient is a feathered rounded rectangle, it is useful for rendering +// drop shadows or highlights for boxes. Parameters (x,y) define the top-left corner of the rectangle, +// (w,h) define the size of the rectangle, r defines the corner radius, and f feather. Feather defines how blurry +// the border of the rectangle is. Parameter icol specifies the inner color and ocol the outer color of the gradient. +// The gradient is transformed by the current transform when it is passed to nvgFillPaint() or nvgStrokePaint(). +NVGpaint nvgBoxGradient(NVGcontext* ctx, float x, float y, float w, float h, + float r, float f, NVGcolor icol, NVGcolor ocol); + +// Creates and returns a radial gradient. Parameters (cx,cy) specify the center, inr and outr specify +// the inner and outer radius of the gradient, icol specifies the start color and ocol the end color. +// The gradient is transformed by the current transform when it is passed to nvgFillPaint() or nvgStrokePaint(). +NVGpaint nvgRadialGradient(NVGcontext* ctx, float cx, float cy, float inr, float outr, + NVGcolor icol, NVGcolor ocol); + +// Creates and returns an image pattern. Parameters (ox,oy) specify the left-top location of the image pattern, +// (ex,ey) the size of one image, angle rotation around the top-left corner, image is handle to the image to render. +// The gradient is transformed by the current transform when it is passed to nvgFillPaint() or nvgStrokePaint(). +NVGpaint nvgImagePattern(NVGcontext* ctx, float ox, float oy, float ex, float ey, + float angle, int image, float alpha); + +// +// Scissoring +// +// Scissoring allows you to clip the rendering into a rectangle. This is useful for various +// user interface cases like rendering a text edit or a timeline. + +// Sets the current scissor rectangle. +// The scissor rectangle is transformed by the current transform. +void nvgScissor(NVGcontext* ctx, float x, float y, float w, float h); + +// Intersects current scissor rectangle with the specified rectangle. +// The scissor rectangle is transformed by the current transform. +// Note: in case the rotation of previous scissor rect differs from +// the current one, the intersection will be done between the specified +// rectangle and the previous scissor rectangle transformed in the current +// transform space. The resulting shape is always rectangle. +void nvgIntersectScissor(NVGcontext* ctx, float x, float y, float w, float h); + +// Reset and disables scissoring. +void nvgResetScissor(NVGcontext* ctx); + +// +// Paths +// +// Drawing a new shape starts with nvgBeginPath(), it clears all the currently defined paths. +// Then you define one or more paths and sub-paths which describe the shape. The are functions +// to draw common shapes like rectangles and circles, and lower level step-by-step functions, +// which allow to define a path curve by curve. +// +// NanoVG uses even-odd fill rule to draw the shapes. Solid shapes should have counter clockwise +// winding and holes should have counter clockwise order. To specify winding of a path you can +// call nvgPathWinding(). This is useful especially for the common shapes, which are drawn CCW. +// +// Finally you can fill the path using current fill style by calling nvgFill(), and stroke it +// with current stroke style by calling nvgStroke(). +// +// The curve segments and sub-paths are transformed by the current transform. + +// Clears the current path and sub-paths. +void nvgBeginPath(NVGcontext* ctx); + +// Starts new sub-path with specified point as first point. +void nvgMoveTo(NVGcontext* ctx, float x, float y); + +// Adds line segment from the last point in the path to the specified point. +void nvgLineTo(NVGcontext* ctx, float x, float y); + +// Adds cubic bezier segment from last point in the path via two control points to the specified point. +void nvgBezierTo(NVGcontext* ctx, float c1x, float c1y, float c2x, float c2y, float x, float y); + +// Adds quadratic bezier segment from last point in the path via a control point to the specified point. +void nvgQuadTo(NVGcontext* ctx, float cx, float cy, float x, float y); + +// Adds an arc segment at the corner defined by the last path point, and two specified points. +void nvgArcTo(NVGcontext* ctx, float x1, float y1, float x2, float y2, float radius); + +// Closes current sub-path with a line segment. +void nvgClosePath(NVGcontext* ctx); + +// Sets the current sub-path winding, see NVGwinding and NVGsolidity. +void nvgPathWinding(NVGcontext* ctx, int dir); + +// Creates new circle arc shaped sub-path. The arc center is at cx,cy, the arc radius is r, +// and the arc is drawn from angle a0 to a1, and swept in direction dir (NVG_CCW, or NVG_CW). +// Angles are specified in radians. +void nvgArc(NVGcontext* ctx, float cx, float cy, float r, float a0, float a1, int dir); + +// Creates new rectangle shaped sub-path. +void nvgRect(NVGcontext* ctx, float x, float y, float w, float h); + +// Creates new rounded rectangle shaped sub-path. +void nvgRoundedRect(NVGcontext* ctx, float x, float y, float w, float h, float r); + +// Creates new rounded rectangle shaped sub-path with varying radii for each corner. +void nvgRoundedRectVarying(NVGcontext* ctx, float x, float y, float w, float h, float radTopLeft, float radTopRight, float radBottomRight, float radBottomLeft); + +// Creates new rounded rectangle shaped sub-path with varying elliptic radii for each corner. +void nvgRoundedRectElliptic(NVGcontext* ctx, float x, float y, float w, float h, float rxTopLeft, float ryTopLeft, float rxTopRight, float ryTopRight, float rxBottomRight, float ryBottomRight, float rxBottomLeft, float ryBottomLeft); + +// Creates new ellipse shaped sub-path. +void nvgEllipse(NVGcontext* ctx, float cx, float cy, float rx, float ry); + +// Creates new circle shaped sub-path. +void nvgCircle(NVGcontext* ctx, float cx, float cy, float r); + +// Fills the current path with current fill style. +void nvgFill(NVGcontext* ctx); + +// Fills the current path with current stroke style. +void nvgStroke(NVGcontext* ctx); + + +// +// Text +// +// NanoVG allows you to load .ttf files and use the font to render text. +// +// The appearance of the text can be defined by setting the current text style +// and by specifying the fill color. Common text and font settings such as +// font size, letter spacing and text align are supported. Font blur allows you +// to create simple text effects such as drop shadows. +// +// At render time the font face can be set based on the font handles or name. +// +// Font measure functions return values in local space, the calculations are +// carried in the same resolution as the final rendering. This is done because +// the text glyph positions are snapped to the nearest pixels sharp rendering. +// +// The local space means that values are not rotated or scale as per the current +// transformation. For example if you set font size to 12, which would mean that +// line height is 16, then regardless of the current scaling and rotation, the +// returned line height is always 16. Some measures may vary because of the scaling +// since aforementioned pixel snapping. +// +// While this may sound a little odd, the setup allows you to always render the +// same way regardless of scaling. I.e. following works regardless of scaling: +// +// const char* txt = "Text me up."; +// nvgTextBounds(vg, x,y, txt, NULL, bounds); +// nvgBeginPath(vg); +// nvgRoundedRect(vg, bounds[0],bounds[1], bounds[2]-bounds[0], bounds[3]-bounds[1]); +// nvgFill(vg); +// +// Note: currently only solid color fill is supported for text. + +// Creates font by loading it from the disk from specified file name. +// Returns handle to the font. +int nvgCreateFont(NVGcontext* ctx, const char* name, const char* filename); + +// Creates font by loading it from the specified memory chunk. +// Returns handle to the font. +int nvgCreateFontMem(NVGcontext* ctx, const char* name, unsigned char* data, int ndata, int freeData); + +// Finds a loaded font of specified name, and returns handle to it, or -1 if the font is not found. +int nvgFindFont(NVGcontext* ctx, const char* name); + +// Adds a fallback font by handle. +int nvgAddFallbackFontId(NVGcontext* ctx, int baseFont, int fallbackFont); + +// Adds a fallback font by name. +int nvgAddFallbackFont(NVGcontext* ctx, const char* baseFont, const char* fallbackFont); + +// Sets the font size of current text style. +void nvgFontSize(NVGcontext* ctx, float size); + +// Sets the blur of current text style. +void nvgFontBlur(NVGcontext* ctx, float blur); + +// Sets the letter spacing of current text style. +void nvgTextLetterSpacing(NVGcontext* ctx, float spacing); + +// Sets the proportional line height of current text style. The line height is specified as multiple of font size. +void nvgTextLineHeight(NVGcontext* ctx, float lineHeight); + +// Sets the text align of current text style, see NVGalign for options. +void nvgTextAlign(NVGcontext* ctx, int align); + +// Sets the font face based on specified id of current text style. +void nvgFontFaceId(NVGcontext* ctx, int font); + +// Sets the font face based on specified name of current text style. +void nvgFontFace(NVGcontext* ctx, const char* font); + +// Draws text string at specified location. If end is specified only the sub-string up to the end is drawn. +float nvgText(NVGcontext* ctx, float x, float y, const char* string, const char* end); +float nvgStrokeText(NVGcontext* ctx, float x, float y, const char* string, const char* end); + +// Draws multi-line text string at specified location wrapped at the specified width. If end is specified only the sub-string up to the end is drawn. +// White space is stripped at the beginning of the rows, the text is split at word boundaries or when new-line characters are encountered. +// Words longer than the max width are slit at nearest character (i.e. no hyphenation). +void nvgTextBox(NVGcontext* ctx, float x, float y, float breakRowWidth, const char* string, const char* end); + +// Measures the specified text string. Parameter bounds should be a pointer to float[4], +// if the bounding box of the text should be returned. The bounds value are [xmin,ymin, xmax,ymax] +// Returns the horizontal advance of the measured text (i.e. where the next character should drawn). +// Measured values are returned in local coordinate space. +float nvgTextBounds(NVGcontext* ctx, float x, float y, const char* string, const char* end, float* bounds); + +// Measures the specified multi-text string. Parameter bounds should be a pointer to float[4], +// if the bounding box of the text should be returned. The bounds value are [xmin,ymin, xmax,ymax] +// Measured values are returned in local coordinate space. +void nvgTextBoxBounds(NVGcontext* ctx, float x, float y, float breakRowWidth, const char* string, const char* end, float* bounds); + +// Calculates the glyph x positions of the specified text. If end is specified only the sub-string will be used. +// Measured values are returned in local coordinate space. +int nvgTextGlyphPositions(NVGcontext* ctx, float x, float y, const char* string, const char* end, NVGglyphPosition* positions, int maxPositions); + +// Returns the vertical metrics based on the current text style. +// Measured values are returned in local coordinate space. +void nvgTextMetrics(NVGcontext* ctx, float* ascender, float* descender, float* lineh); + +// Breaks the specified text into lines. If end is specified only the sub-string will be used. +// White space is stripped at the beginning of the rows, the text is split at word boundaries or when new-line characters are encountered. +// Words longer than the max width are slit at nearest character (i.e. no hyphenation). +int nvgTextBreakLines(NVGcontext* ctx, const char* string, const char* end, float breakRowWidth, NVGtextRow* rows, int maxRows); + +void nvgFilterStack(NVGcontext* ctx, nanovg_filterstack& filterStack); +// +// Internal Render API +// +enum NVGtexture { + NVG_TEXTURE_ALPHA = 0x01, + NVG_TEXTURE_RGBA = 0x02, +}; + +struct NVGscissor { + float xform[6]; + float extent[2]; +}; +typedef struct NVGscissor NVGscissor; + +struct NVGvertex { + float x,y,u,v; +}; +typedef struct NVGvertex NVGvertex; + +struct NVGpath { + int first; + int count; + unsigned char closed; + int nbevel; + NVGvertex* fill; + int nfill; + NVGvertex* stroke; + int nstroke; + int winding; + int convex; +}; +typedef struct NVGpath NVGpath; + +struct NVGparams { + void* userPtr; + int edgeAntiAlias; + int (*renderCreate)(void* uptr); + int (*renderCreateTexture)(void* uptr, int type, int w, int h, int imageFlags, const unsigned char* data); + int (*renderDeleteTexture)(void* uptr, int image); + int (*renderUpdateTexture)(void* uptr, int image, int x, int y, int w, int h, const unsigned char* data); + int (*renderGetTextureSize)(void* uptr, int image, int* w, int* h); + void (*renderViewport)(void* uptr, float width, float height, float devicePixelRatio); + void (*renderCancel)(void* uptr); + void (*renderFlush)(void* uptr); + void (*renderFill)(void* uptr, NVGpaint* paint, NVGcompositeOperationState compositeOperation, NVGscissor* scissor, float fringe, const float* bounds, const NVGpath* paths, int npaths, nanovg_filterstack& filterStack); + void (*renderStroke)(void* uptr, NVGpaint* paint, NVGcompositeOperationState compositeOperation, NVGscissor* scissor, float fringe, float strokeWidth, const NVGpath* paths, int npaths, nanovg_filterstack& filterStack); + void (*renderTriangles)(void* uptr, NVGpaint* paint, NVGcompositeOperationState compositeOperation, NVGscissor* scissor, const NVGvertex* verts, int nverts, nanovg_filterstack& filterStack); + void (*renderDelete)(void* uptr); +}; +typedef struct NVGparams NVGparams; + +// Constructor and destructor, called by the render back-end. +NVGcontext* nvgCreateInternal(NVGparams* params); +void nvgDeleteInternal(NVGcontext* ctx); + +NVGparams* nvgInternalParams(NVGcontext* ctx); + +// Debug function to dump cached path data. +void nvgDebugDumpPathCache(NVGcontext* ctx); + +#ifdef _MSC_VER +#pragma warning(pop) +#endif + +#define NVG_NOTUSED(v) for (;;) { (void)(1 ? (void)0 : ( (void)(v) ) ); break; } + +#ifdef __cplusplus +} +#endif + +#endif // NANOVG_H diff --git a/Polyfills/Canvas/Source/nanovg_babylon.cpp b/Polyfills/Canvas/Source/nanovg/nanovg_babylon.cpp similarity index 65% rename from Polyfills/Canvas/Source/nanovg_babylon.cpp rename to Polyfills/Canvas/Source/nanovg/nanovg_babylon.cpp index c56c83e3d..2ed3643d3 100644 --- a/Polyfills/Canvas/Source/nanovg_babylon.cpp +++ b/Polyfills/Canvas/Source/nanovg/nanovg_babylon.cpp @@ -23,7 +23,7 @@ // #define NVG_ANTIALIAS 1 -#include "nanovg_babylon.h" +#include "nanovg/nanovg_babylon.h" #include #include @@ -36,7 +36,7 @@ #include #include - +#include BX_PRAGMA_DIAGNOSTIC_IGNORED_MSVC(4244) // warning C4244: '=' : conversion from '' to '', possible loss of data #include "Shaders/dx11/vs_nanovg_fill.h" @@ -50,6 +50,85 @@ BX_PRAGMA_DIAGNOSTIC_IGNORED_MSVC(4244) // warning C4244: '=' : conversion from #include "Shaders/spirv/vs_nanovg_fill.h" #include "Shaders/spirv/fs_nanovg_fill.h" +#include "nanovg_filterstack.h" + +struct PosTexCoord0Vertex +{ + float m_x; + float m_y; + float m_z; + float m_u; + float m_v; + + static void init() + { + ms_layout + .begin() + .add(bgfx::Attrib::Position, 3, bgfx::AttribType::Float) + .add(bgfx::Attrib::TexCoord0, 2, bgfx::AttribType::Float) + .end(); + } + + static bgfx::VertexLayout ms_layout; +}; + +bgfx::VertexLayout PosTexCoord0Vertex::ms_layout; + +void screenSpaceQuad(bgfx::Encoder* encoder, bool _originBottomLeft, float _width = 1.0f, float _height = 1.0f) +{ + if (3 == bgfx::getAvailTransientVertexBuffer(3, PosTexCoord0Vertex::ms_layout)) + { + bgfx::TransientVertexBuffer vb; + bgfx::allocTransientVertexBuffer(&vb, 3, PosTexCoord0Vertex::ms_layout); + PosTexCoord0Vertex* vertex = (PosTexCoord0Vertex*)vb.data; + + const float minx = -_width; + const float maxx = _width; + const float miny = 0.0f; + const float maxy = _height * 2.0f; + + const float minu = -1.0f; + const float maxu = 1.0f; + + const float zz = 0.0f; + + float minv = 0.0f; + float maxv = 2.0f; + + if (_originBottomLeft) + { + float temp = minv; + minv = maxv; + maxv = temp; + + minv -= 1.0f; + maxv -= 1.0f; + } + + vertex[0].m_x = minx; + vertex[0].m_y = miny; + vertex[0].m_z = zz; + vertex[0].m_u = minu; + vertex[0].m_v = minv; + + vertex[1].m_x = maxx; + vertex[1].m_y = miny; + vertex[1].m_z = zz; + vertex[1].m_u = maxu; + vertex[1].m_v = minv; + + vertex[2].m_x = maxx; + vertex[2].m_y = maxy; + vertex[2].m_z = zz; + vertex[2].m_u = maxu; + vertex[2].m_v = maxv; + + //bgfx::setVertexBuffer(0, &vb); + encoder->setVertexBuffer(0, &vb); + } +} + + static const bgfx::EmbeddedShader s_embeddedShadersBabylon[] = { BGFX_EMBEDDED_SHADER(vs_nanovg_fill), @@ -67,7 +146,8 @@ namespace NSVG_SHADER_FILLGRAD, NSVG_SHADER_FILLIMG, NSVG_SHADER_SIMPLE, - NSVG_SHADER_IMG + NSVG_SHADER_IMG, + NSVG_SHADER_IMG_MODULATEGRAD, }; // These are additional flags on top of NVGimageFlags. @@ -103,12 +183,14 @@ namespace { int type; int image; + int image2; int pathOffset; int pathCount; int vertexOffset; int vertexCount; int uniformOffset; GLNVGblend blendFunc; + nanovg_filterstack filterStack; }; struct GLNVGpath @@ -139,6 +221,12 @@ namespace float strokeMult; float texType; float type; + + // u_sdf + float sdfMin; + float sdfMax; + float sdfBlur; + float unused; }; struct GLNVGcontext @@ -155,15 +243,20 @@ namespace bgfx::UniformHandle u_extentRadius; bgfx::UniformHandle u_params; bgfx::UniformHandle u_halfTexel; + bgfx::UniformHandle u_sdf; bgfx::UniformHandle s_tex; + bgfx::UniformHandle s_tex2; + uint64_t state; bgfx::TextureHandle th; + bgfx::TextureHandle th2; bgfx::TextureHandle texMissing; bgfx::TransientVertexBuffer tvb; Babylon::Graphics::FrameBuffer* frameBuffer; + PoolInterface frameBufferPool; bgfx::Encoder* encoder; struct GLNVGtexture* textures; @@ -276,7 +369,10 @@ namespace gl->u_scissorExtScale = bgfx::createUniform("u_scissorExtScale", bgfx::UniformType::Vec4); gl->u_extentRadius = bgfx::createUniform("u_extentRadius", bgfx::UniformType::Vec4); gl->u_params = bgfx::createUniform("u_params", bgfx::UniformType::Vec4); + gl->u_sdf = bgfx::createUniform("u_sdf", bgfx::UniformType::Vec4); gl->s_tex = bgfx::createUniform("s_tex", bgfx::UniformType::Sampler); + gl->s_tex2 = bgfx::createUniform("s_tex2", bgfx::UniformType::Sampler); + nanovg_filterstack::InitBgfx(); // initialize filter stack uniforms + programs gl->u_halfTexel.idx = bgfx::kInvalidHandle; @@ -440,6 +536,7 @@ namespace ) { struct GLNVGtexture* tex = NULL; + struct GLNVGtexture* tex2 = NULL; float invxform[6] = {}; bx::memSet(frag, 0, sizeof(*frag) ); @@ -468,6 +565,8 @@ namespace frag->strokeMult = (width*0.5f + fringe*0.5f) / fringe; gl->th = gl->texMissing; + gl->th2 = { bgfx::kInvalidHandle }; + if (paint->image != 0) { tex = glnvg__findTexture(gl, paint->image); @@ -487,6 +586,17 @@ namespace frag->texType = 2.0f; } gl->th = tex->id; + + // tex2 is optional + if (paint->image2 != 0) + { + tex2 = glnvg__findTexture(gl, paint->image2); // TODO get paint image + if (tex) + { + gl->th2 = tex2->id; + frag->type = NSVG_SHADER_IMG_MODULATEGRAD; + } + } } else { @@ -497,6 +607,9 @@ namespace } glnvg__xformToMat3x4(frag->paintMat, invxform); + frag->sdfMin = paint->sdfMin; + frag->sdfMax = paint->sdfMax; + frag->sdfBlur = paint->sdfBlur; return 1; } @@ -521,7 +634,7 @@ namespace return (struct GLNVGfragUniforms*)&gl->uniforms[i]; } - static void nvgRenderSetUniforms(struct GLNVGcontext* gl, int uniformOffset, int image) + static void nvgRenderSetUniforms(struct GLNVGcontext* gl, int uniformOffset, int image, int image2) { struct GLNVGfragUniforms* frag = nvg__fragUniformPtr(gl, uniformOffset); float tmp[9]; // Maybe there's a way to get rid of this... @@ -535,6 +648,7 @@ namespace gl->encoder->setUniform(gl->u_scissorExtScale, &frag->scissorExt[0]); gl->encoder->setUniform(gl->u_extentRadius, &frag->extent[0]); gl->encoder->setUniform(gl->u_params, &frag->feather); + gl->encoder->setUniform(gl->u_sdf, &frag->sdfMin); bgfx::TextureHandle handle = gl->texMissing; @@ -552,8 +666,18 @@ namespace } } } - gl->th = handle; + + bgfx::TextureHandle handle2 = gl->texMissing; + if (image2 != 0) + { + struct GLNVGtexture* tex = glnvg__findTexture(gl, image2); + if (tex != NULL) + { + handle2 = tex->id; + } + } + gl->th2 = handle2; } static void nvgRenderViewport(void* _userPtr, float width, float height, float /*devicePixelRatio*/) @@ -581,136 +705,252 @@ namespace static void glnvg__fill(struct GLNVGcontext* gl, struct GLNVGcall* call) { - struct GLNVGpath* paths = &gl->paths[call->pathOffset]; - int i, npaths = call->pathCount; + bgfx::ProgramHandle firstProg = gl->prog; + std::function setUniform = [gl](bgfx::UniformHandle u, const void *value, const uint16_t num) { + gl->encoder->setUniform(u, value, num); + }; + std::function firstPass = [gl, call](bgfx::ProgramHandle prog, Babylon::Graphics::FrameBuffer *outBuffer) { - // set bindpoint for solid loc - nvgRenderSetUniforms(gl, call->uniformOffset, 0); + struct GLNVGpath* paths = &gl->paths[call->pathOffset]; + int i, npaths = call->pathCount; - for (i = 0; i < npaths; i++) - { - if (2 < paths[i].fillCount) + // set bindpoint for solid loc + nvgRenderSetUniforms(gl, call->uniformOffset, 0, 0); + + for (i = 0; i < npaths; i++) { - gl->encoder->setState(0); - gl->encoder->setStencil(0 - | BGFX_STENCIL_TEST_ALWAYS - | BGFX_STENCIL_FUNC_RMASK(0xff) - | BGFX_STENCIL_OP_FAIL_S_KEEP - | BGFX_STENCIL_OP_FAIL_Z_KEEP - | BGFX_STENCIL_OP_PASS_Z_INCR - , 0 - | BGFX_STENCIL_TEST_ALWAYS - | BGFX_STENCIL_FUNC_RMASK(0xff) - | BGFX_STENCIL_OP_FAIL_S_KEEP - | BGFX_STENCIL_OP_FAIL_Z_KEEP - | BGFX_STENCIL_OP_PASS_Z_DECR - ); - gl->encoder->setVertexBuffer(0, &gl->tvb); - gl->encoder->setTexture(0, gl->s_tex, gl->th); - fan(gl->encoder, paths[i].fillOffset, paths[i].fillCount); - gl->frameBuffer->Submit(*gl->encoder, gl->prog, BGFX_DISCARD_ALL); + if (2 < paths[i].fillCount) + { + gl->encoder->setState(0); + gl->encoder->setStencil(0 + | BGFX_STENCIL_TEST_ALWAYS + | BGFX_STENCIL_FUNC_RMASK(0xff) + | BGFX_STENCIL_OP_FAIL_S_KEEP + | BGFX_STENCIL_OP_FAIL_Z_KEEP + | BGFX_STENCIL_OP_PASS_Z_INCR + , 0 + | BGFX_STENCIL_TEST_ALWAYS + | BGFX_STENCIL_FUNC_RMASK(0xff) + | BGFX_STENCIL_OP_FAIL_S_KEEP + | BGFX_STENCIL_OP_FAIL_Z_KEEP + | BGFX_STENCIL_OP_PASS_Z_DECR + ); + gl->encoder->setVertexBuffer(0, &gl->tvb); + gl->encoder->setTexture(0, gl->s_tex, gl->th); + gl->encoder->setTexture(1, gl->s_tex2, gl->th2); + fan(gl->encoder, paths[i].fillOffset, paths[i].fillCount); + outBuffer->Submit(*gl->encoder, prog, BGFX_DISCARD_ALL); + } } - } - // Draw aliased off-pixels - nvgRenderSetUniforms(gl, call->uniformOffset + gl->fragSize, call->image); + // Draw aliased off-pixels + nvgRenderSetUniforms(gl, call->uniformOffset + gl->fragSize, call->image, call->image2); - if (gl->edgeAntiAlias) - { - // Draw fringes - for (i = 0; i < npaths; i++) + if (gl->edgeAntiAlias) { - gl->encoder->setState(gl->state - | BGFX_STATE_PT_TRISTRIP - ); - gl->encoder->setStencil(0 - | BGFX_STENCIL_TEST_EQUAL - | BGFX_STENCIL_FUNC_RMASK(0xff) - | BGFX_STENCIL_OP_FAIL_S_KEEP - | BGFX_STENCIL_OP_FAIL_Z_KEEP - | BGFX_STENCIL_OP_PASS_Z_KEEP - ); - gl->encoder->setVertexBuffer(0, &gl->tvb, paths[i].strokeOffset, paths[i].strokeCount); - gl->encoder->setTexture(0, gl->s_tex, gl->th); - gl->frameBuffer->Submit(*gl->encoder, gl->prog, BGFX_DISCARD_ALL); + // Draw fringes + for (i = 0; i < npaths; i++) + { + gl->encoder->setState(gl->state + | BGFX_STATE_PT_TRISTRIP + ); + gl->encoder->setStencil(0 + | BGFX_STENCIL_TEST_EQUAL + | BGFX_STENCIL_FUNC_RMASK(0xff) + | BGFX_STENCIL_OP_FAIL_S_KEEP + | BGFX_STENCIL_OP_FAIL_Z_KEEP + | BGFX_STENCIL_OP_PASS_Z_KEEP + ); + gl->encoder->setVertexBuffer(0, &gl->tvb, paths[i].strokeOffset, paths[i].strokeCount); + gl->encoder->setTexture(0, gl->s_tex, gl->th); + gl->encoder->setTexture(1, gl->s_tex2, gl->th2); + outBuffer->Submit(*gl->encoder, prog, BGFX_DISCARD_ALL); + } } - } - // Draw fill - gl->encoder->setState(gl->state); - gl->encoder->setVertexBuffer(0, &gl->tvb, call->vertexOffset, call->vertexCount); - gl->encoder->setTexture(0, gl->s_tex, gl->th); - gl->encoder->setStencil(0 - | BGFX_STENCIL_TEST_NOTEQUAL - | BGFX_STENCIL_FUNC_RMASK(0xff) - | BGFX_STENCIL_OP_FAIL_S_ZERO - | BGFX_STENCIL_OP_FAIL_Z_ZERO - | BGFX_STENCIL_OP_PASS_Z_ZERO - ); - gl->frameBuffer->Submit(*gl->encoder, gl->prog, BGFX_DISCARD_ALL); + // Draw fill + gl->encoder->setState(gl->state); + gl->encoder->setVertexBuffer(0, &gl->tvb, call->vertexOffset, call->vertexCount); + gl->encoder->setTexture(0, gl->s_tex, gl->th); + gl->encoder->setTexture(1, gl->s_tex2, gl->th2); + gl->encoder->setStencil(0 + | BGFX_STENCIL_TEST_NOTEQUAL + | BGFX_STENCIL_FUNC_RMASK(0xff) + | BGFX_STENCIL_OP_FAIL_S_ZERO + | BGFX_STENCIL_OP_FAIL_Z_ZERO + | BGFX_STENCIL_OP_PASS_Z_ZERO + ); + outBuffer->Submit(*gl->encoder, prog, BGFX_DISCARD_ALL); + }; + std::function filterPass = [gl, call](bgfx::ProgramHandle prog, Babylon::Graphics::FrameBuffer *inBuffer, Babylon::Graphics::FrameBuffer *outBuffer) { + gl->encoder->setUniform(gl->u_viewSize, gl->view); // TODO: also set other common uniforms + gl->encoder->setState(BGFX_STATE_WRITE_RGB | BGFX_STATE_WRITE_A); + gl->encoder->setTexture(0, gl->s_tex, bgfx::getTexture(inBuffer->Handle())); + bool s_originBottomLeft = bgfx::getCaps()->originBottomLeft; + screenSpaceQuad(gl->encoder, s_originBottomLeft); + outBuffer->Submit(*gl->encoder, prog, BGFX_DISCARD_ALL); + }; + std::function finalPass = [gl, call](bgfx::ProgramHandle prog, Babylon::Graphics::FrameBuffer *inBuffer, Babylon::Graphics::FrameBuffer *outBuffer) { + gl->encoder->setUniform(gl->u_viewSize, gl->view); // TODO: also set other common uniforms + gl->encoder->setState(BGFX_STATE_WRITE_RGB | BGFX_STATE_WRITE_A + | BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_ONE, BGFX_STATE_BLEND_INV_SRC_ALPHA) + | BGFX_STATE_BLEND_EQUATION(BGFX_STATE_BLEND_EQUATION_ADD)); + gl->encoder->setTexture(0, gl->s_tex, bgfx::getTexture(inBuffer->Handle())); + bool s_originBottomLeft = bgfx::getCaps()->originBottomLeft; + screenSpaceQuad(gl->encoder, s_originBottomLeft); + outBuffer->Submit(*gl->encoder, prog, BGFX_DISCARD_ALL); + }; + Babylon::Graphics::FrameBuffer *finalFrameBuffer = gl->frameBuffer; + finalFrameBuffer->Bind(*gl->encoder); // Should this be bound elsewhere? + + call->filterStack.Render(firstProg, setUniform, firstPass, filterPass, finalPass, finalFrameBuffer, gl->frameBufferPool.acquire, gl->frameBufferPool.release); } static void glnvg__convexFill(struct GLNVGcontext* gl, struct GLNVGcall* call) { - struct GLNVGpath* paths = &gl->paths[call->pathOffset]; - int i, npaths = call->pathCount; + bgfx::ProgramHandle firstProg = gl->prog; + std::function setUniform = [gl](bgfx::UniformHandle u, const void *value, const uint16_t num) { + gl->encoder->setUniform(u, value, num); + }; + std::function firstPass = [gl, call](bgfx::ProgramHandle prog, Babylon::Graphics::FrameBuffer *outBuffer) { + struct GLNVGpath* paths = &gl->paths[call->pathOffset]; + int i, npaths = call->pathCount; - nvgRenderSetUniforms(gl, call->uniformOffset, call->image); - - for (i = 0; i < npaths; i++) - { - if (paths[i].fillCount == 0) continue; - gl->encoder->setState(gl->state); - gl->encoder->setVertexBuffer(0, &gl->tvb); - gl->encoder->setTexture(0, gl->s_tex, gl->th); - fan(gl->encoder, paths[i].fillOffset, paths[i].fillCount); - gl->frameBuffer->Submit(*gl->encoder, gl->prog, BGFX_DISCARD_ALL); - } + nvgRenderSetUniforms(gl, call->uniformOffset, call->image, call->image2); - if (gl->edgeAntiAlias) - { - // Draw fringes for (i = 0; i < npaths; i++) { - gl->encoder->setState(gl->state - | BGFX_STATE_PT_TRISTRIP - ); - gl->encoder->setVertexBuffer(0, &gl->tvb, paths[i].strokeOffset, paths[i].strokeCount); + if (paths[i].fillCount == 0) continue; + gl->encoder->setState(gl->state); + gl->encoder->setVertexBuffer(0, &gl->tvb); gl->encoder->setTexture(0, gl->s_tex, gl->th); - gl->frameBuffer->Submit(*gl->encoder, gl->prog, BGFX_DISCARD_ALL); + gl->encoder->setTexture(1, gl->s_tex2, gl->th2); + fan(gl->encoder, paths[i].fillOffset, paths[i].fillCount); + outBuffer->Submit(*gl->encoder, prog, BGFX_DISCARD_ALL); } - } + + if (gl->edgeAntiAlias) + { + // Draw fringes + for (i = 0; i < npaths; i++) + { + gl->encoder->setState(gl->state + | BGFX_STATE_PT_TRISTRIP + ); + gl->encoder->setVertexBuffer(0, &gl->tvb, paths[i].strokeOffset, paths[i].strokeCount); + gl->encoder->setTexture(0, gl->s_tex, gl->th); + gl->encoder->setTexture(1, gl->s_tex2, gl->th2); + outBuffer->Submit(*gl->encoder, prog, BGFX_DISCARD_ALL); + } + } + }; + std::function filterPass = [gl, call](bgfx::ProgramHandle prog, Babylon::Graphics::FrameBuffer *inBuffer, Babylon::Graphics::FrameBuffer *outBuffer) { + gl->encoder->setUniform(gl->u_viewSize, gl->view); // TODO: also set other common uniforms + gl->encoder->setState(BGFX_STATE_WRITE_RGB | BGFX_STATE_WRITE_A); + gl->encoder->setTexture(0, gl->s_tex, bgfx::getTexture(inBuffer->Handle())); + bool s_originBottomLeft = bgfx::getCaps()->originBottomLeft; + screenSpaceQuad(gl->encoder, s_originBottomLeft); + outBuffer->Submit(*gl->encoder, prog, BGFX_DISCARD_ALL); + }; + std::function finalPass = [gl, call](bgfx::ProgramHandle prog, Babylon::Graphics::FrameBuffer *inBuffer, Babylon::Graphics::FrameBuffer *outBuffer) { + gl->encoder->setUniform(gl->u_viewSize, gl->view); // TODO: also set other common uniforms + gl->encoder->setState(BGFX_STATE_WRITE_RGB | BGFX_STATE_WRITE_A + | BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_ONE, BGFX_STATE_BLEND_INV_SRC_ALPHA) + | BGFX_STATE_BLEND_EQUATION(BGFX_STATE_BLEND_EQUATION_ADD)); + gl->encoder->setTexture(0, gl->s_tex, bgfx::getTexture(inBuffer->Handle())); + bool s_originBottomLeft = bgfx::getCaps()->originBottomLeft; + screenSpaceQuad(gl->encoder, s_originBottomLeft); + outBuffer->Submit(*gl->encoder, prog, BGFX_DISCARD_ALL); + }; + Babylon::Graphics::FrameBuffer *finalFrameBuffer = gl->frameBuffer; + finalFrameBuffer->Bind(*gl->encoder); // Should this be bound elsewhere? + + call->filterStack.Render(firstProg, setUniform, firstPass, filterPass, finalPass, finalFrameBuffer, gl->frameBufferPool.acquire, gl->frameBufferPool.release); } static void glnvg__stroke(struct GLNVGcontext* gl, struct GLNVGcall* call) { - struct GLNVGpath* paths = &gl->paths[call->pathOffset]; - int npaths = call->pathCount, i; - - nvgRenderSetUniforms(gl, call->uniformOffset, call->image); + bgfx::ProgramHandle firstProg = gl->prog; + std::function setUniform = [gl](bgfx::UniformHandle u, const void *value, const uint16_t num) { + gl->encoder->setUniform(u, value, num); + }; + std::function firstPass = [gl, call](bgfx::ProgramHandle prog, Babylon::Graphics::FrameBuffer *outBuffer) { + // Draw Strokes + struct GLNVGpath* paths = &gl->paths[call->pathOffset]; + int npaths = call->pathCount, i; + for (i = 0; i < npaths; i++) + { + nvgRenderSetUniforms(gl, call->uniformOffset, call->image, call->image2); - // Draw Strokes - for (i = 0; i < npaths; i++) - { - gl->encoder->setState(gl->state - | BGFX_STATE_PT_TRISTRIP - ); - gl->encoder->setVertexBuffer(0, &gl->tvb, paths[i].strokeOffset, paths[i].strokeCount); - gl->encoder->setTexture(0, gl->s_tex, gl->th); - gl->frameBuffer->Submit(*gl->encoder, gl->prog, BGFX_DISCARD_ALL); - } + gl->encoder->setState(gl->state | BGFX_STATE_PT_TRISTRIP ); + gl->encoder->setVertexBuffer(0, &gl->tvb, paths[i].strokeOffset, paths[i].strokeCount); + gl->encoder->setTexture(0, gl->s_tex, gl->th); + gl->encoder->setTexture(1, gl->s_tex2, gl->th2); + outBuffer->Submit(*gl->encoder, prog, BGFX_DISCARD_ALL); + } + }; + std::function filterPass = [gl, call](bgfx::ProgramHandle prog, Babylon::Graphics::FrameBuffer *inBuffer, Babylon::Graphics::FrameBuffer *outBuffer) { + gl->encoder->setUniform(gl->u_viewSize, gl->view); // TODO: also set other common uniforms + gl->encoder->setState(BGFX_STATE_WRITE_RGB | BGFX_STATE_WRITE_A); + gl->encoder->setTexture(0, gl->s_tex, bgfx::getTexture(inBuffer->Handle())); + bool s_originBottomLeft = bgfx::getCaps()->originBottomLeft; + screenSpaceQuad(gl->encoder, s_originBottomLeft); + outBuffer->Submit(*gl->encoder, prog, BGFX_DISCARD_ALL); + }; + std::function finalPass = [gl, call](bgfx::ProgramHandle prog, Babylon::Graphics::FrameBuffer *inBuffer, Babylon::Graphics::FrameBuffer *outBuffer) { + gl->encoder->setUniform(gl->u_viewSize, gl->view); // TODO: also set other common uniforms + gl->encoder->setState(BGFX_STATE_WRITE_RGB | BGFX_STATE_WRITE_A + | BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_ONE, BGFX_STATE_BLEND_INV_SRC_ALPHA) + | BGFX_STATE_BLEND_EQUATION(BGFX_STATE_BLEND_EQUATION_ADD)); + gl->encoder->setTexture(0, gl->s_tex, bgfx::getTexture(inBuffer->Handle())); + bool s_originBottomLeft = bgfx::getCaps()->originBottomLeft; + screenSpaceQuad(gl->encoder, s_originBottomLeft); + outBuffer->Submit(*gl->encoder, prog, BGFX_DISCARD_ALL); + }; + Babylon::Graphics::FrameBuffer *finalFrameBuffer = gl->frameBuffer; + finalFrameBuffer->Bind(*gl->encoder); // Should this be bound elsewhere? + + call->filterStack.Render(firstProg, setUniform, firstPass, filterPass, finalPass, finalFrameBuffer, gl->frameBufferPool.acquire, gl->frameBufferPool.release); } static void glnvg__triangles(struct GLNVGcontext* gl, struct GLNVGcall* call) { if (3 <= call->vertexCount) { - nvgRenderSetUniforms(gl, call->uniformOffset, call->image); - - gl->encoder->setState(gl->state); - gl->encoder->setVertexBuffer(0, &gl->tvb, call->vertexOffset, call->vertexCount); - gl->encoder->setTexture(0, gl->s_tex, gl->th); - gl->frameBuffer->Submit(*gl->encoder, gl->prog, BGFX_DISCARD_ALL); + bgfx::ProgramHandle firstProg = gl->prog; + std::function setUniform = [gl](bgfx::UniformHandle u, const void *value, const uint16_t num) { + gl->encoder->setUniform(u, value, num); + }; + std::function firstPass = [gl, call](bgfx::ProgramHandle prog, Babylon::Graphics::FrameBuffer *outBuffer) { + nvgRenderSetUniforms(gl, call->uniformOffset, call->image, call->image2); + gl->encoder->setState(gl->state); + gl->encoder->setVertexBuffer(0, &gl->tvb, call->vertexOffset, call->vertexCount); + gl->encoder->setTexture(0, gl->s_tex, gl->th); + gl->encoder->setTexture(1, gl->s_tex2, gl->th2); + outBuffer->Submit(*gl->encoder, prog, BGFX_DISCARD_ALL); + }; + std::function filterPass = [gl, call](bgfx::ProgramHandle prog, Babylon::Graphics::FrameBuffer *inBuffer, Babylon::Graphics::FrameBuffer *outBuffer) { + gl->encoder->setUniform(gl->u_viewSize, gl->view); // TODO: also set other common uniforms + gl->encoder->setState(BGFX_STATE_WRITE_RGB | BGFX_STATE_WRITE_A); + gl->encoder->setTexture(0, gl->s_tex, bgfx::getTexture(inBuffer->Handle())); + bool s_originBottomLeft = bgfx::getCaps()->originBottomLeft; + screenSpaceQuad(gl->encoder, s_originBottomLeft); + outBuffer->Submit(*gl->encoder, prog, BGFX_DISCARD_ALL); + }; + std::function finalPass = [gl, call](bgfx::ProgramHandle prog, Babylon::Graphics::FrameBuffer *inBuffer, Babylon::Graphics::FrameBuffer *outBuffer) { + gl->encoder->setUniform(gl->u_viewSize, gl->view); // TODO: also set other common uniforms + gl->encoder->setState(BGFX_STATE_WRITE_RGB | BGFX_STATE_WRITE_A + | BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_ONE, BGFX_STATE_BLEND_INV_SRC_ALPHA) + | BGFX_STATE_BLEND_EQUATION(BGFX_STATE_BLEND_EQUATION_ADD)); + gl->encoder->setTexture(0, gl->s_tex, bgfx::getTexture(inBuffer->Handle())); + bool s_originBottomLeft = bgfx::getCaps()->originBottomLeft; + screenSpaceQuad(gl->encoder, s_originBottomLeft); + outBuffer->Submit(*gl->encoder, prog, BGFX_DISCARD_ALL); + }; + Babylon::Graphics::FrameBuffer *finalFrameBuffer = gl->frameBuffer; + finalFrameBuffer->Bind(*gl->encoder); // Should this be bound elsewhere? + + call->filterStack.Render(firstProg, setUniform, firstPass, filterPass, finalPass, finalFrameBuffer, gl->frameBufferPool.acquire, gl->frameBufferPool.release); } } @@ -765,6 +1005,9 @@ namespace , bgfx::createEmbeddedShader(s_embeddedShadersBabylon, type, "fs_nanovg_fill") , true ); + + // Vertex layout + PosTexCoord0Vertex::init(); } if (gl->ncalls > 0) @@ -786,6 +1029,8 @@ namespace for (uint32_t ii = 0, num = gl->ncalls; ii < num; ++ii) { struct GLNVGcall* call = &gl->calls[ii]; + nanovg_filterstack fs = call->filterStack; // CHECK: did we want to do something with this? + const GLNVGblend* blend = &call->blendFunc; gl->state = BGFX_STATE_BLEND_FUNC_SEPARATE(blend->srcRGB, blend->dstRGB, blend->srcAlpha, blend->dstAlpha) | BGFX_STATE_WRITE_RGB @@ -908,6 +1153,7 @@ namespace , const float* bounds , const NVGpath* paths , int npaths + , nanovg_filterstack& filterStack ) { struct GLNVGcontext* gl = (struct GLNVGcontext*)_userPtr; @@ -921,7 +1167,9 @@ namespace call->pathOffset = glnvg__allocPaths(gl, npaths); call->pathCount = npaths; call->image = paint->image; + call->image2 = paint->image2; call->blendFunc = glnvg__blendCompositeOperation(compositeOperation); + call->filterStack = filterStack; if (npaths == 1 && paths[0].convex) { @@ -994,6 +1242,7 @@ namespace , float strokeWidth , const struct NVGpath* paths , int npaths + , nanovg_filterstack& filterStack ) { struct GLNVGcontext* gl = (struct GLNVGcontext*)_userPtr; @@ -1005,7 +1254,9 @@ namespace call->pathOffset = glnvg__allocPaths(gl, npaths); call->pathCount = npaths; call->image = paint->image; + call->image2 = paint->image2; call->blendFunc = glnvg__blendCompositeOperation(compositeOperation); + call->filterStack = filterStack; // Allocate vertices for all the paths. maxverts = glnvg__maxVertCount(paths, npaths); @@ -1031,7 +1282,7 @@ namespace } static void nvgRenderTriangles(void* _userPtr, struct NVGpaint* paint, NVGcompositeOperationState compositeOperation, struct NVGscissor* scissor, - const struct NVGvertex* verts, int nverts) + const struct NVGvertex* verts, int nverts, nanovg_filterstack& filterStack) { struct GLNVGcontext* gl = (struct GLNVGcontext*)_userPtr; struct GLNVGcall* call = glnvg__allocCall(gl); @@ -1039,7 +1290,9 @@ namespace call->type = GLNVG_TRIANGLES; call->image = paint->image; + call->image2 = paint->image2; call->blendFunc = glnvg__blendCompositeOperation(compositeOperation); + call->filterStack = filterStack; // Allocate vertices for all the paths. call->vertexOffset = glnvg__allocVerts(gl, nverts); @@ -1050,7 +1303,7 @@ namespace call->uniformOffset = glnvg__allocFragUniforms(gl, 1); frag = nvg__fragUniformPtr(gl, call->uniformOffset); glnvg__convertPaint(gl, frag, paint, scissor, 1.0f, 1.0f); - frag->type = NSVG_SHADER_IMG; + frag->type = bgfx::isValid(gl->th2) ? NSVG_SHADER_IMG_MODULATEGRAD : NSVG_SHADER_IMG; } static void nvgRenderDelete(void* _userPtr) @@ -1078,6 +1331,8 @@ namespace bgfx::destroy(gl->u_extentRadius); bgfx::destroy(gl->u_params); bgfx::destroy(gl->s_tex); + bgfx::destroy(gl->s_tex2); + nanovg_filterstack::DisposeBgfx(); if (bgfx::isValid(gl->u_halfTexel) ) { @@ -1153,6 +1408,12 @@ NVGcontext* nvgCreate(int32_t _edgeaa, bx::AllocatorI* _allocator) return NULL; } +void nvgSetFrameBufferPool(NVGcontext* _ctx, PoolInterface pool) +{ + struct GLNVGcontext* gl = (GLNVGcontext*)nvgInternalParams(_ctx)->userPtr; + gl->frameBufferPool = pool; +} + void nvgSetFrameBufferAndEncoder(NVGcontext* _ctx, Babylon::Graphics::FrameBuffer& frameBuffer, bgfx::Encoder* encoder) { struct GLNVGcontext* gl = (GLNVGcontext*)nvgInternalParams(_ctx)->userPtr; diff --git a/Polyfills/Canvas/Source/nanovg_babylon.h b/Polyfills/Canvas/Source/nanovg/nanovg_babylon.h similarity index 73% rename from Polyfills/Canvas/Source/nanovg_babylon.h rename to Polyfills/Canvas/Source/nanovg/nanovg_babylon.h index 8b7800490..18800babe 100644 --- a/Polyfills/Canvas/Source/nanovg_babylon.h +++ b/Polyfills/Canvas/Source/nanovg/nanovg_babylon.h @@ -6,6 +6,7 @@ #ifndef NANOVG_BABYLON_H_HEADER_GUARD #define NANOVG_BABYLON_H_HEADER_GUARD +#include #include #include namespace bx @@ -21,6 +22,13 @@ NVGcontext* nvgCreate(int32_t _edgeaa, bx::AllocatorI* _allocator); /// NVGcontext* nvgCreate(int32_t _edgeaa); +struct PoolInterface +{ + std::function acquire; + std::function release; +}; + +void nvgSetFrameBufferPool(NVGcontext* _ctx, PoolInterface pool); void nvgSetFrameBufferAndEncoder(NVGcontext* _ctx, Babylon::Graphics::FrameBuffer& frameBuffer, bgfx::Encoder* encoder); /// diff --git a/Polyfills/Canvas/Source/nanovg/nanovg_filterstack.cpp b/Polyfills/Canvas/Source/nanovg/nanovg_filterstack.cpp new file mode 100644 index 000000000..ba36655ff --- /dev/null +++ b/Polyfills/Canvas/Source/nanovg/nanovg_filterstack.cpp @@ -0,0 +1,273 @@ +#include "nanovg_filterstack.h" +#include +#include + +#include +#include + +std::regex blurRegex(R"(blur\((\d*\.?\d+)(px|rem)?\)|blur\(\))"); +std::regex noneRegex(R"(^\s*none\s*$)"); + +#include "Shaders/dx11/vs_fspass.h" +#include "Shaders/metal/vs_fspass.h" +#include "Shaders/glsl/vs_fspass.h" +#include "Shaders/essl/vs_fspass.h" +#include "Shaders/spirv/vs_fspass.h" + +#include "Shaders/dx11/fs_gaussblur.h" +#include "Shaders/metal/fs_gaussblur.h" +#include "Shaders/glsl/fs_gaussblur.h" +#include "Shaders/essl/fs_gaussblur.h" +#include "Shaders/spirv/fs_gaussblur.h" + +#include "Shaders/dx11/fs_boxblur.h" +#include "Shaders/metal/fs_boxblur.h" +#include "Shaders/glsl/fs_boxblur.h" +#include "Shaders/essl/fs_boxblur.h" +#include "Shaders/spirv/fs_boxblur.h" + +#define BLUR_MAX_PX 1000 +#define BLUR_TAPS 13 +#define BLUR_UNIFORM_SIZE 5 // fit into vec4: ceil(BLUR_TAPS / 4) + +static const bgfx::EmbeddedShader s_embeddedShadersFilterStack[] = +{ + BGFX_EMBEDDED_SHADER(vs_fspass), + BGFX_EMBEDDED_SHADER(fs_gaussblur), + BGFX_EMBEDDED_SHADER(fs_boxblur), + BGFX_EMBEDDED_SHADER_END() +}; + +nanovg_filterstack::nanovg_filterstack() +{ +} + +void nanovg_filterstack::InitBgfx() +{ + m_uniforms.u_strength = bgfx::createUniform("u_strength", bgfx::UniformType::Vec4); + m_uniforms.u_direction = bgfx::createUniform("u_direction", bgfx::UniformType::Vec4); + m_uniforms.u_weights = bgfx::createUniform("u_weights", bgfx::UniformType::Vec4, BLUR_UNIFORM_SIZE); + + // create shaders used by the different elements + bgfx::RendererType::Enum type = bgfx::getRendererType(); + gaussBlurProg = bgfx::createProgram( + bgfx::createEmbeddedShader(s_embeddedShadersFilterStack, type, "vs_fspass") + , bgfx::createEmbeddedShader(s_embeddedShadersFilterStack, type, "fs_gaussblur") + , true + ); + boxBlurProg = bgfx::createProgram( + bgfx::createEmbeddedShader(s_embeddedShadersFilterStack, type, "vs_fspass"), + bgfx::createEmbeddedShader(s_embeddedShadersFilterStack, type, "fs_boxblur"), + true); +} + +void nanovg_filterstack::DisposeBgfx() +{ + // check if uniforms + programs are valid before destroying + if (m_uniforms.u_strength.idx != bgfx::kInvalidHandle) + bgfx::destroy(m_uniforms.u_strength); + if (m_uniforms.u_direction.idx != bgfx::kInvalidHandle) + bgfx::destroy(m_uniforms.u_direction); + if (m_uniforms.u_weights.idx != bgfx::kInvalidHandle) + bgfx::destroy(m_uniforms.u_weights); + if (gaussBlurProg.idx != bgfx::kInvalidHandle) + bgfx::destroy(gaussBlurProg); + if (boxBlurProg.idx != bgfx::kInvalidHandle) + bgfx::destroy(boxBlurProg); +} + +bool nanovg_filterstack::ValidString(const std::string& string) +{ + std::smatch match; + return std::regex_match(string, match, noneRegex) || std::regex_match(string, match, blurRegex); +} + +void nanovg_filterstack::ParseString(const std::string& string) +{ + stackElements.clear(); + + std::smatch match; + if (std::regex_match(string, match, blurRegex)) + { + if (match.size() > 1 && match[1].matched) + { + float radius = std::stof(match[1].str()); + std::string unit = match[2].matched ? match[2].str() : "px"; + std::transform(unit.begin(), unit.end(), unit.begin(), ::tolower); + + if (unit != "px") + { + // TODO: convert non-px radius + } + + if (radius > 0) + { + StackElement element = {}; + element.type = SE_BLUR; + element.blurElement = {radius, radius}; + stackElements.push_back(element); + } + } + else + { + // defaults to blur(0), which is no blur + } + } +} + +std::vector nanovg_filterstack::CalculateGaussianKernel(float sigma, int kernelSize) +{ + assert(kernelSize % 2 == 1); // kernel size must be odd + std::vector kernel(kernelSize); + int halfSize = kernelSize / 2; + float sum = 0.0f; + + // calculate weights + for (int i = -halfSize; i <= halfSize; ++i) + { + float weight = std::exp(-0.5f * (i * i) / (sigma * sigma)); + kernel[i + halfSize] = weight; + sum += weight; + } + + // normalize kernel + for (float& weight : kernel) + { + weight /= sum; + } + + return kernel; +} + +std::array nanovg_filterstack::CalculateBoxKernel(float sigma) +{ + if (sigma > BLUR_MAX_PX) + sigma = BLUR_MAX_PX; + float d = std::floor(1.879971f * sigma + 0.5f); // d = floor(s * (3 * sqrt(2 * pi) / 4) + 0.5) + std::array kernel = {d, std::floor(d / 2.0f)}; // kernel size, kernel radius + return kernel; +} + +void nanovg_filterstack::Render(std::function element) +{ + element(); +} + +void nanovg_filterstack::Render( + bgfx::ProgramHandle firstProg, + std::function setUniform, + std::function firstPass, + std::function filterPass, + std::function finalPass, + Babylon::Graphics::FrameBuffer* finalFrameBuffer, + std::function acquire, + std::function release +) +{ + if (stackElements.empty()) + { + // no filter, render straight into final framebuffer + firstPass(firstProg, finalFrameBuffer); + } + else + { + assert(stackElements.size() > 0); + + Babylon::Graphics::FrameBuffer* prevBuf = nullptr; + Babylon::Graphics::FrameBuffer* nextBuf = acquire(); + bgfx::ProgramHandle lastProg = firstProg; + + // first pass + firstPass(firstProg, nextBuf); + prevBuf = nextBuf; + nextBuf = nullptr; + + int i = 0; + for (auto& element : stackElements) + { + assert(prevBuf != nullptr); + assert(nextBuf == nullptr); + + const bool lastElement = (i == stackElements.size() - 1); + + if (element.type == SE_BLUR) + { + static const std::array, 2> directions = { + std::array{1.f, 0.f, 0.f, 0.f}, // horizontal + std::array{0.f, 1.f, 0.f, 0.f} // vertical + }; + + for (int i = 0; i < 2; i++) + { + const std::array& direction = directions[i]; + bool last = lastElement && i == 1; + float sigma = i == 0 ? element.blurElement.horizontal : element.blurElement.vertical; + + // use gaussian blur for sigma < 2, box blur for sigma >= 2 + if (sigma < 2) + { + std::vector kernel = CalculateGaussianKernel(sigma, BLUR_TAPS); + setUniform(m_uniforms.u_direction, &direction, 1); + setUniform(m_uniforms.u_weights, kernel.data(), BLUR_UNIFORM_SIZE); + + if (last) + { + lastProg = gaussBlurProg; + break; // last pass will write to finalFrameBuffer + } + nextBuf = acquire(); + filterPass(gaussBlurProg, prevBuf, nextBuf); + release(prevBuf); + prevBuf = nextBuf; + nextBuf = nullptr; + } + else + { + std::array kernel = CalculateBoxKernel(sigma); + bool isOdd = static_cast(kernel[0]) % 2 == 1; + + std::array, 3> kernelsOdd = { + std::array{kernel[0], kernel[1], 0.f, 0.f}, + std::array{kernel[0], kernel[1], 0.f, 0.f}, + std::array{kernel[0], kernel[1], 0.f, 0.f}, + }; + float xOffsetL = direction[0] > 0 ? -0.5f : 0.f; + float xOffsetR = direction[0] > 0 ? 0.5f : 0.f; + float yOffsetL = direction[1] > 0 ? -0.5f : 0.f; + float yOffsetR = direction[1] > 0 ? 0.5f : 0.f; + std::array, 3> kernelsEven = { + std::array{kernel[0], kernel[1], xOffsetL, yOffsetL}, + std::array{kernel[0], kernel[1], xOffsetR, yOffsetR}, + std::array{kernel[0] + 1, kernel[1], 0.f, 0.f}, + }; + + // 3 pass box blur for s >= 2 + for (int i = 0; i < 3; i++) + { + setUniform(m_uniforms.u_direction, &direction, 1); + setUniform(m_uniforms.u_weights, isOdd ? kernelsOdd[i].data() : kernelsEven[i].data(), 1); + + if (last && i == 2) + { + lastProg = boxBlurProg; + break; // last pass will write to finalFrameBuffer + } + nextBuf = acquire(); + filterPass(boxBlurProg, prevBuf, nextBuf); + release(prevBuf); + prevBuf = nextBuf; + nextBuf = nullptr; + } + } + } + } + i++; + } + + assert(prevBuf != nullptr); + assert(nextBuf == nullptr); + + finalPass(lastProg, prevBuf, finalFrameBuffer); + release(prevBuf); + } +} \ No newline at end of file diff --git a/Polyfills/Canvas/Source/nanovg/nanovg_filterstack.h b/Polyfills/Canvas/Source/nanovg/nanovg_filterstack.h new file mode 100644 index 000000000..2ba533739 --- /dev/null +++ b/Polyfills/Canvas/Source/nanovg/nanovg_filterstack.h @@ -0,0 +1,85 @@ +#pragma once +#include +#include +#include +#include +#include "Babylon/Graphics/FrameBuffer.h" + +class nanovg_filterstack +{ +public: + nanovg_filterstack(); + + static void InitBgfx(); + static void DisposeBgfx(); + inline static bgfx::ProgramHandle fspassProg; + inline static bgfx::ProgramHandle gaussBlurProg; + inline static bgfx::ProgramHandle boxBlurProg; + inline struct Uniforms + { + bgfx::UniformHandle u_strength; + bgfx::UniformHandle u_direction; + bgfx::UniformHandle u_weights; + } static m_uniforms; + + void AddSepia(float strength) {} + void AddContrast(float strength) {} + void AddBlur(int horizontal, int vertical) {} + + void Render( + bgfx::ProgramHandle firstProg, + std::function setUniform, + std::function firstPass, + std::function filterPass, + std::function finalPass, + Babylon::Graphics::FrameBuffer* finalFrameBuffer, + std::function acquire, + std::function release + ); + void Render(std::function element); + + void ParseString(const std::string& string); + static bool ValidString(const std::string& string); + + void AddDropShadow() + { + // break down shadow as blur + color + } + void Clear() { stackElements.clear(); } +protected: + + enum StackElementTypes + { + SE_SEPIA = 0, + SE_CONTRAST = 1, + SE_BLUR = 2, + }; + + struct SepiaElement + { + float strength; + }; + struct Contrast + { + float strength; + }; + struct Blur + { + float horizontal, vertical; // blur strength (standard deviation px) + }; + struct StackElement + { + StackElementTypes type; + union + { + SepiaElement sepiaElement; + Contrast contrastElement; + Blur blurElement; + }; + }; + std::vector stackElements; + +private: + std::vector CalculateGaussianKernel(float sigma, int kernelSize); + std::array CalculateBoxKernel(float sigma); +}; \ No newline at end of file diff --git a/README.md b/README.md index b1d33243f..082411998 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,13 @@ [![Build Status](https://dev.azure.com/babylonjs/ContinousIntegration/_apis/build/status/BabylonNative%20CI?branchName=master)](https://dev.azure.com/babylonjs/ContinousIntegration/_build/latest?definitionId=6&branchName=master) [![Nightly build](https://github.com/BabylonJS/BabylonNative/actions/workflows/nightly.yml/badge.svg?branch=master)](https://github.com/BabylonJS/BabylonNative/actions/workflows/nightly.yml) +# CANVAS TEST BRANCH + +Build and run Playground project, default experience will load a font and will display this animation: +https://playground.babylonjs.com/#UZRZXU + +This branch contains fixes from https://github.com/BabylonJS/BabylonNative/pull/1457 + # Babylon Native Welcome! Babylon Native is a collection of technologies intended to bring