blob: 421de5e81677badc68fa05fc38629a3be496511a [file] [log] [blame]
////////////////////////////////////////////////////////////////////////////////
// Do not modify!
// Generated by codergen
////////////////////////////////////////////////////////////////////////////////
package service
import (
"io"
"android.googlesource.com/platform/tools/gpu/framework/binary/registry"
"android.googlesource.com/platform/tools/gpu/framework/binary/schema"
"android.googlesource.com/platform/tools/gpu/framework/log"
"android.googlesource.com/platform/tools/gpu/framework/multiplexer"
"android.googlesource.com/platform/tools/gpu/framework/rpc"
"android.googlesource.com/platform/tools/gpu/framework/stringtable"
"android.googlesource.com/platform/tools/gpu/gapid/gfxapi"
"android.googlesource.com/platform/tools/gpu/gapid/service/path"
)
// Client is the client interface for service calls.
type Client interface {
// Client exposes all the service interface methods.
Debug
Service
// Close closes the client connection.
Close(ctx log.Context) error
// Namespace returns the custom namespace used for decoding responses from the
// server, or nil if no custom namespace has been specified.
Namespace() *registry.Namespace
// SetNamespace replaces the namespace used for decoding objects.
SetNamespace(n *registry.Namespace)
}
type client struct{ rpc rpc.Client }
// NewClient creates a new rpc client using s for communication and n for
// decoding objects. If n is nil then the global namespace is used.
func NewClient(ctx log.Context, s io.ReadWriteCloser, n *registry.Namespace) Client {
m := multiplexer.New(ctx, s, 0, nil)
return &client{rpc.NewClient(m, n)}
}
// Close closes the client connection.
func (c *client) Close(ctx log.Context) error {
return c.rpc.Close(ctx)
}
// Namespace returns the custom namespace used for decoding responses from the
// server, or nil if no custom namespace has been specified.
func (c *client) Namespace() *registry.Namespace {
return c.rpc.Namespace();
}
// SetNamespace replaces the namespace used for decoding objects.
func (c *client) SetNamespace(n *registry.Namespace) {
c.rpc = rpc.NewClient(c.rpc.Multiplexer(), n);
}
// BeginCPUProfile implements the Debug interface.
func (c *client) BeginCPUProfile(ctx log.Context) error {
_, err := c.rpc.Send(&callBeginCPUProfile{})
if err != nil {
return ctx.WrapError(err, "Calling Debug.BeginCPUProfile")
}
return nil}
// EndCPUProfile implements the Debug interface.
func (c *client) EndCPUProfile(ctx log.Context) (res []byte, err error) {
val, err := c.rpc.Send(&callEndCPUProfile{});
if err != nil {
return res, ctx.WrapError(err, "Calling Debug.EndCPUProfile")
}
return val.(*resultEndCPUProfile).value, nil
}
// GetMemProfileRate implements the Debug interface.
func (c *client) GetMemProfileRate(ctx log.Context) (res int, err error) {
val, err := c.rpc.Send(&callGetMemProfileRate{});
if err != nil {
return res, ctx.WrapError(err, "Calling Debug.GetMemProfileRate")
}
return val.(*resultGetMemProfileRate).value, nil
}
// GetPerformanceCounters implements the Debug interface.
func (c *client) GetPerformanceCounters(ctx log.Context) (res []byte, err error) {
val, err := c.rpc.Send(&callGetPerformanceCounters{});
if err != nil {
return res, ctx.WrapError(err, "Calling Debug.GetPerformanceCounters")
}
return val.(*resultGetPerformanceCounters).value, nil
}
// GetProfile implements the Debug interface.
func (c *client) GetProfile(ctx log.Context, name string, debug int) (res []byte, err error) {
val, err := c.rpc.Send(&callGetProfile{name: name, debug: debug});
if err != nil {
return res, ctx.WrapError(err, "Calling Debug.GetProfile")
}
return val.(*resultGetProfile).value, nil
}
// SetMemProfileRate implements the Debug interface.
func (c *client) SetMemProfileRate(ctx log.Context, rate int) error {
_, err := c.rpc.Send(&callSetMemProfileRate{rate: rate})
if err != nil {
return ctx.WrapError(err, "Calling Debug.SetMemProfileRate")
}
return nil}
// Follow implements the Service interface.
func (c *client) Follow(ctx log.Context, p path.Path) (res path.Path, err error) {
val, err := c.rpc.Send(&callFollow{p: p});
if err != nil {
return res, ctx.WrapError(err, "Calling Service.Follow")
}
return val.(*resultFollow).value, nil
}
// Get implements the Service interface.
func (c *client) Get(ctx log.Context, p path.Path) (res interface{}, err error) {
val, err := c.rpc.Send(&callGet{p: p});
if err != nil {
return res, ctx.WrapError(err, "Calling Service.Get")
}
return val.(*resultGet).value, nil
}
// GetAvailableStringTables implements the Service interface.
func (c *client) GetAvailableStringTables(ctx log.Context) (res []stringtable.Info, err error) {
val, err := c.rpc.Send(&callGetAvailableStringTables{});
if err != nil {
return res, ctx.WrapError(err, "Calling Service.GetAvailableStringTables")
}
return val.(*resultGetAvailableStringTables).value, nil
}
// GetCaptures implements the Service interface.
func (c *client) GetCaptures(ctx log.Context) (res []*path.Capture, err error) {
val, err := c.rpc.Send(&callGetCaptures{});
if err != nil {
return res, ctx.WrapError(err, "Calling Service.GetCaptures")
}
return val.(*resultGetCaptures).value, nil
}
// GetDevices implements the Service interface.
func (c *client) GetDevices(ctx log.Context) (res []*path.Device, err error) {
val, err := c.rpc.Send(&callGetDevices{});
if err != nil {
return res, ctx.WrapError(err, "Calling Service.GetDevices")
}
return val.(*resultGetDevices).value, nil
}
// GetFeatures implements the Service interface.
func (c *client) GetFeatures(ctx log.Context) (res []string, err error) {
val, err := c.rpc.Send(&callGetFeatures{});
if err != nil {
return res, ctx.WrapError(err, "Calling Service.GetFeatures")
}
return val.(*resultGetFeatures).value, nil
}
// GetFramebufferAttachment implements the Service interface.
func (c *client) GetFramebufferAttachment(ctx log.Context, device *path.Device, after *path.Atom, attachment gfxapi.FramebufferAttachment, settings RenderSettings) (res *path.ImageInfo, err error) {
val, err := c.rpc.Send(&callGetFramebufferAttachment{device: device, after: after, attachment: attachment, settings: settings});
if err != nil {
return res, ctx.WrapError(err, "Calling Service.GetFramebufferAttachment")
}
return val.(*resultGetFramebufferAttachment).value, nil
}
// GetFramebufferColor implements the Service interface.
func (c *client) GetFramebufferColor(ctx log.Context, device *path.Device, after *path.Atom, settings RenderSettings) (res *path.ImageInfo, err error) {
val, err := c.rpc.Send(&callGetFramebufferColor{device: device, after: after, settings: settings});
if err != nil {
return res, ctx.WrapError(err, "Calling Service.GetFramebufferColor")
}
return val.(*resultGetFramebufferColor).value, nil
}
// GetFramebufferDepth implements the Service interface.
func (c *client) GetFramebufferDepth(ctx log.Context, device *path.Device, after *path.Atom) (res *path.ImageInfo, err error) {
val, err := c.rpc.Send(&callGetFramebufferDepth{device: device, after: after});
if err != nil {
return res, ctx.WrapError(err, "Calling Service.GetFramebufferDepth")
}
return val.(*resultGetFramebufferDepth).value, nil
}
// GetSchema implements the Service interface.
func (c *client) GetSchema(ctx log.Context) (res schema.Message, err error) {
val, err := c.rpc.Send(&callGetSchema{});
if err != nil {
return res, ctx.WrapError(err, "Calling Service.GetSchema")
}
return val.(*resultGetSchema).value, nil
}
// GetStringTable implements the Service interface.
func (c *client) GetStringTable(ctx log.Context, info stringtable.Info) (res *stringtable.StringTable, err error) {
val, err := c.rpc.Send(&callGetStringTable{info: info});
if err != nil {
return res, ctx.WrapError(err, "Calling Service.GetStringTable")
}
return val.(*resultGetStringTable).value, nil
}
// GetTimingInfo implements the Service interface.
func (c *client) GetTimingInfo(ctx log.Context, device *path.Device, capture *path.Capture, flags TimingFlags) (res *path.TimingInfo, err error) {
val, err := c.rpc.Send(&callGetTimingInfo{device: device, capture: capture, flags: flags});
if err != nil {
return res, ctx.WrapError(err, "Calling Service.GetTimingInfo")
}
return val.(*resultGetTimingInfo).value, nil
}
// ImportCapture implements the Service interface.
func (c *client) ImportCapture(ctx log.Context, name string, Data []uint8) (res *path.Capture, err error) {
val, err := c.rpc.Send(&callImportCapture{name: name, Data: Data});
if err != nil {
return res, ctx.WrapError(err, "Calling Service.ImportCapture")
}
return val.(*resultImportCapture).value, nil
}
// LoadCapture implements the Service interface.
func (c *client) LoadCapture(ctx log.Context, path string) (res *path.Capture, err error) {
val, err := c.rpc.Send(&callLoadCapture{path: path});
if err != nil {
return res, ctx.WrapError(err, "Calling Service.LoadCapture")
}
return val.(*resultLoadCapture).value, nil
}
// RegisterAndroidDevice implements the Service interface.
func (c *client) RegisterAndroidDevice(ctx log.Context, serial string) (res *path.Device, err error) {
val, err := c.rpc.Send(&callRegisterAndroidDevice{serial: serial});
if err != nil {
return res, ctx.WrapError(err, "Calling Service.RegisterAndroidDevice")
}
return val.(*resultRegisterAndroidDevice).value, nil
}
// Set implements the Service interface.
func (c *client) Set(ctx log.Context, p path.Path, v interface{}) (res path.Path, err error) {
val, err := c.rpc.Send(&callSet{p: p, v: v});
if err != nil {
return res, ctx.WrapError(err, "Calling Service.Set")
}
return val.(*resultSet).value, nil
}