summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gpu_util.h
blob: 5bf65d355ad72fc632d5e2af9e2815c4f746efb8 (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
// Copyright (c) 2012 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_BROWSER_GPU_UTIL_H_
#define CHROME_BROWSER_GPU_UTIL_H_
#pragma once

#include <string>

#include "content/public/common/gpu_feature_type.h"

namespace base {
class DictionaryValue;
class Value;
}

namespace gpu_util {

// Maps string to GpuFeatureType; returns GPU_FEATURE_TYPE_UNKNOWN if none of
// the following is input (case-sensitive):
//   "accelerated_2d_canvas"
//   "accelerated_compositing"
//   "webgl"
//   "multisampling"
content::GpuFeatureType StringToGpuFeatureType(
    const std::string& feature_string);

// Gets a string version of a feature type for use in about:gpu. Will yield
// strings from StringToGpuFeatureType, e.g.
// GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS becomes "accelerated_2d_canvas"
std::string GpuFeatureTypeToString(content::GpuFeatureType feature);

// Returns status of various GPU features. This is two parted:
// {
//    featureStatus: []
//    problems: []
// }
//
// Each entry in feature_status has:
// {
//    name:  "name of feature"
//    status: "enabled" | "unavailable_software" | "unavailable_off" |
//            "software" | "disabled_off" | "disabled_softare";
// }
//
// The features reported are not 1:1 with GpuFeatureType. Rather, they are:
//    '2d_canvas'
//    '3d_css'
//    'composting',
//    'webgl',
//    'multisampling'
//
// Each problems has:
// {
//    "description": "Your GPU is too old",
//    "crBugs": [1234],
//    "webkitBugs": []
// }
//
// Caller is responsible for deleting the returned value.
base::Value* GetFeatureStatus();

// Returns the GpuInfo as a DictionaryValue.
base::DictionaryValue* GpuInfoAsDictionaryValue();

// Send UMA histograms about the enabled features.
void UpdateStats();

}  // namespace gpu_util

#endif  // CHROME_BROWSER_GPU_UTIL_H_