blob: 21c790d6507eba1a9ad4a53e2ac7a582bcee591e [file] [log] [blame]
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <emscripten/threading.h>
#include <cinttypes>
namespace Skwasm {
class Surface;
}
using SkwasmObject = __externref_t;
extern "C" {
extern void skwasm_setAssociatedObjectOnThread(unsigned long threadId,
void* pointer,
SkwasmObject object);
extern SkwasmObject skwasm_getAssociatedObject(void* pointer);
extern void skwasm_disposeAssociatedObjectOnThread(unsigned long threadId,
void* pointer);
extern void skwasm_registerMessageListener(pthread_t threadId);
extern uint32_t skwasm_createOffscreenCanvas(int width, int height);
extern void skwasm_resizeCanvas(uint32_t contextHandle, int width, int height);
extern void skwasm_captureImageBitmap(Skwasm::Surface* surfaceHandle,
uint32_t contextHandle,
uint32_t bitmapId,
int width,
int height);
extern unsigned int skwasm_createGlTextureFromTextureSource(
SkwasmObject textureSource,
int width,
int height);
}