Commit Graph

52 Commits

Author SHA1 Message Date
Ying Wang
75ac6f2897 "debug" in those modules is discouraged
Because we need those modules for only emulator builds.
If you mark them as "debug", you'll get them even if you are doing a
real device userdebug/eng build.
Instead, we should add their module names to the emulator product config
in build/target/product/emulator.mk.

Bug: 8276818
Change-Id: I58988ce49804583b06e7d93380c44ba800448216
2013-03-01 09:49:44 -08:00
Jesse Hall
56513f5ff4 Move emugl system code to development.git
Because of the way the SDK and Android system images are branched,
host code that goes into the SDK tools can't live in the same
repository as code that goes into the system image. This change keeps
the emugl host code in sdk.git/emulator/opengl while moving the emugl
system code to development.git/tools/emulator/opengl.

A few changes were made beyond simply cloning the directories:

(a) Makefiles were modified to only build the relevant components. Not
    doing so would break the build due to having multiple rule
    definitions.

(b) Protocol spec files were moved from the guest encoder directories
    to the host decoder directories. The decoder must support older
    versions of the protocol, but not newer versions, so it makes
    sense to keep the latest version of the protocol spec with the
    decoder.

(c) Along with that, the encoder is now built from checked in
    generated encoder source rather than directly from the protocol
    spec.  The generated code must be updated manually. This makes it
    possible to freeze the system encoder version without freezing the
    host decoder version, and also makes it very obvious when a
    protocol changes is happening that will require special
    backwards-compatibility support in the decoder/renderer.

(d) Host-only and system-only code were removed from the repository
    where they aren't used.

(e) README and DESIGN documents were updated to reflect this split.

No actual source code was changed due to the above.

Change-Id: I2c936101ea0405b372750d36ba0f01e84d719c43
2012-06-06 09:46:29 -07:00
Jesse Hall
80d4ba7716 Move emulator GLES from development.git to sdk.git
The emulator GLES support has two interfaces: a host shared library
interface used by QEMU, and a protocol between the platform and the
host. The host library interface is not versioned; QEMU and the GLES
renderer must match. The protocol on the other hand must be backwards
compatible: a new GLES renderer must support an older platform image.

Thus for branching purposes it makes more sense to put the GLES
renderer in sdk.git, which is branched along with qemu.git for SDK
releases. Platform images will be built against the protocol version
in the platform branch of sdk.git.

Change-Id: Ie73fce12815c9740e27d0f56caa53c6ceb3d30cc
2012-04-18 06:26:17 -07:00
Xavier Ducrohet
40525ef472 Move stuff from prebuilt to prebuilts/tools
Also move some atree copy to sdk.git where they belong.

Change-Id: Iab62343806917f24f47d15b9dea75e44422d8764
2012-04-03 16:33:35 -07:00
Al Sutton
87879839f1 Fix build on MacOS 10.7 / XCode 4
Ensure the dynamic library library gets linked in with SDL
to fix compilation errors

Change-Id: I32e6929088eaf73d707e89d10392c658b58ec465
2011-12-21 13:21:32 -08:00
David 'Digit' Turner
3d76ec1e3c emulator: opengl: Add support for unix sockets.
This patch allows the OpenGLES rendering library to use Unix
sockets instead of TCP ones when communicating with its clients.
On certain benchmarks (e.g. 0xBench teapot), this provides a
noticeable improvement (x1.05 fps) without any other changes.

On practice, Unix sockets are faster than TCP sockets, even
local ones. Also, this introduces a moderate amount of
abstraction that will allow us to use Win32 named pipes
on Windows (where TCP sockets are much slower than they
are on Unix).

Note that by default, TCP streams are still used.
The client (emulator) must call the new API 'setStreamMode'
to change it to STREAM_MODE_UNIX between 'initLibrary' and
'startOpenglRenderer' calls.

+ Adjust callers / user appropriately.

Change-Id: I4105bbf07541f3146b50a58d1a5b51e8cf044fab
2011-09-13 14:03:32 +02:00
David 'Digit' Turner
5dfd5b292a emulator: opengl: support moved shared libraries.
It is possible to move the final installation path of a shared
library by using LOCAL_MODULE_PATH/LOCAL_UNSTRIPPED_PATH in its
module declaration.

We do this for example to put certain libraries under /system/lib/egl
or /system/lib/hw.

However, the Android build system has a small bug where you cannot
depend on these shared libraries because it will complain it doesn't
find them under /system/lib, the default install location.

More precisely, consider libfoo defined as:

  include $(CLEAR_VARS)
  LOCAL_MODULE := libfoo
  LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/egl
  ...
  include $(BUILD_SHARED_LIBRARY)

