summaryrefslogtreecommitdiffstats
path: root/chrome/common/gpu_info.cc
blob: ff9caae13147c6f59476381074d0fecd0a45d249 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
// Copyright (c) 2011 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.

#include "chrome/common/gpu_info.h"

GPUInfo::GPUInfo()
    : level_(kUninitialized),
      vendor_id_(0),
      device_id_(0),
      driver_vendor_(""),
      driver_version_(""),
      pixel_shader_version_(0),
      vertex_shader_version_(0),
      gl_version_(0),
      gl_version_string_(""),
      gl_vendor_(""),
      gl_renderer_(""),
      gl_extensions_(""),
      can_lose_context_(false) {
}

GPUInfo::~GPUInfo() {}

GPUInfo::Level GPUInfo::level() const {
  return level_;
}

base::TimeDelta GPUInfo::initialization_time() const {
  return initialization_time_;
}

uint32 GPUInfo::vendor_id() const {
  return vendor_id_;
}

uint32 GPUInfo::device_id() const {
  return device_id_;
}

std::string GPUInfo::driver_vendor() const {
  return driver_vendor_;
}

std::string GPUInfo::driver_version() const {
  return driver_version_;
}

uint32 GPUInfo::pixel_shader_version() const {
  return pixel_shader_version_;
}

uint32 GPUInfo::vertex_shader_version() const {
  return vertex_shader_version_;
}

uint32 GPUInfo::gl_version() const {
  return gl_version_;
}

std::string GPUInfo::gl_version_string() const {
  return gl_version_string_;
}

std::string GPUInfo::gl_vendor() const {
  return gl_vendor_;
}

std::string GPUInfo::gl_renderer() const {
  return gl_renderer_;
}

std::string GPUInfo::gl_extensions() const {
  return gl_extensions_;
}

bool GPUInfo::can_lose_context() const {
  return can_lose_context_;
}

void GPUInfo::SetLevel(Level level) {
  level_ = level;
}

void GPUInfo::SetInitializationTime(
    const base::TimeDelta& initialization_time) {
  initialization_time_ = initialization_time;
}

void GPUInfo::SetVideoCardInfo(uint32 vendor_id, uint32 device_id) {
  vendor_id_ = vendor_id;
  device_id_ = device_id;
}

void GPUInfo::SetDriverInfo(const std::string& driver_vendor,
                            const std::string& driver_version) {
  driver_vendor_ = driver_vendor;
  driver_version_ = driver_version;
}

void GPUInfo::SetShaderVersion(uint32 pixel_shader_version,
                               uint32 vertex_shader_version) {
  pixel_shader_version_ = pixel_shader_version;
  vertex_shader_version_ = vertex_shader_version;
}

void GPUInfo::SetGLVersion(uint32 gl_version) {
  gl_version_ = gl_version;
}

void GPUInfo::SetGLVersionString(const std::string& gl_version_string) {
  gl_version_string_ = gl_version_string;
}

void GPUInfo::SetGLVendor(const std::string& gl_vendor) {
  gl_vendor_ = gl_vendor;
}

void GPUInfo::SetGLRenderer(const std::string& gl_renderer) {
  gl_renderer_ = gl_renderer;
}

void GPUInfo::SetGLExtensions(const std::string& gl_extensions) {
  gl_extensions_ = gl_extensions;
}

void GPUInfo::SetCanLoseContext(bool can_lose_context) {
  can_lose_context_ = can_lose_context;
}

#if defined(OS_WIN)
const DxDiagNode& GPUInfo::dx_diagnostics() const {
  return dx_diagnostics_;
}

void GPUInfo::SetDxDiagnostics(const DxDiagNode& dx_diagnostics) {
  dx_diagnostics_ = dx_diagnostics;
}
#endif