| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2013 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 // Determines whether a certain gpu is prefered in a dual-gpu situation. | |
| 6 // A valid gpu_switching_list.json file are in the format of | |
| 7 // { | |
| 8 // "version": "x.y", | |
| 9 // "entries": [ | |
| 10 // { // entry 1 | |
| 11 // }, | |
| 12 // ... | |
| 13 // { // entry n | |
| 14 // } | |
| 15 // ] | |
| 16 // } | |
| 17 // | |
| 18 // Each entry contains the following fields (fields are optional unless | |
| 19 // specifically described as mandatory below): | |
| 20 // 1. "id" is an integer. 0 is reserved. This field is mandatory. | |
| 21 // 2. "os" contains "type" and an optional "version". "type" could be "macosx", | |
| 22 // "linux", "win", "chromeos", or "any". "any" is the same as not specifying | |
| 23 // "os". | |
| 24 // "version" is a VERSION structure (defined below). | |
| 25 // 3. "vendor_id" is a string. 0 is reserved. | |
| 26 // 4. "device_id" is an array of strings. 0 is reserved. | |
| 27 // 5. "multi_gpu_style" is a string, valid values include "optimus", and | |
| 28 // "amd_switchable". | |
| 29 // 6. "multi_gpu_category" is a string, valid values include "any", "primary", | |
| 30 // and "secondary". If unspecified, the default value is "primary". | |
| 31 // 7. "driver_vendor" is a STRING structure (defined below). | |
| 32 // 8. "driver_version" is a VERSION structure (defined below). | |
| 33 // 9. "driver_date" is a VERSION structure (defined below). | |
| 34 // The version is interpreted as "year.month.day". | |
| 35 // 10. "gl_vendor" is a STRING structure (defined below). | |
| 36 // 11. "gl_renderer" is a STRING structure (defined below). | |
| 37 // 12. "gl_extensions" is a STRING structure (defined below). | |
| 38 // 13. "perf_graphics" is a FLOAT structure (defined below). | |
| 39 // 14. "perf_gaming" is a FLOAT structure (defined below). | |
| 40 // 15. "perf_overall" is a FLOAT structure (defined below). | |
| 41 // 16. "machine_model" contais "name" and an optional "version". "name" is a | |
| 42 // STRING structure and "version" is a VERSION structure (defined below). | |
| 43 // 17. "gpu_count" is a INT structure (defined below). | |
| 44 // 18 "cpu_info" is a STRING structure (defined below). | |
| 45 // 19. "exceptions" is a list of entries. | |
| 46 // 20. "features" is a list of gpu switching options, including | |
| 47 // "force_discrete" and "force_integrated". | |
| 48 // This field is mandatory. | |
| 49 // 21. "description" has the description of the entry. | |
| 50 // 22. "webkit_bugs" is an array of associated webkit bug numbers. | |
| 51 // 23. "cr_bugs" is an array of associated webkit bug numbers. | |
| 52 // 24. "browser_version" is a VERSION structure (defined below). If this | |
| 53 // condition is not satisfied, the entry will be ignored. If it is not | |
| 54 // present, then the entry applies to all versions of the browser. | |
| 55 // 25. "disabled" is a boolean. If it is present, the entry will be skipped. | |
| 56 // This can not be used in exceptions. | |
| 57 // | |
| 58 // VERSION includes "op", "style", "number", and "number2". "op" can be any of | |
| 59 // the following values: "=", "<", "<=", ">", ">=", "any", "between". "style" | |
| 60 // is optional and can be "lexical" or "numerical"; if it's not specified, it | |
| 61 // defaults to "numerical". "number2" is only used if "op" is "between". | |
| 62 // "between" is "number <= * <= number2". | |
| 63 // "number" is used for all "op" values except "any". "number" and "number2" | |
| 64 // are in the format of x, x.x, x.x.x, etc. | |
| 65 // Only "driver_version" supports lexical style if the format is major.minor; | |
| 66 // in that case, major is still numerical, but minor is lexical. | |
| 67 // | |
| 68 // STRING includes "op" and "value". "op" can be any of the following values: | |
| 69 // "contains", "beginwith", "endwith", "=". "value" is a string. | |
| 70 // | |
| 71 // FLOAT includes "op" "value", and "value2". "op" can be any of the | |
| 72 // following values: "=", "<", "<=", ">", ">=", "any", "between". "value2" is | |
| 73 // only used if "op" is "between". "value" is used for all "op" values except | |
| 74 // "any". "value" and "value2" are valid float numbers. | |
| 75 // INT is very much like FLOAT, except that the values need to be integers. | |
| 76 | |
| 77 #include "content/browser/gpu/gpu_control_list_jsons.h" | |
| 78 | |
| 79 #define LONG_STRING_CONST(...) #__VA_ARGS__ | |
| 80 | |
| 81 namespace content { | |
| 82 | |
| 83 const char kGpuSwitchingListJson[] = LONG_STRING_CONST( | |
| 84 | |
| 85 { | |
| 86 "name": "gpu switching list", | |
| 87 // Please update the version number whenever you change this file. | |
| 88 "version": "2.0", | |
| 89 "entries": [ | |
| 90 { | |
| 91 "id": 1, | |
| 92 "description": "Force to use discrete GPU on older MacBookPro models.", | |
| 93 "cr_bugs": [113703], | |
| 94 "os": { | |
| 95 "type": "macosx", | |
| 96 "version": { | |
| 97 "op": ">=", | |
| 98 "number": "10.7" | |
| 99 } | |
| 100 }, | |
| 101 "machine_model": { | |
| 102 "name": { | |
| 103 "op": "=", | |
| 104 "value": "MacBookPro" | |
| 105 }, | |
| 106 "version": { | |
| 107 "op": "<", | |
| 108 "number": "8" | |
| 109 } | |
| 110 }, | |
| 111 "gpu_count": { | |
| 112 "op": "=", | |
| 113 "value": "2" | |
| 114 }, | |
| 115 "features": [ | |
| 116 "force_discrete" | |
| 117 ] | |
| 118 } | |
| 119 ] | |
| 120 } | |
| 121 | |
| 122 ); // LONG_STRING_CONST macro | |
| 123 | |
| 124 } // namespace content | |
| 125 | |
| OLD | NEW |