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

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

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.cc
diff --git a/gpu/command_buffer/service/shader_translator_cache.cc b/gpu/command_buffer/service/shader_translator_cache.cc
index f78039fcac25d72c900bc2360ceb668fe669abb2..9c04f60adf89f7a3d13b7eb79a1e69b6e9cb524e 100644
--- a/gpu/command_buffer/service/shader_translator_cache.cc
+++ b/gpu/command_buffer/service/shader_translator_cache.cc
@@ -2,14 +2,18 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "gpu/command_buffer/service/shader_translator_cache.h"
+
#include <GLES2/gl2.h>
-#include "gpu/command_buffer/service/shader_translator_cache.h"
+#include "gpu/command_buffer/service/gpu_preferences.h"
namespace gpu {
namespace gles2 {
-ShaderTranslatorCache::ShaderTranslatorCache() {
+ShaderTranslatorCache::ShaderTranslatorCache(
+ const GpuPreferences& gpu_preferences)
+ : gpu_preferences_(gpu_preferences) {
}
ShaderTranslatorCache::~ShaderTranslatorCache() {
@@ -43,7 +47,8 @@ scoped_refptr<ShaderTranslator> ShaderTranslatorCache::GetTranslator(
ShaderTranslator* translator = new ShaderTranslator();
if (translator->Init(shader_type, shader_spec, resources,
- shader_output_language, driver_bug_workarounds)) {
+ shader_output_language, driver_bug_workarounds,
+ gpu_preferences_.gl_shader_interm_output)) {
cache_[params] = translator;
translator->AddDestructionObserver(this);
return translator;
« no previous file with comments | « gpu/command_buffer/service/shader_translator_cache.h ('k') | gpu/command_buffer/service/shader_translator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698