#include "gpu/config/dx_diag_node.h"
#include "gpu/config/gpu_performance_stats.h"
#include "gpu/gpu_export.h"
+#include "media/video/video_encode_accelerator.h"
namespace gpu {
+// Result for the various Collect*Info* functions below.
+// Fatal failures are for cases where we can't create a context at all or
+// something, making the use of the GPU impossible.
+// Non-fatal failures are for cases where we could gather most info, but maybe
+// some is missing (e.g. unable to parse a version string or to detect the exact
+// model).
+enum CollectInfoResult {
+ kCollectInfoNone = 0,
+ kCollectInfoSuccess = 1,
+ kCollectInfoNonFatalFailure = 2,
+ kCollectInfoFatalFailure = 3
+};
+
struct GPU_EXPORT GPUInfo {
struct GPU_EXPORT GPUDevice {
GPUDevice();
// Device ids are unique to vendor, not to one another.
uint32 device_id;
+ // Whether this GPU is the currently used one.
+ // Currently this field is only supported and meaningful on OS X.
+ bool active;
+
// The strings that describe the GPU.
// In Linux these strings are obtained through libpci.
// In Win/MacOSX, these two strings are not filled at the moment.
return !can_lose_context && !software_rendering;
}
- // Whether more GPUInfo fields might be collected in the future.
- bool finalized;
-
// The amount of time taken to get from the process starting to the message
// loop being pumped.
base::TimeDelta initialization_time;
// The version of the vertex shader used by the gpu.
std::string vertex_shader_version;
- // The machine model identifier with format "name major.minor".
- // Name should not contain any whitespaces.
- std::string machine_model;
+ // The machine model identifier. They can contain any character, including
+ // whitespaces. Currently it is supported on MacOSX and Android.
+ // Android examples: "Naxus 5", "XT1032".
+ // On MacOSX, the version is stripped out of the model identifier, for
+ // example, the original identifier is "MacBookPro7,2", and we put
+ // "MacBookPro" as machine_model_name, and "7.2" as machine_model_version.
+ std::string machine_model_name;
- // The version of OpenGL we are using.
- // TODO(zmo): should be able to tell if it's GL or GLES.
- std::string gl_version;
+ // The version of the machine model. Currently it is supported on MacOSX.
+ // See machine_model_name's comment.
+ std::string machine_model_version;
- // The GL_VERSION string. "" if we are not using OpenGL.
- std::string gl_version_string;
+ // The GL_VERSION string.
+ std::string gl_version;
- // The GL_VENDOR string. "" if we are not using OpenGL.
+ // The GL_VENDOR string.
std::string gl_vendor;
- // The GL_RENDERER string. "" if we are not using OpenGL.
+ // The GL_RENDERER string.
std::string gl_renderer;
- // The GL_EXTENSIONS string. "" if we are not using OpenGL.
+ // The GL_EXTENSIONS string.
std::string gl_extensions;
// GL window system binding vendor. "" if not available.
bool software_rendering;
+ // Whether the driver uses direct rendering. True on most platforms, false on
+ // X11 when using remote X.
+ bool direct_rendering;
+
// Whether the gpu process is running in a sandbox.
bool sandboxed;
+ // Number of GPU process crashes recorded.
+ int process_crash_count;
+
+ // The state of whether the basic/context/DxDiagnostics info is collected and
+ // if the collection fails or not.
+ CollectInfoResult basic_info_state;
+ CollectInfoResult context_info_state;
#if defined(OS_WIN)
+ CollectInfoResult dx_diagnostics_info_state;
+
// The information returned by the DirectX Diagnostics Tool.
DxDiagNode dx_diagnostics;
#endif
+
+ std::vector<media::VideoEncodeAccelerator::SupportedProfile>
+ video_encode_accelerator_supported_profiles;
// Note: when adding new members, please remember to update EnumerateFields
// in gpu_info.cc.
virtual void BeginGPUDevice() = 0;
virtual void EndGPUDevice() = 0;
+ // Markers indicating that a VideoEncodeAccelerator::SupportedProfile is
+ // being described.
+ virtual void BeginVideoEncodeAcceleratorSupportedProfile() = 0;
+ virtual void EndVideoEncodeAcceleratorSupportedProfile() = 0;
+
// Markers indicating that "auxiliary" attributes of the GPUInfo
// (according to the DevTools protocol) are being described.
virtual void BeginAuxAttributes() = 0;