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