Documentation
¶
Index ¶
- Constants
- func Finalize()
- func GFXSlowSwizzlingBlit(buffer []byte, image []byte, w, h, tx, ty int)
- func GetVSyncEvent() (nxtypes.ReventHandle, error)
- func IGBPDequeueBuffer(igbp vi.IGBP, width, height uint32, pixelFormat graphics.PixelFormat, ...) (status, slot uint32, fence Fence, outTimestamps *FrameEventHistoryDelta, ...)
- func IGBPDisconnect(igbp vi.IGBP, api int, mode DisconnectMode) (status int, err error)
- func IGBPSetPreallocatedBuffer(igbp vi.IGBP, slot int, gb *GraphicBuffer) error
- func Init() (err error)
- type BqRect
- type CompositorTiming
- type DisconnectMode
- type Fence
- type Frame
- func (f *Frame) At(x, y int) color.Color
- func (f *Frame) Bounds() image.Rectangle
- func (f *Frame) Clear(c color.RGBA)
- func (f *Frame) ColorModel() color.Model
- func (f *Frame) Convert(c color.Color) color.Color
- func (f *Frame) Destroy() error
- func (f *Frame) Display() error
- func (f *Frame) DrawStringAt(x, y int, data string, c color.RGBA, font *font.Data)
- func (f *Frame) SetPixel(x, y int16, c color.RGBA)
- func (f *Frame) Size() (x, y int16)
- func (f *Frame) WaitVSync() error
- type FrameEventHistoryDelta
- type GraphicBuffer
- type NativeWindow
- type QueueBufferInput
- type QueueBufferOutput
- func IGBPConnect(igbp vi.IGBP, api int, producerControlledByApp bool) (status int, qbo *QueueBufferOutput, err error)
- func IGBPQueueBuffer(igbp vi.IGBP, slot int, qbi *QueueBufferInput) (qbo *QueueBufferOutput, status int, err error)
- func UnflattenQueueBufferOutput(p *vi.Parcel) (qbo *QueueBufferOutput, err error)
- type Rect
- type Surface
- type SurfaceState
Constants ¶
const ( REQUEST_BUFFER = 0x1 SET_BUFFER_COUNT = 0x2 DEQUEUE_BUFFER = 0x3 DETACH_BUFFER = 0x4 DETACH_NEXT_BUFFER = 0x5 ATTACH_BUFFER = 0x6 QUEUE_BUFFER = 0x7 CANCEL_BUFFER = 0x8 QUERY = 0x9 CONNECT = 0xA DISCONNECT = 0xB ALLOCATE_BUFFERS = 0xD SET_PREALLOCATED_BUFFER = 0xE )
const ( /* buffer is never read in software */ GRALLOC_USAGE_SW_READ_NEVER = 0x00000000 /* buffer is rarely read in software */ GRALLOC_USAGE_SW_READ_RARELY = 0x00000002 /* buffer is often read in software */ GRALLOC_USAGE_SW_READ_OFTEN = 0x00000003 /* mask for the software read values */ GRALLOC_USAGE_SW_READ_MASK = 0x0000000F /* buffer is never written in software */ GRALLOC_USAGE_SW_WRITE_NEVER = 0x00000000 /* buffer is rarely written in software */ GRALLOC_USAGE_SW_WRITE_RARELY = 0x00000020 /* buffer is often written in software */ GRALLOC_USAGE_SW_WRITE_OFTEN = 0x00000030 /* mask for the software write values */ GRALLOC_USAGE_SW_WRITE_MASK = 0x000000F0 /* buffer will be used as an OpenGL ES texture */ GRALLOC_USAGE_HW_TEXTURE = 0x00000100 /* buffer will be used as an OpenGL ES render target */ GRALLOC_USAGE_HW_RENDER = 0x00000200 /* buffer will be used by the 2D hardware blitter */ GRALLOC_USAGE_HW_2D = 0x00000400 /* buffer will be used by the HWComposer HAL module */ GRALLOC_USAGE_HW_COMPOSER = 0x00000800 /* buffer will be used with the framebuffer device */ GRALLOC_USAGE_HW_FB = 0x00001000 /* buffer should be displayed full-screen on an external display when * possible */ GRALLOC_USAGE_EXTERNAL_DISP = 0x00002000 /* Must have a hardware-protected path to external display sink for * this buffer. If a hardware-protected path is not available, then * either don't composite only this buffer (preferred) to the * external sink, or (less desirable) do not route the entire * composition to the external sink. */ GRALLOC_USAGE_PROTECTED = 0x00004000 /* buffer may be used as a cursor */ GRALLOC_USAGE_CURSOR = 0x00008000 /* buffer will be used with the HW video encoder */ GRALLOC_USAGE_HW_VIDEO_ENCODER = 0x00010000 /* buffer will be written by the HW camera pipeline */ GRALLOC_USAGE_HW_CAMERA_WRITE = 0x00020000 /* buffer will be read by the HW camera pipeline */ GRALLOC_USAGE_HW_CAMERA_READ = 0x00040000 /* buffer will be used as part of zero-shutter-lag queue */ GRALLOC_USAGE_HW_CAMERA_ZSL = 0x00060000 /* mask for the camera access values */ GRALLOC_USAGE_HW_CAMERA_MASK = 0x00060000 /* mask for the software usage bit-mask */ GRALLOC_USAGE_HW_MASK = 0x00071F00 /* buffer will be used as a RenderScript Allocation */ GRALLOC_USAGE_RENDERSCRIPT = 0x00100000 )
const ( // From Android window.h. /* attributes queriable with query() */ NativeWindowWidth = 0 NativeWindowHeight = 1 NativeWindowFormat = 2 )
const NativeWindowAPICPU = 2
From Android window.h.
parameter for NATIVE_WINDOW_[API_][DIS]CONNECT
...
Buffers will be queued after being filled using the CPU
Variables ¶
This section is empty.
Functions ¶
func GFXSlowSwizzlingBlit ¶
func GetVSyncEvent ¶
func GetVSyncEvent() (nxtypes.ReventHandle, error)
func IGBPDequeueBuffer ¶
func IGBPDisconnect ¶
func IGBPSetPreallocatedBuffer ¶
func IGBPSetPreallocatedBuffer(igbp vi.IGBP, slot int, gb *GraphicBuffer) error
Types ¶
type CompositorTiming ¶
type CompositorTiming struct {
DeadlineNanoseconds int64
InternalNanoseconds int64
PresentLatencyNanoseconds int64
}
CompositorTiming https://source.android.com/reference/hidl/android/hardware/graphics/bufferqueue/1.0/IGraphicBufferProducer#compositortiming
type DisconnectMode ¶
type DisconnectMode int
const ( DisconnectAPI DisconnectMode = 0 DisconnectAllLocal DisconnectMode = 1 )
type Frame ¶
type Frame struct {
// contains filtered or unexported fields
}
func (*Frame) At ¶
At returns the color of the pixel at (x, y). At(Bounds().Min.X, Bounds().Min.Y) returns the upper-left pixel of the grid. At(Bounds().Max.X-1, Bounds().Max.Y-1) returns the lower-right one.
func (*Frame) Bounds ¶
Bounds returns the domain for which At can return non-zero color. The bounds do not necessarily contain the point (0, 0).
func (*Frame) ColorModel ¶
ColorModel returns the Image's color model.
func (*Frame) DrawStringAt ¶
type FrameEventHistoryDelta ¶
type FrameEventHistoryDelta struct {
CompositorTiming CompositorTiming
}
FrameEventHistoryDelta
Not fully implemented, just enough that it works. https://source.android.com/reference/hidl/android/hardware/graphics/bufferqueue/1.0/IGraphicBufferProducer#frameeventhistorydelta
type GraphicBuffer ¶
type GraphicBuffer struct {
Width uint32
Height uint32
Stride uint32
Format graphics.PixelFormat
Length uint32
Usage uint32
GPUBuffer *gpu.Buffer
Index int32
PixelBufferOffset uint32
NativeHandle *nxtypes.NativeHandle
GRBuff *nv.GraphicBuffer
}
GraphicBuffer Graphics Buffer
func IGBPRequestBuffer ¶
type NativeWindow ¶
type NativeWindow struct {
Magic uint32
SlotsConfigured uint64
SlotsRequested uint64
CurSlot int32
Width uint32
Height uint32
Format uint32
Usage uint32
Crop BqRect
ScalingMode uint32
Transform uint32
StickyTransform uint32
DefaultWidth uint32
DefaultHeight uint32
SwapInterval uint32
IsConnected bool
ProducerControlledByApp bool
ConsumerRunningBehind bool
// contains filtered or unexported fields
}
type QueueBufferInput ¶
type QueueBufferInput struct {
Size uint32
NumFds uint32
Timestamp int64
IsAutoTimestamp int32
Crop Rect
ScalingMode int32
Transform uint32
StickyTransform uint32
Unknown [2]uint32
Fence Fence
}
QueueBufferInput Parameters passed to queueBuffer https://source.android.com/reference/hidl/android/hardware/graphics/bufferqueue/1.0/IGraphicBufferProducer#queuebufferinput
func (*QueueBufferInput) Flatten ¶
func (qbi *QueueBufferInput) Flatten(p *vi.Parcel)
type QueueBufferOutput ¶
type QueueBufferOutput struct {
Width uint32
Height uint32
TransformHint uint32
NumPendingBuffers uint32
NextFrameNumber uint32
BufferReplaced bool
FrameTimestamps FrameEventHistoryDelta
}
QueueBufferOutput Values received back from queueBuffer https://source.android.com/reference/hidl/android/hardware/graphics/bufferqueue/1.0/IGraphicBufferProducer#queuebufferoutput
func IGBPConnect ¶
func IGBPQueueBuffer ¶
func IGBPQueueBuffer(igbp vi.IGBP, slot int, qbi *QueueBufferInput) (qbo *QueueBufferOutput, status int, err error)
func UnflattenQueueBufferOutput ¶
func UnflattenQueueBufferOutput(p *vi.Parcel) (qbo *QueueBufferOutput, err error)
type Surface ¶
type Surface struct {
LayerId uint64
IGBP vi.IGBP
IGBPIsConnected bool
State SurfaceState
HasRequested []bool
CurrentSlot uint32
GpuBuffer *gpu.Buffer
GpuBufferMemory []byte
GpuBufferMemoryAlloc uintptr
GraphicBuffers []GraphicBuffer
CurrentFence Fence
GRBuff *nv.GraphicBuffer
// contains filtered or unexported fields
}
func SurfaceCreate ¶
func (*Surface) CloseLayer ¶
func (*Surface) DequeueBuffer ¶
func (*Surface) Disconnect ¶
func (s *Surface) Disconnect()
func (*Surface) QueueBuffer ¶
type SurfaceState ¶
type SurfaceState int
SurfaceState Keeps track of the internal state of a \ref surface_t
const ( SURFACE_STATE_INVALID SurfaceState = iota SURFACE_STATE_DEQUEUED SurfaceState = iota SURFACE_STATE_QUEUED SurfaceState = iota )