RenderState.h 1.5 KB

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