| 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 #include "chrome/common/gpu_feature_flags.h" | |
| 6 | |
| 7 #include "base/logging.h" | |
| 8 | |
| 9 const char GpuFeatureFlags::kGpuFeatureNameAccelerated2dCanvas[] = | |
| 10 "accelerated_2d_canvas"; | |
| 11 const char GpuFeatureFlags::kGpuFeatureNameAcceleratedCompositing[] = | |
| 12 "accelerated_compositing"; | |
| 13 const char GpuFeatureFlags::kGpuFeatureNameWebgl[] = "webgl"; | |
| 14 const char GpuFeatureFlags::kGpuFeatureNameMultisampling[] = "multisampling"; | |
| 15 const char GpuFeatureFlags::kGpuFeatureNameAll[] = "all"; | |
| 16 | |
| 17 GpuFeatureFlags::GpuFeatureFlags() | |
| 18 : flags_(0) { | |
| 19 } | |
| 20 | |
| 21 void GpuFeatureFlags::set_flags(uint32 flags) { | |
| 22 DCHECK_EQ(flags & (~kGpuFeatureAll), 0u); | |
| 23 flags_ = flags; | |
| 24 } | |
| 25 | |
| 26 uint32 GpuFeatureFlags::flags() const { | |
| 27 return flags_; | |
| 28 } | |
| 29 | |
| 30 void GpuFeatureFlags::Combine(const GpuFeatureFlags& other) { | |
| 31 flags_ |= other.flags_; | |
| 32 } | |
| 33 | |
| 34 GpuFeatureFlags::GpuFeatureType GpuFeatureFlags::StringToGpuFeatureType( | |
| 35 const std::string& feature_string) { | |
| 36 if (feature_string == kGpuFeatureNameAccelerated2dCanvas) | |
| 37 return kGpuFeatureAccelerated2dCanvas; | |
| 38 else if (feature_string == kGpuFeatureNameAcceleratedCompositing) | |
| 39 return kGpuFeatureAcceleratedCompositing; | |
| 40 else if (feature_string == kGpuFeatureNameWebgl) | |
| 41 return kGpuFeatureWebgl; | |
| 42 else if (feature_string == kGpuFeatureNameMultisampling) | |
| 43 return kGpuFeatureMultisampling; | |
| 44 else if (feature_string == kGpuFeatureNameAll) | |
| 45 return kGpuFeatureAll; | |
| 46 return kGpuFeatureUnknown; | |
| 47 } | |
| 48 | |
| OLD | NEW |