[email protected] | 3d34657 | 2013-03-22 19:59:55 | [diff] [blame] | 1 | // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
[email protected] | 2efc3118 | 2010-12-11 21:07:18 | [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 | |
Chris Blume | 29bf536 | 2019-09-06 02:34:45 | [diff] [blame] | 5 | #include "gpu/config/gpu_blocklist.h" |
[email protected] | 2efc3118 | 2010-12-11 21:07:18 | [diff] [blame] | 6 | |
[email protected] | d7b5cc7 | 2013-05-23 20:05:00 | [diff] [blame] | 7 | #include "gpu/config/gpu_feature_type.h" |
zmo | 2602bcf | 2017-04-01 00:12:03 | [diff] [blame] | 8 | #include "gpu/config/software_rendering_list_autogen.h" |
[email protected] | 2efc3118 | 2010-12-11 21:07:18 | [diff] [blame] | 9 | |
[email protected] | d7b5cc7 | 2013-05-23 20:05:00 | [diff] [blame] | 10 | namespace gpu { |
[email protected] | 2efc3118 | 2010-12-11 21:07:18 | [diff] [blame] | 11 | |
Chris Blume | 29bf536 | 2019-09-06 02:34:45 | [diff] [blame] | 12 | GpuBlocklist::GpuBlocklist(const GpuControlListData& data) |
zmo | 2602bcf | 2017-04-01 00:12:03 | [diff] [blame] | 13 | : GpuControlList(data) {} |
[email protected] | 2efc3118 | 2010-12-11 21:07:18 | [diff] [blame] | 14 | |
Chris Blume | 29bf536 | 2019-09-06 02:34:45 | [diff] [blame] | 15 | GpuBlocklist::~GpuBlocklist() = default; |
[email protected] | 916b977f | 2011-09-04 02:50:38 | [diff] [blame] | 16 | |
[email protected] | d1f43ab | 2012-03-07 20:42:34 | [diff] [blame] | 17 | // static |
Chris Blume | 29bf536 | 2019-09-06 02:34:45 | [diff] [blame] | 18 | std::unique_ptr<GpuBlocklist> GpuBlocklist::Create() { |
Kai Ninomiya | 96bd9ef9 | 2017-10-20 21:30:37 | [diff] [blame] | 19 | GpuControlListData data(kSoftwareRenderingListEntryCount, |
zmo | 2602bcf | 2017-04-01 00:12:03 | [diff] [blame] | 20 | kSoftwareRenderingListEntries); |
| 21 | return Create(data); |
| 22 | } |
| 23 | |
| 24 | // static |
Chris Blume | 29bf536 | 2019-09-06 02:34:45 | [diff] [blame] | 25 | std::unique_ptr<GpuBlocklist> GpuBlocklist::Create( |
zmo | 2602bcf | 2017-04-01 00:12:03 | [diff] [blame] | 26 | const GpuControlListData& data) { |
Chris Blume | 29bf536 | 2019-09-06 02:34:45 | [diff] [blame] | 27 | std::unique_ptr<GpuBlocklist> list(new GpuBlocklist(data)); |
[email protected] | 9c2985a | 2013-04-02 18:11:57 | [diff] [blame] | 28 | list->AddSupportedFeature("accelerated_2d_canvas", |
| 29 | GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS); |
sugoi | 9e3f1853 | 2017-03-13 17:05:19 | [diff] [blame] | 30 | list->AddSupportedFeature("accelerated_webgl", |
| 31 | GPU_FEATURE_TYPE_ACCELERATED_WEBGL); |
zmo | 2602bcf | 2017-04-01 00:12:03 | [diff] [blame] | 32 | list->AddSupportedFeature("flash3d", GPU_FEATURE_TYPE_FLASH3D); |
| 33 | list->AddSupportedFeature("flash_stage3d", GPU_FEATURE_TYPE_FLASH_STAGE3D); |
[email protected] | 9c2985a | 2013-04-02 18:11:57 | [diff] [blame] | 34 | list->AddSupportedFeature("flash_stage3d_baseline", |
| 35 | GPU_FEATURE_TYPE_FLASH_STAGE3D_BASELINE); |
[email protected] | 9c2985a | 2013-04-02 18:11:57 | [diff] [blame] | 36 | list->AddSupportedFeature("accelerated_video_decode", |
| 37 | GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE); |
[email protected] | 723f7c5 | 2014-04-17 17:34:41 | [diff] [blame] | 38 | list->AddSupportedFeature("gpu_rasterization", |
| 39 | GPU_FEATURE_TYPE_GPU_RASTERIZATION); |
Alexis Hetu | b6e6102 | 2017-09-07 22:37:36 | [diff] [blame] | 40 | list->AddSupportedFeature("accelerated_webgl2", |
| 41 | GPU_FEATURE_TYPE_ACCELERATED_WEBGL2); |
Maggie Chen | 5df39954 | 2018-05-22 07:51:04 | [diff] [blame] | 42 | list->AddSupportedFeature("protected_video_decode", |
| 43 | GPU_FEATURE_TYPE_PROTECTED_VIDEO_DECODE); |
Adrienne Walker | c87477e | 2018-06-06 22:28:21 | [diff] [blame] | 44 | list->AddSupportedFeature("oop_rasterization", |
| 45 | GPU_FEATURE_TYPE_OOP_RASTERIZATION); |
Khushal | bb1963a | 2018-10-02 21:02:35 | [diff] [blame] | 46 | list->AddSupportedFeature("android_surface_control", |
| 47 | GPU_FEATURE_TYPE_ANDROID_SURFACE_CONTROL); |
Sean Gilhuly | 1e54ddb | 2019-11-28 18:52:28 | [diff] [blame] | 48 | list->AddSupportedFeature("accelerated_gl", GPU_FEATURE_TYPE_ACCELERATED_GL); |
Christopher Cameron | 3a360189 | 2019-05-16 21:43:52 | [diff] [blame] | 49 | list->AddSupportedFeature("metal", GPU_FEATURE_TYPE_METAL); |
Peng Huang | 9b7d2ee | 2019-10-02 20:18:22 | [diff] [blame] | 50 | list->AddSupportedFeature("vulkan", GPU_FEATURE_TYPE_VULKAN); |
[email protected] | 3d34657 | 2013-03-22 19:59:55 | [diff] [blame] | 51 | return list; |
[email protected] | d1f43ab | 2012-03-07 20:42:34 | [diff] [blame] | 52 | } |
[email protected] | 21efac3 | 2012-10-29 02:41:11 | [diff] [blame] | 53 | |
Zhenyao Mo | 2eb1fe5 | 2018-01-13 05:49:25 | [diff] [blame] | 54 | // static |
Chris Blume | 29bf536 | 2019-09-06 02:34:45 | [diff] [blame] | 55 | bool GpuBlocklist::AreEntryIndicesValid( |
Zhenyao Mo | 2eb1fe5 | 2018-01-13 05:49:25 | [diff] [blame] | 56 | const std::vector<uint32_t>& entry_indices) { |
| 57 | return GpuControlList::AreEntryIndicesValid(entry_indices, |
| 58 | kSoftwareRenderingListEntryCount); |
| 59 | } |
| 60 | |
[email protected] | d7b5cc7 | 2013-05-23 20:05:00 | [diff] [blame] | 61 | } // namespace gpu |