Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Functions
surface.cpp File Reference
#include "surface.h"
#include <algorithm>
#include "third_party/skia/include/gpu/GrBackendSurface.h"
#include "third_party/skia/include/gpu/GrDirectContext.h"
#include "third_party/skia/include/gpu/ganesh/gl/GrGLBackendSurface.h"
#include "third_party/skia/include/gpu/ganesh/gl/GrGLDirectContext.h"

Go to the source code of this file.

Functions

SKWASM_EXPORT Surfacesurface_create ()
 
SKWASM_EXPORT unsigned long surface_getThreadId (Surface *surface)
 
SKWASM_EXPORT void surface_setCallbackHandler (Surface *surface, Surface::CallbackHandler *callbackHandler)
 
SKWASM_EXPORT void surface_destroy (Surface *surface)
 
SKWASM_EXPORT uint32_t surface_renderPictures (Surface *surface, SkPicture **pictures, int count)
 
SKWASM_EXPORT void surface_renderPicturesOnWorker (Surface *surface, sk_sp< SkPicture > *pictures, int pictureCount, uint32_t callbackId, double rasterStart)
 
SKWASM_EXPORT uint32_t surface_rasterizeImage (Surface *surface, SkImage *image, ImageByteFormat format)
 
SKWASM_EXPORT void surface_onRenderComplete (Surface *surface, uint32_t callbackId, SkwasmObject imageBitmap)
 

Function Documentation

◆ surface_create()

SKWASM_EXPORT Surface * surface_create ( )

Definition at line 232 of file surface.cpp.

232 {
233 return new Surface();
234}

◆ surface_destroy()

SKWASM_EXPORT void surface_destroy ( Surface surface)

Definition at line 246 of file surface.cpp.

246 {
247 surface->dispose();
248}
VkSurfaceKHR surface
Definition main.cc:49

◆ surface_getThreadId()

SKWASM_EXPORT unsigned long surface_getThreadId ( Surface surface)

Definition at line 236 of file surface.cpp.

236 {
237 return surface->getThreadId();
238}

◆ surface_onRenderComplete()

SKWASM_EXPORT void surface_onRenderComplete ( Surface surface,
uint32_t  callbackId,
SkwasmObject  imageBitmap 
)

Definition at line 276 of file surface.cpp.

278 {
279 return surface->onRenderComplete(callbackId, imageBitmap);
280}

◆ surface_rasterizeImage()

SKWASM_EXPORT uint32_t surface_rasterizeImage ( Surface surface,
SkImage image,
ImageByteFormat  format 
)

Definition at line 268 of file surface.cpp.

270 {
271 return surface->rasterizeImage(image, format);
272}
sk_sp< SkImage > image
Definition examples.cpp:29
uint32_t uint32_t * format

◆ surface_renderPictures()

SKWASM_EXPORT uint32_t surface_renderPictures ( Surface surface,
SkPicture **  pictures,
int  count 
)

Definition at line 250 of file surface.cpp.

252 {
253 return surface->renderPictures(pictures, count);
254}
int count

◆ surface_renderPicturesOnWorker()

SKWASM_EXPORT void surface_renderPicturesOnWorker ( Surface surface,
sk_sp< SkPicture > *  pictures,
int  pictureCount,
uint32_t  callbackId,
double  rasterStart 
)

Definition at line 256 of file surface.cpp.

260 {
261 // This will release the pictures when they leave scope.
262 std::unique_ptr<sk_sp<SkPicture>[]> picturesPointer =
263 std::unique_ptr<sk_sp<SkPicture>[]>(pictures);
264 surface->renderPicturesOnWorker(pictures, pictureCount, callbackId,
265 rasterStart);
266}

◆ surface_setCallbackHandler()

SKWASM_EXPORT void surface_setCallbackHandler ( Surface surface,
Surface::CallbackHandler *  callbackHandler 
)

Definition at line 240 of file surface.cpp.

242 {
243 surface->setCallbackHandler(callbackHandler);
244}