diff options
author | ericrk <ericrk@chromium.org> | 2015-07-15 10:55:08 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-07-15 17:55:56 +0000 |
commit | 9c79932e180918336f6140236a2cdedcaed4f535 (patch) | |
tree | 52154821af971cf7614e8675e8fbfd8c58990dd4 /mojo/gpu | |
parent | 84d47ef5061ae8ac0d5de2525c8c8c17cf8f439d (diff) | |
download | chromium_src-9c79932e180918336f6140236a2cdedcaed4f535.zip chromium_src-9c79932e180918336f6140236a2cdedcaed4f535.tar.gz chromium_src-9c79932e180918336f6140236a2cdedcaed4f535.tar.bz2 |
Rebind EGL context to flush driver caches
Android Adreno drivers do not flush caches on glFinish, making it hard to clear up app resources when going to the background.
To work around this, we introduce a glFlushDriverCachesCHROMIUM call which does the right thing based on the driver workaround list.
On most cards, this call simply does a glFinish, which will clean up driver caches. On Adreno GPUs, this call binds a NULL surface/context then re-binds the correct surface/context.
This causes the driver's texture cache to flush, reducing our memory usage by around ~6mb.
BUG=505495,509727
Review URL: https://codereview.chromium.org/1241433003
Cr-Commit-Position: refs/heads/master@{#338883}
Diffstat (limited to 'mojo/gpu')
-rw-r--r-- | mojo/gpu/mojo_gles2_impl_autogen.cc | 3 | ||||
-rw-r--r-- | mojo/gpu/mojo_gles2_impl_autogen.h | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/mojo/gpu/mojo_gles2_impl_autogen.cc b/mojo/gpu/mojo_gles2_impl_autogen.cc index 6351a07..f677723 100644 --- a/mojo/gpu/mojo_gles2_impl_autogen.cc +++ b/mojo/gpu/mojo_gles2_impl_autogen.cc @@ -1638,6 +1638,9 @@ void MojoGLES2Impl::ScheduleOverlayPlaneCHROMIUM(GLint plane_z_order, void MojoGLES2Impl::SwapInterval(GLint interval) { NOTREACHED() << "Unimplemented SwapInterval."; } +void MojoGLES2Impl::FlushDriverCachesCHROMIUM() { + NOTREACHED() << "Unimplemented FlushDriverCachesCHROMIUM."; +} void MojoGLES2Impl::MatrixLoadfCHROMIUM(GLenum matrixMode, const GLfloat* m) { NOTREACHED() << "Unimplemented MatrixLoadfCHROMIUM."; } diff --git a/mojo/gpu/mojo_gles2_impl_autogen.h b/mojo/gpu/mojo_gles2_impl_autogen.h index c71536c..0a90a7b 100644 --- a/mojo/gpu/mojo_gles2_impl_autogen.h +++ b/mojo/gpu/mojo_gles2_impl_autogen.h @@ -784,6 +784,7 @@ class MojoGLES2Impl : public gpu::gles2::GLES2Interface { GLfloat uv_width, GLfloat uv_height) override; void SwapInterval(GLint interval) override; + void FlushDriverCachesCHROMIUM() override; void MatrixLoadfCHROMIUM(GLenum matrixMode, const GLfloat* m) override; void MatrixLoadIdentityCHROMIUM(GLenum matrixMode) override; GLuint GenPathsCHROMIUM(GLsizei range) override; |