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 #ifndef GPU_CONFIG_GPU_DRIVER_BUG_LIST_H_
6 #define GPU_CONFIG_GPU_DRIVER_BUG_LIST_H_
7 
8 #include <memory>
9 #include <set>
10 
11 #include "base/command_line.h"
12 #include "base/macros.h"
13 #include "gpu/config/gpu_control_list.h"
14 #include "gpu/gpu_export.h"
15 
16 namespace gpu {
17 
18 class GPU_EXPORT GpuDriverBugList : public GpuControlList {
19  public:
20   ~GpuDriverBugList() override;
21 
22   static std::unique_ptr<GpuDriverBugList> Create();
23   static std::unique_ptr<GpuDriverBugList> Create(
24       const GpuControlListData& data);
25 
26   // Append |workarounds| with these passed in through the
27   // |command_line|.
28   static void AppendWorkaroundsFromCommandLine(
29       std::set<int>* workarounds,
30       const base::CommandLine& command_line);
31 
32   // Append |workarounds| with the full list of workarounds.
33   // This is needed for correctly passing flags down from
34   // the browser process to the GPU process.
35   static void AppendAllWorkarounds(std::vector<const char*>* workarounds);
36 
37   static bool AreEntryIndicesValid(const std::vector<uint32_t>& entry_indices);
38 
39  private:
40   explicit GpuDriverBugList(const GpuControlListData& data);
41 
42   DISALLOW_COPY_AND_ASSIGN(GpuDriverBugList);
43 };
44 
45 }  // namespace gpu
46 
47 #endif  // GPU_CONFIG_GPU_DRIVER_BUG_LIST_H_
48