blob: 168f36127cd306d42e50a7e0691d700f624b38be [file] [log] [blame]
ericrk41a1579e2017-02-10 20:56:281// 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
Khushalb39ecde2019-03-06 00:28:566#if defined(OS_ANDROID)
7#include "ui/gl/android/android_surface_control_compat.h"
8#endif
9
ericrk41a1579e2017-02-10 20:56:2810namespace features {
Maggie Chen1ecb0742018-11-28 07:27:3711#if defined(OS_ANDROID)
12// Use android AImageReader when playing videos with MediaPlayer.
13const 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.
19const base::Feature kAndroidSurfaceControl{"AndroidSurfaceControl",
20 base::FEATURE_DISABLED_BY_DEFAULT};
21#endif
ericrk41a1579e2017-02-10 20:56:2822
23// Enable GPU Rasterization by default. This can still be overridden by
24// --force-gpu-rasterization or --disable-gpu-rasterization.
Eric Karlba990bf2018-01-03 00:19:3525#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.
ericrk41a1579e2017-02-10 20:56:2829const base::Feature kDefaultEnableGpuRasterization{
30 "DefaultEnableGpuRasterization", base::FEATURE_ENABLED_BY_DEFAULT};
31#else
32const base::Feature kDefaultEnableGpuRasterization{
33 "DefaultEnableGpuRasterization", base::FEATURE_DISABLED_BY_DEFAULT};
34#endif
35
Adrienne Walkerc87477e2018-06-06 22:28:2136// Enable out of process rasterization by default. This can still be overridden
37// by --enable-oop-rasterization or --disable-oop-rasterization.
38const base::Feature kDefaultEnableOopRasterization{
39 "DefaultEnableOopRasterization", base::FEATURE_DISABLED_BY_DEFAULT};
40
Geoff Lang94cb9462017-10-25 21:54:0241// Use the passthrough command decoder by default. This can be overridden with
42// the --use-cmd-decoder=passthrough or --use-cmd-decoder=validating flags.
43const base::Feature kDefaultPassthroughCommandDecoder{
Sunny Sachanandani9456e9b2018-09-08 02:30:5344 "DefaultPassthroughCommandDecoder", base::FEATURE_DISABLED_BY_DEFAULT};
Geoff Lang94cb9462017-10-25 21:54:0245
Vikas Soni882982e12018-08-05 19:50:5846
Sunny Sachanandani729164b2018-08-10 00:45:1447// Overrides preferred overlay format to NV12 instead of YUY2.
48const base::Feature kDirectCompositionPreferNV12Overlays{
Sunny Sachanandani8f9ee582018-11-28 03:57:5149 "DirectCompositionPreferNV12Overlays", base::FEATURE_ENABLED_BY_DEFAULT};
Sunny Sachanandani729164b2018-08-10 00:45:1450
Maggie Chen132c38e52019-02-04 22:18:4751// 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.
54const base::Feature kDirectCompositionUnderlays{
55 "DirectCompositionUnderlays", base::FEATURE_DISABLED_BY_DEFAULT};
56
Maggie Chen1ecb0742018-11-28 07:27:3757// 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.
60const 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
65const base::Feature kUseDCOverlaysForSoftwareProtectedVideo{
66 "UseDCOverlaysForSoftwareProtectedVideo",
67 base::FEATURE_DISABLED_BY_DEFAULT};
68
Sunny Sachanandani8918dc62018-12-05 02:01:5169// Use decode swap chain created from compatible video decoder buffers.
70const base::Feature kDirectCompositionUseNV12DecodeSwapChain{
71 "DirectCompositionUseNV12DecodeSwapChain",
72 base::FEATURE_DISABLED_BY_DEFAULT};
73
Andres Calderon Jaramillo605253d2018-09-05 15:46:3574// 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.
78const base::Feature kVaapiJpegImageDecodeAcceleration{
79 "VaapiJpegImageDecodeAcceleration", base::FEATURE_DISABLED_BY_DEFAULT};
80
Khushalb39ecde2019-03-06 00:28:5681#if defined(OS_ANDROID)
82bool IsAndroidSurfaceControlEnabled() {
83 return base::FeatureList::IsEnabled(kAndroidSurfaceControl) &&
84 gl::SurfaceControl::IsSupported();
85}
86#endif
87
ericrk41a1579e2017-02-10 20:56:2888} // namespace features