1 /* 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 #pragma once 18 19 #include <chrono> 20 #include <optional> 21 #include <vector> 22 23 #include <compositionengine/Display.h> 24 #include <compositionengine/LayerFE.h> 25 #include <compositionengine/OutputColorSetting.h> 26 #include <math/mat4.h> 27 #include <ui/Transform.h> 28 29 namespace android::compositionengine { 30 31 using Layers = std::vector<sp<compositionengine::LayerFE>>; 32 using Outputs = std::vector<std::shared_ptr<compositionengine::Output>>; 33 34 /** 35 * A parameter object for refreshing a set of outputs 36 */ 37 struct CompositionRefreshArgs { 38 // All the outputs being refreshed 39 Outputs outputs; 40 41 // All the layers that are potentially visible in the outputs. The order of 42 // the layers is important, and should be in traversal order from back to 43 // front. 44 Layers layers; 45 46 // All the layers that have queued updates. 47 Layers layersWithQueuedFrames; 48 49 // If true, forces the entire display to be considered dirty and repainted 50 bool repaintEverything{false}; 51 52 // Controls how the color mode is chosen for an output 53 OutputColorSetting outputColorSetting{OutputColorSetting::kEnhanced}; 54 55 // If not Dataspace::UNKNOWN, overrides the dataspace on each output 56 ui::Dataspace colorSpaceAgnosticDataspace{ui::Dataspace::UNKNOWN}; 57 58 // Forces a color mode on the outputs being refreshed 59 ui::ColorMode forceOutputColorMode{ui::ColorMode::NATIVE}; 60 61 // Used to correctly apply an inverse-display buffer transform if applicable 62 ui::Transform::RotationFlags internalDisplayRotationFlags{ui::Transform::ROT_0}; 63 64 // If true, GPU clocks will be increased when rendering blurs 65 bool blursAreExpensive{false}; 66 67 // If true, the complete output geometry needs to be recomputed this frame 68 bool updatingOutputGeometryThisFrame{false}; 69 70 // If true, there was a geometry update this frame 71 bool updatingGeometryThisFrame{false}; 72 73 // The color matrix to use for this 74 // frame. Only set if the color transform is changing this frame. 75 std::optional<mat4> colorTransformMatrix; 76 77 // If true, client composition is always used. 78 bool devOptForceClientComposition{false}; 79 80 // If set, causes the dirty regions to flash with the delay 81 std::optional<std::chrono::microseconds> devOptFlashDirtyRegionsDelay; 82 }; 83 84 } // namespace android::compositionengine 85