Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(930)

Side by Side Diff: content/common/gpu_info.cc

Issue 6793054: Moved code that runs in both the browser and GPU process from content/gpu to content/common/gpu. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/common/gpu_info.h ('k') | content/common/gpu_info_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "content/common/gpu_info.h"
6
7 GPUInfo::GPUInfo()
8 : finalized(false),
9 vendor_id(0),
10 device_id(0),
11 can_lose_context(false) {
12 }
13
14 GPUInfo::~GPUInfo() { }
15
16 bool GPUInfo::Merge(const GPUInfo& other) {
17 if (device_id != other.device_id || vendor_id != other.vendor_id) {
18 *this = other;
19 return true;
20 }
21
22 bool changed = false;
23 if (!finalized) {
24 finalized = other.finalized;
25 initialization_time = other.initialization_time;
26 if (driver_vendor.empty() && !other.driver_vendor.empty()) {
27 driver_vendor = other.driver_vendor;
28 changed = true;
29 }
30 if (driver_version.empty() && !other.driver_version.empty()) {
31 driver_version = other.driver_version;
32 changed = true;
33 }
34 if (driver_date.empty() && !other.driver_date.empty()) {
35 driver_date = other.driver_date;
36 changed = true;
37 }
38 if (pixel_shader_version.empty())
39 pixel_shader_version = other.pixel_shader_version;
40 if (vertex_shader_version.empty())
41 vertex_shader_version = other.vertex_shader_version;
42 if (gl_version.empty())
43 gl_version = other.gl_version;
44 if (gl_version_string.empty())
45 gl_version_string = other.gl_version_string;
46 if (gl_vendor.empty())
47 gl_vendor = other.gl_vendor;
48 if (gl_renderer.empty() && !other.gl_renderer.empty()) {
49 gl_renderer = other.gl_renderer;
50 changed = true;
51 }
52 if (gl_extensions.empty())
53 gl_extensions = other.gl_extensions;
54 can_lose_context = other.can_lose_context;
55 #if defined(OS_WIN)
56 if (dx_diagnostics.values.size() == 0 &&
57 dx_diagnostics.children.size() == 0)
58 dx_diagnostics = other.dx_diagnostics;
59 #endif
60 }
61 return changed;
62 }
63
OLDNEW
« no previous file with comments | « content/common/gpu_info.h ('k') | content/common/gpu_info_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698