OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2010 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 CHROME_COMMON_GPU_FEATURE_FLAGS_H__ | |
6 #define CHROME_COMMON_GPU_FEATURE_FLAGS_H__ | |
7 #pragma once | |
8 | |
9 // Provides flags indicating which gpu features are blacklisted for the system | |
10 // on which chrome is currently running. | |
11 | |
12 #include <string> | |
13 | |
14 #include "base/basictypes.h" | |
15 | |
16 class GpuFeatureFlags { | |
17 public: | |
18 enum GpuFeatureType { | |
19 kGpuFeatureAccelerated2dCanvas = 1, | |
vangelis
2010/12/10 18:17:24
Since you're expecting to be able to do binary ope
| |
20 kGpuFeatureAcceleratedCompositing = 2, | |
21 kGpuFeatureWebgl = 4, | |
22 kGpuFeatureUnknown = 0 | |
23 }; | |
24 | |
25 // All flags initialized to false, i.e., no feature is blacklisted. | |
26 GpuFeatureFlags(); | |
27 | |
28 // flags are OR combination of GpuFeatureType. | |
29 void set_flags(uint32 flags); | |
30 | |
31 uint32 flags() const; | |
32 | |
33 // Resets each flag by OR with the corresponding flag in "other". | |
34 void Combine(const GpuFeatureFlags& other); | |
35 | |
36 // Maps string to GpuFeatureType; returns kGpuFeatureUnknown if none of the | |
37 // following is input (case-sensitive): | |
38 // "accelerated_2d_canvas" | |
39 // "accelerated_compositing" | |
40 // "webgl" | |
41 static GpuFeatureType StringToGpuFeatureType( | |
42 const std::string& feature_string); | |
43 | |
44 private: | |
45 static const char kGpuFeatureNameAccelerated2dCanvas[]; | |
46 static const char kGpuFeatureNameAcceleratedCompositing[]; | |
47 static const char kGpuFeatureNameWebgl[]; | |
48 | |
49 // If a bit is set to 1, corresponding feature is blacklisted. | |
50 uint32 flags_; | |
51 }; | |
52 | |
53 #endif // CHROME_COMMON_GPU_FEATURE_FLAGS_H__ | |
54 | |
OLD | NEW |