CompositionEngine.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * Copyright 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 <memory>
  18. namespace android {
  19. class HWComposer;
  20. namespace renderengine {
  21. class RenderEngine;
  22. } // namespace renderengine
  23. namespace compositionengine {
  24. class Display;
  25. class Layer;
  26. struct DisplayCreationArgs;
  27. struct LayerCreationArgs;
  28. /**
  29. * Encapsulates all the interfaces and implementation details for performing
  30. * display output composition.
  31. */
  32. class CompositionEngine {
  33. public:
  34. virtual ~CompositionEngine();
  35. // Create a composition Display
  36. virtual std::shared_ptr<Display> createDisplay(DisplayCreationArgs&&) = 0;
  37. virtual std::shared_ptr<Layer> createLayer(LayerCreationArgs&&) = 0;
  38. virtual HWComposer& getHwComposer() const = 0;
  39. virtual void setHwComposer(std::unique_ptr<HWComposer>) = 0;
  40. virtual renderengine::RenderEngine& getRenderEngine() const = 0;
  41. virtual void setRenderEngine(std::unique_ptr<renderengine::RenderEngine>) = 0;
  42. };
  43. } // namespace compositionengine
  44. } // namespace android