java.lang.Object
io.github.jwharm.cairobindings.Proxy
org.freedesktop.cairo.Device
org.freedesktop.cairo.Script
- All Implemented Interfaces:
AutoCloseable
Output device for use with a
ScriptSurface
.
The script surface provides the ability to render to a native script that matches the cairo drawing model. The scripts can be replayed using tools under the util/cairo-script directory, or with cairo-perf-trace.
- Since:
- 1.12
- See Also:
-
Constructor Summary
ConstructorDescriptionScript
(MemorySegment address) Constructor used internally to instantiate a java ScriptSurface object for a nativecairo_device_t
instance -
Method Summary
Modifier and TypeMethodDescriptionstatic Script
create
(OutputStream stream) Creates a output device for emitting the script, used when creating the individual surfaces.static Script
Creates a output device for emitting the script, used when creating the individual surfaces.createScriptSurface
(Content content, double width, double height) Create a new surface that will emit its rendering through this script (output device)createScriptSurfaceForTarget
(Surface target) Create a proxy surface that will render totarget
and record the operations to this script (output device).void
from
(RecordingSurface recordingSurface) Converts the record operations in recordingSurface into a script.getMode()
Queries the script for its current output mode.void
setMode
(ScriptMode mode) Change the output mode of the scriptvoid
writeComment
(String comment) Emit a string verbatim into the script.Methods inherited from class org.freedesktop.cairo.Device
acquire, close, destroy, finish, flush, getDeviceType, getType, getUserData, observerElapsed, observerFillElapsed, observerGlyphsElapsed, observerMaskElapsed, observerPaintElapsed, observerPrint, observerStrokeElapsed, release, setUserData, status
-
Constructor Details
-
Script
Constructor used internally to instantiate a java ScriptSurface object for a nativecairo_device_t
instance- Parameters:
address
- the memory address of the nativecairo_device_t
instance
-
-
Method Details
-
create
-
create
Creates a output device for emitting the script, used when creating the individual surfaces.- Parameters:
stream
-OutputStream
passed the bytes written to the script- Returns:
- the newly created device
- Since:
- 1.12
-
from
Converts the record operations in recordingSurface into a script.- Parameters:
recordingSurface
- the recording surface to replay- Since:
- 1.12
-
getMode
Queries the script for its current output mode.- Returns:
- the current output mode of the script
- Since:
- 1.12
-
setMode
Change the output mode of the script- Parameters:
mode
- the new mode- Since:
- 1.12
-
createScriptSurface
Create a new surface that will emit its rendering through this script (output device)- Parameters:
content
- the content of the surfacewidth
- width in pixelsheight
- height in pixels- Returns:
- the newly created surface
- Since:
- 1.12
-
createScriptSurfaceForTarget
Create a proxy surface that will render totarget
and record the operations to this script (output device).- Parameters:
target
- a target surface to wrap- Returns:
- the newly created surface.
- Since:
- 1.12
-
writeComment
Emit a string verbatim into the script.- Parameters:
comment
- the string to emit- Since:
- 1.12
-