ContainerLayer.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * Copyright (C) 2018 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 <sys/types.h>
  18. #include <cstdint>
  19. #include "Layer.h"
  20. namespace android {
  21. class ContainerLayer : public Layer {
  22. public:
  23. explicit ContainerLayer(const LayerCreationArgs&);
  24. ~ContainerLayer() override;
  25. const char* getTypeId() const override { return "ContainerLayer"; }
  26. bool isVisible() const override;
  27. void setPerFrameData(const sp<const DisplayDevice>& display, const ui::Transform& transform,
  28. const Rect& viewport, int32_t supportedPerFrameMetadata,
  29. const ui::Dataspace targetDataspace) override;
  30. bool isCreatedFromMainThread() const override { return true; }
  31. bool onPreComposition(nsecs_t /*refreshStartTime*/) override { return false; }
  32. protected:
  33. bool prepareClientLayer(const RenderArea& renderArea, const Region& clip,
  34. bool useIdentityTransform, Region& clearRegion,
  35. const bool supportProtectedContent,
  36. renderengine::LayerSettings& layer) override;
  37. };
  38. } // namespace android