aboutsummaryrefslogtreecommitdiffstats
path: root/emulator/opengl/host/libs/libOpenglRender
Commit message (Collapse)AuthorAgeFilesLines
* emulator/opengl: Remove obsolete directory.David 'Digit' Turner2014-12-0834-5000/+0
| | | | | | | | | | | | | All sources were moved to external/qemu/distrib/android-emugl to make it easier to modify both the emulator and host libraries at the same time. See: https://android-review.googlesource.com/#/c/118203/ As such, the sources in this directory are now ignored and can be safely removed. Change-Id: I5d143c971f995e2599e5e1d6174030d6803e8080
* emulator/opengl: Remove compiler warnings.David 'Digit' Turner2014-10-301-0/+2
| | | | | | | | | | This patch ensures that the auto-generated client_context.h headers do not generate compiler warnings in the setError() function. + Remove tiny warning for NativeLinuxSubWindow.cpp Change-Id: Ibab92ab3332fd284589435732b52c011ae21c15f
* emulator/opengl/emugen: Remove accessor functions.David 'Digit' Turner2014-09-251-26/+26
| | | | | | | | This patch simplifies the generated encoders and decoders by getting rid of the accessor functions (e.g. set_glDrawElementsData) given that all fields are public and can be written to directly. Change-Id: I15f4caac95e4d5f1e24a1a5838622600c6bc3207
* emulator/opengl: Cleanup build files + remove obsolete tests.David 'Digit' Turner2014-08-271-14/+11
| | | | | | | | | | | | | | | | | | | | | | This patch cleans up the build files for the GPU emulation libraries (i.e. there is no need to test for BUILD_EMULATOR_64BITS anymore, filtering is now handled by the build system directly). + Remove a bunch obsolete tests, which were not unit tests, despite their name beginning with ut_xxxx. Which includes removing dependency on SDL too. + Remove -m64 and -fPIC flags from compilation. These are not necessary anymore (again, the build system now takes charge of placing them when necessary), and generated link-time warning when building Windows executables. + Remove a few declarations related to the now-obsolete platform build (these libraries are only built with the emulator's build system now). Change-Id: I27c28979c42cd51f2fe9e30edd4141136e80ee03
* emulator/opengl: Remove out-of-process handling code.David 'Digit' Turner2014-07-092-125/+5
| | | | | | | | | | | This removes the last pieces of shared/OpenglOsUtils which were never used since the code in render_api.cpp always used thread-based rendering, instead of process-based one. This feature could be re-implemented in the future, if really desirable. Change-Id: I551e0f3d6d5a06ff66cb40b007e2b24c295f1dd8
* emulator/opengl: refactor Thread class.David 'Digit' Turner2014-07-095-13/+11
| | | | | | + Add unit test. Change-Id: I26d84cf590f6bfff3304be3f42dc0196bcc7f6d2
* emulator/opengl: refactor shared library handling.David 'Digit' Turner2014-07-093-8/+11
| | | | | | + Add a unit test. Change-Id: I27c993d1dc819e5bd89fc1e9ae266e11e6ef9a76
* emulator/opengl: Add global lock to libOpenglRender.David 'Digit' Turner2014-07-084-14/+17
| | | | | | | | | | | This patch ensures that all render threads use the same global lock to synchronize calls to the underlying GLES/EGL libraries. Original patch from Thomas Knych (thomaswk@google.com) BUG=9627179 Change-Id: I8ac9a43bc30bba8a9a06f832cf29e72263d946ce
* emulator/opengl: Prepare for 64-bit build changes.David 'Digit' Turner2014-06-111-1/+1
| | | | | | | | | | | This patch slightly modifies the build files for the GPU emulation libraries to prepare for future changes in the emulator-specific build system that will be necessary to support Win64 binaries. The main difference is the introduction of 64-bit versions of the emugl-begin-host-<type> macros, named emugl-begin-host64-<type>. Change-Id: Ib40c030fa407b0ed951755dd9b007fda85778e03
* opengl: rcOpenColorBuffer must be synchronousJesse Hall2014-05-274-6/+21
| | | | | | | | | | | | | The gralloc register_buffer() function, which calls rcOpenColorBuffer, must actually increment the reference count before returning. Otherwise the buffer allocator may release its reference before the client has obtained one, and the buffer will be freed prematurely. Since rcOpenColorBuffer was just sending a message to the host without waiting for it to be received/processed, this guarantee was not met. Adding a return value makes the call synchronous. Bug: 12988668 Change-Id: I8b2399cfb0f600f99b3387f630343291b59bc9a6
* emulator/opengl: A few debugging, stability improvements to emuglKen Mixter2014-05-211-1/+1
| | | | | | | | | | | | | | | | | | | * Zero output parameters so that errors don't return random data (even if the target code was careful to zero its output parameters.) Spec says that we will not modify values in case of an error, which is not currently possible, but at least this means we return deterministic values. * Similarly, avoid passing uninitialized data if an error occurs during getting the viewport. * Fix a bug where glGetError may be called when NULL is decoded in CHECK_GL_ERROR mode. * Output more information about the stream in DEBUG_PRINTOUT mode to help separate from multiple streams. Change-Id: I31706b92642efe4c7ed38d178b49e72835a9c9a6
* emulator/opengl: Allow standalone build.David 'Digit' Turner2014-03-111-12/+14
| | | | | | | | This patch improves the build files for the GPU emulation libraries to allow them to be built directly with the emulator's own standalone build system. Change-Id: I205392bdfe4223a5c43fa67e24a2beffcbcbc07a
* emulator/opengl: Remove libcutils/libutils/liblogDavid 'Digit' Turner2014-03-111-2/+2
| | | | | | | | Final patch to completely remove dependencies on libcutils/libutils/liblog from the host-side GPU emulation libraries. Change-Id: I84a058bbd0ca676b18c0b0a094ac8bae692f9c94
* emulator/opengl: Remove Android-specific thread_store.David 'Digit' Turner2014-03-111-4/+15
| | | | | | | | | | | | | | | | | This patch removes the use of the 'thread_store' class from <utils/threads.h> by providing its own implementation instead under shared/emugl/common/thread_store.h, plus appropriate unit tests. Note that unlike the Android version, this properly destroys the thread-local values on thread exit (instead of leaking them). + Provide a LazyInstance class used to perform thread-safe lazy initialization of static variables without the use of C++ constructors. Change-Id: Iabe01fbd713c6872b5fe245d7255c3c03749a88a
* emulator/opengl: Remove android::Mutex.David 'Digit' Turner2014-03-112-16/+17
| | | | | | | | | | | This patch removes the dependency on android::Mutex from <cutils/threads.h> by providing a custom implementation, which is a simple wrapper around pthread_mutex_t / CriticalSection, under shared/emugl/common/mutex.h + Provide unit tests. Change-Id: I379ef0c480c478ab9ba5f2faaf8274267eff37ba
* emulator/opengl: Remove compiler warningsDavid 'Digit' Turner2014-03-063-7/+1
| | | | | | | This patch removes a few minor compiler warnings related to unused local variables. Change-Id: Icd4b3b478dce0c38cc1dd04419db7350dcbdb8f6
* emulator/opengl: Refactor SmartPtr implementation.David 'Digit' Turner2014-01-214-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | This gets rid of two copies of SmartPtr.h and replaces them with a single implementation under shared/emugl/common/smart_ptr.* Note that this uses a new include path rooted at the shared/ directory for classes that are likely to be built both for the host and the device (in case we back-port this to device/generic/goldfish/opengl/ in the future). + Add a gtest-based set of unittests, after building, just call 'emugl_common_host_unittests' to run it. Note that this probably needs a 64-bit version as well, will come later once I find a way to build GTest for 64-bits without breaking the platform build :-) Also note that this moves the class to the 'emugl' namespace, in order to make the code easier to build out of the platform tree, and embed it in other projects. More classes will be transitioned / refactored in future patches. AOSP_BUG=64806 Change-Id: Ieb326c5f3f002a21537b8a391a82ce2ef9925073
* emulator/opengl: Get rid of all compiler warnings (Linux).David 'Digit' Turner2014-01-181-11/+14
| | | | | | | | | | | This patch gets rid of all compiler warnings for the GPU emulation libraries when building on a Linux host. Note that GLcommon/GLutils.h now provides two new functions to perform 'safe' type casts between unsigned integers and pointers: SafePointerFromUInt() and SafeUIntFromPointer(). Change-Id: I01c48bbd72f925d70eb9831f57e15815e687121f
* Merge "Catch NULL context and bubbling error up."Xavier Ducrohet2013-11-214-14/+21
|\
| * Catch NULL context and bubbling error up.Stuart Scott2013-08-234-14/+21
| | | | | | | | | | | | | | | | bug: 10456411 Fix for internal bug Change-Id: I85181d358f1844b25cc85fbaf5f64842d5ed6f22
* | Copy the GL2 extension string before destroying contextJesse Hall2013-08-231-8/+15
|/ | | | | | | | | | The pointer returned by glGetString is owned by the GL context, so when the GL context is destroyed it may become invalid. This happens on Mesa, for example. Make/manage our own copy of the extension string to use after destroying the context. Bug: 9627179 Change-Id: I605536151ee64f50403546d0d38c5b5f1f27dd73
* Merge changes Ibc381479,I21a2430cXavier Ducrohet2013-08-142-29/+5
|\ | | | | | | | | | | * changes: ColorBuffer: Remove the y-invert Intel GPU bug workaround EglMacApi: Use the right pbuffer texture target and format parameters
| * ColorBuffer: Remove the y-invert Intel GPU bug workaroundMartin Storsjo2013-08-102-29/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fix in 57501158 makes sure pbuffers get initialized properly. The previously incorrect pbuffer texture parameters had different effects on different GPUs/drivers. On a Nvidia GT 650M, the buffers were rendered properly but glReadPixels calls were inverted, while Intel HD 3000/4000 seemed to get the rendering inverted as well. By passing proper pbuffer texture parameters, the bug (which in itself was no driver bug but inconsistent behaviour when given invalid parameters) vanishes. This reverts the bug workaround parts of 9322c5cb (from development.git). Change-Id: Ibc38147967361cba6ba85cdf3b4e9a2e2ee6d881
* | Check the return value of eglChooseConfigMartin Storsjo2013-08-111-1/+3
|/ | | | | | | | | | | | The EGL specs say that eglChooseConfig doesn't update num_config if it returns a failure (which is exactly what Translator/EGL/EglImp.cpp does). Therefore, if this function returned a failure (e.g. due to an unsupported egl attribute), nConfigs was left untouched, meaning that the configs array was left uninitialized but treated as if it was full of valid configs. Change-Id: I3809272298ea10d65dc939849d2e3c17d1158da6
* Merge "Fix RenderThreadInfo lifetime and cleanup"Jesse Hall2013-07-116-62/+45
|\
| * Fix RenderThreadInfo lifetime and cleanupJesse Hall2013-06-186-62/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of using a TLS destructor, RenderThreadInfo is now an automatic variable of RenderThread::Main(), so is automatically destroyed on thread exit. RenderThread::Main() now explicitly unbinds the thread's context and surfaces from the FrameBuffer, ensuring that the thread has released all references before it exits. This fixes a bug where RenderThreadInfo's destructor was releasing the references in the TLS destructor, which caused ColorBuffer's destructor to call FrameBuffer::bind_locked() when the FrameBuffer lock wasn't held. By clearing the references in FrameBuffer::bindContext(), locking around destruction happens correctly. Change-Id: I617cea838d5f352a597ccc6d3dbd8f9c08cb91bd
* | Fix a crash which occured with some graphic libraries.Deepanshu Gupta2013-06-211-4/+4
|/ | | | | | | Fix a small bug that caused the emulator to crash when used with some graphic libraries. Change-Id: Ifb7e0b11a8302d0538632dac467d187dfcdfda47
* Prevent SocketStream to be freed twicePetar Jovanovic2013-05-171-8/+8
| | | | | | | | | In cases when RenderThread failed to start, RenderServer would free the stream first and then the thread. However, the thread itself also attemps to free the stream and this caused a crash of the emulator in some corner cases. Change-Id: I2e508c37ab0a09c9261b30e59072bf1a44982dfe
* use tlsDestruct in linux to destroy thread specific OpenGl resourceskeunyoung2013-04-051-13/+11
| | | | | | - lack of tlsDestruct causes resource leakage in linux Change-Id: I6f5308fd00da06dbecd9246393021e3d72aa40c3
* delete socket when the thread is destroyedkeunyoung2013-04-012-1/+6
| | | | | | | - SocketStream is passed from RenderServer::Main, but it is not deleted. - As a result, emulator will keep opening these sockets. Change-Id: I4f2445855fc45a8d5f20f4d598e7021e8f3e000c
* Extend Mac Intel graphics bug workaround to HD 4000Jesse Hall2012-12-101-8/+11
| | | | | Bug: 39835 Change-Id: Ied3f43b76d2bb1bdba478f57122ec0ef4d967ae4
* Send full-size framebuffer to OnPost callbackJesse Hall2012-07-203-10/+23
| | | | | | | | | | | When the emulator window has non-1.0 scaling, the scale is applied when blitting the Android framebuffer to the host window. For the OnPost callback, we were not only reading the image back from the window (so post-scaling), we were also storing it in a 1.0-scaled buffer. Now we read back from the Android framebuffer image, which is always 1.0-scaled. Change-Id: Ia9c974711a9a4b0b19f4b997f65ecc64481b4c6a
* Use a per-process server address for the GLES serverJesse Hall2012-07-113-10/+19
| | | | | | | | | | | | | | | Previously we used a hardcoded address (tcp port, unix pipe path, etc.) for the OpenGLRender system. Multiple emulators would all try to listen on the same address, with the system non-deterministically (?) choosing which one accepted each new connection. This resulted in frames going to the wrong emulator window, one emulator shutting down another's OpenGL system, etc. Now the OpenGLRender server requests an unused tcp port or derives a path from the pid, and reports the address back to the emulator client to use for future connections from the guest. Change-Id: I6af2eac0c7f27670a3b6595772eebc7aa2b24688
* Fix socket leak when shutting down rendererJesse Hall2012-07-092-1/+10
| | | | | | | | | | | | | | | | | | | This leak has always been there, but normally only leaks one socket per emulator instance. Worse, though, is that the socket is listening for connections on a hardcoded port, so it prevents other emulators from listening on that port. Since we now start the GL renderer briefly in every emulator instance (for GL string collection) this means only one emulator can run at a time, even if none are using GL acceleration. Even with this fix, a GL-accelerated emulator will prevent any other emulator (accelerated or not) from starting, since it is listening on the hardcoded port, and the new emulator will try to listen on and connect to that port at least for GL string collection. That will be fixed in a future change. Bug: 33383 Change-Id: I62a8a67eb6afb6c53cb41a19d00b6449cf5e1abe
* Use linear filtering for colorbuffer texturesJesse Hall2012-06-261-2/+2
| | | | | | | | | | | | | | | | | | Switch the min and mag filters for the ColorBuffer's texture object to linear instead of nearest. This gives much better results when posting a colorbuffer to a scaled framebuffer, which happens when the android screen + emulator skin is too big to fit on the user's display. The ColorBuffer's own texture object is only actually used as a texture during post(); when used as a texture by the guest system (e.g. by surfaceflinger composition) it's mapped through an EGLImage to a guest-owned texture object, which has its own filter settings. So we can just change the filter settings for the ColorBuffer texture object at initialization without affecting anything else. SDK Bug: 6721429 Change-Id: I8ec81125d076e0ed77a44f8b0dce412fa3cecabf
* Fix tex and EGLImage leak in ColorBufferJesse Hall2012-06-251-1/+11
| | | | | | | | ColorBuffer wasn't destroying its blit texture and associated EGLImage, leaking one pair per Android gralloc buffer. Change-Id: I2fa42d2ecbb654edca7b224bd002d7513a08a633 http://code.google.com/p/android/issues/detail?id=33445
* Allow frame callback to be enabled/disabledJesse Hall2012-05-103-22/+48
| | | | | | | | Since per-frame readback is slow and clients don't need it on all the time, this change allows the callback to be registered after initialization, and allows it to be disabled later. Change-Id: Ic73d4515d302a0981ee0c80b9e6f9ba5c84b82ae
* Export GL strings through render_apiJesse Hall2012-05-013-4/+35
| | | | | | | | | This also changes the strings reported by the default OpenGL ES 1.1/2.0 to OpenGL translators so they include the strings from the underlying OpenGL implementation. This will give more useful bug reports and SDK deployment statistics. Change-Id: Id2d231a4fe3c40157c24a63ec19785826e037fd3
* Publish and use libOpenglRender interface headerJesse Hall2012-04-181-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | The emulator opengles.c file duplicated the function declarations from libOpenglRenderer's render_api.h instead of including it directly. This led to multiple bugs since the declarations didn't actually match, but there was no way for the compiler or dynamic loader to check this. This change makes opengles.c include render_api.h to get function pointer prototypes, and changes the prototypes/implementation as necessary to make both sides actually match. It should be much more difficult to introduce interface mismatch bugs now. Two bugs this change would have prevented: (a) The interface mismatch caused by inconsistent branching which led to GPU acceleration crashing on Windows. With this change, we would have caught the problem at compile time. (b) The emulator verbose log has always been printing "Can't start OpenGLES renderer?" even when the renderer started fine. This is because the renderer was returning a bool (true == success) but the emulator's declaration said it returned int, and the emulator assumed 0 meant success. This difference in return type should now be caught at compile time. Change-Id: Iab3b6960e221edd135b515a166cf991b62bb60c9
* Move emulator GLES from development.git to sdk.gitJesse Hall2012-04-1634-0/+5012
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: I2c3bce627ecfd0a4b3e688d1839fe10755a21e58