Limit tab recording/capture indicator throbs to 3, then stay static.
[chromium-blink-merge.git] / gpu / config / gpu_driver_bug_list.cc
blobd845c1630439d0c3df94650cd44e188992288ca6
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.
5 #include "gpu/config/gpu_driver_bug_list.h"
7 #include "base/basictypes.h"
8 #include "base/logging.h"
9 #include "gpu/config/gpu_driver_bug_workaround_type.h"
11 namespace gpu {
13 namespace {
15 struct DriverBugInfo {
16 int feature_type;
17 std::string feature_name;
20 } // namespace anonymous
22 GpuDriverBugList::GpuDriverBugList()
23 : GpuControlList() {
26 GpuDriverBugList::~GpuDriverBugList() {
29 // static
30 GpuDriverBugList* GpuDriverBugList::Create() {
31 GpuDriverBugList* list = new GpuDriverBugList();
33 const DriverBugInfo kFeatureList[] = {
34 #define GPU_OP(type, name) { type, #name },
35 GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP)
36 #undef GPU_OP
38 DCHECK_EQ(static_cast<int>(arraysize(kFeatureList)),
39 NUMBER_OF_GPU_DRIVER_BUG_WORKAROUND_TYPES);
40 for (int i = 0; i < NUMBER_OF_GPU_DRIVER_BUG_WORKAROUND_TYPES; ++i) {
41 list->AddSupportedFeature(kFeatureList[i].feature_name,
42 kFeatureList[i].feature_type);
44 return list;
47 std::string GpuDriverBugWorkaroundTypeToString(
48 GpuDriverBugWorkaroundType type) {
49 switch (type) {
50 #define GPU_OP(type, name) case type: return #name;
51 GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP)
52 #undef GPU_OP
53 default:
54 return "unknown";
58 } // namespace gpu