Its final binary will be installed to /system/lib/egl/libfoo.so

Now, let's write a module that depends on it, as:

  include $(CLEAR_VARS)
  LOCAL_MODULE := libbar
  LOCAL_SHARED_LIBRARIES += libfoo
  ...
  include $(BUILD_SHARED_LIBRARY)

The build system will complain there is no rule to define the target
/system/lib/libfoo.so, but the target should be /system/lib/egl/libfoo.so.

A work-around is to define libbar as follows instead:

  include $(CLEAR_VARS)
  LOCAL_MODULE := libbar
  LOCAL_ADDITIONAL_DEPENDENCIES := $(TARGET_OUT_SHARED_LIBRARIES)/egl/libfoo.so
  ...
  include $(BUILD_SHARED_LIBRARY)

This works if you don't need to link against the library when building your
shared library (which is fortunately the case for the GLES emulation
libraries).

That's essentially what this patch implements under common.mk. We update
emugl-set-shared-library-subpath to record that a module has been "moved",
and we avoid adding them to the LOCAL_SHARED_LIBRARIES variable of the
modules that export it.

+ Simplify three Android.mk files accordingly.

Change-Id: Id15bef5359b0daa8d82bfaa5abf9346f00190ab5
2011-08-24 16:01:00 +02:00
David 'Digit' Turner
e2dda38017 emulator: opengl: Avoid conflicts with SDL_CONFIG
Do not redefine SDL_CONFIG to avoid conflicts with the emulator's
build system which depend on its definition. Note that this has
been fixed in another patch (https://review.source.android.com/25684)
but it is also cleaner to do this here.

Change-Id: I1a30d200e467ac7a91a1e6135fa1de34033e8df0
2011-08-24 16:00:56 +02:00
David 'Digit' Turner
503419ca75 Remove obsolete comments
Change-Id: Ibaeca7f3cd17305dd4cac042d6020455c5675e2d
2011-08-23 14:10:46 +02:00
Guy Zadickario
bdfb71562c opengles emulator: call XInitThreads in emulator_test_renderer
Now that we are not running the renderer as a seperate process
we need to have the XInitThreads call we put in the renderer process
inside emulator_test_renderer since the render server runs inside that
thread.
NOTE FOR INTEGRATION: this will need to be added to the emulator as
well.

Change-Id: I70592ad976d08c86e2c9e75b11b6ad57d6067606
2011-08-15 16:46:57 +03:00
Guy Zadickario
617416e693 opengles emulator: support display rotation and resize
Changes the render_api to support re-creating the display
sub-window and the ability to rotate the displayed framebuffer
image.
That currently works only when the renderer runs as a thread
and not as seperate process. Therefore we setup the library
to run the renderer as thread(s) inside the calling process
on *all* platforms for now.

Change-Id: Ifd009db903759042a7edcf89866d3c3fe076cae9
2011-08-11 17:36:20 +03:00
Guy Zadickario
ea7f72a6c7 opengl emulator: fix windows build
That fixes the event injection code to build correctly on
Windows.
Also renamed SDL_{CFLAGS,LDFLAGS} used in the Android.mk
to have a LOCAL_ prefix.

Change-Id: Ie82838ffb931880e700322116c3190fbb754d889
2011-08-11 17:35:33 +03:00
Guy Zadickario
0d5ea9bb69 opengles emulator: test: added shader flags to triangleV2 test
Added the ability to provide external vertex and fragment shader
files to the test application triangleV2. That makes easy to test
various shaders we see failing in applications.

Change-Id: Ifaae8490ac76c022aa712ae516355658922b47bd
2011-08-09 17:38:48 +02:00
Vladimir Chtchetkine
b2b6f2f9da Get rid of libqemu library.
Its implementation has been inlined in hardware/libhardware/include/hardware/qemu_pipe.h

Change-Id: I355764f87047c915ac43b85cd18bf0f27f06ede3
2011-08-03 09:10:14 -07:00
David Turner
b75382ea35 emulator:opengl: fix windows build
This fixes the Windows build of the opengl emulation code.

The official is not broken because you still need to define
BUILD_EMULATOR_OPENGL=true in your environment to enable the
code to be built.

Change-Id: I527f305c8a09df2740a93736123935d480170ffb
2011-07-14 23:29:32 +02:00
David Turner
16f2e31f24 emulator:opengl: input event redirection
This patch allows the emulator_test_renderer program to redirect
input events (mouse, keyboard) to the emulator's console program.

This in order to make testing easier, while we wait for integration
of the display into the emulator program.

For now, this is hard-coded to use localhost port 5554, and only
a few keys are properly translated (Dpad, HOME, BACK, MENU).

Change-Id: Ie6e37c85c291f53de49220a181cb8724f66519ea
2011-07-12 06:35:25 +02:00
David Turner
70d98e6466 emulator:opengl: custom framebuffer sizes
This allows the "emulator_test_renderer" program to use
custom framebuffer sizes. You need to define ANDROID_WINDOW_SIZE
in your environment before launching the test program, e.g.:

  export ANDROID_WINDOW_SIZE=640x480

Change-Id: I2559c6e75022762697ed4c4559d6c2ba3f400e8f
2011-07-12 06:35:25 +02:00
Guy Zadickario
b68a421908 opengl renderer: Enable and fix renderer Mac support
The following enables the renderer build on darwin.
Moved platform specific type declarations from render_api.h
to render_api_platform_types.h so it can be included from the
objective c code.
Fixed subwindow to use EmuGLView which overrides NSView to prevent
background drawing of the view.
2011-07-03 15:40:52 +03:00
Amit Feller
31580f42b1 opengl renderer: windows runtime fix
Need to initialize networking by calling WSAStartup
in the renderer process.
2011-07-03 15:14:59 +03:00
Amit Feller
2ca84fb34a opengl translator: supporting GL_BYTE type
support GL_BYTE in glvertexpointer & glTexCoordPointer,
Desktop OpenGL does not support GL_BYTE in those calls
so we convert the data into GL_SHORT.
2011-07-03 14:32:43 +03:00
David 'Digit' Turner
8422a11a21 emulator: opengl: Update/simplify build scripts
This patch is a major rework of the build opengl-emulation
build scripts. See README for details.

In a nutshell, this introduces various functions that considerably
simplify the declaration of the 26+ modules in this implementation,
by handling auto-generation of sources and module imports/exports.

Change-Id: I827522d783c7b6cf5eafd37204a1025c235458cd
2011-06-23 00:35:54 +02:00
Stas Gurtovoy
5def410ff5 emulator opengl: more few fixups needed for the system to load.
Change-Id: I698b14d0f594c091c237a605aeefbb048bf746ca
2011-06-21 14:48:44 +03:00
Stas Gurtovoy
6a79e88f01 emulator opengl: pool of fixups to the system components.
Those fixes make the system load without failure.
Also the flinger and bootanimation are running.

Change-Id: Ieb7039e76c444df778a421a07bccc48514199245
2011-06-21 01:41:50 +03:00
Stas Gurtovoy
d32c2d9633 emulator opengl: system GLESv1 first commit.
This is the first commit for the GLESv1 implementation.
It also includes needed fixes in emugen to support const types.
Also, changed glFinish definition in gl.in to match the
definition as in gl.h.

Change-Id: I90262a1db6035a90af8db17984acecef6499847a
2011-06-17 17:18:45 +03:00
Guy Zadikario
cd1489a89c opengl translator: make GLcommon static library
This change turns GLcommon to be static instead of shared
library.
Removed the s_globalNameSpace static object from objectNameManager
and moved it to live inside the EglDisplay object which is shared
for all display space objects (GLESv1, GLESv2 and EGL).

Change-Id: I92fa71fb7cbac423c22b7188e8d9642a5fddf0d9
2011-06-07 11:29:15 +02:00
Amit Feller
3dd22a5450 implementing mac OS support for translator's libs
Change-Id: Ifa12cf1177db49197ad8496f4e0ef8098d43aa8d
2011-06-06 18:45:01 +03:00
Liran
3b7e5e3281 Add gles 1 extension implementation to translator
This fix addes to the Translator the implementations of theses extensions:
GL_EXT_texture_format_BGRA8888
GL_OES_blend_equation_separate
GL_OES_blend_func_separate
GL_OES_blend_subtract
GL_OES_depth24
GL_OES_matrix_palette
GL_OES_extended_matrix_palette
GL_OES_element_index_uint
GL_OES_framebuffer_object
GL_OES_packed_depth_stencil
GL_OES_point_size_array
GL_OES_point_sprite
GL_OES_read_format
GL_OES_stencil_wrap
GL_OES_texture_env_crossbar
GL_OES_texture_cube_map
GL_OES_texture_mirrored_repeat

Change-Id: I472808d123ec0e03279137a48d89dc4b19023758
2011-06-06 13:22:30 +03:00
Amit Feller
624176d51a Emulators's GLES 2.0 translator implementation
This is the GLESv2 on top of openGL implementation on the host
most of this change is moving code which is necessary by both
GLES 1.0 and GLES 2.0 implementations from GLES_CM folder into
GLcommon folder.

GLESv2Imp - includes GLES 2.0 entry points implementation

Change-Id: I934fb963478a7f596d824612f847a5aa77d2ed9d
2011-05-30 11:06:24 +03:00
David 'Digit' Turner
91f40d930e emulator: opengl: ut_renderer usability improvements
This patch provides two useful changes to the ut_renderer
unit-test program:

1/ the ability to control the GL window dimensions with
   two env. variables: ANDROID_WINDOW_WIDTH and ANDROID_WINDOW_HEIGHT

2/ the ability to save/restore the GL window position between
   GL connections.

Both are useful to use ut_renderer in a demo setting, nothing more.

Change-Id: I19a8f911ee821ddc4eb6307de12d63600ff696b0
2011-05-05 22:42:31 +02:00
David Turner
fdd5607a6d emulator: opengl: Fix Mac and Windows builds.
+ Fix typo in clean step.

Change-Id: I1da8b17a167247d252b5e8519832b042c2db3ccd
2011-05-03 18:29:27 +02:00
David 'Digit' Turner
e22ae45128 emulator: opengl: Add clean step.
The previous changes replaced /system/lib/libGLES_emul.so with
several other libraries (lib{EGL, GLESv1_CM, GLESv2}_emul.so).

The clean step removes the old libGLES_emul.so from the build to
avoid any surprises.

Change-Id: I285b34c4d5f5a8bd3b37d9cb1b2da33fb155e62c
2011-05-03 16:55:11 +02:00
David 'Digit' Turner
892a6306e7 emulator: opengl: Use QEMU pipe.
This patch modifies the guest libraries to use the new
fast qemu "opengles" pipe to communicate with the host
renderer process.

Note that the renderer is still listening on a TCP socket
on port 22468.

Change-Id: I6ab84f972a8024e1fdababa4615d0650c8d461bf

Conflicts:

	tools/emulator/opengl/tests/gles_android_wrapper/Android.mk
	tools/emulator/opengl/tests/gles_android_wrapper/ServerConnection.h
2011-05-03 16:21:12 +02:00
Jacky Romano
7b73c9f1d3 common debug flag for the wrapper libraries
Change-Id: I6f20ed1e7a2b95dee21e09aa9b43fae22e5e4d3d
2011-05-03 16:12:26 +02:00
Jacky Romano
4a17ab6429 emulator opengl - ensure server connection for rendering thread
Ensure a server connection creation on make current, for cases where
the context and surface was created on a seperate thread.

In addition this commit publishes all the surface as ES2 capable
if queried.

Change-Id: Ie415b8ab3e370fa7fe97a526276e333aaa5e9e8b
2011-05-03 16:01:31 +02:00
Jacky Romano
bfefa4dbc8 emulator opengl : add Dungeon Defenders to the test apps list
Change-Id: Ia97db38daa672e5d9d265e2ffa5bd169b59bd7d5
2011-05-03 15:53:41 +02:00
Jacky Romano
44d4d9473e opengl emulator : GLESv2 handling in the test egl implementation
Handle GLESv2 rendering in the emulator:
* load and initialize GLESv2 encoder library
* hide request for GLESv2 surfaces and contexts from the emulator
native implementation
* communicate the context/surface version configuration to the rendering
server

Change-Id: I9226275fc4a24983767735bdf19ddafbe9d07f34
2011-05-03 15:49:02 +02:00
Jacky Romano
0c01f32aa2 emulator opengl : unit-test renderer GLESv2
Make the unit test renderer (ut_renderer) encode GLESv2 commands.
A rendering thread has both V1 & V2 decoder object, and tryies to decode
commands of the two protocols from the stream.
Context creating is taking into account the API version and creates context
accordingly.
Decoder data is shared between the V1 & V2 decoders and applied to both of
them on makeCurrent (regardless to the requested context version)

Change-Id: If78e84310e5dcd22108c19656051b138b22e3c9f
2011-05-03 15:47:07 +02:00
Jacky Romano
25af30c464 emulator opengl: context version param
add version parameter when creating new context

Change-Id: I3e36796dd4e582b5deda0da2aaf764ceba92a1d1
2011-05-03 15:46:43 +02:00
Jacky Romano
e359543f4a Emulator Opengl unit test - use sperate implementation libraries
Use seperate EGL_emul, GLESv1_CM_emul and GLESv2_emul implementation
libraries.  This replaces GLES_emul that was prviously included
EGL and GLESv1.
This change enables the wrapper to support GLESv2. However,
this current EGL implementation uses the native android emulator
EGL thus will not expose this GLESv2 capability.

Change-Id: Ib0a309d71cce1248efe9a08aa59434101d0ac607
2011-05-03 14:54:04 +02:00
Liran
fb06a28c30 GLESv1 extensions
This fix adds support for OpenGLES 1.1 extensions in the codec
layer. This fix also includes bug fixes in GLEncoder (client-state)
and gles android wrapper modules.

Change-Id: I512649724d43e4af9d3ce5d49ae66d9f4da0b823
2011-04-28 09:24:46 +03:00
David Turner
eff952cdbf Really fix the Mac build.
Damned!

Change-Id: Ice8295fb23beefe328207112b011489276b5b278
2011-04-16 22:21:57 +02:00
Guy Zadikario
cca6a5fc0e emulator opengl: small test app for the emulator renderer API.
This sample program simulates the use of the renderer api as it should
be used from the emulator program. It opens a SDL window, initialize the
renderer, process events on the window and terminate the renderer when the
window is closed.

Change-Id: If983b4ce6465dee71f548e8edaf2b56b6443f7b0
2011-04-16 10:45:48 +03:00
Guy Zadikario
caafd4df2e Moved IOStream.h to be used in external API for libOpenGLRender.
This change includes four changes:
1) moved IOStream.h into host/include/libOpenGLRender, this directory
   will include the api interface into the libOpenGLRender which will be
   used later by the emulator and we need this interface to use IOStream.h
