Skip to content

Commit

Permalink
Remove unused function argument GpuPreferences in the gpu info collec…
Browse files Browse the repository at this point in the history
…tor.

Bug:961662

Change-Id: I094104499332bbbb08c1244995e551cd0c474d00
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1615803
Commit-Queue: Maggie Chen <magchen@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#660559}
  • Loading branch information
Maggie Chen authored and Commit Bot committed May 16, 2019
1 parent c194831 commit 93759b4
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 34 deletions.
2 changes: 1 addition & 1 deletion gpu/command_buffer/tests/gl_test_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ bool GpuCommandBufferTestEGL::InitializeEGLGLES2(int width, int height) {
}

gpu::GPUInfo gpu_info;
gpu::CollectContextGraphicsInfo(&gpu_info, gpu::GpuPreferences());
gpu::CollectContextGraphicsInfo(&gpu_info);
// See crbug.com/822716, the ATI proprietary driver has eglGetProcAddress
// but eglInitialize crashes with x11.
if (gpu_info.gl_vendor.find("ATI Technologies Inc.") != std::string::npos) {
Expand Down
6 changes: 2 additions & 4 deletions gpu/config/gpu_info_collector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "base/trace_event/trace_event.h"
#include "gpu/config/gpu_preferences.h"
#include "gpu/config/gpu_switches.h"
#include "third_party/angle/src/gpu_info_util/SystemInfo.h" // nogncheck
#include "third_party/skia/include/core/SkGraphics.h"
Expand Down Expand Up @@ -171,8 +170,7 @@ bool CollectBasicGraphicsInfo(const base::CommandLine* command_line,
return CollectBasicGraphicsInfo(gpu_info);
}

bool CollectGraphicsInfoGL(GPUInfo* gpu_info,
const GpuPreferences& gpu_preferences) {
bool CollectGraphicsInfoGL(GPUInfo* gpu_info) {
TRACE_EVENT0("startup", "gpu_info_collector::CollectGraphicsInfoGL");
DCHECK_NE(gl::GetGLImplementation(), gl::kGLImplementationNone);

Expand Down Expand Up @@ -380,7 +378,7 @@ void FillGPUInfoFromSystemInfo(GPUInfo* gpu_info,
void CollectGraphicsInfoForTesting(GPUInfo* gpu_info) {
DCHECK(gpu_info);
#if defined(OS_ANDROID)
CollectContextGraphicsInfo(gpu_info, GpuPreferences());
CollectContextGraphicsInfo(gpu_info);
#else
CollectBasicGraphicsInfo(gpu_info);
#endif // OS_ANDROID
Expand Down
8 changes: 2 additions & 6 deletions gpu/config/gpu_info_collector.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ class CommandLine;
}

namespace gpu {
struct GpuPreferences;

// Collects basic GPU info without creating a GL/DirectX context (and without
// the danger of crashing), including vendor_id and device_id.
Expand All @@ -35,9 +34,7 @@ GPU_EXPORT bool CollectBasicGraphicsInfo(const base::CommandLine* command_line,

// Create a GL/DirectX context and collect related info.
// This is called at GPU process startup time.
GPU_EXPORT bool CollectContextGraphicsInfo(
GPUInfo* gpu_info,
const GpuPreferences& gpu_preferences);
GPU_EXPORT bool CollectContextGraphicsInfo(GPUInfo* gpu_info);

#if defined(OS_WIN)
// Collect the DirectX Disagnostics information about the attached displays.
Expand All @@ -47,8 +44,7 @@ GPU_EXPORT void RecordGpuSupportedRuntimeVersionHistograms(
#endif // OS_WIN

// Create a GL context and collect GL strings and versions.
GPU_EXPORT bool CollectGraphicsInfoGL(GPUInfo* gpu_info,
const GpuPreferences& gpu_preferences);
GPU_EXPORT bool CollectGraphicsInfoGL(GPUInfo* gpu_info);

// If more than one GPUs are identified, and GL strings are available,
// identify the active GPU based on GL strings.
Expand Down
5 changes: 2 additions & 3 deletions gpu/config/gpu_info_collector_android.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@

namespace gpu {

bool CollectContextGraphicsInfo(GPUInfo* gpu_info,
const GpuPreferences& gpu_preferences) {
bool CollectContextGraphicsInfo(GPUInfo* gpu_info) {
// When command buffer is compiled as a standalone library, the process might
// not have a Java environment.
if (base::android::IsVMInitialized()) {
Expand All @@ -22,7 +21,7 @@ bool CollectContextGraphicsInfo(GPUInfo* gpu_info,
}

// At this point GL bindings have been initialized already.
return CollectGraphicsInfoGL(gpu_info, gpu_preferences);
return CollectGraphicsInfoGL(gpu_info);
}

bool CollectBasicGraphicsInfo(GPUInfo* gpu_info) {
Expand Down
5 changes: 2 additions & 3 deletions gpu/config/gpu_info_collector_fuchsia.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@

namespace gpu {

bool CollectContextGraphicsInfo(GPUInfo* gpu_info,
const GpuPreferences& gpu_preferences) {
bool CollectContextGraphicsInfo(GPUInfo* gpu_info) {
DCHECK(gpu_info);

TRACE_EVENT0("gpu", "gpu_info_collector::CollectGraphicsInfo");

return CollectGraphicsInfoGL(gpu_info, gpu_preferences);
return CollectGraphicsInfoGL(gpu_info);
}

bool CollectBasicGraphicsInfo(GPUInfo* gpu_info) {
Expand Down
6 changes: 2 additions & 4 deletions gpu/config/gpu_info_collector_linux.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,16 @@

#include "base/trace_event/trace_event.h"
#include "gpu/config/gpu_info_collector.h"
#include "gpu/config/gpu_preferences.h"
#include "third_party/angle/src/gpu_info_util/SystemInfo.h"

namespace gpu {

bool CollectContextGraphicsInfo(GPUInfo* gpu_info,
const GpuPreferences& gpu_preferences) {
bool CollectContextGraphicsInfo(GPUInfo* gpu_info) {
DCHECK(gpu_info);

TRACE_EVENT0("gpu", "gpu_info_collector::CollectGraphicsInfo");

return CollectGraphicsInfoGL(gpu_info, gpu_preferences);
return CollectGraphicsInfoGL(gpu_info);
}

bool CollectBasicGraphicsInfo(GPUInfo* gpu_info) {
Expand Down
5 changes: 2 additions & 3 deletions gpu/config/gpu_info_collector_mac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@

namespace gpu {

bool CollectContextGraphicsInfo(GPUInfo* gpu_info,
const GpuPreferences& gpu_preferences) {
bool CollectContextGraphicsInfo(GPUInfo* gpu_info) {
DCHECK(gpu_info);

TRACE_EVENT0("gpu", "gpu_info_collector::CollectGraphicsInfo");
return CollectGraphicsInfoGL(gpu_info, gpu_preferences);
return CollectGraphicsInfoGL(gpu_info);
}

bool CollectBasicGraphicsInfo(GPUInfo* gpu_info) {
Expand Down
3 changes: 1 addition & 2 deletions gpu/config/gpu_info_collector_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include "base/strings/string_split.h"
#include "gpu/config/gpu_info.h"
#include "gpu/config/gpu_info_collector.h"
#include "gpu/config/gpu_preferences.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gl/gl_context_stub.h"
Expand Down Expand Up @@ -208,7 +207,7 @@ INSTANTIATE_TEST_SUITE_P(GPUConfig,
// be fixed.
TEST_P(GPUInfoCollectorTest, CollectGraphicsInfoGL) {
GPUInfo gpu_info;
CollectGraphicsInfoGL(&gpu_info, GpuPreferences());
CollectGraphicsInfoGL(&gpu_info);
#if defined(OS_WIN)
if (GetParam() == kMockedWindows) {
EXPECT_EQ(test_values_.gpu.driver_vendor, gpu_info.gpu.driver_vendor);
Expand Down
5 changes: 2 additions & 3 deletions gpu/config/gpu_info_collector_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -557,13 +557,12 @@ void RecordGpuSupportedRuntimeVersionHistograms(Dx12VulkanVersionInfo* info) {
}
}

bool CollectContextGraphicsInfo(GPUInfo* gpu_info,
const GpuPreferences& gpu_preferences) {
bool CollectContextGraphicsInfo(GPUInfo* gpu_info) {
TRACE_EVENT0("gpu", "CollectGraphicsInfo");

DCHECK(gpu_info);

if (!CollectGraphicsInfoGL(gpu_info, gpu_preferences))
if (!CollectGraphicsInfoGL(gpu_info))
return false;

// ANGLE's renderer strings are of the form:
Expand Down
2 changes: 1 addition & 1 deletion gpu/config/gpu_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ bool InitializeGLThreadSafe(base::CommandLine* command_line,
return false;
}
}
CollectContextGraphicsInfo(out_gpu_info, gpu_preferences);
CollectContextGraphicsInfo(out_gpu_info);
*out_gpu_feature_info = ComputeGpuFeatureInfo(*out_gpu_info, gpu_preferences,
command_line, nullptr);
if (!out_gpu_feature_info->disabled_extensions.empty()) {
Expand Down
8 changes: 4 additions & 4 deletions gpu/ipc/service/gpu_init.cc
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ bool CollectGraphicsInfo(GPUInfo* gpu_info,
DCHECK(gpu_info);
TRACE_EVENT0("gpu,startup", "Collect Graphics Info");
base::TimeTicks before_collect_context_graphics_info = base::TimeTicks::Now();
bool success = CollectContextGraphicsInfo(gpu_info, gpu_preferences);
bool success = CollectContextGraphicsInfo(gpu_info);
if (!success)
LOG(ERROR) << "gpu::CollectGraphicsInfo failed.";

Expand Down Expand Up @@ -456,7 +456,7 @@ void GpuInit::InitializeInProcess(base::CommandLine* command_line,
bool gl_disabled = gl::GetGLImplementation() == gl::kGLImplementationDisabled;

if (!gl_disabled && !use_swiftshader) {
CollectContextGraphicsInfo(&gpu_info_, gpu_preferences_);
CollectContextGraphicsInfo(&gpu_info_);
gpu_feature_info_ = ComputeGpuFeatureInfo(gpu_info_, gpu_preferences_,
command_line, nullptr);
use_swiftshader = EnableSwiftShaderIfNeeded(
Expand Down Expand Up @@ -494,7 +494,7 @@ void GpuInit::InitializeInProcess(base::CommandLine* command_line,
// information on Linux platform. Try to collect graphics information
// based on core profile context after disabling platform extensions.
if (!gl_disabled && !use_swiftshader) {
CollectContextGraphicsInfo(&gpu_info_, gpu_preferences_);
CollectContextGraphicsInfo(&gpu_info_);
gpu_feature_info_ = ComputeGpuFeatureInfo(gpu_info_, gpu_preferences_,
command_line, nullptr);
use_swiftshader = EnableSwiftShaderIfNeeded(
Expand Down Expand Up @@ -524,7 +524,7 @@ void GpuInit::AdjustInfoToSwiftShader() {
gpu_info_.passthrough_cmd_decoder = false;
gpu_feature_info_for_hardware_gpu_ = gpu_feature_info_;
gpu_feature_info_ = ComputeGpuFeatureInfoForSwiftShader();
CollectContextGraphicsInfo(&gpu_info_, gpu_preferences_);
CollectContextGraphicsInfo(&gpu_info_);
}

scoped_refptr<gl::GLSurface> GpuInit::TakeDefaultOffscreenSurface() {
Expand Down

0 comments on commit 93759b4

Please sign in to comment.