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

Unified Diff: gpu/command_buffer/service/program_manager.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/program_manager.cc
diff --git a/gpu/command_buffer/service/program_manager.cc b/gpu/command_buffer/service/program_manager.cc
index e0dfd1daa7e3bcaa71ef785275e0e028e0a48a48..21c89ead439ea55ce62c7c4001139ac51656feb9 100644
--- a/gpu/command_buffer/service/program_manager.cc
+++ b/gpu/command_buffer/service/program_manager.cc
@@ -26,7 +26,7 @@
#include "gpu/command_buffer/common/gles2_cmd_utils.h"
#include "gpu/command_buffer/service/feature_info.h"
#include "gpu/command_buffer/service/gles2_cmd_decoder.h"
-#include "gpu/command_buffer/service/gpu_switches.h"
+#include "gpu/command_buffer/service/gpu_preferences.h"
#include "gpu/command_buffer/service/program_cache.h"
#include "gpu/command_buffer/service/shader_manager.h"
#include "third_party/re2/src/re2/re2.h"
@@ -493,8 +493,7 @@ void Program::Update() {
}
#if !defined(NDEBUG)
- if (base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableGPUServiceLoggingGPU)) {
+ if (manager_->gpu_preferences_.enable_gpu_service_logging_gpu) {
DVLOG(1) << "----: attribs for service_id: " << service_id();
for (size_t ii = 0; ii < attrib_infos_.size(); ++ii) {
const VertexAttrib& info = attrib_infos_[ii];
@@ -508,8 +507,7 @@ void Program::Update() {
UpdateUniforms();
#if !defined(NDEBUG)
- if (base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableGPUServiceLoggingGPU)) {
+ if (manager_->gpu_preferences_.enable_gpu_service_logging_gpu) {
DVLOG(1) << "----: uniforms for service_id: " << service_id();
size_t ii = 0;
for (const UniformInfo& info : uniform_infos_) {
@@ -2264,15 +2262,18 @@ Program::~Program() {
}
}
-ProgramManager::ProgramManager(ProgramCache* program_cache,
- uint32_t max_varying_vectors,
- uint32_t max_dual_source_draw_buffers,
- FeatureInfo* feature_info)
+ProgramManager::ProgramManager(
+ ProgramCache* program_cache,
+ uint32_t max_varying_vectors,
+ uint32_t max_dual_source_draw_buffers,
+ const GpuPreferences& gpu_preferences,
+ FeatureInfo* feature_info)
: program_count_(0),
have_context_(true),
program_cache_(program_cache),
max_varying_vectors_(max_varying_vectors),
max_dual_source_draw_buffers_(max_dual_source_draw_buffers),
+ gpu_preferences_(gpu_preferences),
feature_info_(feature_info) {}
ProgramManager::~ProgramManager() {
« no previous file with comments | « gpu/command_buffer/service/program_manager.h ('k') | gpu/command_buffer/service/program_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698