Flutter Engine
The Flutter Engine
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"
#include "third_party/skia/include/gpu/ganesh/gl/GrGLMakeWebGLInterface.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 233 of file surface.cpp.

233 {
234 return new Surface();
235}

◆ surface_destroy()

SKWASM_EXPORT void surface_destroy ( Surface surface)

Definition at line 247 of file surface.cpp.

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

◆ surface_getThreadId()

SKWASM_EXPORT unsigned long surface_getThreadId ( Surface surface)

Definition at line 237 of file surface.cpp.

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

◆ surface_onRenderComplete()

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

Definition at line 277 of file surface.cpp.

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

◆ surface_rasterizeImage()

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

Definition at line 269 of file surface.cpp.

271 {
272 return surface->rasterizeImage(image, format);
273}
uint32_t uint32_t * format
sk_sp< const SkImage > image
Definition: SkRecords.h:269

◆ surface_renderPictures()

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

Definition at line 251 of file surface.cpp.

253 {
254 return surface->renderPictures(pictures, count);
255}
int count
Definition: FontMgrTest.cpp:50

◆ surface_renderPicturesOnWorker()

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

Definition at line 257 of file surface.cpp.

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

◆ surface_setCallbackHandler()

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

Definition at line 241 of file surface.cpp.

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