Initial work
This commit is contained in:
commit
3222551702
374 changed files with 40290 additions and 0 deletions
20
external/android-emugl/host/tools/emugen/tests/t.001/expected/encoder/foo_client_context.cpp
vendored
Normal file
20
external/android-emugl/host/tools/emugen/tests/t.001/expected/encoder/foo_client_context.cpp
vendored
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
// Generated Code - DO NOT EDIT !!
|
||||
// generated by 'emugen'
|
||||
|
||||
|
||||
#include <string.h>
|
||||
#include "foo_client_context.h"
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
int foo_client_context_t::initDispatchByName(void *(*getProc)(const char *, void *userData), void *userData)
|
||||
{
|
||||
fooAlphaFunc = (fooAlphaFunc_client_proc_t) getProc("fooAlphaFunc", userData);
|
||||
fooIsBuffer = (fooIsBuffer_client_proc_t) getProc("fooIsBuffer", userData);
|
||||
fooUnsupported = (fooUnsupported_client_proc_t) getProc("fooUnsupported", userData);
|
||||
fooDoEncoderFlush = (fooDoEncoderFlush_client_proc_t) getProc("fooDoEncoderFlush", userData);
|
||||
fooTakeConstVoidPtrConstPtr = (fooTakeConstVoidPtrConstPtr_client_proc_t) getProc("fooTakeConstVoidPtrConstPtr", userData);
|
||||
return 0;
|
||||
}
|
||||
|
||||
27
external/android-emugl/host/tools/emugen/tests/t.001/expected/encoder/foo_client_context.h
vendored
Normal file
27
external/android-emugl/host/tools/emugen/tests/t.001/expected/encoder/foo_client_context.h
vendored
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
// Generated Code - DO NOT EDIT !!
|
||||
// generated by 'emugen'
|
||||
#ifndef __foo_client_context_t_h
|
||||
#define __foo_client_context_t_h
|
||||
|
||||
#include "foo_client_proc.h"
|
||||
|
||||
#include "foo_types.h"
|
||||
|
||||
|
||||
struct foo_client_context_t {
|
||||
|
||||
fooAlphaFunc_client_proc_t fooAlphaFunc;
|
||||
fooIsBuffer_client_proc_t fooIsBuffer;
|
||||
fooUnsupported_client_proc_t fooUnsupported;
|
||||
fooDoEncoderFlush_client_proc_t fooDoEncoderFlush;
|
||||
fooTakeConstVoidPtrConstPtr_client_proc_t fooTakeConstVoidPtrConstPtr;
|
||||
virtual ~foo_client_context_t() {}
|
||||
|
||||
typedef foo_client_context_t *CONTEXT_ACCESSOR_TYPE(void);
|
||||
static void setContextAccessor(CONTEXT_ACCESSOR_TYPE *f);
|
||||
int initDispatchByName( void *(*getProc)(const char *name, void *userData), void *userData);
|
||||
virtual void setError(unsigned int error){ (void)error; };
|
||||
virtual unsigned int getError(){ return 0; };
|
||||
};
|
||||
|
||||
#endif
|
||||
21
external/android-emugl/host/tools/emugen/tests/t.001/expected/encoder/foo_client_proc.h
vendored
Normal file
21
external/android-emugl/host/tools/emugen/tests/t.001/expected/encoder/foo_client_proc.h
vendored
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
// Generated Code - DO NOT EDIT !!
|
||||
// generated by 'emugen'
|
||||
#ifndef __foo_client_proc_t_h
|
||||
#define __foo_client_proc_t_h
|
||||
|
||||
|
||||
|
||||
#include "foo_types.h"
|
||||
|
||||
#include "emugl/common/logging.h"
|
||||
#ifndef foo_APIENTRY
|
||||
#define foo_APIENTRY
|
||||
#endif
|
||||
typedef void (foo_APIENTRY *fooAlphaFunc_client_proc_t) (void * ctx, FooInt, FooFloat);
|
||||
typedef FooBoolean (foo_APIENTRY *fooIsBuffer_client_proc_t) (void * ctx, void*);
|
||||
typedef void (foo_APIENTRY *fooUnsupported_client_proc_t) (void * ctx, void*);
|
||||
typedef void (foo_APIENTRY *fooDoEncoderFlush_client_proc_t) (void * ctx, FooInt);
|
||||
typedef void (foo_APIENTRY *fooTakeConstVoidPtrConstPtr_client_proc_t) (void * ctx, const void* const*);
|
||||
|
||||
|
||||
#endif
|
||||
153
external/android-emugl/host/tools/emugen/tests/t.001/expected/encoder/foo_enc.cpp
vendored
Normal file
153
external/android-emugl/host/tools/emugen/tests/t.001/expected/encoder/foo_enc.cpp
vendored
Normal file
|
|
@ -0,0 +1,153 @@
|
|||
// Generated Code - DO NOT EDIT !!
|
||||
// generated by 'emugen'
|
||||
|
||||
|
||||
#include <memory>
|
||||
#include <string.h>
|
||||
#include "foo_opcodes.h"
|
||||
|
||||
#include "foo_enc.h"
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
namespace {
|
||||
|
||||
void enc_unsupported()
|
||||
{
|
||||
ALOGE("Function is unsupported\n");
|
||||
}
|
||||
|
||||
void fooAlphaFunc_enc(void *self , FooInt func, FooFloat ref)
|
||||
{
|
||||
|
||||
foo_encoder_context_t *ctx = (foo_encoder_context_t *)self;
|
||||
IOStream *stream = ctx->m_stream;
|
||||
ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
|
||||
bool useChecksum = checksumCalculator->getVersion() > 0;
|
||||
|
||||
unsigned char *ptr;
|
||||
unsigned char *buf;
|
||||
const size_t sizeWithoutChecksum = 8 + 4 + 4;
|
||||
const size_t checksumSize = checksumCalculator->checksumByteSize();
|
||||
const size_t totalSize = sizeWithoutChecksum + checksumSize;
|
||||
buf = stream->alloc(totalSize);
|
||||
ptr = buf;
|
||||
int tmp = OP_fooAlphaFunc;memcpy(ptr, &tmp, 4); ptr += 4;
|
||||
memcpy(ptr, &totalSize, 4); ptr += 4;
|
||||
|
||||
memcpy(ptr, &func, 4); ptr += 4;
|
||||
memcpy(ptr, &ref, 4); ptr += 4;
|
||||
|
||||
if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
|
||||
if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
|
||||
|
||||
}
|
||||
|
||||
FooBoolean fooIsBuffer_enc(void *self , void* stuff)
|
||||
{
|
||||
|
||||
foo_encoder_context_t *ctx = (foo_encoder_context_t *)self;
|
||||
IOStream *stream = ctx->m_stream;
|
||||
ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
|
||||
bool useChecksum = checksumCalculator->getVersion() > 0;
|
||||
|
||||
const unsigned int __size_stuff = (4 * sizeof(float));
|
||||
unsigned char *ptr;
|
||||
unsigned char *buf;
|
||||
const size_t sizeWithoutChecksum = 8 + __size_stuff + 1*4;
|
||||
const size_t checksumSize = checksumCalculator->checksumByteSize();
|
||||
const size_t totalSize = sizeWithoutChecksum + checksumSize;
|
||||
buf = stream->alloc(totalSize);
|
||||
ptr = buf;
|
||||
int tmp = OP_fooIsBuffer;memcpy(ptr, &tmp, 4); ptr += 4;
|
||||
memcpy(ptr, &totalSize, 4); ptr += 4;
|
||||
|
||||
*(unsigned int *)(ptr) = __size_stuff; ptr += 4;
|
||||
memcpy(ptr, stuff, __size_stuff);ptr += __size_stuff;
|
||||
|
||||
if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
|
||||
if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
|
||||
|
||||
|
||||
FooBoolean retval;
|
||||
stream->readback(&retval, 1);
|
||||
if (useChecksum) checksumCalculator->addBuffer(&retval, 1);
|
||||
if (useChecksum) {
|
||||
std::unique_ptr<unsigned char[]> checksumBuf(new unsigned char[checksumSize]);
|
||||
stream->readback(checksumBuf.get(), checksumSize);
|
||||
if (!checksumCalculator->validate(checksumBuf.get(), checksumSize)) {
|
||||
ALOGE("fooIsBuffer: GL communication error, please report this issue to b.android.com.\n");
|
||||
abort();
|
||||
}
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
void fooDoEncoderFlush_enc(void *self , FooInt param)
|
||||
{
|
||||
|
||||
foo_encoder_context_t *ctx = (foo_encoder_context_t *)self;
|
||||
IOStream *stream = ctx->m_stream;
|
||||
ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
|
||||
bool useChecksum = checksumCalculator->getVersion() > 0;
|
||||
|
||||
unsigned char *ptr;
|
||||
unsigned char *buf;
|
||||
const size_t sizeWithoutChecksum = 8 + 4;
|
||||
const size_t checksumSize = checksumCalculator->checksumByteSize();
|
||||
const size_t totalSize = sizeWithoutChecksum + checksumSize;
|
||||
buf = stream->alloc(totalSize);
|
||||
ptr = buf;
|
||||
int tmp = OP_fooDoEncoderFlush;memcpy(ptr, &tmp, 4); ptr += 4;
|
||||
memcpy(ptr, &totalSize, 4); ptr += 4;
|
||||
|
||||
memcpy(ptr, ¶m, 4); ptr += 4;
|
||||
|
||||
if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
|
||||
if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
|
||||
|
||||
stream->flush();
|
||||
}
|
||||
|
||||
void fooTakeConstVoidPtrConstPtr_enc(void *self , const void* const* param)
|
||||
{
|
||||
|
||||
foo_encoder_context_t *ctx = (foo_encoder_context_t *)self;
|
||||
IOStream *stream = ctx->m_stream;
|
||||
ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
|
||||
bool useChecksum = checksumCalculator->getVersion() > 0;
|
||||
|
||||
const unsigned int __size_param = ;
|
||||
unsigned char *ptr;
|
||||
unsigned char *buf;
|
||||
const size_t sizeWithoutChecksum = 8 + __size_param + 1*4;
|
||||
const size_t checksumSize = checksumCalculator->checksumByteSize();
|
||||
const size_t totalSize = sizeWithoutChecksum + checksumSize;
|
||||
buf = stream->alloc(totalSize);
|
||||
ptr = buf;
|
||||
int tmp = OP_fooTakeConstVoidPtrConstPtr;memcpy(ptr, &tmp, 4); ptr += 4;
|
||||
memcpy(ptr, &totalSize, 4); ptr += 4;
|
||||
|
||||
*(unsigned int *)(ptr) = __size_param; ptr += 4;
|
||||
memcpy(ptr, param, __size_param);ptr += __size_param;
|
||||
|
||||
if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
|
||||
if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
|
||||
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
foo_encoder_context_t::foo_encoder_context_t(IOStream *stream, ChecksumCalculator *checksumCalculator)
|
||||
{
|
||||
m_stream = stream;
|
||||
m_checksumCalculator = checksumCalculator;
|
||||
|
||||
this->fooAlphaFunc = &fooAlphaFunc_enc;
|
||||
this->fooIsBuffer = &fooIsBuffer_enc;
|
||||
this->fooUnsupported = (fooUnsupported_client_proc_t) &enc_unsupported;
|
||||
this->fooDoEncoderFlush = &fooDoEncoderFlush_enc;
|
||||
this->fooTakeConstVoidPtrConstPtr = &fooTakeConstVoidPtrConstPtr_enc;
|
||||
}
|
||||
|
||||
23
external/android-emugl/host/tools/emugen/tests/t.001/expected/encoder/foo_enc.h
vendored
Normal file
23
external/android-emugl/host/tools/emugen/tests/t.001/expected/encoder/foo_enc.h
vendored
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
// Generated Code - DO NOT EDIT !!
|
||||
// generated by 'emugen'
|
||||
|
||||
#ifndef GUARD_foo_encoder_context_t
|
||||
#define GUARD_foo_encoder_context_t
|
||||
|
||||
#include "IOStream.h"
|
||||
#include "ChecksumCalculator.h"
|
||||
#include "foo_client_context.h"
|
||||
|
||||
|
||||
#include "fooUtils.h"
|
||||
#include "fooBase.h"
|
||||
|
||||
struct foo_encoder_context_t : public foo_client_context_t {
|
||||
|
||||
IOStream *m_stream;
|
||||
ChecksumCalculator *m_checksumCalculator;
|
||||
|
||||
foo_encoder_context_t(IOStream *stream, ChecksumCalculator *checksumCalculator);
|
||||
};
|
||||
|
||||
#endif // GUARD_foo_encoder_context_t
|
||||
53
external/android-emugl/host/tools/emugen/tests/t.001/expected/encoder/foo_entry.cpp
vendored
Normal file
53
external/android-emugl/host/tools/emugen/tests/t.001/expected/encoder/foo_entry.cpp
vendored
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
// Generated Code - DO NOT EDIT !!
|
||||
// generated by 'emugen'
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "foo_client_context.h"
|
||||
|
||||
#ifndef GL_TRUE
|
||||
extern "C" {
|
||||
void fooAlphaFunc(FooInt func, FooFloat ref);
|
||||
FooBoolean fooIsBuffer(void* stuff);
|
||||
void fooUnsupported(void* params);
|
||||
void fooDoEncoderFlush(FooInt param);
|
||||
void fooTakeConstVoidPtrConstPtr(const void* const* param);
|
||||
};
|
||||
|
||||
#endif
|
||||
#ifndef GET_CONTEXT
|
||||
static foo_client_context_t::CONTEXT_ACCESSOR_TYPE *getCurrentContext = NULL;
|
||||
void foo_client_context_t::setContextAccessor(CONTEXT_ACCESSOR_TYPE *f) { getCurrentContext = f; }
|
||||
#define GET_CONTEXT foo_client_context_t * ctx = getCurrentContext()
|
||||
#endif
|
||||
|
||||
void fooAlphaFunc(FooInt func, FooFloat ref)
|
||||
{
|
||||
GET_CONTEXT;
|
||||
ctx->fooAlphaFunc(ctx, func, ref);
|
||||
}
|
||||
|
||||
FooBoolean fooIsBuffer(void* stuff)
|
||||
{
|
||||
GET_CONTEXT;
|
||||
if (n == NULL) { LOG(ERROR) << "NULL stuff"; return; }
|
||||
return ctx->fooIsBuffer(ctx, stuff);
|
||||
}
|
||||
|
||||
void fooUnsupported(void* params)
|
||||
{
|
||||
GET_CONTEXT;
|
||||
ctx->fooUnsupported(ctx, params);
|
||||
}
|
||||
|
||||
void fooDoEncoderFlush(FooInt param)
|
||||
{
|
||||
GET_CONTEXT;
|
||||
ctx->fooDoEncoderFlush(ctx, param);
|
||||
}
|
||||
|
||||
void fooTakeConstVoidPtrConstPtr(const void* const* param)
|
||||
{
|
||||
GET_CONTEXT;
|
||||
ctx->fooTakeConstVoidPtrConstPtr(ctx, param);
|
||||
}
|
||||
|
||||
20
external/android-emugl/host/tools/emugen/tests/t.001/expected/encoder/foo_ftable.h
vendored
Normal file
20
external/android-emugl/host/tools/emugen/tests/t.001/expected/encoder/foo_ftable.h
vendored
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
// Generated Code - DO NOT EDIT !!
|
||||
// generated by 'emugen'
|
||||
#ifndef __foo_client_ftable_t_h
|
||||
#define __foo_client_ftable_t_h
|
||||
|
||||
|
||||
static const struct _foo_funcs_by_name {
|
||||
const char *name;
|
||||
void *proc;
|
||||
} foo_funcs_by_name[] = {
|
||||
{"fooAlphaFunc", (void*)fooAlphaFunc},
|
||||
{"fooIsBuffer", (void*)fooIsBuffer},
|
||||
{"fooUnsupported", (void*)fooUnsupported},
|
||||
{"fooDoEncoderFlush", (void*)fooDoEncoderFlush},
|
||||
{"fooTakeConstVoidPtrConstPtr", (void*)fooTakeConstVoidPtrConstPtr},
|
||||
};
|
||||
static const int foo_num_funcs = sizeof(foo_funcs_by_name) / sizeof(struct _foo_funcs_by_name);
|
||||
|
||||
|
||||
#endif
|
||||
14
external/android-emugl/host/tools/emugen/tests/t.001/expected/encoder/foo_opcodes.h
vendored
Normal file
14
external/android-emugl/host/tools/emugen/tests/t.001/expected/encoder/foo_opcodes.h
vendored
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
// Generated Code - DO NOT EDIT !!
|
||||
// generated by 'emugen'
|
||||
#ifndef __GUARD_foo_opcodes_h_
|
||||
#define __GUARD_foo_opcodes_h_
|
||||
|
||||
#define OP_fooAlphaFunc 200
|
||||
#define OP_fooIsBuffer 201
|
||||
#define OP_fooUnsupported 202
|
||||
#define OP_fooDoEncoderFlush 203
|
||||
#define OP_fooTakeConstVoidPtrConstPtr 204
|
||||
#define OP_last 205
|
||||
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue