| Index: chrome/common/gpu_feature_flags.cc
|
| ===================================================================
|
| --- chrome/common/gpu_feature_flags.cc (revision 0)
|
| +++ chrome/common/gpu_feature_flags.cc (revision 0)
|
| @@ -0,0 +1,44 @@
|
| +// 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";
|
| +
|
| +GpuFeatureFlags::GpuFeatureFlags()
|
| + : flags_(0) {
|
| +}
|
| +
|
| +void GpuFeatureFlags::set_flags(uint32 flags) {
|
| + DCHECK_EQ(flags & (~(kGpuFeatureAccelerated2dCanvas |
|
| + kGpuFeatureAcceleratedCompositing |
|
| + kGpuFeatureWebgl)), 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;
|
| + return kGpuFeatureUnknown;
|
| +}
|
| +
|
|
|