OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "gpu/config/gpu_driver_bug_list.h" | 5 #include "gpu/config/gpu_driver_bug_list.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "gpu/config/gpu_driver_bug_list_autogen.h" |
8 #include "gpu/config/gpu_driver_bug_workaround_type.h" | 9 #include "gpu/config/gpu_driver_bug_workaround_type.h" |
9 #include "gpu/config/gpu_switches.h" | 10 #include "gpu/config/gpu_switches.h" |
10 #include "gpu/config/gpu_util.h" | 11 #include "gpu/config/gpu_util.h" |
11 | 12 |
12 namespace gpu { | 13 namespace gpu { |
13 | 14 |
14 namespace { | 15 namespace { |
15 | 16 |
16 struct GpuDriverBugWorkaroundInfo { | 17 struct GpuDriverBugWorkaroundInfo { |
17 GpuDriverBugWorkaroundType type; | 18 GpuDriverBugWorkaroundType type; |
18 const char* name; | 19 const char* name; |
19 }; | 20 }; |
20 | 21 |
21 const GpuDriverBugWorkaroundInfo kFeatureList[] = { | 22 const GpuDriverBugWorkaroundInfo kFeatureList[] = { |
22 #define GPU_OP(type, name) { type, #name }, | 23 #define GPU_OP(type, name) { type, #name }, |
23 GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP) | 24 GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP) |
24 #undef GPU_OP | 25 #undef GPU_OP |
25 }; | 26 }; |
26 | 27 |
27 } // namespace anonymous | 28 } // namespace anonymous |
28 | 29 |
29 GpuDriverBugList::GpuDriverBugList() | 30 GpuDriverBugList::GpuDriverBugList(const GpuControlListData& data) |
30 : GpuControlList() { | 31 : GpuControlList(data) {} |
31 } | |
32 | 32 |
33 GpuDriverBugList::~GpuDriverBugList() { | 33 GpuDriverBugList::~GpuDriverBugList() { |
34 } | 34 } |
35 | 35 |
36 // static | 36 // static |
37 GpuDriverBugList* GpuDriverBugList::Create() { | 37 std::unique_ptr<GpuDriverBugList> GpuDriverBugList::Create() { |
38 GpuDriverBugList* list = new GpuDriverBugList(); | 38 GpuControlListData data(kGpuDriverBugListVersion, kGpuDriverBugListEntryCount, |
| 39 kGpuDriverBugListEntries); |
| 40 return Create(data); |
| 41 } |
| 42 |
| 43 // static |
| 44 std::unique_ptr<GpuDriverBugList> GpuDriverBugList::Create( |
| 45 const GpuControlListData& data) { |
| 46 std::unique_ptr<GpuDriverBugList> list(new GpuDriverBugList(data)); |
39 | 47 |
40 DCHECK_EQ(static_cast<int>(arraysize(kFeatureList)), | 48 DCHECK_EQ(static_cast<int>(arraysize(kFeatureList)), |
41 NUMBER_OF_GPU_DRIVER_BUG_WORKAROUND_TYPES); | 49 NUMBER_OF_GPU_DRIVER_BUG_WORKAROUND_TYPES); |
42 for (int i = 0; i < NUMBER_OF_GPU_DRIVER_BUG_WORKAROUND_TYPES; ++i) { | 50 for (int i = 0; i < NUMBER_OF_GPU_DRIVER_BUG_WORKAROUND_TYPES; ++i) { |
43 list->AddSupportedFeature(kFeatureList[i].name, | 51 list->AddSupportedFeature(kFeatureList[i].name, |
44 kFeatureList[i].type); | 52 kFeatureList[i].type); |
45 } | 53 } |
46 return list; | 54 return list; |
47 } | 55 } |
48 | 56 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 std::vector<const char*>* workarounds) { | 107 std::vector<const char*>* workarounds) { |
100 workarounds->resize(workarounds->size() + | 108 workarounds->resize(workarounds->size() + |
101 NUMBER_OF_GPU_DRIVER_BUG_WORKAROUND_TYPES); | 109 NUMBER_OF_GPU_DRIVER_BUG_WORKAROUND_TYPES); |
102 | 110 |
103 #define GPU_OP(type, name) workarounds->push_back(#name); | 111 #define GPU_OP(type, name) workarounds->push_back(#name); |
104 GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP) | 112 GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP) |
105 #undef GPU_OP | 113 #undef GPU_OP |
106 } | 114 } |
107 | 115 |
108 } // namespace gpu | 116 } // namespace gpu |
109 | |
OLD | NEW |