summaryrefslogtreecommitdiffstats
path: root/chrome/gpu
diff options
context:
space:
mode:
authorzmo@google.com <zmo@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-21 19:59:56 +0000
committerzmo@google.com <zmo@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-21 19:59:56 +0000
commit8cc22fd1329fc82da18132faae2bfe8eefa7f1e1 (patch)
tree63c05ce15fcde4365a4bcb9b4f4cf350d1d67f90 /chrome/gpu
parentba6ef393b8a5d8b5f82467aa095660b6cecf9a09 (diff)
downloadchromium_src-8cc22fd1329fc82da18132faae2bfe8eefa7f1e1.zip
chromium_src-8cc22fd1329fc82da18132faae2bfe8eefa7f1e1.tar.gz
chromium_src-8cc22fd1329fc82da18132faae2bfe8eefa7f1e1.tar.bz2
Collect GL_EXTENSIONS string in GPUInfo and display it in about:gpu page.
BUG=none TEST=GL_EXTENSIONS showing in about:gpu Review URL: http://codereview.chromium.org/6306008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72180 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/gpu')
-rw-r--r--chrome/gpu/gpu_info_collector.cc1
-rw-r--r--chrome/gpu/gpu_info_collector_unittest.cc19
2 files changed, 18 insertions, 2 deletions
diff --git a/chrome/gpu/gpu_info_collector.cc b/chrome/gpu/gpu_info_collector.cc
index bb55eaf..f6936fd 100644
--- a/chrome/gpu/gpu_info_collector.cc
+++ b/chrome/gpu/gpu_info_collector.cc
@@ -89,6 +89,7 @@ bool CollectGraphicsInfoGL(GPUInfo* gpu_info) {
gpu_info->SetGLRenderer(GetGLString(GL_RENDERER));
gpu_info->SetGLVendor(GetGLString(GL_VENDOR));
gpu_info->SetGLVersionString(GetGLString(GL_VERSION));
+ gpu_info->SetGLExtensions(GetGLString(GL_EXTENSIONS));
bool validGLVersionInfo = CollectGLVersionInfo(gpu_info);
bool validVideoCardInfo = CollectVideoCardInfo(gpu_info);
diff --git a/chrome/gpu/gpu_info_collector_unittest.cc b/chrome/gpu/gpu_info_collector_unittest.cc
index 1d0156f..8e3d9c1 100644
--- a/chrome/gpu/gpu_info_collector_unittest.cc
+++ b/chrome/gpu/gpu_info_collector_unittest.cc
@@ -33,6 +33,9 @@ class GPUInfoCollectorTest : public testing::Test {
const char* gl_vendor = "NVIDIA Corporation";
const char* gl_version_string = "3.1.0";
const char* gl_shading_language_version = "1.40 NVIDIA via Cg compiler";
+ const char* gl_extensions =
+ "GL_OES_packed_depth_stencil GL_EXT_texture_format_BGRA8888 "
+ "GL_EXT_read_format_bgra";
#elif defined(OS_MACOSX)
const uint32 vendor_id = 0x10de;
const uint32 device_id = 0x0640;
@@ -44,6 +47,9 @@ class GPUInfoCollectorTest : public testing::Test {
const char* gl_vendor = "NVIDIA Corporation";
const char* gl_version_string = "2.1 NVIDIA-1.6.18";
const char* gl_shading_language_version = "1.20 ";
+ const char* gl_extensions =
+ "GL_OES_packed_depth_stencil GL_EXT_texture_format_BGRA8888 "
+ "GL_EXT_read_format_bgra";
#else // defined (OS_LINUX)
const uint32 vendor_id = 0x10de;
const uint32 device_id = 0x0658;
@@ -55,6 +61,9 @@ class GPUInfoCollectorTest : public testing::Test {
const char* gl_vendor = "NVIDIA Corporation";
const char* gl_version_string = "3.2.0 NVIDIA 195.36.24";
const char* gl_shading_language_version = "1.50 NVIDIA via Cg compiler";
+ const char* gl_extensions =
+ "GL_OES_packed_depth_stencil GL_EXT_texture_format_BGRA8888 "
+ "GL_EXT_read_format_bgra";
#endif
test_values_.SetVideoCardInfo(vendor_id, device_id);
test_values_.SetDriverInfo(driver_vendor, driver_version);
@@ -67,8 +76,7 @@ class GPUInfoCollectorTest : public testing::Test {
EXPECT_CALL(*gl_, GetString(GL_EXTENSIONS))
.WillRepeatedly(Return(reinterpret_cast<const GLubyte*>(
- "GL_OES_packed_depth_stencil GL_EXT_texture_format_BGRA8888 "
- "GL_EXT_read_format_bgra")));
+ gl_extensions)));
EXPECT_CALL(*gl_, GetString(GL_SHADING_LANGUAGE_VERSION))
.WillRepeatedly(Return(reinterpret_cast<const GLubyte*>(
gl_shading_language_version)));
@@ -153,3 +161,10 @@ TEST_F(GPUInfoCollectorTest, GLVendorGL) {
EXPECT_EQ(test_values_.gl_vendor(), gl_vendor);
}
+TEST_F(GPUInfoCollectorTest, GLExtensionsGL) {
+ GPUInfo gpu_info;
+ gpu_info_collector::CollectGraphicsInfoGL(&gpu_info);
+ std::string gl_extensions = gpu_info.gl_extensions();
+ EXPECT_EQ(test_values_.gl_extensions(), gl_extensions);
+}
+