summaryrefslogtreecommitdiffstats
path: root/chrome/common/gpu_feature_flags.cc
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2011-01-16 15:17:15 +0000
committerBen Murdoch <benm@google.com>2011-01-16 15:18:37 +0000
commitac1e49eb6695f711d72215fcdf9388548942a00d (patch)
tree88c78e7d66603996cf0dc78d7676b11d57a305bd /chrome/common/gpu_feature_flags.cc
parentdac52a1b6f0c401bccca1e5713f782a8b26345b3 (diff)
downloadexternal_chromium-ac1e49eb6695f711d72215fcdf9388548942a00d.zip
external_chromium-ac1e49eb6695f711d72215fcdf9388548942a00d.tar.gz
external_chromium-ac1e49eb6695f711d72215fcdf9388548942a00d.tar.bz2
Merge Chromium at 9.0.597.69: Trivial merge by Git.
/branches/597/src@71538 Change-Id: Id9fad65a5e6d2ab901d9c8bff6dbf96ab7977f36
Diffstat (limited to 'chrome/common/gpu_feature_flags.cc')
-rw-r--r--chrome/common/gpu_feature_flags.cc45
1 files changed, 45 insertions, 0 deletions
diff --git a/chrome/common/gpu_feature_flags.cc b/chrome/common/gpu_feature_flags.cc
new file mode 100644
index 0000000..12b857b
--- /dev/null
+++ b/chrome/common/gpu_feature_flags.cc
@@ -0,0 +1,45 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/common/gpu_feature_flags.h"
+
+#include "base/logging.h"
+
+const char GpuFeatureFlags::kGpuFeatureNameAccelerated2dCanvas[] =
+ "accelerated_2d_canvas";
+const char GpuFeatureFlags::kGpuFeatureNameAcceleratedCompositing[] =
+ "accelerated_compositing";
+const char GpuFeatureFlags::kGpuFeatureNameWebgl[] = "webgl";
+const char GpuFeatureFlags::kGpuFeatureNameAll[] = "all";
+
+GpuFeatureFlags::GpuFeatureFlags()
+ : flags_(0) {
+}
+
+void GpuFeatureFlags::set_flags(uint32 flags) {
+ DCHECK_EQ(flags & (~kGpuFeatureAll), 0u);
+ flags_ = flags;
+}
+
+uint32 GpuFeatureFlags::flags() const {
+ return flags_;
+}
+
+void GpuFeatureFlags::Combine(const GpuFeatureFlags& other) {
+ flags_ |= other.flags_;
+}
+
+GpuFeatureFlags::GpuFeatureType GpuFeatureFlags::StringToGpuFeatureType(
+ const std::string& feature_string) {
+ if (feature_string == kGpuFeatureNameAccelerated2dCanvas)
+ return kGpuFeatureAccelerated2dCanvas;
+ else if (feature_string == kGpuFeatureNameAcceleratedCompositing)
+ return kGpuFeatureAcceleratedCompositing;
+ else if (feature_string == kGpuFeatureNameWebgl)
+ return kGpuFeatureWebgl;
+ else if (feature_string == kGpuFeatureNameAll)
+ return kGpuFeatureAll;
+ return kGpuFeatureUnknown;
+}
+