Avi Drissman | 4e1b7bc3 | 2022-09-15 14:03:50 | [diff] [blame] | 1 | // Copyright 2013 The Chromium Authors |
[email protected] | b7c4f03 | 2012-08-07 16:38:56 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. | ||||
4 | |||||
[email protected] | 1515493 | 2013-08-21 03:27:24 | [diff] [blame] | 5 | #ifndef CONTENT_BROWSER_GPU_COMPOSITOR_UTIL_H_ |
6 | #define CONTENT_BROWSER_GPU_COMPOSITOR_UTIL_H_ | ||||
[email protected] | b7c4f03 | 2012-08-07 16:38:56 | [diff] [blame] | 7 | |
jdoerrie | 664305c | 2017-06-07 08:34:34 | [diff] [blame] | 8 | #include <memory> |
Jonathan Backer | 76dfd50 | 2018-05-03 18:34:31 | [diff] [blame] | 9 | #include <string> |
Victor Miura | cabdfac | 2018-01-05 02:18:18 | [diff] [blame] | 10 | #include <vector> |
jdoerrie | 664305c | 2017-06-07 08:34:34 | [diff] [blame] | 11 | |
[email protected] | f454eed | 2013-10-16 05:48:02 | [diff] [blame] | 12 | #include "base/values.h" |
[email protected] | b7c4f03 | 2012-08-07 16:38:56 | [diff] [blame] | 13 | |
14 | namespace content { | ||||
15 | |||||
[email protected] | 50cf199 | 2014-03-29 00:06:00 | [diff] [blame] | 16 | // Note: When adding a function here, please make sure the logic is not |
17 | // duplicated in the renderer. | ||||
18 | |||||
danakj | 0977ec8 | 2015-01-13 01:54:34 | [diff] [blame] | 19 | // Returns true if zero-copy uploads is on (via flags, or platform default). |
20 | // Only one of one-copy and zero-copy can be enabled at a time. | ||||
Lei Zhang | ed9be3a | 2021-11-17 22:01:18 | [diff] [blame] | 21 | bool IsZeroCopyUploadEnabled(); |
danakj | 0977ec8 | 2015-01-13 01:54:34 | [diff] [blame] | 22 | |
ericrk | 1d17f75 | 2015-10-20 03:03:07 | [diff] [blame] | 23 | // Returns true if a partial raster is on (via flags). |
Lei Zhang | ed9be3a | 2021-11-17 22:01:18 | [diff] [blame] | 24 | bool IsPartialRasterEnabled(); |
jbroman | 5f7f7193 | 2015-08-18 16:24:46 | [diff] [blame] | 25 | |
ccameron | c7fcd13 | 2015-11-03 20:14:31 | [diff] [blame] | 26 | // Returns true if all compositor resources should use GPU memory buffers. |
Lei Zhang | ed9be3a | 2021-11-17 22:01:18 | [diff] [blame] | 27 | bool IsGpuMemoryBufferCompositorResourcesEnabled(); |
ccameron | c7fcd13 | 2015-11-03 20:14:31 | [diff] [blame] | 28 | |
senorblanco | b60ba95 | 2015-01-27 19:12:36 | [diff] [blame] | 29 | // Returns the number of multisample antialiasing samples (via flags) for |
30 | // GPU rasterization. | ||||
Lei Zhang | ed9be3a | 2021-11-17 22:01:18 | [diff] [blame] | 31 | int GpuRasterizationMSAASampleCount(); |
senorblanco | b60ba95 | 2015-01-27 19:12:36 | [diff] [blame] | 32 | |
danakj | 8a91b03 | 2014-08-30 00:04:22 | [diff] [blame] | 33 | // Returns the number of raster threads to use for compositing. |
Lei Zhang | ed9be3a | 2021-11-17 22:01:18 | [diff] [blame] | 34 | int NumberOfRendererRasterThreads(); |
danakj | 8a91b03 | 2014-08-30 00:04:22 | [diff] [blame] | 35 | |
sunnyps | 3fe3c98 | 2016-05-18 00:22:46 | [diff] [blame] | 36 | // Returns true if main thread can be pipelined with activation. |
Lei Zhang | ed9be3a | 2021-11-17 22:01:18 | [diff] [blame] | 37 | bool IsMainFrameBeforeActivationEnabled(); |
sunnyps | 3fe3c98 | 2016-05-18 00:22:46 | [diff] [blame] | 38 | |
Lei Zhang | ed9be3a | 2021-11-17 22:01:18 | [diff] [blame] | 39 | base::Value GetFeatureStatus(); |
40 | base::Value GetProblems(); | ||||
41 | std::vector<std::string> GetDriverBugWorkarounds(); | ||||
[email protected] | f454eed | 2013-10-16 05:48:02 | [diff] [blame] | 42 | |
Lei Zhang | ed9be3a | 2021-11-17 22:01:18 | [diff] [blame] | 43 | base::Value GetFeatureStatusForHardwareGpu(); |
44 | base::Value GetProblemsForHardwareGpu(); | ||||
45 | std::vector<std::string> GetDriverBugWorkaroundsForHardwareGpu(); | ||||
Zhenyao Mo | 68ef56d | 2018-04-21 01:05:10 | [diff] [blame] | 46 | |
[email protected] | b7c4f03 | 2012-08-07 16:38:56 | [diff] [blame] | 47 | } // namespace content |
48 | |||||
[email protected] | 1515493 | 2013-08-21 03:27:24 | [diff] [blame] | 49 | #endif // CONTENT_BROWSER_GPU_COMPOSITOR_UTIL_H_ |