2) Updated Andorid.mk files to include the new directory location of IOStream.h
   in the LOCAL_C_INCLUDE.
3) Added new function "read" to IOStream which reads a message without a givven
   size.
4) Updated TcpStream to use "cutils/sockets.h" instead of using directly the socket api for portability reasons. (It now compiles on windows as well).

Change-Id: I30eb40c8dcd5aacf0d993aff9cdb90b283b12dde
2011-04-13 13:33:05 +03:00
David Turner
e8c05eb11a Merge "fix handling pointers in emugen." 2011-04-05 05:59:55 -07:00
Liran
03c86416d5 fix handling pointers in emugen.
Moved 'isPointer' attribute from variable to type field.
The .types input file now includes new column specifying if a type is a pointer or not
previously emugen declared as pointer only types which included '*' character but did not
process well the case of 'char **' (pointer to pointer).

Fixed the gl.types and ut_rendercontrol.types accordingly.
Few other fixes to gl.attrib and gl.in.

Change-Id: Ifd3591119dfa504703c68556802a40e38fe4940e
2011-04-04 16:05:18 +03:00
Jacky Romano
81c015740c emulator opengl - directory rearrangment
Move system/OpenglCodecCommon into shared/OpenglCodecCommon so it's code
can be shared among more components of the project.

