Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(193)

Unified Diff: gpu/command_buffer/service/gles2_cmd_decoder.cc

Issue 1241433003: Rebind EGL context to flush driver caches. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: gpu/command_buffer/service/gles2_cmd_decoder.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index dd08df8214eedc278f3173f43e2a6d03981b2d13..5cdf63163626eb7dbf06bb691d7f571169671752 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -1098,6 +1098,8 @@ class GLES2DecoderImpl : public GLES2Decoder,
void DoLoseContextCHROMIUM(GLenum current, GLenum other);
+ void DoFlushDriverCachesCHROMIUM(void);
+
void DoMatrixLoadfCHROMIUM(GLenum matrix_mode, const GLfloat* matrix);
void DoMatrixLoadIdentityCHROMIUM(GLenum matrix_mode);
@@ -13082,6 +13084,18 @@ void GLES2DecoderImpl::DoLoseContextCHROMIUM(GLenum current, GLenum other) {
reset_by_robustness_extension_ = true;
}
+void GLES2DecoderImpl::DoFlushDriverCachesCHROMIUM(void) {
+ // Normally, we should just need to call glFinish to flush driver caches.
+ glFinish();
+
+ // On Adreno Android devices we need to use a workaround to force more caches
+ // to clear.
+ if (feature_info_->workarounds().unbind_egl_context_to_flush_driver_caches) {
+ context_->MakeCurrent(nullptr);
piman 2015/07/13 21:25:29 How about context_->ReleaseCurrent() here, instead
ericrk 2015/07/13 22:11:11 good point.
+ context_->MakeCurrent(surface_.get());
+ }
+}
+
void GLES2DecoderImpl::DoMatrixLoadfCHROMIUM(GLenum matrix_mode,
const GLfloat* matrix) {
DCHECK(matrix_mode == GL_PATH_PROJECTION_CHROMIUM ||

Powered by Google App Engine
This is Rietveld 408576698