Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1244)

Side by Side Diff: chrome/common/gpu_feature_flags.cc

Issue 6672064: Move gpu_feature_flags from chrome\common to content\browser since it's only ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/common/gpu_feature_flags.h ('k') | chrome/common/gpu_feature_flags_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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
OLDNEW
« no previous file with comments | « chrome/common/gpu_feature_flags.h ('k') | chrome/common/gpu_feature_flags_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698