| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_GPU_GPU_FEATURE_CHECKER_H_ | |
| 6 #define CHROME_BROWSER_GPU_GPU_FEATURE_CHECKER_H_ | |
| 7 | |
| 8 #include "base/callback.h" | |
| 9 #include "base/macros.h" | |
| 10 #include "base/memory/ref_counted.h" | |
| 11 #include "content/public/browser/gpu_data_manager_observer.h" | |
| 12 #include "gpu/config/gpu_feature_type.h" | |
| 13 | |
| 14 class GPUFeatureChecker : public base::RefCountedThreadSafe<GPUFeatureChecker>, | |
| 15 public content::GpuDataManagerObserver { | |
| 16 public: | |
| 17 typedef base::Callback<void(bool feature_available)> FeatureAvailableCallback; | |
| 18 | |
| 19 GPUFeatureChecker(gpu::GpuFeatureType feature, | |
| 20 FeatureAvailableCallback callback); | |
| 21 | |
| 22 // Check to see if |feature_| is available on the current GPU. |callback_| | |
| 23 // will be called to indicate the availability of the feature. Must be called | |
| 24 // from the the UI thread. | |
| 25 void CheckGPUFeatureAvailability(); | |
| 26 | |
| 27 // content::GpuDataManagerObserver | |
| 28 void OnGpuInfoUpdate() override; | |
| 29 | |
| 30 private: | |
| 31 friend class base::RefCountedThreadSafe<GPUFeatureChecker>; | |
| 32 | |
| 33 ~GPUFeatureChecker() override; | |
| 34 | |
| 35 gpu::GpuFeatureType feature_; | |
| 36 FeatureAvailableCallback callback_; | |
| 37 | |
| 38 DISALLOW_COPY_AND_ASSIGN(GPUFeatureChecker); | |
| 39 }; | |
| 40 | |
| 41 #endif // CHROME_BROWSER_GPU_GPU_FEATURE_CHECKER_H_ | |
| OLD | NEW |