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

Unified Diff: gpu/command_buffer/client/gles2_implementation.cc

Issue 1241433003: Rebind EGL context to flush driver caches. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge 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/client/gles2_implementation.cc
diff --git a/gpu/command_buffer/client/gles2_implementation.cc b/gpu/command_buffer/client/gles2_implementation.cc
index 5dcc9dd3844c32e51eb7b6c1b1fd240c5bebb135..d4e77f2d2c492dc9f1951b740ba3c451d8dcb50a 100644
--- a/gpu/command_buffer/client/gles2_implementation.cc
+++ b/gpu/command_buffer/client/gles2_implementation.cc
@@ -331,9 +331,16 @@ void GLES2Implementation::SetAggressivelyFreeResources(
"aggressively_free_resources", aggressively_free_resources);
aggressively_free_resources_ = aggressively_free_resources;
- // ShallowFlushCHROMIUM will free resources if |aggressively_free_resources_|
- // is false.
- ShallowFlushCHROMIUM();
+ if (aggressively_free_resources_ && helper_->HaveRingBuffer()) {
+ // Ensure that we clean up as much cache memory as possible and fully flush.
+ FlushDriverCachesCHROMIUM();
+
+ // Flush will delete transfer buffer resources if
+ // |aggressively_free_resources_| is true.
+ Flush();
+ } else {
+ ShallowFlushCHROMIUM();
+ }
}
void GLES2Implementation::WaitForCmd() {
« no previous file with comments | « gpu/command_buffer/client/gles2_cmd_helper_autogen.h ('k') | gpu/command_buffer/client/gles2_implementation_autogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698