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_workaround_type.h" | 8 #include "gpu/config/gpu_driver_bug_list_autogen.h" |
9 #include "gpu/config/gpu_switches.h" | 9 #include "gpu/config/gpu_switches.h" |
10 #include "gpu/config/gpu_util.h" | 10 #include "gpu/config/gpu_util.h" |
11 | 11 |
12 namespace gpu { | 12 namespace gpu { |
13 | 13 |
14 namespace { | 14 namespace { |
15 | 15 |
16 struct GpuDriverBugWorkaroundInfo { | 16 struct GpuDriverBugWorkaroundInfo { |
17 GpuDriverBugWorkaroundType type; | 17 GpuDriverBugWorkaroundType type; |
18 const char* name; | 18 const char* name; |
19 }; | 19 }; |
20 | 20 |
21 const GpuDriverBugWorkaroundInfo kFeatureList[] = { | 21 const GpuDriverBugWorkaroundInfo kFeatureList[] = { |
22 #define GPU_OP(type, name) { type, #name }, | 22 #define GPU_OP(type, name) { type, #name }, |
23 GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP) | 23 GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP) |
24 #undef GPU_OP | 24 #undef GPU_OP |
25 }; | 25 }; |
26 | 26 |
27 } // namespace anonymous | 27 } // namespace anonymous |
28 | 28 |
29 GpuDriverBugList::GpuDriverBugList() | 29 GpuDriverBugList::GpuDriverBugList(const GpuControlListData& data) |
30 : GpuControlList() { | 30 : GpuControlList(data) {} |
31 } | |
32 | 31 |
33 GpuDriverBugList::~GpuDriverBugList() { | 32 GpuDriverBugList::~GpuDriverBugList() { |
34 } | 33 } |
35 | 34 |
36 // static | 35 // static |
37 GpuDriverBugList* GpuDriverBugList::Create() { | 36 GpuDriverBugList* GpuDriverBugList::Create() { |
38 GpuDriverBugList* list = new GpuDriverBugList(); | 37 GpuControlListData data(kGpuDriverBugListVersion, kGpuDriverBugListEntryCount, |
| 38 kGpuDriverBugListEntries); |
| 39 return Create(data); |
| 40 } |
| 41 |
| 42 // static |
| 43 GpuDriverBugList* GpuDriverBugList::Create(const GpuControlListData& data) { |
| 44 GpuDriverBugList* list = new GpuDriverBugList(data); |
39 | 45 |
40 DCHECK_EQ(static_cast<int>(arraysize(kFeatureList)), | 46 DCHECK_EQ(static_cast<int>(arraysize(kFeatureList)), |
41 NUMBER_OF_GPU_DRIVER_BUG_WORKAROUND_TYPES); | 47 NUMBER_OF_GPU_DRIVER_BUG_WORKAROUND_TYPES); |
42 for (int i = 0; i < NUMBER_OF_GPU_DRIVER_BUG_WORKAROUND_TYPES; ++i) { | 48 for (int i = 0; i < NUMBER_OF_GPU_DRIVER_BUG_WORKAROUND_TYPES; ++i) { |
43 list->AddSupportedFeature(kFeatureList[i].name, | 49 list->AddSupportedFeature(kFeatureList[i].name, |
44 kFeatureList[i].type); | 50 kFeatureList[i].type); |
45 } | 51 } |
46 return list; | 52 return list; |
47 } | 53 } |
48 | 54 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 workarounds->resize(workarounds->size() + | 106 workarounds->resize(workarounds->size() + |
101 NUMBER_OF_GPU_DRIVER_BUG_WORKAROUND_TYPES); | 107 NUMBER_OF_GPU_DRIVER_BUG_WORKAROUND_TYPES); |
102 | 108 |
103 #define GPU_OP(type, name) workarounds->push_back(#name); | 109 #define GPU_OP(type, name) workarounds->push_back(#name); |
104 GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP) | 110 GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP) |
105 #undef GPU_OP | 111 #undef GPU_OP |
106 } | 112 } |
107 | 113 |
108 } // namespace gpu | 114 } // namespace gpu |
109 | 115 |
OLD | NEW |