| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2017 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 CONTENT_PUBLIC_BROWSER_GPU_FEATURE_CHECKER_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_GPU_FEATURE_CHECKER_H_ |
| 7 |
| 8 #include "base/callback_forward.h" |
| 9 #include "base/memory/ref_counted.h" |
| 10 #include "content/common/content_export.h" |
| 11 #include "gpu/config/gpu_feature_type.h" |
| 12 |
| 13 namespace content { |
| 14 |
| 15 class GpuFeatureChecker : public base::RefCountedThreadSafe<GpuFeatureChecker> { |
| 16 public: |
| 17 typedef base::Callback<void(bool feature_available)> FeatureAvailableCallback; |
| 18 |
| 19 CONTENT_EXPORT static scoped_refptr<GpuFeatureChecker> Create( |
| 20 gpu::GpuFeatureType feature, |
| 21 FeatureAvailableCallback callback); |
| 22 |
| 23 // Checks to see if |feature_| is available on the current GPU. |callback_| |
| 24 // will be called to indicate the availability of the feature. Must be called |
| 25 // from the the UI thread. |
| 26 virtual void CheckGpuFeatureAvailability() = 0; |
| 27 |
| 28 protected: |
| 29 friend class base::RefCountedThreadSafe<GpuFeatureChecker>; |
| 30 |
| 31 virtual ~GpuFeatureChecker(); |
| 32 }; |
| 33 |
| 34 } // namespace content |
| 35 |
| 36 #endif // CONTENT_PUBLIC_BROWSER_GPU_FEATURE_CHECKER_H_ |
| OLD | NEW |