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

Unified 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. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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,64 @@
+// 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"
+
+const char GpuFeatureFlags::kGpuFeatureNameAccelerated2dCanvas[] =
+ "accelerated_2d_canvas";
+const char GpuFeatureFlags::kGpuFeatureNameAcceleratedCompositing[] =
+ "accelerated_compositing";
+const char GpuFeatureFlags::kGpuFeatureNameWebgl[] = "webgl";
+const char GpuFeatureFlags::kGpuFeatureNameAny[] = "any";
+
+GpuFeatureFlags::GpuFeatureFlags()
+ : is_accelerated_2d_canvas_blacklisted_(false),
+ is_accelerated_compositing_blacklisted_(false),
+ is_webgl_blacklisted_(false) {
+}
+
+void GpuFeatureFlags::SetFlags(bool is_accelerated_2d_canvas_blacklisted,
+ bool is_accelerated_compositing_blacklisted,
+ bool is_webgl_blacklisted) {
+ is_accelerated_2d_canvas_blacklisted_ = is_accelerated_2d_canvas_blacklisted;
+ is_accelerated_compositing_blacklisted_ =
+ is_accelerated_compositing_blacklisted;
+ is_webgl_blacklisted_ = is_webgl_blacklisted;
+}
+
+bool GpuFeatureFlags::is_accelerated_2d_canvas_blacklisted() const {
+ return is_accelerated_2d_canvas_blacklisted_;
+}
+
+bool GpuFeatureFlags::is_accelerated_compositing_blacklisted() const {
+ return is_accelerated_compositing_blacklisted_;
+}
+
+bool GpuFeatureFlags::is_webgl_blacklisted() const {
+ return is_webgl_blacklisted_;
+}
+
+void GpuFeatureFlags::Combine(const GpuFeatureFlags& other) {
+ is_accelerated_2d_canvas_blacklisted_ =
+ (is_accelerated_2d_canvas_blacklisted_ ||
+ other.is_accelerated_2d_canvas_blacklisted_);
+ is_accelerated_compositing_blacklisted_ =
+ (is_accelerated_compositing_blacklisted_ ||
+ other.is_accelerated_compositing_blacklisted_);
+ is_webgl_blacklisted_ =
+ (is_webgl_blacklisted_ || other.is_webgl_blacklisted_);
+}
+
+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 == kGpuFeatureNameAny)
+ return kGpuFeatureAny;
+ return kGpuFeatureUnknown;
+}
+

Powered by Google App Engine
This is Rietveld 408576698