blob: dccad58dde521fdf65b097b480a987f6f9962703 [file] [log] [blame]
Lloyd Pique32cbe282018-10-19 13:09:22 -07001/*
2 * Copyright 2019 The Android Open Source Project
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 <cmath>
18
Lloyd Pique56eba802019-08-28 15:45:25 -070019#include <compositionengine/impl/LayerCompositionState.h>
Lloyd Pique32cbe282018-10-19 13:09:22 -070020#include <compositionengine/impl/Output.h>
Lloyd Pique66d68602019-02-13 14:23:31 -080021#include <compositionengine/impl/OutputCompositionState.h>
Lloyd Pique56eba802019-08-28 15:45:25 -070022#include <compositionengine/impl/OutputLayerCompositionState.h>
Lloyd Pique32cbe282018-10-19 13:09:22 -070023#include <compositionengine/mock/CompositionEngine.h>
Lloyd Pique3d0c02e2018-10-19 18:38:12 -070024#include <compositionengine/mock/DisplayColorProfile.h>
Lloyd Piquecc01a452018-12-04 17:24:00 -080025#include <compositionengine/mock/Layer.h>
26#include <compositionengine/mock/LayerFE.h>
27#include <compositionengine/mock/OutputLayer.h>
Lloyd Pique31cb2942018-10-19 17:23:03 -070028#include <compositionengine/mock/RenderSurface.h>
Lloyd Pique32cbe282018-10-19 13:09:22 -070029#include <gtest/gtest.h>
Lloyd Pique56eba802019-08-28 15:45:25 -070030#include <renderengine/mock/RenderEngine.h>
Lloyd Pique32cbe282018-10-19 13:09:22 -070031#include <ui/Rect.h>
32#include <ui/Region.h>
33
34#include "RegionMatcher.h"
35#include "TransformMatcher.h"
36
37namespace android::compositionengine {
38namespace {
39
Lloyd Pique56eba802019-08-28 15:45:25 -070040using testing::_;
Lloyd Pique31cb2942018-10-19 17:23:03 -070041using testing::Return;
Lloyd Pique32cbe282018-10-19 13:09:22 -070042using testing::ReturnRef;
43using testing::StrictMock;
44
Lloyd Pique56eba802019-08-28 15:45:25 -070045constexpr auto TR_IDENT = 0u;
46constexpr auto TR_ROT_90 = HAL_TRANSFORM_ROT_90;
47
Lloyd Pique66d68602019-02-13 14:23:31 -080048struct OutputTest : public testing::Test {
Lloyd Pique31cb2942018-10-19 17:23:03 -070049 OutputTest() {
Lloyd Pique3d0c02e2018-10-19 18:38:12 -070050 mOutput.setDisplayColorProfileForTest(
51 std::unique_ptr<DisplayColorProfile>(mDisplayColorProfile));
Lloyd Pique31cb2942018-10-19 17:23:03 -070052 mOutput.setRenderSurfaceForTest(std::unique_ptr<RenderSurface>(mRenderSurface));
Lloyd Piqueef958122019-02-05 18:00:12 -080053
54 mOutput.editState().bounds = kDefaultDisplaySize;
Lloyd Pique31cb2942018-10-19 17:23:03 -070055 }
Lloyd Pique32cbe282018-10-19 13:09:22 -070056
Lloyd Piqueef958122019-02-05 18:00:12 -080057 static const Rect kDefaultDisplaySize;
58
Lloyd Pique32cbe282018-10-19 13:09:22 -070059 StrictMock<mock::CompositionEngine> mCompositionEngine;
Lloyd Pique3d0c02e2018-10-19 18:38:12 -070060 mock::DisplayColorProfile* mDisplayColorProfile = new StrictMock<mock::DisplayColorProfile>();
Lloyd Pique31cb2942018-10-19 17:23:03 -070061 mock::RenderSurface* mRenderSurface = new StrictMock<mock::RenderSurface>();
Lloyd Pique32cbe282018-10-19 13:09:22 -070062 impl::Output mOutput{mCompositionEngine};
63};
64
Lloyd Piqueef958122019-02-05 18:00:12 -080065const Rect OutputTest::kDefaultDisplaySize{100, 200};
66
Lloyd Pique66d68602019-02-13 14:23:31 -080067/*
Lloyd Pique32cbe282018-10-19 13:09:22 -070068 * Basic construction
69 */
70
Lloyd Pique31cb2942018-10-19 17:23:03 -070071TEST_F(OutputTest, canInstantiateOutput) {
72 // The validation check checks each required component.
Lloyd Pique3d0c02e2018-10-19 18:38:12 -070073 EXPECT_CALL(*mDisplayColorProfile, isValid()).WillOnce(Return(true));
Lloyd Pique31cb2942018-10-19 17:23:03 -070074 EXPECT_CALL(*mRenderSurface, isValid()).WillOnce(Return(true));
75
76 EXPECT_TRUE(mOutput.isValid());
77
78 // If we take away the required components, it is no longer valid.
79 mOutput.setRenderSurfaceForTest(std::unique_ptr<RenderSurface>());
80
Lloyd Pique3d0c02e2018-10-19 18:38:12 -070081 EXPECT_CALL(*mDisplayColorProfile, isValid()).WillOnce(Return(true));
82
Lloyd Pique31cb2942018-10-19 17:23:03 -070083 EXPECT_FALSE(mOutput.isValid());
84}
Lloyd Pique32cbe282018-10-19 13:09:22 -070085
Lloyd Pique66d68602019-02-13 14:23:31 -080086/*
Lloyd Pique32cbe282018-10-19 13:09:22 -070087 * Output::setCompositionEnabled()
88 */
89
90TEST_F(OutputTest, setCompositionEnabledDoesNothingIfAlreadyEnabled) {
Lloyd Pique32cbe282018-10-19 13:09:22 -070091 mOutput.editState().isEnabled = true;
92
93 mOutput.setCompositionEnabled(true);
94
95 EXPECT_TRUE(mOutput.getState().isEnabled);
96 EXPECT_THAT(mOutput.getState().dirtyRegion, RegionEq(Region()));
97}
98
99TEST_F(OutputTest, setCompositionEnabledSetsEnabledAndDirtiesEntireOutput) {
Lloyd Pique32cbe282018-10-19 13:09:22 -0700100 mOutput.editState().isEnabled = false;
101
102 mOutput.setCompositionEnabled(true);
103
104 EXPECT_TRUE(mOutput.getState().isEnabled);
Lloyd Piqueef958122019-02-05 18:00:12 -0800105 EXPECT_THAT(mOutput.getState().dirtyRegion, RegionEq(Region(kDefaultDisplaySize)));
Lloyd Pique32cbe282018-10-19 13:09:22 -0700106}
107
108TEST_F(OutputTest, setCompositionEnabledSetsDisabledAndDirtiesEntireOutput) {
Lloyd Pique32cbe282018-10-19 13:09:22 -0700109 mOutput.editState().isEnabled = true;
110
111 mOutput.setCompositionEnabled(false);
112
113 EXPECT_FALSE(mOutput.getState().isEnabled);
Lloyd Piqueef958122019-02-05 18:00:12 -0800114 EXPECT_THAT(mOutput.getState().dirtyRegion, RegionEq(Region(kDefaultDisplaySize)));
Lloyd Pique32cbe282018-10-19 13:09:22 -0700115}
116
Lloyd Pique66d68602019-02-13 14:23:31 -0800117/*
Lloyd Pique32cbe282018-10-19 13:09:22 -0700118 * Output::setProjection()
119 */
120
121TEST_F(OutputTest, setProjectionTriviallyWorks) {
122 const ui::Transform transform{ui::Transform::ROT_180};
123 const int32_t orientation = 123;
124 const Rect frame{1, 2, 3, 4};
125 const Rect viewport{5, 6, 7, 8};
126 const Rect scissor{9, 10, 11, 12};
127 const bool needsFiltering = true;
128
129 mOutput.setProjection(transform, orientation, frame, viewport, scissor, needsFiltering);
130
131 EXPECT_THAT(mOutput.getState().transform, TransformEq(transform));
132 EXPECT_EQ(orientation, mOutput.getState().orientation);
133 EXPECT_EQ(frame, mOutput.getState().frame);
134 EXPECT_EQ(viewport, mOutput.getState().viewport);
135 EXPECT_EQ(scissor, mOutput.getState().scissor);
136 EXPECT_EQ(needsFiltering, mOutput.getState().needsFiltering);
137}
138
Lloyd Pique66d68602019-02-13 14:23:31 -0800139/*
Lloyd Pique32cbe282018-10-19 13:09:22 -0700140 * Output::setBounds()
141 */
142
143TEST_F(OutputTest, setBoundsSetsSizeAndDirtiesEntireOutput) {
Lloyd Piqueef958122019-02-05 18:00:12 -0800144 const ui::Size displaySize{200, 400};
Lloyd Pique31cb2942018-10-19 17:23:03 -0700145
146 EXPECT_CALL(*mRenderSurface, setDisplaySize(displaySize)).Times(1);
147 EXPECT_CALL(*mRenderSurface, getSize()).WillOnce(ReturnRef(displaySize));
148
Lloyd Pique32cbe282018-10-19 13:09:22 -0700149 mOutput.setBounds(displaySize);
150
Lloyd Pique31cb2942018-10-19 17:23:03 -0700151 EXPECT_EQ(Rect(displaySize), mOutput.getState().bounds);
Lloyd Pique32cbe282018-10-19 13:09:22 -0700152
Lloyd Pique31cb2942018-10-19 17:23:03 -0700153 EXPECT_THAT(mOutput.getState().dirtyRegion, RegionEq(Region(Rect(displaySize))));
Lloyd Pique32cbe282018-10-19 13:09:22 -0700154}
155
Lloyd Pique66d68602019-02-13 14:23:31 -0800156/*
Lloyd Pique32cbe282018-10-19 13:09:22 -0700157 * Output::setLayerStackFilter()
158 */
159
160TEST_F(OutputTest, setLayerStackFilterSetsFilterAndDirtiesEntireOutput) {
Lloyd Pique32cbe282018-10-19 13:09:22 -0700161 const uint32_t layerStack = 123u;
Lloyd Piqueef36b002019-01-23 17:52:04 -0800162 mOutput.setLayerStackFilter(layerStack, true);
Lloyd Pique32cbe282018-10-19 13:09:22 -0700163
Lloyd Piqueef36b002019-01-23 17:52:04 -0800164 EXPECT_TRUE(mOutput.getState().layerStackInternal);
165 EXPECT_EQ(layerStack, mOutput.getState().layerStackId);
Lloyd Pique32cbe282018-10-19 13:09:22 -0700166
Lloyd Piqueef958122019-02-05 18:00:12 -0800167 EXPECT_THAT(mOutput.getState().dirtyRegion, RegionEq(Region(kDefaultDisplaySize)));
Lloyd Pique32cbe282018-10-19 13:09:22 -0700168}
169
Lloyd Pique66d68602019-02-13 14:23:31 -0800170/*
Lloyd Pique32cbe282018-10-19 13:09:22 -0700171 * Output::setColorTransform
172 */
173
174TEST_F(OutputTest, setColorTransformSetsTransform) {
175 // Identity matrix sets an identity state value
176 const mat4 identity;
177
178 mOutput.setColorTransform(identity);
179
180 EXPECT_EQ(HAL_COLOR_TRANSFORM_IDENTITY, mOutput.getState().colorTransform);
Lloyd Pique77f79a22019-04-29 15:55:40 -0700181 EXPECT_EQ(identity, mOutput.getState().colorTransformMat);
Lloyd Pique32cbe282018-10-19 13:09:22 -0700182
Lloyd Piqueef958122019-02-05 18:00:12 -0800183 // Since identity is the default, the dirty region should be unchanged (empty)
184 EXPECT_THAT(mOutput.getState().dirtyRegion, RegionEq(Region()));
185
Lloyd Pique32cbe282018-10-19 13:09:22 -0700186 // Non-identity matrix sets a non-identity state value
Lloyd Pique77f79a22019-04-29 15:55:40 -0700187 const mat4 nonIdentityHalf = mat4() * 0.5;
Lloyd Pique32cbe282018-10-19 13:09:22 -0700188
Lloyd Pique77f79a22019-04-29 15:55:40 -0700189 mOutput.setColorTransform(nonIdentityHalf);
Lloyd Pique32cbe282018-10-19 13:09:22 -0700190
191 EXPECT_EQ(HAL_COLOR_TRANSFORM_ARBITRARY_MATRIX, mOutput.getState().colorTransform);
Lloyd Pique77f79a22019-04-29 15:55:40 -0700192 EXPECT_EQ(nonIdentityHalf, mOutput.getState().colorTransformMat);
193
194 // Since this is a state change, the entire output should now be dirty.
195 EXPECT_THAT(mOutput.getState().dirtyRegion, RegionEq(Region(kDefaultDisplaySize)));
196
197 // Non-identity matrix sets a non-identity state value
198 const mat4 nonIdentityQuarter = mat4() * 0.25;
199
200 mOutput.setColorTransform(nonIdentityQuarter);
201
202 EXPECT_EQ(HAL_COLOR_TRANSFORM_ARBITRARY_MATRIX, mOutput.getState().colorTransform);
203 EXPECT_EQ(nonIdentityQuarter, mOutput.getState().colorTransformMat);
Lloyd Piqueef958122019-02-05 18:00:12 -0800204
205 // Since this is a state change, the entire output should now be dirty.
206 EXPECT_THAT(mOutput.getState().dirtyRegion, RegionEq(Region(kDefaultDisplaySize)));
Lloyd Pique32cbe282018-10-19 13:09:22 -0700207}
208
Lloyd Pique66d68602019-02-13 14:23:31 -0800209/*
Lloyd Pique32cbe282018-10-19 13:09:22 -0700210 * Output::setColorMode
211 */
212
Lloyd Piqueef958122019-02-05 18:00:12 -0800213TEST_F(OutputTest, setColorModeSetsStateAndDirtiesOutputIfChanged) {
Lloyd Pique6a3b4462019-03-07 20:58:12 -0800214 using ColorProfile = Output::ColorProfile;
215
Lloyd Piquef5275482019-01-29 18:42:42 -0800216 EXPECT_CALL(*mDisplayColorProfile,
217 getTargetDataspace(ui::ColorMode::DISPLAY_P3, ui::Dataspace::DISPLAY_P3,
218 ui::Dataspace::UNKNOWN))
219 .WillOnce(Return(ui::Dataspace::UNKNOWN));
Lloyd Piqueef958122019-02-05 18:00:12 -0800220 EXPECT_CALL(*mRenderSurface, setBufferDataspace(ui::Dataspace::DISPLAY_P3)).Times(1);
Lloyd Pique31cb2942018-10-19 17:23:03 -0700221
Lloyd Pique6a3b4462019-03-07 20:58:12 -0800222 mOutput.setColorProfile(ColorProfile{ui::ColorMode::DISPLAY_P3, ui::Dataspace::DISPLAY_P3,
223 ui::RenderIntent::TONE_MAP_COLORIMETRIC,
224 ui::Dataspace::UNKNOWN});
Lloyd Pique32cbe282018-10-19 13:09:22 -0700225
Lloyd Piqueef958122019-02-05 18:00:12 -0800226 EXPECT_EQ(ui::ColorMode::DISPLAY_P3, mOutput.getState().colorMode);
227 EXPECT_EQ(ui::Dataspace::DISPLAY_P3, mOutput.getState().dataspace);
Lloyd Pique32cbe282018-10-19 13:09:22 -0700228 EXPECT_EQ(ui::RenderIntent::TONE_MAP_COLORIMETRIC, mOutput.getState().renderIntent);
Lloyd Piquef5275482019-01-29 18:42:42 -0800229 EXPECT_EQ(ui::Dataspace::UNKNOWN, mOutput.getState().targetDataspace);
230
Lloyd Piqueef958122019-02-05 18:00:12 -0800231 EXPECT_THAT(mOutput.getState().dirtyRegion, RegionEq(Region(kDefaultDisplaySize)));
232}
233
234TEST_F(OutputTest, setColorModeDoesNothingIfNoChange) {
Lloyd Pique6a3b4462019-03-07 20:58:12 -0800235 using ColorProfile = Output::ColorProfile;
236
Lloyd Piquef5275482019-01-29 18:42:42 -0800237 EXPECT_CALL(*mDisplayColorProfile,
238 getTargetDataspace(ui::ColorMode::DISPLAY_P3, ui::Dataspace::DISPLAY_P3,
239 ui::Dataspace::UNKNOWN))
240 .WillOnce(Return(ui::Dataspace::UNKNOWN));
241
Lloyd Piqueef958122019-02-05 18:00:12 -0800242 mOutput.editState().colorMode = ui::ColorMode::DISPLAY_P3;
243 mOutput.editState().dataspace = ui::Dataspace::DISPLAY_P3;
244 mOutput.editState().renderIntent = ui::RenderIntent::TONE_MAP_COLORIMETRIC;
Lloyd Piquef5275482019-01-29 18:42:42 -0800245 mOutput.editState().targetDataspace = ui::Dataspace::UNKNOWN;
Lloyd Piqueef958122019-02-05 18:00:12 -0800246
Lloyd Pique6a3b4462019-03-07 20:58:12 -0800247 mOutput.setColorProfile(ColorProfile{ui::ColorMode::DISPLAY_P3, ui::Dataspace::DISPLAY_P3,
248 ui::RenderIntent::TONE_MAP_COLORIMETRIC,
249 ui::Dataspace::UNKNOWN});
Lloyd Piqueef958122019-02-05 18:00:12 -0800250
251 EXPECT_THAT(mOutput.getState().dirtyRegion, RegionEq(Region()));
Lloyd Pique32cbe282018-10-19 13:09:22 -0700252}
253
Lloyd Pique66d68602019-02-13 14:23:31 -0800254/*
Lloyd Pique31cb2942018-10-19 17:23:03 -0700255 * Output::setRenderSurface()
256 */
257
258TEST_F(OutputTest, setRenderSurfaceResetsBounds) {
259 const ui::Size newDisplaySize{640, 480};
260
261 mock::RenderSurface* renderSurface = new StrictMock<mock::RenderSurface>();
262 EXPECT_CALL(*renderSurface, getSize()).WillOnce(ReturnRef(newDisplaySize));
263
264 mOutput.setRenderSurface(std::unique_ptr<RenderSurface>(renderSurface));
265
266 EXPECT_EQ(Rect(newDisplaySize), mOutput.getState().bounds);
267}
268
Lloyd Pique66d68602019-02-13 14:23:31 -0800269/*
Alec Mourie7d1d4a2019-02-05 01:13:46 +0000270 * Output::getDirtyRegion()
Lloyd Pique32cbe282018-10-19 13:09:22 -0700271 */
272
Alec Mourie7d1d4a2019-02-05 01:13:46 +0000273TEST_F(OutputTest, getDirtyRegionWithRepaintEverythingTrue) {
274 const Rect viewport{100, 200};
275 mOutput.editState().viewport = viewport;
Lloyd Pique32cbe282018-10-19 13:09:22 -0700276 mOutput.editState().dirtyRegion.set(50, 300);
277
278 {
Alec Mourie7d1d4a2019-02-05 01:13:46 +0000279 Region result = mOutput.getDirtyRegion(true);
Lloyd Pique32cbe282018-10-19 13:09:22 -0700280
Alec Mourie7d1d4a2019-02-05 01:13:46 +0000281 EXPECT_THAT(result, RegionEq(Region(viewport)));
Lloyd Pique32cbe282018-10-19 13:09:22 -0700282 }
283}
284
Alec Mourie7d1d4a2019-02-05 01:13:46 +0000285TEST_F(OutputTest, getDirtyRegionWithRepaintEverythingFalse) {
286 const Rect viewport{100, 200};
287 mOutput.editState().viewport = viewport;
Lloyd Pique32cbe282018-10-19 13:09:22 -0700288 mOutput.editState().dirtyRegion.set(50, 300);
289
290 {
Alec Mourie7d1d4a2019-02-05 01:13:46 +0000291 Region result = mOutput.getDirtyRegion(false);
Lloyd Pique32cbe282018-10-19 13:09:22 -0700292
293 // The dirtyRegion should be clipped to the display bounds.
294 EXPECT_THAT(result, RegionEq(Region(Rect(50, 200))));
295 }
Lloyd Pique32cbe282018-10-19 13:09:22 -0700296}
297
Lloyd Pique66d68602019-02-13 14:23:31 -0800298/*
Lloyd Piqueef36b002019-01-23 17:52:04 -0800299 * Output::belongsInOutput()
300 */
301
302TEST_F(OutputTest, belongsInOutputFiltersAsExpected) {
303 const uint32_t layerStack1 = 123u;
304 const uint32_t layerStack2 = 456u;
305
306 // If the output accepts layerStack1 and internal-only layers....
307 mOutput.setLayerStackFilter(layerStack1, true);
308
309 // Any layer with layerStack1 belongs to it, internal-only or not.
310 EXPECT_TRUE(mOutput.belongsInOutput(layerStack1, false));
311 EXPECT_TRUE(mOutput.belongsInOutput(layerStack1, true));
312 EXPECT_FALSE(mOutput.belongsInOutput(layerStack2, true));
313 EXPECT_FALSE(mOutput.belongsInOutput(layerStack2, false));
314
315 // If the output accepts layerStack21 but not internal-only layers...
316 mOutput.setLayerStackFilter(layerStack1, false);
317
318 // Only non-internal layers with layerStack1 belong to it.
319 EXPECT_TRUE(mOutput.belongsInOutput(layerStack1, false));
320 EXPECT_FALSE(mOutput.belongsInOutput(layerStack1, true));
321 EXPECT_FALSE(mOutput.belongsInOutput(layerStack2, true));
322 EXPECT_FALSE(mOutput.belongsInOutput(layerStack2, false));
323}
324
Lloyd Pique66d68602019-02-13 14:23:31 -0800325/*
Lloyd Piquecc01a452018-12-04 17:24:00 -0800326 * Output::getOutputLayerForLayer()
327 */
328
329TEST_F(OutputTest, getOutputLayerForLayerWorks) {
330 mock::OutputLayer* outputLayer1 = new StrictMock<mock::OutputLayer>();
331 mock::OutputLayer* outputLayer2 = new StrictMock<mock::OutputLayer>();
332
333 Output::OutputLayers outputLayers;
334 outputLayers.emplace_back(std::unique_ptr<OutputLayer>(outputLayer1));
335 outputLayers.emplace_back(nullptr);
336 outputLayers.emplace_back(std::unique_ptr<OutputLayer>(outputLayer2));
337 mOutput.setOutputLayersOrderedByZ(std::move(outputLayers));
338
339 StrictMock<mock::Layer> layer;
340 StrictMock<mock::Layer> otherLayer;
341
342 // If the input layer matches the first OutputLayer, it will be returned.
343 EXPECT_CALL(*outputLayer1, getLayer()).WillOnce(ReturnRef(layer));
344 EXPECT_EQ(outputLayer1, mOutput.getOutputLayerForLayer(&layer));
345
346 // If the input layer matches the second OutputLayer, it will be returned.
347 EXPECT_CALL(*outputLayer1, getLayer()).WillOnce(ReturnRef(otherLayer));
348 EXPECT_CALL(*outputLayer2, getLayer()).WillOnce(ReturnRef(layer));
349 EXPECT_EQ(outputLayer2, mOutput.getOutputLayerForLayer(&layer));
350
351 // If the input layer does not match an output layer, null will be returned.
352 EXPECT_CALL(*outputLayer1, getLayer()).WillOnce(ReturnRef(otherLayer));
353 EXPECT_CALL(*outputLayer2, getLayer()).WillOnce(ReturnRef(otherLayer));
354 EXPECT_EQ(nullptr, mOutput.getOutputLayerForLayer(&layer));
355}
356
Lloyd Pique66d68602019-02-13 14:23:31 -0800357/*
Lloyd Piquecc01a452018-12-04 17:24:00 -0800358 * Output::getOrCreateOutputLayer()
359 */
360
361TEST_F(OutputTest, getOrCreateOutputLayerWorks) {
362 mock::OutputLayer* existingOutputLayer = new StrictMock<mock::OutputLayer>();
363
364 Output::OutputLayers outputLayers;
365 outputLayers.emplace_back(nullptr);
366 outputLayers.emplace_back(std::unique_ptr<OutputLayer>(existingOutputLayer));
367 mOutput.setOutputLayersOrderedByZ(std::move(outputLayers));
368
369 std::shared_ptr<mock::Layer> layer{new StrictMock<mock::Layer>()};
370 sp<LayerFE> layerFE{new StrictMock<mock::LayerFE>()};
371
372 StrictMock<mock::Layer> otherLayer;
373
374 {
375 // If there is no OutputLayer corresponding to the input layer, a
376 // new OutputLayer is constructed and returned.
377 EXPECT_CALL(*existingOutputLayer, getLayer()).WillOnce(ReturnRef(otherLayer));
Lloyd Pique07e33212018-12-18 16:33:37 -0800378 auto result = mOutput.getOrCreateOutputLayer(std::nullopt, layer, layerFE);
Lloyd Piquecc01a452018-12-04 17:24:00 -0800379 EXPECT_NE(existingOutputLayer, result.get());
380 EXPECT_TRUE(result.get() != nullptr);
381 EXPECT_EQ(layer.get(), &result->getLayer());
382 EXPECT_EQ(layerFE.get(), &result->getLayerFE());
383
384 // The entries in the ordered array should be unchanged.
385 auto& outputLayers = mOutput.getOutputLayersOrderedByZ();
386 EXPECT_EQ(nullptr, outputLayers[0].get());
387 EXPECT_EQ(existingOutputLayer, outputLayers[1].get());
388 }
389
390 {
391 // If there is an existing OutputLayer for the requested layer, an owned
392 // pointer is returned
393 EXPECT_CALL(*existingOutputLayer, getLayer()).WillOnce(ReturnRef(*layer));
Lloyd Pique07e33212018-12-18 16:33:37 -0800394 auto result = mOutput.getOrCreateOutputLayer(std::nullopt, layer, layerFE);
Lloyd Piquecc01a452018-12-04 17:24:00 -0800395 EXPECT_EQ(existingOutputLayer, result.get());
396
397 // The corresponding entry in the ordered array should be cleared.
398 auto& outputLayers = mOutput.getOutputLayersOrderedByZ();
399 EXPECT_EQ(nullptr, outputLayers[0].get());
400 EXPECT_EQ(nullptr, outputLayers[1].get());
401 }
402}
403
Lloyd Pique66d68602019-02-13 14:23:31 -0800404/*
405 * Output::prepareFrame()
406 */
407
408struct OutputPrepareFrameTest : public testing::Test {
409 struct OutputPartialMock : public impl::Output {
410 OutputPartialMock(const compositionengine::CompositionEngine& compositionEngine)
411 : impl::Output(compositionEngine) {}
412
413 // Sets up the helper functions called by prepareFrame to use a mock
414 // implementations.
415 MOCK_METHOD0(chooseCompositionStrategy, void());
416 };
417
418 OutputPrepareFrameTest() {
419 mOutput.setDisplayColorProfileForTest(
420 std::unique_ptr<DisplayColorProfile>(mDisplayColorProfile));
421 mOutput.setRenderSurfaceForTest(std::unique_ptr<RenderSurface>(mRenderSurface));
422 }
423
424 StrictMock<mock::CompositionEngine> mCompositionEngine;
425 mock::DisplayColorProfile* mDisplayColorProfile = new StrictMock<mock::DisplayColorProfile>();
426 mock::RenderSurface* mRenderSurface = new StrictMock<mock::RenderSurface>();
427 StrictMock<OutputPartialMock> mOutput{mCompositionEngine};
428};
429
430TEST_F(OutputPrepareFrameTest, takesEarlyOutIfNotEnabled) {
431 mOutput.editState().isEnabled = false;
432
433 mOutput.prepareFrame();
434}
435
436TEST_F(OutputPrepareFrameTest, delegatesToChooseCompositionStrategyAndRenderSurface) {
437 mOutput.editState().isEnabled = true;
438 mOutput.editState().usesClientComposition = false;
439 mOutput.editState().usesDeviceComposition = true;
440
441 EXPECT_CALL(mOutput, chooseCompositionStrategy()).Times(1);
442 EXPECT_CALL(*mRenderSurface, prepareFrame(false, true));
443
444 mOutput.prepareFrame();
445}
446
447// Note: Use OutputTest and not OutputPrepareFrameTest, so the real
448// base chooseCompositionStrategy() is invoked.
449TEST_F(OutputTest, prepareFrameSetsClientCompositionOnlyByDefault) {
450 mOutput.editState().isEnabled = true;
451 mOutput.editState().usesClientComposition = false;
452 mOutput.editState().usesDeviceComposition = true;
453
454 EXPECT_CALL(*mRenderSurface, prepareFrame(true, false));
455
456 mOutput.prepareFrame();
457
458 EXPECT_TRUE(mOutput.getState().usesClientComposition);
459 EXPECT_FALSE(mOutput.getState().usesDeviceComposition);
460}
461
Lloyd Pique56eba802019-08-28 15:45:25 -0700462/*
463 * Output::composeSurfaces()
464 */
465
466struct OutputComposeSurfacesTest : public testing::Test {
467 static constexpr uint32_t kDefaultOutputOrientation = TR_IDENT;
468 static constexpr ui::Dataspace kDefaultOutputDataspace = ui::Dataspace::DISPLAY_P3;
469
470 static const Rect kDefaultOutputFrame;
471 static const Rect kDefaultOutputViewport;
472 static const Rect kDefaultOutputScissor;
473 static const mat4 kDefaultColorTransformMat;
474
475 struct OutputPartialMock : public impl::Output {
476 OutputPartialMock(const compositionengine::CompositionEngine& compositionEngine)
477 : impl::Output(compositionEngine) {}
478
479 // Sets up the helper functions called by composeSurfaces to use a mock
480 // implementations.
481 MOCK_CONST_METHOD0(getSkipColorTransform, bool());
482 MOCK_METHOD2(generateClientCompositionRequests,
483 std::vector<renderengine::LayerSettings>(bool, Region&));
484 MOCK_METHOD2(appendRegionFlashRequests,
485 void(const Region&, std::vector<renderengine::LayerSettings>&));
486 MOCK_METHOD1(setExpensiveRenderingExpected, void(bool));
487 };
488
489 OutputComposeSurfacesTest() {
490 mOutput.setDisplayColorProfileForTest(
491 std::unique_ptr<DisplayColorProfile>(mDisplayColorProfile));
492 mOutput.setRenderSurfaceForTest(std::unique_ptr<RenderSurface>(mRenderSurface));
493
494 Output::OutputLayers outputLayers;
495 outputLayers.emplace_back(std::unique_ptr<OutputLayer>(mOutputLayer1));
496 outputLayers.emplace_back(std::unique_ptr<OutputLayer>(mOutputLayer2));
497 mOutput.setOutputLayersOrderedByZ(std::move(outputLayers));
498
499 mOutput.editState().frame = kDefaultOutputFrame;
500 mOutput.editState().viewport = kDefaultOutputViewport;
501 mOutput.editState().scissor = kDefaultOutputScissor;
502 mOutput.editState().transform = ui::Transform{kDefaultOutputOrientation};
503 mOutput.editState().orientation = kDefaultOutputOrientation;
504 mOutput.editState().dataspace = kDefaultOutputDataspace;
505 mOutput.editState().colorTransformMat = kDefaultColorTransformMat;
506 mOutput.editState().isSecure = true;
507 mOutput.editState().needsFiltering = false;
508 mOutput.editState().usesClientComposition = true;
509 mOutput.editState().usesDeviceComposition = false;
510
511 EXPECT_CALL(mCompositionEngine, getRenderEngine()).WillRepeatedly(ReturnRef(mRenderEngine));
512 }
513
514 StrictMock<mock::CompositionEngine> mCompositionEngine;
515 StrictMock<renderengine::mock::RenderEngine> mRenderEngine;
516 mock::DisplayColorProfile* mDisplayColorProfile = new StrictMock<mock::DisplayColorProfile>();
517 mock::RenderSurface* mRenderSurface = new StrictMock<mock::RenderSurface>();
518 mock::OutputLayer* mOutputLayer1 = new StrictMock<mock::OutputLayer>();
519 mock::OutputLayer* mOutputLayer2 = new StrictMock<mock::OutputLayer>();
520 StrictMock<OutputPartialMock> mOutput{mCompositionEngine};
521 sp<GraphicBuffer> mOutputBuffer = new GraphicBuffer();
522};
523
524const Rect OutputComposeSurfacesTest::kDefaultOutputFrame{1001, 1002, 1003, 1004};
525const Rect OutputComposeSurfacesTest::kDefaultOutputViewport{1005, 1006, 1007, 1008};
526const Rect OutputComposeSurfacesTest::kDefaultOutputScissor{1009, 1010, 1011, 1012};
527const mat4 OutputComposeSurfacesTest::kDefaultColorTransformMat{mat4() * 0.5};
528
529// TODO(b/121291683): Expand unit test coverage for composeSurfaces beyond these
530// basic tests.
531
532TEST_F(OutputComposeSurfacesTest, doesNothingIfNoClientComposition) {
533 mOutput.editState().usesClientComposition = false;
534
535 Region debugRegion;
Lloyd Piqued3d69882019-02-28 16:03:46 -0800536 std::optional<base::unique_fd> readyFence = mOutput.composeSurfaces(debugRegion);
537 EXPECT_TRUE(readyFence);
Lloyd Pique56eba802019-08-28 15:45:25 -0700538}
539
540TEST_F(OutputComposeSurfacesTest, worksIfNoClientLayersQueued) {
541 const Region kDebugRegion{Rect{100, 101, 102, 103}};
542
543 constexpr float kDefaultMaxLuminance = 1.0f;
544 constexpr float kDefaultAvgLuminance = 0.7f;
545 constexpr float kDefaultMinLuminance = 0.1f;
546 HdrCapabilities HdrCapabilities{{},
547 kDefaultMaxLuminance,
548 kDefaultAvgLuminance,
549 kDefaultMinLuminance};
550
551 EXPECT_CALL(mRenderEngine, supportsProtectedContent()).WillOnce(Return(false));
552 EXPECT_CALL(mRenderEngine, drawLayers(_, _, _, true, _, _)).Times(1);
553
554 EXPECT_CALL(*mDisplayColorProfile, hasWideColorGamut()).WillOnce(Return(true));
555 EXPECT_CALL(*mDisplayColorProfile, getHdrCapabilities()).WillOnce(ReturnRef(HdrCapabilities));
556
557 EXPECT_CALL(*mRenderSurface, dequeueBuffer(_)).WillOnce(Return(mOutputBuffer));
558
559 EXPECT_CALL(mOutput, getSkipColorTransform()).WillOnce(Return(false));
560 EXPECT_CALL(mOutput, generateClientCompositionRequests(false, _)).Times(1);
561 EXPECT_CALL(mOutput, appendRegionFlashRequests(RegionEq(kDebugRegion), _)).Times(1);
562 EXPECT_CALL(mOutput, setExpensiveRenderingExpected(true)).Times(1);
563 EXPECT_CALL(mOutput, setExpensiveRenderingExpected(false)).Times(1);
564
Lloyd Piqued3d69882019-02-28 16:03:46 -0800565 std::optional<base::unique_fd> readyFence = mOutput.composeSurfaces(kDebugRegion);
566 EXPECT_TRUE(readyFence);
Lloyd Pique56eba802019-08-28 15:45:25 -0700567}
568
569/*
570 * Output::generateClientCompositionRequests()
571 */
572
573struct GenerateClientCompositionRequestsTest : public testing::Test {
574 struct OutputPartialMock : public impl::Output {
575 OutputPartialMock(const compositionengine::CompositionEngine& compositionEngine)
576 : impl::Output(compositionEngine) {}
577
578 std::vector<renderengine::LayerSettings> generateClientCompositionRequests(
579 bool supportsProtectedContent, Region& clearRegion) override {
580 return impl::Output::generateClientCompositionRequests(supportsProtectedContent,
581 clearRegion);
582 }
583 };
584
585 GenerateClientCompositionRequestsTest() {
586 mOutput.setDisplayColorProfileForTest(
587 std::unique_ptr<DisplayColorProfile>(mDisplayColorProfile));
588 mOutput.setRenderSurfaceForTest(std::unique_ptr<RenderSurface>(mRenderSurface));
589 }
590
591 StrictMock<mock::CompositionEngine> mCompositionEngine;
592 mock::DisplayColorProfile* mDisplayColorProfile = new StrictMock<mock::DisplayColorProfile>();
593 mock::RenderSurface* mRenderSurface = new StrictMock<mock::RenderSurface>();
594 StrictMock<OutputPartialMock> mOutput{mCompositionEngine};
595};
596
597// TODO(b/121291683): Add more unit test coverage for generateClientCompositionRequests
598
599TEST_F(GenerateClientCompositionRequestsTest, worksForLandscapeModeSplitScreen) {
600 // In split-screen landscape mode, the screen is rotated 90 degrees, with
601 // one layer on the left covering the left side of the output, and one layer
602 // on the right covering that side of the output.
603
604 mock::OutputLayer* leftOutputLayer = new StrictMock<mock::OutputLayer>();
605 mock::OutputLayer* rightOutputLayer = new StrictMock<mock::OutputLayer>();
606
607 StrictMock<mock::Layer> leftLayer;
608 StrictMock<mock::LayerFE> leftLayerFE;
609 StrictMock<mock::Layer> rightLayer;
610 StrictMock<mock::LayerFE> rightLayerFE;
611
612 impl::OutputLayerCompositionState leftOutputLayerState;
613 leftOutputLayerState.clearClientTarget = false;
614
615 impl::LayerCompositionState leftLayerState;
616 leftLayerState.frontEnd.geomVisibleRegion = Region{Rect{0, 0, 1000, 1000}};
617 leftLayerState.frontEnd.isOpaque = true;
618
619 const half3 leftLayerColor{1.f, 0.f, 0.f};
620 renderengine::LayerSettings leftLayerRESettings;
621 leftLayerRESettings.source.solidColor = leftLayerColor;
622
623 impl::OutputLayerCompositionState rightOutputLayerState;
624 rightOutputLayerState.clearClientTarget = false;
625
626 impl::LayerCompositionState rightLayerState;
627 rightLayerState.frontEnd.geomVisibleRegion = Region{Rect{1000, 0, 2000, 1000}};
628 rightLayerState.frontEnd.isOpaque = true;
629
630 const half3 rightLayerColor{0.f, 1.f, 0.f};
631 renderengine::LayerSettings rightLayerRESettings;
632 rightLayerRESettings.source.solidColor = rightLayerColor;
633
634 EXPECT_CALL(*leftOutputLayer, getState()).WillRepeatedly(ReturnRef(leftOutputLayerState));
635 EXPECT_CALL(*leftOutputLayer, getLayer()).WillRepeatedly(ReturnRef(leftLayer));
636 EXPECT_CALL(*leftOutputLayer, getLayerFE()).WillRepeatedly(ReturnRef(leftLayerFE));
637 EXPECT_CALL(*leftOutputLayer, requiresClientComposition()).WillRepeatedly(Return(true));
638 EXPECT_CALL(*leftOutputLayer, needsFiltering()).WillRepeatedly(Return(false));
639 EXPECT_CALL(leftLayer, getState()).WillRepeatedly(ReturnRef(leftLayerState));
640 EXPECT_CALL(leftLayerFE, prepareClientComposition(_)).WillOnce(Return(leftLayerRESettings));
641
642 EXPECT_CALL(*rightOutputLayer, getState()).WillRepeatedly(ReturnRef(rightOutputLayerState));
643 EXPECT_CALL(*rightOutputLayer, getLayer()).WillRepeatedly(ReturnRef(rightLayer));
644 EXPECT_CALL(*rightOutputLayer, getLayerFE()).WillRepeatedly(ReturnRef(rightLayerFE));
645 EXPECT_CALL(*rightOutputLayer, requiresClientComposition()).WillRepeatedly(Return(true));
646 EXPECT_CALL(*rightOutputLayer, needsFiltering()).WillRepeatedly(Return(false));
647 EXPECT_CALL(rightLayer, getState()).WillRepeatedly(ReturnRef(rightLayerState));
648 EXPECT_CALL(rightLayerFE, prepareClientComposition(_)).WillOnce(Return(rightLayerRESettings));
649
650 Output::OutputLayers outputLayers;
651 outputLayers.emplace_back(std::unique_ptr<OutputLayer>(leftOutputLayer));
652 outputLayers.emplace_back(std::unique_ptr<OutputLayer>(rightOutputLayer));
653 mOutput.setOutputLayersOrderedByZ(std::move(outputLayers));
654
655 const Rect kPortraitFrame(0, 0, 1000, 2000);
656 const Rect kPortraitViewport(0, 0, 2000, 1000);
657 const Rect kPortraitScissor(0, 0, 1000, 2000);
658 const uint32_t kPortraitOrientation = TR_ROT_90;
659
660 mOutput.editState().frame = kPortraitFrame;
661 mOutput.editState().viewport = kPortraitViewport;
662 mOutput.editState().scissor = kPortraitScissor;
663 mOutput.editState().transform = ui::Transform{kPortraitOrientation};
664 mOutput.editState().orientation = kPortraitOrientation;
665 mOutput.editState().needsFiltering = true;
666 mOutput.editState().isSecure = false;
667
668 constexpr bool supportsProtectedContent = false;
669 Region clearRegion;
670 auto requests =
671 mOutput.generateClientCompositionRequests(supportsProtectedContent, clearRegion);
672
673 ASSERT_EQ(2u, requests.size());
674 EXPECT_EQ(leftLayerColor, requests[0].source.solidColor);
675 EXPECT_EQ(rightLayerColor, requests[1].source.solidColor);
676}
677
678TEST_F(GenerateClientCompositionRequestsTest, ignoresLayersThatDoNotIntersectWithViewport) {
679 // Layers whose visible region does not intersect with the viewport will be
680 // skipped when generating client composition request state.
681
682 mock::OutputLayer* outputLayer = new StrictMock<mock::OutputLayer>();
683 StrictMock<mock::Layer> layer;
684 StrictMock<mock::LayerFE> layerFE;
685
686 impl::OutputLayerCompositionState outputLayerState;
687 outputLayerState.clearClientTarget = false;
688
689 impl::LayerCompositionState layerState;
690 layerState.frontEnd.geomVisibleRegion = Region{Rect{3000, 0, 4000, 1000}};
691 layerState.frontEnd.isOpaque = true;
692
693 EXPECT_CALL(*outputLayer, getState()).WillRepeatedly(ReturnRef(outputLayerState));
694 EXPECT_CALL(*outputLayer, getLayer()).WillRepeatedly(ReturnRef(layer));
695 EXPECT_CALL(*outputLayer, getLayerFE()).WillRepeatedly(ReturnRef(layerFE));
696 EXPECT_CALL(*outputLayer, requiresClientComposition()).WillRepeatedly(Return(true));
697 EXPECT_CALL(*outputLayer, needsFiltering()).WillRepeatedly(Return(false));
698 EXPECT_CALL(layer, getState()).WillRepeatedly(ReturnRef(layerState));
699 EXPECT_CALL(layerFE, prepareClientComposition(_)).Times(0);
700
701 Output::OutputLayers outputLayers;
702 outputLayers.emplace_back(std::unique_ptr<OutputLayer>(outputLayer));
703 mOutput.setOutputLayersOrderedByZ(std::move(outputLayers));
704
705 const Rect kPortraitFrame(0, 0, 1000, 2000);
706 const Rect kPortraitViewport(0, 0, 2000, 1000);
707 const Rect kPortraitScissor(0, 0, 1000, 2000);
708 const uint32_t kPortraitOrientation = TR_ROT_90;
709
710 mOutput.editState().frame = kPortraitFrame;
711 mOutput.editState().viewport = kPortraitViewport;
712 mOutput.editState().scissor = kPortraitScissor;
713 mOutput.editState().transform = ui::Transform{kPortraitOrientation};
714 mOutput.editState().orientation = kPortraitOrientation;
715 mOutput.editState().needsFiltering = true;
716 mOutput.editState().isSecure = false;
717
718 constexpr bool supportsProtectedContent = false;
719 Region clearRegion;
720 auto requests =
721 mOutput.generateClientCompositionRequests(supportsProtectedContent, clearRegion);
722
723 EXPECT_EQ(0u, requests.size());
724}
725
Lloyd Piquec2d54d42019-08-28 18:04:21 -0700726TEST_F(GenerateClientCompositionRequestsTest, clearsDeviceLayesAfterFirst) {
727 // If client composition is performed with some layers set to use device
728 // composition, device layers after the first layer (device or client) will
729 // clear the frame buffer if they are opaque and if that layer has a flag
730 // set to do so. The first layer is skipped as the frame buffer is already
731 // expected to be clear.
732
733 mock::OutputLayer* leftOutputLayer = new StrictMock<mock::OutputLayer>();
734 mock::OutputLayer* rightOutputLayer = new StrictMock<mock::OutputLayer>();
735
736 StrictMock<mock::Layer> leftLayer;
737 StrictMock<mock::LayerFE> leftLayerFE;
738 StrictMock<mock::Layer> rightLayer;
739 StrictMock<mock::LayerFE> rightLayerFE;
740
741 impl::OutputLayerCompositionState leftOutputLayerState;
742 leftOutputLayerState.clearClientTarget = true;
743
744 impl::LayerCompositionState leftLayerState;
745 leftLayerState.frontEnd.geomVisibleRegion = Region{Rect{0, 0, 1000, 1000}};
746 leftLayerState.frontEnd.isOpaque = true;
747
748 impl::OutputLayerCompositionState rightOutputLayerState;
749 rightOutputLayerState.clearClientTarget = true;
750
751 impl::LayerCompositionState rightLayerState;
752 rightLayerState.frontEnd.geomVisibleRegion = Region{Rect{1000, 0, 2000, 1000}};
753 rightLayerState.frontEnd.isOpaque = true;
754
755 const half3 rightLayerColor{0.f, 1.f, 0.f};
756 renderengine::LayerSettings rightLayerRESettings;
757 rightLayerRESettings.geometry.boundaries = FloatRect{456, 0, 0, 0};
758 rightLayerRESettings.source.solidColor = rightLayerColor;
759
760 EXPECT_CALL(*leftOutputLayer, getState()).WillRepeatedly(ReturnRef(leftOutputLayerState));
761 EXPECT_CALL(*leftOutputLayer, getLayer()).WillRepeatedly(ReturnRef(leftLayer));
762 EXPECT_CALL(*leftOutputLayer, getLayerFE()).WillRepeatedly(ReturnRef(leftLayerFE));
763 EXPECT_CALL(*leftOutputLayer, requiresClientComposition()).WillRepeatedly(Return(false));
764 EXPECT_CALL(*leftOutputLayer, needsFiltering()).WillRepeatedly(Return(false));
765 EXPECT_CALL(leftLayer, getState()).WillRepeatedly(ReturnRef(leftLayerState));
766
767 EXPECT_CALL(*rightOutputLayer, getState()).WillRepeatedly(ReturnRef(rightOutputLayerState));
768 EXPECT_CALL(*rightOutputLayer, getLayer()).WillRepeatedly(ReturnRef(rightLayer));
769 EXPECT_CALL(*rightOutputLayer, getLayerFE()).WillRepeatedly(ReturnRef(rightLayerFE));
770 EXPECT_CALL(*rightOutputLayer, requiresClientComposition()).WillRepeatedly(Return(false));
771 EXPECT_CALL(*rightOutputLayer, needsFiltering()).WillRepeatedly(Return(false));
772 EXPECT_CALL(rightLayer, getState()).WillRepeatedly(ReturnRef(rightLayerState));
773 EXPECT_CALL(rightLayerFE, prepareClientComposition(_)).WillOnce(Return(rightLayerRESettings));
774
775 Output::OutputLayers outputLayers;
776 outputLayers.emplace_back(std::unique_ptr<OutputLayer>(leftOutputLayer));
777 outputLayers.emplace_back(std::unique_ptr<OutputLayer>(rightOutputLayer));
778 mOutput.setOutputLayersOrderedByZ(std::move(outputLayers));
779
780 const Rect kPortraitFrame(0, 0, 1000, 2000);
781 const Rect kPortraitViewport(0, 0, 2000, 1000);
782 const Rect kPortraitScissor(0, 0, 1000, 2000);
783 const uint32_t kPortraitOrientation = TR_ROT_90;
784
785 mOutput.editState().frame = kPortraitFrame;
786 mOutput.editState().viewport = kPortraitViewport;
787 mOutput.editState().scissor = kPortraitScissor;
788 mOutput.editState().transform = ui::Transform{kPortraitOrientation};
789 mOutput.editState().orientation = kPortraitOrientation;
790 mOutput.editState().needsFiltering = true;
791 mOutput.editState().isSecure = false;
792
793 constexpr bool supportsProtectedContent = false;
794 Region clearRegion;
795 auto requests =
796 mOutput.generateClientCompositionRequests(supportsProtectedContent, clearRegion);
797
798 const half3 clearColor{0.f, 0.f, 0.f};
799
800 ASSERT_EQ(1u, requests.size());
801 EXPECT_EQ(456.f, requests[0].geometry.boundaries.left);
802 EXPECT_EQ(clearColor, requests[0].source.solidColor);
803}
804
Lloyd Pique32cbe282018-10-19 13:09:22 -0700805} // namespace
806} // namespace android::compositionengine