Changeset View
Changeset View
Standalone View
Standalone View
plugins/platforms/drm/drm_output.h
Show First 20 Lines • Show All 125 Lines • ▼ Show 20 Line(s) | 60 | public: | |||
---|---|---|---|---|---|
126 | bool isInternal() const { | 126 | bool isInternal() const { | ||
127 | return m_internal; | 127 | return m_internal; | ||
128 | } | 128 | } | ||
129 | 129 | | |||
130 | Qt::ScreenOrientation orientation() const { | 130 | Qt::ScreenOrientation orientation() const { | ||
131 | return m_orientation; | 131 | return m_orientation; | ||
132 | } | 132 | } | ||
133 | 133 | | |||
134 | const KWayland::Server::OutputInterface* getWaylandInterface() const { | ||||
135 | return m_waylandOutput.data(); | ||||
romangg: This gives me an compile error: invalid static_cast from type 'QObject*' to type 'KWayland… | |||||
Fixed. Also removed override in places where it didn't compile because of it. Kanedias: Fixed. Also removed `override` in places where it didn't compile because of it. | |||||
136 | } | ||||
137 | | ||||
134 | Q_SIGNALS: | 138 | Q_SIGNALS: | ||
135 | void dpmsChanged(); | 139 | void dpmsChanged(); | ||
136 | void modeChanged(); | 140 | void modeChanged(); | ||
137 | 141 | | |||
138 | private: | 142 | private: | ||
139 | friend class DrmBackend; | 143 | friend class DrmBackend; | ||
Is it only a friend class to access m_waylandOutput.data()? In this case better create a getter for it in DrmOutput. Or better do the passBuffer call in DrmBackend::present and give instead of the DrmOutput the KWayland::Server::OutputInterface from there to passBuffer. romangg: Is it only a friend class to access `m_waylandOutput.data()`? In this case better create a… | |||||
Regarding the "better" part: you would need the m_remoteaccessManager in DrmBackend. Only with EGL/GBM this would then be set. I.e. in QPainter DrmBackend would ignore it. But that's maybe a bit too much (also you would need to change the buffer cast in passBuffer). So better just add a getter in DrmOutput. romangg: Regarding the "better" part: you would need the `m_remoteaccessManager` in `DrmBackend`. Only… | |||||
140 | friend class DrmCrtc; // TODO: For use of setModeLegacy. Remove later when we allow multiple connectors per crtc | 144 | friend class DrmCrtc; // TODO: For use of setModeLegacy. Remove later when we allow multiple connectors per crtc | ||
141 | // and save the connector ids in the DrmCrtc instance. | 145 | // and save the connector ids in the DrmCrtc instance. | ||
142 | DrmOutput(DrmBackend *backend); | 146 | DrmOutput(DrmBackend *backend); | ||
143 | bool presentAtomically(DrmBuffer *buffer); | 147 | bool presentAtomically(DrmBuffer *buffer); | ||
144 | 148 | | |||
145 | enum class AtomicCommitMode { | 149 | enum class AtomicCommitMode { | ||
146 | Test, | 150 | Test, | ||
147 | Real | 151 | Real | ||
▲ Show 20 Lines • Show All 71 Lines • Show Last 20 Lines |
This gives me an compile error: invalid static_cast from type 'QObject*' to type 'KWayland::Server::OutputInterface*'
I assume you can just pass m_waylandOutput as QPointer and then access data() in passBuffer. This compiled for me.