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

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

Issue 1716813002: Use GpuPreferences to avoid directly accessing switches in gpu related code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update Created 4 years, 10 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/shader_translator_cache.h
diff --git a/gpu/command_buffer/service/shader_translator_cache.h b/gpu/command_buffer/service/shader_translator_cache.h
index 06f00f7e89aab33e06168fa6928697b06feacf12..67b9158de63459f42b3341f693db0d76151c848a 100644
--- a/gpu/command_buffer/service/shader_translator_cache.h
+++ b/gpu/command_buffer/service/shader_translator_cache.h
@@ -15,6 +15,9 @@
#include "third_party/angle/include/GLSLANG/ShaderLang.h"
namespace gpu {
+
+struct GpuPreferences;
+
namespace gles2 {
// This class is not thread safe and can only be created and destroyed
@@ -27,7 +30,7 @@ class GPU_EXPORT ShaderTranslatorCache
: public base::RefCounted<ShaderTranslatorCache>,
public NON_EXPORTED_BASE(ShaderTranslator::DestructionObserver) {
public:
- ShaderTranslatorCache();
+ explicit ShaderTranslatorCache(const GpuPreferences& gpu_preferences);
// ShaderTranslator::DestructionObserver implementation
void OnDestruct(ShaderTranslator* translator) override;
@@ -82,6 +85,8 @@ class GPU_EXPORT ShaderTranslatorCache
ShaderTranslatorInitParams& operator=(const ShaderTranslatorInitParams&);
};
+ const GpuPreferences& gpu_preferences_;
+
typedef std::map<ShaderTranslatorInitParams, ShaderTranslator* > Cache;
Cache cache_;
« no previous file with comments | « gpu/command_buffer/service/shader_translator.cc ('k') | gpu/command_buffer/service/shader_translator_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698