1 /* 2 * Copyright 2017 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 <hardware/hwcomposer2.h> 20 21 #include <vector> 22 23 namespace sftest { 24 // Description of a rendered rectangle. Should only contain 25 // instructions necessary to rasterize the rectangle. The full scene 26 // is given as a sorted list of rectangles, bottom layer at index 0. 27 class RenderState { 28 public: 29 RenderState() = default; 30 // Default copy-ctor 31 32 hwc_rect_t mDisplayFrame = {0, 0, 0, 0}; 33 hwc_frect_t mSourceCrop = {0.f, 0.f, 0.f, 0.f}; 34 std::vector<hwc_rect_t> mVisibleRegion; 35 hwc2_blend_mode_t mBlendMode = HWC2_BLEND_MODE_NONE; 36 buffer_handle_t mBuffer = 0; 37 uint32_t mSwapCount = 0; // How many set buffer calls to the layer. 38 int32_t mAcquireFence = 0; // Probably should not be here. 39 float mPlaneAlpha = 0.f; 40 hwc_color_t mLayerColor = {0, 0, 0, 0}; 41 hwc_transform_t mTransform = static_cast<hwc_transform_t>(0); 42 }; 43 44 } // namespace sftest 45