OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef CONTENT_COMMON_GPU_GPU_FEATURE_FLAGS_H_ | 5 #ifndef CONTENT_COMMON_GPU_GPU_FEATURE_FLAGS_H_ |
6 #define CONTENT_COMMON_GPU_GPU_FEATURE_FLAGS_H_ | 6 #define CONTENT_COMMON_GPU_GPU_FEATURE_FLAGS_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 // Provides flags indicating which gpu features are blacklisted for the system | 9 // Provides flags indicating which gpu features are blacklisted for the system |
10 // on which chrome is currently running. | 10 // on which chrome is currently running. |
11 | 11 |
12 #include <string> | 12 #include <string> |
13 | 13 |
14 #include "base/basictypes.h" | 14 #include "base/basictypes.h" |
| 15 #include "content/common/content_export.h" |
15 | 16 |
16 class GpuFeatureFlags { | 17 class GpuFeatureFlags { |
17 public: | 18 public: |
18 enum GpuFeatureType { | 19 enum GpuFeatureType { |
19 kGpuFeatureAccelerated2dCanvas = 1 << 0, | 20 kGpuFeatureAccelerated2dCanvas = 1 << 0, |
20 kGpuFeatureAcceleratedCompositing = 1 << 1, | 21 kGpuFeatureAcceleratedCompositing = 1 << 1, |
21 kGpuFeatureWebgl = 1 << 2, | 22 kGpuFeatureWebgl = 1 << 2, |
22 kGpuFeatureMultisampling = 1 << 3, | 23 kGpuFeatureMultisampling = 1 << 3, |
23 kGpuFeatureAll = kGpuFeatureAccelerated2dCanvas | | 24 kGpuFeatureAll = kGpuFeatureAccelerated2dCanvas | |
24 kGpuFeatureAcceleratedCompositing | | 25 kGpuFeatureAcceleratedCompositing | |
25 kGpuFeatureWebgl | | 26 kGpuFeatureWebgl | |
26 kGpuFeatureMultisampling, | 27 kGpuFeatureMultisampling, |
27 kGpuFeatureUnknown = 0 | 28 kGpuFeatureUnknown = 0 |
28 }; | 29 }; |
29 | 30 |
30 // All flags initialized to false, i.e., no feature is blacklisted. | 31 // All flags initialized to false, i.e., no feature is blacklisted. |
31 GpuFeatureFlags(); | 32 GpuFeatureFlags(); |
32 | 33 |
33 // flags are OR combination of GpuFeatureType. | 34 // flags are OR combination of GpuFeatureType. |
34 void set_flags(uint32 flags); | 35 void set_flags(uint32 flags); |
35 | 36 |
36 uint32 flags() const; | 37 CONTENT_EXPORT uint32 flags() const; |
37 | 38 |
38 // Resets each flag by OR with the corresponding flag in "other". | 39 // Resets each flag by OR with the corresponding flag in "other". |
39 void Combine(const GpuFeatureFlags& other); | 40 void Combine(const GpuFeatureFlags& other); |
40 | 41 |
41 // Maps string to GpuFeatureType; returns kGpuFeatureUnknown if none of the | 42 // Maps string to GpuFeatureType; returns kGpuFeatureUnknown if none of the |
42 // following is input (case-sensitive): | 43 // following is input (case-sensitive): |
43 // "accelerated_2d_canvas" | 44 // "accelerated_2d_canvas" |
44 // "accelerated_compositing" | 45 // "accelerated_compositing" |
45 // "webgl" | 46 // "webgl" |
46 // "multisampling" | 47 // "multisampling" |
(...skipping 11 matching lines...) Expand all Loading... |
58 static const char kGpuFeatureNameWebgl[]; | 59 static const char kGpuFeatureNameWebgl[]; |
59 static const char kGpuFeatureNameMultisampling[]; | 60 static const char kGpuFeatureNameMultisampling[]; |
60 static const char kGpuFeatureNameAll[]; | 61 static const char kGpuFeatureNameAll[]; |
61 static const char kGpuFeatureNameUnknown[]; | 62 static const char kGpuFeatureNameUnknown[]; |
62 | 63 |
63 // If a bit is set to 1, corresponding feature is blacklisted. | 64 // If a bit is set to 1, corresponding feature is blacklisted. |
64 uint32 flags_; | 65 uint32 flags_; |
65 }; | 66 }; |
66 | 67 |
67 #endif // CONTENT_COMMON_GPU_GPU_FEATURE_FLAGS_H_ | 68 #endif // CONTENT_COMMON_GPU_GPU_FEATURE_FLAGS_H_ |
OLD | NEW |