Package icyllis.arc3d.granite
Class GraniteDevice
java.lang.Object
icyllis.arc3d.core.RefCnt
icyllis.arc3d.sketch.Device
icyllis.arc3d.granite.GraniteDevice
- All Implemented Interfaces:
RefCounted
The device that is backed by GPU.
-
Method Summary
Modifier and TypeMethodDescriptionvoidprotected voidOverride this method to invoke de-allocation of the underlying resource.voidvoiddrawArc(float cx, float cy, float radius, float startAngle, float sweepAngle, int cap, float width, Paint paint) voiddrawAtlasSubRun(SubRunContainer.AtlasSubRun subRun, float originX, float originY, Paint paint) booleandrawBlurredRRect(RRect rr, Paint paint, float blurRadius, float noiseAlpha) voidvoiddrawClipShape(Draw draw) voiddrawEdgeAAQuad(Rect2fc r, float[] clip, int flags, Paint paint) voiddrawEllipse(float cx, float cy, float rx, float ry, Paint paint) <GEO> voiddrawGeometry(Matrixc localToDevice, GEO geometry, BiConsumer<GEO, Rect2f> boundsFn, boolean inverseFill, Paint paint, GeometryRenderer renderer, Blender primitiveBlender) voiddrawImageRect(@RawPtr Image image, Rect2fc src, Rect2fc dst, SamplingOptions sampling, Paint paint, int constraint) voidvoidvoidvoiddrawPoints(int mode, float[] pts, int offset, int count, Paint paint) voidvoidvoiddrawVertices(Vertices vertices, Blender blender, Paint paint) voidEnsures clip elements are drawn that will clip previous draw calls, snaps all pending work from theSurfaceDrawContextas aRenderPassTaskand records it in theGraniteDevice'sRecordingContext.protected Rect2icvoidgetClipBounds(@NonNull Rect2i bounds) Returns the bounding box of the current clip, in this device's coordinate space.@NonNull RecordingContextbooleanisClipAA()booleanbooleanbooleanstatic @Nullable @SharedPtr GraniteDevicemake(@RawPtr RecordingContext rc, @NonNull ImageInfo deviceInfo, int surfaceFlags, int origin, byte initialLoadOp, String label, boolean trackDevice) static @Nullable @SharedPtr GraniteDevicemake(@RawPtr RecordingContext rc, @SharedPtr ImageViewProxy targetView, ImageInfo deviceInfo, byte initialLoadOp, boolean trackDevice) @Nullable @SharedPtr GraniteImagemakeImageCopy(@NonNull Rect2ic subset, boolean budgeted, boolean mipmapped, boolean approxFit) protected voidonDrawGlyphRunList(Canvas canvas, GlyphRunList glyphRunList, Paint paint) voidvoidvoidMethods inherited from class icyllis.arc3d.sketch.Device
createDevice, drawGlyphRunList, getBounds, getBounds, getDeviceToGlobal, getGlobalBounds, getGlobalToDevice, getHeight, getImageInfo, getLocalToDevice, getLocalToDevice33, getRelativeTransform, getWidth, isPixelAlignedToGlobal, makeSurface, setDeviceCoordinateSystem, setGlobalCTM, setLocalToDevice
-
Method Details
-
make
@SharedPtr public static @Nullable @SharedPtr GraniteDevice make(@RawPtr @RawPtr RecordingContext rc, @NonNull ImageInfo deviceInfo, int surfaceFlags, int origin, byte initialLoadOp, String label, boolean trackDevice) -
make
@SharedPtr public static @Nullable @SharedPtr GraniteDevice make(@RawPtr @RawPtr RecordingContext rc, @SharedPtr @SharedPtr ImageViewProxy targetView, ImageInfo deviceInfo, byte initialLoadOp, boolean trackDevice) -
deallocate
protected void deallocate()Description copied from class:RefCntOverride this method to invoke de-allocation of the underlying resource.- Overrides:
deallocatein classDevice
-
setImmutable
public void setImmutable() -
discardRC
public void discardRC() -
getCommandContext
- Overrides:
getCommandContextin classDevice
-
getReadView
- Returns:
- raw ptr to the read view
-
makeImageCopy
@SharedPtr public @Nullable @SharedPtr GraniteImage makeImageCopy(@NonNull Rect2ic subset, boolean budgeted, boolean mipmapped, boolean approxFit) -
pushClipStack
public void pushClipStack()- Specified by:
pushClipStackin classDevice
-
popClipStack
public void popClipStack()- Specified by:
popClipStackin classDevice
-
getClipStack
-
clipRect
-
isClipAA
public boolean isClipAA() -
isClipEmpty
public boolean isClipEmpty()- Specified by:
isClipEmptyin classDevice
-
isClipRect
public boolean isClipRect()- Specified by:
isClipRectin classDevice
-
isClipWideOpen
public boolean isClipWideOpen()- Specified by:
isClipWideOpenin classDevice
-
getClipBounds
Description copied from class:DeviceReturns the bounding box of the current clip, in this device's coordinate space. No pixels outside these bounds will be touched by draws unless the clip is further modified (at which point this will return the updated bounds).- Specified by:
getClipBoundsin classDevice
-
getClipBounds
- Specified by:
getClipBoundsin classDevice
-
drawPaint
-
drawPoints
- Specified by:
drawPointsin classDevice
-
drawLine
-
drawRect
-
drawRRect
-
drawEllipse
- Specified by:
drawEllipsein classDevice
-
drawArc
public void drawArc(float cx, float cy, float radius, float startAngle, float sweepAngle, int cap, float width, Paint paint) -
drawPie
public void drawPie(float cx, float cy, float radius, float startAngle, float sweepAngle, Paint paint) -
drawChord
public void drawChord(float cx, float cy, float radius, float startAngle, float sweepAngle, Paint paint) -
drawImageRect
public void drawImageRect(@RawPtr @RawPtr Image image, Rect2fc src, Rect2fc dst, SamplingOptions sampling, Paint paint, int constraint) - Specified by:
drawImageRectin classDevice
-
onDrawGlyphRunList
- Specified by:
onDrawGlyphRunListin classDevice
-
drawVertices
- Specified by:
drawVerticesin classDevice
-
drawEdgeAAQuad
- Overrides:
drawEdgeAAQuadin classDevice
-
drawBlurredRRect
- Overrides:
drawBlurredRRectin classDevice
-
drawAtlasSubRun
public void drawAtlasSubRun(SubRunContainer.AtlasSubRun subRun, float originX, float originY, Paint paint) -
drawGeometry
public <GEO> void drawGeometry(Matrixc localToDevice, GEO geometry, BiConsumer<GEO, Rect2f> boundsFn, boolean inverseFill, Paint paint, GeometryRenderer renderer, Blender primitiveBlender) -
drawClipShape
-
flushPendingWork
public void flushPendingWork()Ensures clip elements are drawn that will clip previous draw calls, snaps all pending work from theSurfaceDrawContextas aRenderPassTaskand records it in theGraniteDevice'sRecordingContext.
-