Package icyllis.arc3d.granite
Class GraniteDevice
java.lang.Object
icyllis.arc3d.core.RefCnt
icyllis.arc3d.core.Device
icyllis.arc3d.granite.GraniteDevice
- All Implemented Interfaces:
RefCounted
The device that is backed by GPU.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
protected void
Override this method to invoke de-allocation of the underlying resource.void
void
drawArc
(float cx, float cy, float radius, float startAngle, float sweepAngle, int cap, float width, Paint paint) void
drawAtlasSubRun
(SubRunContainer.AtlasSubRun subRun, float originX, float originY, Paint paint) void
void
drawCircle
(float cx, float cy, float radius, Paint paint) void
drawClipShape
(Draw draw, boolean inverseFill) <GEO> void
drawGeometry
(Matrixc localToDevice, GEO geometry, BiConsumer<GEO, Rect2f> boundsFn, Paint paint, GeometryRenderer renderer, @SharedPtr Blender primitiveBlender) void
drawImageRect
(@RawPtr Image image, Rect2fc src, Rect2fc dst, SamplingOptions sampling, Paint paint, int constraint) void
void
void
void
drawPoints
(int mode, float[] pts, int offset, int count, Paint paint) void
void
drawRoundRect
(RoundRect rr, Paint paint) void
drawVertices
(Vertices vertices, @SharedPtr Blender blender, Paint paint) void
Ensures clip elements are drawn that will clip previous draw calls, snaps all pending work from theSurfaceDrawContext
as aRenderPassTask
and records it in theGraniteDevice
'sRecordingContext
.protected Rect2ic
void
getClipBounds
(Rect2i bounds) Returns the bounding box of the current clip, in this device's coordinate space.boolean
isClipAA()
boolean
boolean
boolean
static @SharedPtr GraniteDevice
make
(@RawPtr RecordingContext rc, ImageInfo deviceInfo, int surfaceFlags, int origin, byte initialLoadOp, String label, boolean trackDevice) static @SharedPtr GraniteDevice
make
(@RawPtr RecordingContext rc, @SharedPtr ImageViewProxy targetView, ImageInfo deviceInfo, byte initialLoadOp, boolean trackDevice) makeImageCopy
(Rect2ic subset, boolean budgeted, boolean mipmapped, boolean approxFit) protected void
onDrawGlyphRunList
(Canvas canvas, GlyphRunList glyphRunList, Paint paint) void
void
void
Methods inherited from class icyllis.arc3d.core.Device
createDevice, drawGlyphRunList, getBounds, getBounds, getDeviceToGlobal, getGlobalBounds, getGlobalToDevice, getHeight, getImageInfo, getLocalToDevice, getLocalToDevice33, getRelativeTransform, getWidth, isPixelAlignedToGlobal, makeSurface, setDeviceCoordinateSystem, setGlobalCTM, setLocalToDevice
-
Method Details
-
make
@Nullable @SharedPtr public static @SharedPtr GraniteDevice make(@RawPtr @RawPtr RecordingContext rc, @Nonnull ImageInfo deviceInfo, int surfaceFlags, int origin, byte initialLoadOp, String label, boolean trackDevice) -
make
@Nullable @SharedPtr public static @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:RefCnt
Override this method to invoke de-allocation of the underlying resource.- Overrides:
deallocate
in classDevice
-
setImmutable
public void setImmutable() -
discardRC
public void discardRC() -
getRecordingContext
- Overrides:
getRecordingContext
in classDevice
-
getReadView
- Returns:
- raw ptr to the read view
-
makeImageCopy
@Nullable @SharedPtr public @SharedPtr GraniteImage makeImageCopy(@Nonnull Rect2ic subset, boolean budgeted, boolean mipmapped, boolean approxFit) -
pushClipStack
public void pushClipStack()- Specified by:
pushClipStack
in classDevice
-
popClipStack
public void popClipStack()- Specified by:
popClipStack
in classDevice
-
getClipStack
-
clipRect
-
isClipAA
public boolean isClipAA() -
isClipEmpty
public boolean isClipEmpty()- Specified by:
isClipEmpty
in classDevice
-
isClipRect
public boolean isClipRect()- Specified by:
isClipRect
in classDevice
-
isClipWideOpen
public boolean isClipWideOpen()- Specified by:
isClipWideOpen
in classDevice
-
getClipBounds
Description copied from class:Device
Returns 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:
getClipBounds
in classDevice
-
getClipBounds
- Specified by:
getClipBounds
in classDevice
-
drawPaint
-
drawPoints
- Specified by:
drawPoints
in classDevice
-
drawLine
-
drawRect
-
drawRoundRect
- Specified by:
drawRoundRect
in classDevice
-
drawCircle
- Specified by:
drawCircle
in 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:
drawImageRect
in classDevice
-
onDrawGlyphRunList
- Specified by:
onDrawGlyphRunList
in classDevice
-
drawVertices
- Specified by:
drawVertices
in 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, Paint paint, GeometryRenderer renderer, @SharedPtr @SharedPtr Blender primitiveBlender) -
drawClipShape
-
flushPendingWork
public void flushPendingWork()Ensures clip elements are drawn that will clip previous draw calls, snaps all pending work from theSurfaceDrawContext
as aRenderPassTask
and records it in theGraniteDevice
'sRecordingContext
.
-