Uses it in the artboard title but also updates the flutter runtime massively to support FFI & WASM C++ Rive Text. PRing to let the tests run.

Diffs=
3be5ff0d8 Text (#4372)
90245a5e1 Fix the Android debug build
0a0f3c267 Fix for missing animation in a blend state. (#4415)
440512dca Add simd::if_then_else (#4403)
ec9fb5bfc Revert "Update SIMD booleans to use bitwise logic operators"
701d8dee2 Update SIMD booleans to use bitwise logic operators
e98b93a61 Add SIMD fallbacks for missing builtins
466f68e3a Add some more core math and SIMD functions
This commit is contained in:
luigi-rosso
2022-11-15 23:07:11 +00:00
parent 0418b7310c
commit e618def5cd
101 changed files with 11860 additions and 30 deletions

View File

@ -0,0 +1,84 @@
#include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole()
{
if (::AllocConsole())
{
FILE* unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout))
{
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unused, "CONOUT$", "w", stderr))
{
_dup2(_fileno(stdout), 2);
}
std::ios::sync_with_stdio();
FlutterDesktopResyncOutputStreams();
}
}
std::vector<std::string> GetCommandLineArguments()
{
// Convert the UTF-16 command line arguments to UTF-8 for the Engine to use.
int argc;
wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc);
if (argv == nullptr)
{
return std::vector<std::string>();
}
std::vector<std::string> command_line_arguments;
// Skip the first argument as it's the binary name.
for (int i = 1; i < argc; i++)
{
command_line_arguments.push_back(Utf8FromUtf16(argv[i]));
}
::LocalFree(argv);
return command_line_arguments;
}
std::string Utf8FromUtf16(const wchar_t* utf16_string)
{
if (utf16_string == nullptr)
{
return std::string();
}
int target_length = ::WideCharToMultiByte(CP_UTF8,
WC_ERR_INVALID_CHARS,
utf16_string,
-1,
nullptr,
0,
nullptr,
nullptr);
std::string utf8_string;
if (target_length == 0 || target_length > utf8_string.max_size())
{
return utf8_string;
}
utf8_string.resize(target_length);
int converted_length = ::WideCharToMultiByte(CP_UTF8,
WC_ERR_INVALID_CHARS,
utf16_string,
-1,
utf8_string.data(),
target_length,
nullptr,
nullptr);
if (converted_length == 0)
{
return std::string();
}
return utf8_string;
}