Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
org.skia.jetski.Surface Class Reference

Public Member Functions

 Surface (Bitmap bitmap)
 
Canvas getCanvas ()
 
Image makeImageSnapshot ()
 
void flushAndSubmit ()
 
int getWidth ()
 
int getHeight ()
 
void release ()
 

Static Public Member Functions

static Surface CreateVulkan (android.view.Surface surface)
 
static Surface CreateGL (android.view.Surface surface)
 
static Surface createThreadedSurface (android.view.Surface surface)
 

Protected Member Functions

void finalize () throws Throwable
 

Detailed Description

Definition at line 14 of file Surface.java.

Constructor & Destructor Documentation

◆ Surface()

org.skia.jetski.Surface.Surface ( Bitmap  bitmap)
inline

Create a Surface backed by the provided Bitmap.

The Bitmap must be mutable and its pixels are locked for the lifetime of the Surface.

Definition at line 22 of file Surface.java.

22 {
23 this(CreateBitmapInstance(bitmap));
24 }
Definition: bitmap.py:1

Member Function Documentation

◆ CreateGL()

static Surface org.skia.jetski.Surface.CreateGL ( android.view.Surface  surface)
inlinestatic

Definition at line 31 of file Surface.java.

31 {
32 return new Surface(nCreateGLSurface(surface));
33 }
Surface(Bitmap bitmap)
Definition: Surface.java:22
VkSurfaceKHR surface
Definition: main.cc:49

◆ createThreadedSurface()

static Surface org.skia.jetski.Surface.createThreadedSurface ( android.view.Surface  surface)
inlinestatic

Create a Surface backed by the provided Android Surface (android.view.Surface). JetSki handles thread management. Assumes OpenGL backend.

Definition at line 39 of file Surface.java.

39 {
40 return new Surface(nCreateThreadedSurface(surface));
41 }

◆ CreateVulkan()

static Surface org.skia.jetski.Surface.CreateVulkan ( android.view.Surface  surface)
inlinestatic

Definition at line 27 of file Surface.java.

27 {
28 return new Surface(nCreateVKSurface(surface));
29 }

◆ finalize()

void org.skia.jetski.Surface.finalize ( ) throws Throwable
inlineprotected

Definition at line 88 of file Surface.java.

89 {
90 release();
91 }

◆ flushAndSubmit()

void org.skia.jetski.Surface.flushAndSubmit ( )
inline

Definition at line 67 of file Surface.java.

67 {
68 nFlushAndSubmit(mNativeInstance);
69 }

◆ getCanvas()

Canvas org.skia.jetski.Surface.getCanvas ( )
inline

The Canvas associated with this Surface.

Definition at line 46 of file Surface.java.

46 {
47 // TODO: given that canvases are now ephemeral, it would make sense to be more explicit
48 // e.g. lockCanvas/unlockCanvasAndPost?
49 return new Canvas(this, nGetNativeCanvas(mNativeInstance));
50 }

◆ getHeight()

int org.skia.jetski.Surface.getHeight ( )
inline

Definition at line 75 of file Surface.java.

75 {
76 return nGetHeight(mNativeInstance);
77 }

◆ getWidth()

int org.skia.jetski.Surface.getWidth ( )
inline

Definition at line 71 of file Surface.java.

71 {
72 return nGetWidth(mNativeInstance);
73 }

◆ makeImageSnapshot()

Image org.skia.jetski.Surface.makeImageSnapshot ( )
inline

Returns an Image capturing the Surface contents. Subsequent drawing to Surface contents are not captured.

Definition at line 57 of file Surface.java.

57 {
58 return new Image(nMakeImageSnapshot(mNativeInstance));
59 }
CanvasImage Image
Definition: dart_ui.cc:55

◆ release()

void org.skia.jetski.Surface.release ( )
inline

Releases any resources associated with this Surface.

Definition at line 82 of file Surface.java.

82 {
83 nRelease(mNativeInstance);
84 mNativeInstance = 0;
85 }

The documentation for this class was generated from the following file: