Chromium Code Reviews

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

Issue 5612002: Blacklist bad GPU drivers: currenly we disable all gpu related features if th... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: removing one garbage line in the code Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | | Annotate | Revision Log
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 const char GpuFeatureFlags::kGpuFeatureNameAccelerated2dCanvas[] =
8 "accelerated_2d_canvas";
9 const char GpuFeatureFlags::kGpuFeatureNameAcceleratedCompositing[] =
10 "accelerated_compositing";
11 const char GpuFeatureFlags::kGpuFeatureNameWebgl[] = "webgl";
12 const char GpuFeatureFlags::kGpuFeatureNameAny[] = "any";
13
14 GpuFeatureFlags::GpuFeatureFlags()
15 : is_accelerated_2d_canvas_blacklisted_(false),
16 is_accelerated_compositing_blacklisted_(false),
17 is_webgl_blacklisted_(false) {
18 }
19
20 void GpuFeatureFlags::SetFlags(bool is_accelerated_2d_canvas_blacklisted,
21 bool is_accelerated_compositing_blacklisted,
22 bool is_webgl_blacklisted) {
23 is_accelerated_2d_canvas_blacklisted_ = is_accelerated_2d_canvas_blacklisted;
24 is_accelerated_compositing_blacklisted_ =
25 is_accelerated_compositing_blacklisted;
26 is_webgl_blacklisted_ = is_webgl_blacklisted;
27 }
28
29 bool GpuFeatureFlags::is_accelerated_2d_canvas_blacklisted() const {
30 return is_accelerated_2d_canvas_blacklisted_;
31 }
32
33 bool GpuFeatureFlags::is_accelerated_compositing_blacklisted() const {
34 return is_accelerated_compositing_blacklisted_;
35 }
36
37 bool GpuFeatureFlags::is_webgl_blacklisted() const {
38 return is_webgl_blacklisted_;
39 }
40
41 void GpuFeatureFlags::Combine(const GpuFeatureFlags& other) {
42 is_accelerated_2d_canvas_blacklisted_ =
43 (is_accelerated_2d_canvas_blacklisted_ ||
44 other.is_accelerated_2d_canvas_blacklisted_);
45 is_accelerated_compositing_blacklisted_ =
46 (is_accelerated_compositing_blacklisted_ ||
47 other.is_accelerated_compositing_blacklisted_);
48 is_webgl_blacklisted_ =
49 (is_webgl_blacklisted_ || other.is_webgl_blacklisted_);
50 }
51
52 GpuFeatureFlags::GpuFeatureType GpuFeatureFlags::StringToGpuFeatureType(
53 const std::string& feature_string) {
54 if (feature_string == kGpuFeatureNameAccelerated2dCanvas)
55 return kGpuFeatureAccelerated2dCanvas;
56 else if (feature_string == kGpuFeatureNameAcceleratedCompositing)
57 return kGpuFeatureAcceleratedCompositing;
58 else if (feature_string == kGpuFeatureNameWebgl)
59 return kGpuFeatureWebgl;
60 else if (feature_string == kGpuFeatureNameAny)
61 return kGpuFeatureAny;
62 return kGpuFeatureUnknown;
63 }
64
OLDNEW

Powered by Google App Engine