From 1bf14bcd62453cb53e21097a61fcefb0c5cc213b Mon Sep 17 00:00:00 2001 From: "rlp@chromium.org" Date: Fri, 9 Jul 2010 16:10:43 +0000 Subject: Moving gpu_info to common so that it can be used by param traits. Pulling the collection out into a separate class. BUG=38736 TEST=existing unittests Review URL: http://codereview.chromium.org/2914001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51967 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/common/gpu_info.h | 54 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 chrome/common/gpu_info.h (limited to 'chrome/common/gpu_info.h') diff --git a/chrome/common/gpu_info.h b/chrome/common/gpu_info.h new file mode 100644 index 0000000..acbc18c --- /dev/null +++ b/chrome/common/gpu_info.h @@ -0,0 +1,54 @@ +// Copyright (c) 2006-2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_COMMON_GPU_INFO_H__ +#define CHROME_COMMON_GPU_INFO_H__ + +// Provides access to the GPU information for the system +// on which chrome is currently running. + +#include + +#include "base/basictypes.h" + +class GPUInfo { + public: + GPUInfo() {} + ~GPUInfo() {} + + // Return the DWORD (uint32) representing the graphics card vendor id. + uint32 vendor_id() const; + + // Return the DWORD (uint32) representing the graphics card device id. + // Device ids are unique to vendor, not to one another. + uint32 device_id() const; + + // Return the version of the graphics driver currently installed. + // This will typically be something + std::wstring driver_version() const; + + // Return the version of the pixel/fragment shader used by the gpu. + // This will typically be a number less than 10 so storing as a float + // should be okay. + uint32 pixel_shader_version() const; + + // Return the version of the vertex shader used by the gpu. + // This will typically be a number less than 10 so storing as a float + // should be okay. + uint32 vertex_shader_version() const; + + // Populate variables with passed in values + void SetGraphicsInfo(uint32 vendor_id, uint32 device_id, + const std::wstring& driver_version, + uint32 pixel_shader_version, + uint32 vertex_shader_version); + private: + uint32 vendor_id_; + uint32 device_id_; + std::wstring driver_version_; + uint32 pixel_shader_version_; + uint32 vertex_shader_version_; +}; + +#endif // CHROME_COMMON_GPU_INFO_H__ -- cgit v1.1