Garfield Tan | 2320289 | 2022-03-02 16:10:21 -0800 | [diff] [blame] | 1 | /* |
Dominik Laskowski | fb281c5 | 2023-02-11 14:24:19 -0500 | [diff] [blame] | 2 | * Copyright 2022 The Android Open Source Project |
Garfield Tan | 2320289 | 2022-03-02 16:10:21 -0800 | [diff] [blame] | 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #include "LayerTestUtils.h" |
| 18 | |
Garfield Tan | 2320289 | 2022-03-02 16:10:21 -0800 | [diff] [blame] | 19 | namespace android { |
| 20 | |
Garfield Tan | 2320289 | 2022-03-02 16:10:21 -0800 | [diff] [blame] | 21 | sp<Layer> BufferStateLayerFactory::createLayer(TestableSurfaceFlinger& flinger) { |
| 22 | sp<Client> client; |
| 23 | LayerCreationArgs args(flinger.flinger(), client, "buffer-state-layer", LAYER_FLAGS, |
| 24 | LayerMetadata()); |
Patrick Williams | 83f36b2 | 2022-09-14 17:57:35 +0000 | [diff] [blame] | 25 | return sp<Layer>::make(args); |
Garfield Tan | 2320289 | 2022-03-02 16:10:21 -0800 | [diff] [blame] | 26 | } |
| 27 | |
| 28 | sp<Layer> EffectLayerFactory::createLayer(TestableSurfaceFlinger& flinger) { |
| 29 | sp<Client> client; |
| 30 | LayerCreationArgs args(flinger.flinger(), client, "color-layer", LAYER_FLAGS, LayerMetadata()); |
Patrick Williams | 46b61b9 | 2022-09-01 17:25:49 +0000 | [diff] [blame] | 31 | return sp<Layer>::make(args); |
Garfield Tan | 2320289 | 2022-03-02 16:10:21 -0800 | [diff] [blame] | 32 | } |
| 33 | |
| 34 | std::string PrintToStringParamName( |
| 35 | const ::testing::TestParamInfo<std::shared_ptr<LayerFactory>>& info) { |
| 36 | return info.param->name(); |
| 37 | } |
| 38 | |
| 39 | BaseLayerTest::BaseLayerTest() { |
Dominik Laskowski | fb281c5 | 2023-02-11 14:24:19 -0500 | [diff] [blame] | 40 | mFlinger.setupMockScheduler(); |
Garfield Tan | 2320289 | 2022-03-02 16:10:21 -0800 | [diff] [blame] | 41 | } |
| 42 | |
| 43 | } // namespace android |