Documentation
¶
Overview ¶
Package hint provides Go bindings for Android performance hint management.
Index ¶
- type Error
- type Manager
- type Pid_t
- type Session
- func (h *Session) APerformanceHint_reportActualWorkDuration2(workDuration *WorkDuration) error
- func (h *Session) APerformanceHint_setPreferPowerEfficiency(enabled bool) error
- func (h *Session) APerformanceHint_setThreads(threadIds *Pid_t, size uint64) error
- func (h *Session) Close() error
- func (h *Session) Pointer() unsafe.Pointer
- func (h *Session) ReportActualWorkDuration(actualDuration time.Duration) error
- func (h *Session) UintPtr() uintptr
- func (h *Session) UpdateTargetWorkDuration(targetDuration time.Duration) error
- type WorkDuration
- func (h *WorkDuration) Close() error
- func (h *WorkDuration) Pointer() unsafe.Pointer
- func (h *WorkDuration) SetActualCpuDurationNanos(actualCpuDurationNanos int64)
- func (h *WorkDuration) SetActualGpuDurationNanos(actualGpuDurationNanos int64)
- func (h *WorkDuration) SetActualTotalDurationNanos(actualTotalDurationNanos int64)
- func (h *WorkDuration) SetWorkPeriodStartTimestampNanos(workPeriodStartTimestampNanos int64)
- func (h *WorkDuration) UintPtr() uintptr
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager wraps the NDK APerformanceHintManager handle.
func APerformanceHint_getManager ¶
func APerformanceHint_getManager() *Manager
APerformanceHint_getManager calls the underlying C function.
func NewManagerFromPointer ¶
NewManagerFromPointer wraps a raw APerformanceHintManager pointer.
func NewManagerFromUintPtr ¶ added in v0.0.4
NewManagerFromUintPtr wraps a uintptr as a Manager. The caller must ensure ptr points to a valid APerformanceHintManager.
func (*Manager) CreateSession ¶
func (h *Manager) CreateSession(threadIds *int32, size uint64, initialTargetWorkDuration time.Duration) *Session
CreateSession creates a new Session from this Manager.
func (*Manager) PreferredUpdateRateNanos ¶
PreferredUpdateRateNanos returns the value directly.
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session wraps the NDK APerformanceHintSession handle.
func NewSessionFromPointer ¶
NewSessionFromPointer wraps a raw APerformanceHintSession pointer.
func NewSessionFromUintPtr ¶ added in v0.0.4
NewSessionFromUintPtr wraps a uintptr as a Session. The caller must ensure ptr points to a valid APerformanceHintSession.
func (*Session) APerformanceHint_reportActualWorkDuration2 ¶
func (h *Session) APerformanceHint_reportActualWorkDuration2(workDuration *WorkDuration) error
APerformanceHint_reportActualWorkDuration2 calls the underlying NDK function.
func (*Session) APerformanceHint_setPreferPowerEfficiency ¶
APerformanceHint_setPreferPowerEfficiency calls the underlying NDK function.
func (*Session) APerformanceHint_setThreads ¶
APerformanceHint_setThreads calls the underlying NDK function.
func (*Session) ReportActualWorkDuration ¶
ReportActualWorkDuration calls the underlying NDK function.
type WorkDuration ¶
type WorkDuration struct {
// contains filtered or unexported fields
}
WorkDuration wraps the NDK AWorkDuration handle.
func NewWorkDuration ¶
func NewWorkDuration() *WorkDuration
NewWorkDuration creates a new WorkDuration.
func NewWorkDurationFromPointer ¶
func NewWorkDurationFromPointer(ptr unsafe.Pointer) *WorkDuration
NewWorkDurationFromPointer wraps a raw AWorkDuration pointer.
func NewWorkDurationFromUintPtr ¶ added in v0.0.4
func NewWorkDurationFromUintPtr(ptr uintptr) *WorkDuration
NewWorkDurationFromUintPtr wraps a uintptr as a WorkDuration. The caller must ensure ptr points to a valid AWorkDuration.
func (*WorkDuration) Close ¶
func (h *WorkDuration) Close() error
Close releases the underlying NDK handle.
func (*WorkDuration) Pointer ¶
func (h *WorkDuration) Pointer() unsafe.Pointer
Pointer returns the underlying pointer as unsafe.Pointer.
func (*WorkDuration) SetActualCpuDurationNanos ¶
func (h *WorkDuration) SetActualCpuDurationNanos(actualCpuDurationNanos int64)
SetActualCpuDurationNanos calls the underlying NDK function.
func (*WorkDuration) SetActualGpuDurationNanos ¶
func (h *WorkDuration) SetActualGpuDurationNanos(actualGpuDurationNanos int64)
SetActualGpuDurationNanos calls the underlying NDK function.
func (*WorkDuration) SetActualTotalDurationNanos ¶
func (h *WorkDuration) SetActualTotalDurationNanos(actualTotalDurationNanos int64)
SetActualTotalDurationNanos calls the underlying NDK function.
func (*WorkDuration) SetWorkPeriodStartTimestampNanos ¶
func (h *WorkDuration) SetWorkPeriodStartTimestampNanos(workPeriodStartTimestampNanos int64)
SetWorkPeriodStartTimestampNanos calls the underlying NDK function.
func (*WorkDuration) UintPtr ¶ added in v0.0.4
func (h *WorkDuration) UintPtr() uintptr
UintPtr returns the underlying pointer as a uintptr. This is useful for interop with gomobile bind, golang.org/x/mobile, gioui.org, and other packages that represent native handles as uintptr.