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

Unified Diff: chrome/common/gpu_feature_flags.h

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: Fixed the unittest issues. 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.h
===================================================================
--- chrome/common/gpu_feature_flags.h (revision 0)
+++ chrome/common/gpu_feature_flags.h (revision 0)
@@ -0,0 +1,54 @@
+// 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.
+
+#ifndef CHROME_COMMON_GPU_FEATURE_FLAGS_H__
+#define CHROME_COMMON_GPU_FEATURE_FLAGS_H__
+#pragma once
+
+// Provides flags indicating which gpu features are blacklisted for the system
+// on which chrome is currently running.
+
+#include <string>
+
+#include "base/basictypes.h"
+
+class GpuFeatureFlags {
+ public:
+ enum GpuFeatureType {
+ kGpuFeatureAccelerated2dCanvas = 1,
vangelis 2010/12/10 18:17:24 Since you're expecting to be able to do binary ope
+ kGpuFeatureAcceleratedCompositing = 2,
+ kGpuFeatureWebgl = 4,
+ kGpuFeatureUnknown = 0
+ };
+
+ // All flags initialized to false, i.e., no feature is blacklisted.
+ GpuFeatureFlags();
+
+ // flags are OR combination of GpuFeatureType.
+ void set_flags(uint32 flags);
+
+ uint32 flags() const;
+
+ // Resets each flag by OR with the corresponding flag in "other".
+ void Combine(const GpuFeatureFlags& other);
+
+ // Maps string to GpuFeatureType; returns kGpuFeatureUnknown if none of the
+ // following is input (case-sensitive):
+ // "accelerated_2d_canvas"
+ // "accelerated_compositing"
+ // "webgl"
+ static GpuFeatureType StringToGpuFeatureType(
+ const std::string& feature_string);
+
+ private:
+ static const char kGpuFeatureNameAccelerated2dCanvas[];
+ static const char kGpuFeatureNameAcceleratedCompositing[];
+ static const char kGpuFeatureNameWebgl[];
+
+ // If a bit is set to 1, corresponding feature is blacklisted.
+ uint32 flags_;
+};
+
+#endif // CHROME_COMMON_GPU_FEATURE_FLAGS_H__
+

Powered by Google App Engine
This is Rietveld 408576698