Move tests/ut_renderer/TimeUtils.* into a the common area

Annotate ErrLog.h and GLDecoderContextData.h with the project license statement

Change-Id: Ieea42e95edd5ad89fda4cfa40356a012304ee976
2011-04-04 12:20:49 +03:00
David 'Digit' Turner
e97b54b648 Fix device builds
This patch ensures that the egl.cfg file specific to our
hardware OpenGL emulation is only copied to the system images
of emulator-specific build products.

This fixes a conflict for device-specific products (which provide
their own hw-specific egl.cfg).

Change-Id: I30cd64ba5915e5ffdc1091de8db20f6c3c671486
2011-03-31 09:39:59 +02:00
David 'Digit' Turner
db35d9a010 Fix linux sdk build.
This is a temporary patch until we update the prebuilt/ tree accordingly
to include libxcb.so for Linux.

Change-Id: I76d9966bfb73bf3f5ca35cc30f6e12fb262dc2b2
2011-03-29 18:37:37 +02:00
Jacky Romano
f99884f916 Android emulator opengl - host side EGL wrapper
This adds an EGL wrapper used by the test rendering to load an EGL
implementation that matches the OpenGL ES impelmentation that it uses.
The library is a simple wrapper that direct EGL calls through a dispatch
table that is dynamically loaded from an EGL shared library implementation

Change-Id: I6379d6b156c69f9e017da0039c96699290f0f84f
2011-03-28 19:22:31 +02:00
Jacky Romano
faa8994f17 Android emulator opengl - unit test host side renderer
This adds 'ut_renderer' - a host side unit test renderer. ut_renderer is used to
take a command stream over a socket connection and render it into an opengl window.
The renderer uses the GLESv1_dec decoder library and the ut_rendercontrol api to parse
the command stream.
The ut_renderer uses an external (plug-in) opengl impelementation.

Change-Id: I77794044ca9ca8a75a66a95a248eac384710aafe
2011-03-28 19:20:23 +02:00