ericrk | 41a1579e | 2017-02-10 20:56:28 | [diff] [blame] | 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 | #include "gpu/config/gpu_finch_features.h" |
| 5 | |
Khushal | b39ecde | 2019-03-06 00:28:56 | [diff] [blame^] | 6 | #if defined(OS_ANDROID) |
| 7 | #include "ui/gl/android/android_surface_control_compat.h" |
| 8 | #endif |
| 9 | |
ericrk | 41a1579e | 2017-02-10 20:56:28 | [diff] [blame] | 10 | namespace features { |
Maggie Chen | 1ecb074 | 2018-11-28 07:27:37 | [diff] [blame] | 11 | #if defined(OS_ANDROID) |
| 12 | // Use android AImageReader when playing videos with MediaPlayer. |
| 13 | const base::Feature kAImageReaderMediaPlayer{"AImageReaderMediaPlayer", |
| 14 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 15 | |
| 16 | // Use android SurfaceControl API for managing display compositor's buffer queue |
| 17 | // and using overlays on Android. |
| 18 | // Note that the feature only works with VizDisplayCompositor enabled. |
| 19 | const base::Feature kAndroidSurfaceControl{"AndroidSurfaceControl", |
| 20 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 21 | #endif |
ericrk | 41a1579e | 2017-02-10 20:56:28 | [diff] [blame] | 22 | |
| 23 | // Enable GPU Rasterization by default. This can still be overridden by |
| 24 | // --force-gpu-rasterization or --disable-gpu-rasterization. |
Eric Karl | ba990bf | 2018-01-03 00:19:35 | [diff] [blame] | 25 | #if defined(OS_MACOSX) || defined(OS_WIN) || defined(OS_CHROMEOS) || \ |
| 26 | defined(OS_ANDROID) |
| 27 | // DefaultEnableGpuRasterization has launched on Mac, Windows, ChromeOS, and |
| 28 | // Android. |
ericrk | 41a1579e | 2017-02-10 20:56:28 | [diff] [blame] | 29 | const base::Feature kDefaultEnableGpuRasterization{ |
| 30 | "DefaultEnableGpuRasterization", base::FEATURE_ENABLED_BY_DEFAULT}; |
| 31 | #else |
| 32 | const base::Feature kDefaultEnableGpuRasterization{ |
| 33 | "DefaultEnableGpuRasterization", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 34 | #endif |
| 35 | |
Adrienne Walker | c87477e | 2018-06-06 22:28:21 | [diff] [blame] | 36 | // Enable out of process rasterization by default. This can still be overridden |
| 37 | // by --enable-oop-rasterization or --disable-oop-rasterization. |
| 38 | const base::Feature kDefaultEnableOopRasterization{ |
| 39 | "DefaultEnableOopRasterization", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 40 | |
Geoff Lang | 94cb946 | 2017-10-25 21:54:02 | [diff] [blame] | 41 | // Use the passthrough command decoder by default. This can be overridden with |
| 42 | // the --use-cmd-decoder=passthrough or --use-cmd-decoder=validating flags. |
| 43 | const base::Feature kDefaultPassthroughCommandDecoder{ |
Sunny Sachanandani | 9456e9b | 2018-09-08 02:30:53 | [diff] [blame] | 44 | "DefaultPassthroughCommandDecoder", base::FEATURE_DISABLED_BY_DEFAULT}; |
Geoff Lang | 94cb946 | 2017-10-25 21:54:02 | [diff] [blame] | 45 | |
Vikas Soni | 882982e1 | 2018-08-05 19:50:58 | [diff] [blame] | 46 | |
Sunny Sachanandani | 729164b | 2018-08-10 00:45:14 | [diff] [blame] | 47 | // Overrides preferred overlay format to NV12 instead of YUY2. |
| 48 | const base::Feature kDirectCompositionPreferNV12Overlays{ |
Sunny Sachanandani | 8f9ee58 | 2018-11-28 03:57:51 | [diff] [blame] | 49 | "DirectCompositionPreferNV12Overlays", base::FEATURE_ENABLED_BY_DEFAULT}; |
Sunny Sachanandani | 729164b | 2018-08-10 00:45:14 | [diff] [blame] | 50 | |
Maggie Chen | 132c38e5 | 2019-02-04 22:18:47 | [diff] [blame] | 51 | // Allow putting a video swapchain underneath the main swapchain, so overlays |
| 52 | // can be used even if there are controls on top of the video. It can be |
| 53 | // enabled only when overlay is supported. |
| 54 | const base::Feature kDirectCompositionUnderlays{ |
| 55 | "DirectCompositionUnderlays", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 56 | |
Maggie Chen | 1ecb074 | 2018-11-28 07:27:37 | [diff] [blame] | 57 | // Causes us to use the SharedImageManager, removing support for the old |
| 58 | // mailbox system. Any consumers of the GPU process using the old mailbox |
| 59 | // system will experience undefined results. |
| 60 | const base::Feature kSharedImageManager{"SharedImageManager", |
| 61 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 62 | |
| 63 | // For Windows only. Use overlay swapchain to present software protected videos |
| 64 | // for all GPUs |
| 65 | const base::Feature kUseDCOverlaysForSoftwareProtectedVideo{ |
| 66 | "UseDCOverlaysForSoftwareProtectedVideo", |
| 67 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 68 | |
Sunny Sachanandani | 8918dc6 | 2018-12-05 02:01:51 | [diff] [blame] | 69 | // Use decode swap chain created from compatible video decoder buffers. |
| 70 | const base::Feature kDirectCompositionUseNV12DecodeSwapChain{ |
| 71 | "DirectCompositionUseNV12DecodeSwapChain", |
| 72 | base::FEATURE_DISABLED_BY_DEFAULT}; |
| 73 | |
Andres Calderon Jaramillo | 605253d | 2018-09-05 15:46:35 | [diff] [blame] | 74 | // Controls the decode acceleration of JPEG images (as opposed to camera |
| 75 | // captures) in Chrome OS using the VA-API. |
| 76 | // TODO(andrescj): remove or enable by default in Chrome OS once |
| 77 | // https://crbug.com/868400 is resolved. |
| 78 | const base::Feature kVaapiJpegImageDecodeAcceleration{ |
| 79 | "VaapiJpegImageDecodeAcceleration", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 80 | |
Khushal | b39ecde | 2019-03-06 00:28:56 | [diff] [blame^] | 81 | #if defined(OS_ANDROID) |
| 82 | bool IsAndroidSurfaceControlEnabled() { |
| 83 | return base::FeatureList::IsEnabled(kAndroidSurfaceControl) && |
| 84 | gl::SurfaceControl::IsSupported(); |
| 85 | } |
| 86 | #endif |
| 87 | |
ericrk | 41a1579e | 2017-02-10 20:56:28 | [diff] [blame] | 88 | } // namespace features |