| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_BROWSER_GPU_GPU_DATA_MANAGER_H_ | 5 #ifndef CONTENT_BROWSER_GPU_GPU_DATA_MANAGER_H_ |
| 6 #define CONTENT_BROWSER_GPU_GPU_DATA_MANAGER_H_ | 6 #define CONTENT_BROWSER_GPU_GPU_DATA_MANAGER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 static GpuDataManager* GetInstance(); | 28 static GpuDataManager* GetInstance(); |
| 29 | 29 |
| 30 // Requests complete GPUinfo if it has not already been requested | 30 // Requests complete GPUinfo if it has not already been requested |
| 31 void RequestCompleteGpuInfoIfNeeded(); | 31 void RequestCompleteGpuInfoIfNeeded(); |
| 32 | 32 |
| 33 // Only update if the current GPUInfo is not finalized. | 33 // Only update if the current GPUInfo is not finalized. |
| 34 void UpdateGpuInfo(const GPUInfo& gpu_info); | 34 void UpdateGpuInfo(const GPUInfo& gpu_info); |
| 35 | 35 |
| 36 const GPUInfo& gpu_info() const; | 36 const GPUInfo& gpu_info() const; |
| 37 | 37 |
| 38 // Returns status of various GPU features. Return type is | 38 // Returns status of various GPU features. This is two parted: |
| 39 // GpuBlacklist::GetFeatureStatus, or NULL if blacklist is | 39 // { |
| 40 // uninitialized. Caller is responsible for deleting the returned value. | 40 // featureStatus: [] |
| 41 // problems: [] |
| 42 // } |
| 43 // |
| 44 // Each entry in feature_status has: |
| 45 // { |
| 46 // name: "name of feature" |
| 47 // status: "enabled" | "unavailable_software" | "unavailable_off" | |
| 48 // "software" | "disabled_off" | "disabled_softare"; |
| 49 // } |
| 50 // |
| 51 // The features reported are not 1:1 with GpuFeatureType. Rather, they are: |
| 52 // '2d_canvas' |
| 53 // '3d_css' |
| 54 // 'composting', |
| 55 // 'webgl', |
| 56 // 'multisampling' |
| 57 // |
| 58 // Each problems has: |
| 59 // { |
| 60 // "description": "Your GPU is too old", |
| 61 // "crBugs": [1234], |
| 62 // "webkitBugs": [] |
| 63 // } |
| 64 // |
| 65 // Caller is responsible for deleting the returned value. |
| 41 Value* GetFeatureStatus(); | 66 Value* GetFeatureStatus(); |
| 42 | 67 |
| 43 std::string GetBlacklistVersion() const; | 68 std::string GetBlacklistVersion() const; |
| 44 | 69 |
| 45 void AddLogMessage(Value* msg); | 70 void AddLogMessage(Value* msg); |
| 46 | 71 |
| 47 const ListValue& log_messages() const; | 72 const ListValue& log_messages() const; |
| 48 | 73 |
| 49 // Can be called on any thread. | 74 // Can be called on any thread. |
| 50 GpuFeatureFlags GetGpuFeatureFlags(); | 75 GpuFeatureFlags GetGpuFeatureFlags(); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 61 void AddGpuInfoUpdateCallback(Callback0::Type* callback); | 86 void AddGpuInfoUpdateCallback(Callback0::Type* callback); |
| 62 | 87 |
| 63 // Remove a callback. | 88 // Remove a callback. |
| 64 // Returns true if removed, or false if it was not found. | 89 // Returns true if removed, or false if it was not found. |
| 65 bool RemoveGpuInfoUpdateCallback(Callback0::Type* callback); | 90 bool RemoveGpuInfoUpdateCallback(Callback0::Type* callback); |
| 66 | 91 |
| 67 // Inserting disable-feature switches into renderer process command-line | 92 // Inserting disable-feature switches into renderer process command-line |
| 68 // in correspondance to preliminary gpu feature flags. | 93 // in correspondance to preliminary gpu feature flags. |
| 69 void AppendRendererCommandLine(CommandLine* command_line); | 94 void AppendRendererCommandLine(CommandLine* command_line); |
| 70 | 95 |
| 96 // Inserting switches into gpu process command-line: kUseGL, |
| 97 // kDisableGLMultisampling. |
| 98 void AppendGpuCommandLine(CommandLine* command_line); |
| 99 |
| 71 // Gives ownership of the built-in blacklist. This is always called on the | 100 // Gives ownership of the built-in blacklist. This is always called on the |
| 72 // UI thread. | 101 // UI thread. |
| 73 void SetBuiltInGpuBlacklist(GpuBlacklist* built_in_list); | 102 void SetBuiltInGpuBlacklist(GpuBlacklist* built_in_list); |
| 74 | 103 |
| 75 // Gives ownership of the latest blacklist. This is always called on the UI | 104 // Gives ownership of the latest blacklist. This is always called on the UI |
| 76 // thread. | 105 // thread. |
| 77 // TODO(zmo): Get rid of preliminary because it should not be exposed to | 106 // TODO(zmo): Get rid of preliminary because it should not be exposed to |
| 78 // outside GpuDataManager. | 107 // outside GpuDataManager. |
| 79 void UpdateGpuBlacklist(GpuBlacklist* updated_list, bool preliminary); | 108 void UpdateGpuBlacklist(GpuBlacklist* updated_list, bool preliminary); |
| 80 | 109 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 std::set<Callback0::Type*> gpu_info_update_callbacks_; | 144 std::set<Callback0::Type*> gpu_info_update_callbacks_; |
| 116 | 145 |
| 117 ListValue log_messages_; | 146 ListValue log_messages_; |
| 118 | 147 |
| 119 DISALLOW_COPY_AND_ASSIGN(GpuDataManager); | 148 DISALLOW_COPY_AND_ASSIGN(GpuDataManager); |
| 120 }; | 149 }; |
| 121 | 150 |
| 122 DISABLE_RUNNABLE_METHOD_REFCOUNT(GpuDataManager); | 151 DISABLE_RUNNABLE_METHOD_REFCOUNT(GpuDataManager); |
| 123 | 152 |
| 124 #endif // CONTENT_BROWSER_GPU_GPU_DATA_MANAGER_H_ | 153 #endif // CONTENT_BROWSER_GPU_GPU_DATA_MANAGER_H_ |
| OLD | NEW |