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

Unified Diff: gpu/command_buffer/service/memory_program_cache.h

Issue 2921653005: GLES ProgramCache listens to memory pressure (Closed)
Patch Set: low-end check only on Android. Created 3 years, 6 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
« no previous file with comments | « gpu/command_buffer/service/gpu_preferences.cc ('k') | gpu/command_buffer/service/memory_program_cache.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/memory_program_cache.h
diff --git a/gpu/command_buffer/service/memory_program_cache.h b/gpu/command_buffer/service/memory_program_cache.h
index 4662e911175a90d486f35b2c9d9e691bf5ad4ebd..15fad43d88b1b7d2d76c59454e72e2dd2f69714f 100644
--- a/gpu/command_buffer/service/memory_program_cache.h
+++ b/gpu/command_buffer/service/memory_program_cache.h
@@ -14,6 +14,7 @@
#include "base/containers/hash_tables.h"
#include "base/containers/mru_cache.h"
#include "base/macros.h"
+#include "base/memory/memory_pressure_listener.h"
#include "base/memory/ref_counted.h"
#include "gpu/command_buffer/service/gles2_cmd_decoder.h"
#include "gpu/command_buffer/service/program_cache.h"
@@ -166,6 +167,9 @@ class GPU_EXPORT MemoryProgramCache : public ProgramCache {
typedef base::MRUCache<std::string,
scoped_refptr<ProgramCacheValue> > ProgramMRUCache;
+ void HandleMemoryPressure(
+ base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level);
+
const size_t max_size_bytes_;
const bool disable_gpu_shader_disk_cache_;
const bool disable_program_caching_for_transform_feedback_;
@@ -173,6 +177,8 @@ class GPU_EXPORT MemoryProgramCache : public ProgramCache {
ProgramMRUCache store_;
GpuProcessActivityFlags* activity_flags_;
+ base::MemoryPressureListener memory_pressure_listener_;
+
DISALLOW_COPY_AND_ASSIGN(MemoryProgramCache);
};
« no previous file with comments | « gpu/command_buffer/service/gpu_preferences.cc ('k') | gpu/command_buffer/service/memory_program_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698