1.10
kmsoverlay.h
1/*
2 * Copyright (C) 2018 Microchip Technology Inc. All rights reserved.
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6#ifndef EGT_DETAIL_SCREEN_KMSOVERLAY_H
7#define EGT_DETAIL_SCREEN_KMSOVERLAY_H
8
14#include <egt/detail/meta.h>
15#include <egt/detail/screen/kmstype.h>
16#include <egt/input.h>
17#include <egt/screen.h>
18#include <egt/widgetflags.h>
19#include <memory>
20
21struct plane_data;
22
23namespace egt
24{
25inline namespace v1
26{
27namespace detail
28{
29struct FlipThread;
30
36class EGT_API KMSOverlay : public Screen
37{
38public:
39
40 KMSOverlay() = delete;
41
47 KMSOverlay(const Size& size, PixelFormat format, WindowHint hint);
48
55 virtual void resize(const Size& size);
57 virtual void position(const DisplayPoint& point);
64 virtual void scale(float hscale, float vscale);
68 virtual void pan_size(const Size& size);
72 virtual void pan_pos(const Point& point);
74 virtual float hscale() const;
76 virtual float vscale() const;
77
79 virtual uint32_t get_plane_format();
80
82 virtual void hide();
83
85 virtual void show();
86
88 virtual int gem();
89
91 virtual void apply();
92
94 void* raw();
95
97 inline plane_data* s() const
98 {
99 return m_plane.get();
100 }
101
103 virtual void rotate(uint32_t degrees);
104
105 void schedule_flip() override;
106
107 uint32_t index() override;
108
109protected:
113 uint32_t m_index{0};
115 std::unique_ptr<FlipThread> m_pool;
116};
117
118}
119}
120}
121
122#endif
Manages one of more buffers that make up a Screen.
Definition screen.h:34
Screen in a KMS dumb buffer inside of an overlay plane.
Definition kmsoverlay.h:37
virtual float vscale() const
Get the vertical scale value.
virtual void apply()
Apply any pending changes to the hardware.
virtual void position(const DisplayPoint &point)
Move the hardware plane to the specified position.
virtual void pan_size(const Size &size)
Set the hardware pan size.
virtual int gem()
Get the associated GEM handle for the overlay plane.
KMSOverlay(const Size &size, PixelFormat format, WindowHint hint)
virtual uint32_t get_plane_format()
Get internal DRM plane format.
virtual void rotate(uint32_t degrees)
Rotate the hardware plane.
uint32_t index() override
If the screen implementation manages multiple buffers, this will return the index of the current buff...
virtual void show()
Show the plane on the display.
virtual float hscale() const
Get the horizontal scale value.
unique_plane_t m_plane
Plane instance pointer.
Definition kmsoverlay.h:111
std::unique_ptr< FlipThread > m_pool
Internal thread pool for flipping.
Definition kmsoverlay.h:115
void schedule_flip() override
Schedule a flip to occur later.
virtual void hide()
Hide the plane from the display.
plane_data * s() const
Get a pointer to the internal plane structure.
Definition kmsoverlay.h:97
virtual void scale(float hscale, float vscale)
Change the hardware scale of the overlay plane.
virtual void resize(const Size &size)
Resize the hardware plane.
virtual void pan_pos(const Point &point)
Set the hardware pan position in the plane buffer.
void * raw()
Get a raw pointer to the current framebuffer.
std::unique_ptr< plane_data, detail::plane_t_deleter > unique_plane_t
Unique pointer for a cairo context.
Definition kmstype.h:30
WindowHint
Hint used for configuring Window backends.
Definition widgetflags.h:683
PixelFormat
Supported pixel formats.
Definition types.h:94
EGT framework namespace.
Definition animation.h:24