Several EmuGL files were missing copyright notices; added them. Others
had them but below other code, which makes checking for them more
difficult -- I moved these to the top of the file.
These files were all created by GraphTech as a work for hire for AOSP.
Change-Id: Iee67bcf1c9b54ad5aa8a9288ded0382a974c32cb
Whenever a surface was attached to a context, it was dequeing a new
buffer, and enqueing it when detached. This has the effect of doing a
SwapBuffers on detach/attach cycle, which is just wrong and
occasionally caused visible glitches (e.g. animations going backwards
for one frame). It also broke some SurfaceTexture tests which
(validly) depend on specific buffer production/consumption counts.
Change-Id: Ibd4761e8842871b79fd9edf52272900193cb672d
Pass the swap interval from eglSwapInterval to the native window so it
can enable/disable SurfaceTexture's async mode. Fixes the deadlock in
SurfaceTextureGLToGLTest.EglDestroySurfaceUnrefsBuffers.
Change-Id: I19bf69247341f5617223722df63d6c7f8cf389c6
* EGLImageTargetRenderbufferStorageOES was incorrectly accepting
TEXTURE_EXTERNAL_OES as a target. Revert that; the host GL will
correctly reject it with INVALID_ENUM.
* Handle the REQUIRED_TEXTURE_IMAGE_UNITS_OES texparameter query.
* Validate texture parameters set on TEXTURE_EXTERNAL textures;
otherwise invalid parameters would work on the emulator but not on a
real device.
Change-Id: I49a088608d58a9822f33e5916bd354eee3709127
The gralloc API assumes system-wide reference counting of gralloc
buffers. The host-GL accelerated gralloc maps buffers to host-side
ColorBuffer objects, but was destroying them unconditionally in
gralloc_free(), ignoring any additional references from
gralloc_register_buffer().
This affected the SurfaceTexture gralloc buffers used by the
Browser/WebView. For some reason these buffers are actually allocated
by SurfaceFlinger and passed back to the WebView through Binder. But
since SurfaceFlinger doesn't actually need the buffer for anything,
sometime after the WebView has called gralloc_register_buffer()
SurfaceFlinger calls gralloc_free() on it. This caused the host
ColorBuffer to be destroyed long before the WebView is done using it.
Change-Id: I33dbee887a48a6907041cf19e9f38a1f6c983eff
The emulator EGL implementation tried to hold its own reference to
buffers acquired/released with dequeueBuffer/queueBuffer, but was
missing an incRef after dequeueBuffer during swapBuffers.
Since the native window holds a reference to the buffer between
dequeueBuffer and queueBuffer, the EGL reference isn't needed anyway.
Change-Id: I95e4f9f4faf59198f99939cdca6603fe176c56bc
The glBufferData, glBufferSubData, and glDeleteBuffers entry points
had interception routines in GL2Encoder which cache the data, but they
weren't hooked up. So when glDrawElements tried to retrieve the cached
data it wasn't there.
Change-Id: Iaed11fccaefab3186485be53a0f15c8ca0a255f9
GLESv2 support will come in a followup change but will take advantage
of the GLClientState changes.
Change-Id: Ib6cbb4dafbd071e3b59b1e5d808b3e23656ada92
This patches fixes a minor invalid usage of delete (instead of delete[])
and reformats the source code a little to make it more obvious.
Change-Id: If853d12e74549abcc6682430c837b0f14da81fdc
This patch modifies the guest encoding libraries to avoid
un-necessary copies when sending large buffers (e.g. pixels)
to the host. Instead, the data is sent directly through a
new IOStream method (writeFully()).
On my machine, this improves the NenaMark2 benchmark
(from 50.8 to 57.1 fps). More importantly, this speeds up
the display of non-GL surfaces too, which are sent through
the special rcUpdateColorBuffer() function in gralloc_goldfish.
This is noticeable in many parts of the UI (e.g. when scrolling
through lists).
To tag a given parameter, use the new 'isLarge' variable flag
in the protocol .attrib file.
Implemented for the following encoding functions:
rcUpdateColorBuffer
glTexSubImage2D
glTexImage2Di
glBufferData
glBufferSubData
glCompressedTexImage2D
glCompressedTexSubImage2D
glTexImage3DOES
glTexSubImage3DOES
glCompressedTexImage3DOES
glCompressedTexSubImage3DOES
+ Optimize the auto-generated encoder functions to avoid
repeated function calls (for size computations).
Change-Id: I13a02607b606c40cd05984cd2051b1f3424bc2d0
The modules here are only built when BUILD_EMULATOR_OPENGL is defined to true
in your environment or your BoardConfig.mk (see tools/emulator/opengl/Android.mk)
Change-Id: I5f32c35b4452fb5a7b4d5f9fc5870ec1da6032e6