Skip to content

Commit e534dcd

Browse files
author
msieben
committed
[wpebackend-rdk/wpeframework-clientlibraries]: Add and use timer based vsync for scanout on VC6.
1 parent c78ed1c commit e534dcd

File tree

2 files changed

+57
-0
lines changed

2 files changed

+57
-0
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
--- a/src/wpeframework/display.cpp
2+
+++ b/src/wpeframework/display.cpp
3+
@@ -219,6 +220,16 @@
4+
_callback->Touch(index, state, x, y);
5+
}
6+
7+
+gboolean vsyncCallback (gpointer data) {
8+
+ Compositor::IDisplay* _display = static_cast <Compositor::IDisplay *> (data);
9+
+
10+
+ if (_display != nullptr) {
11+
+ /* int */ _display->Process (0);
12+
+ }
13+
+
14+
+ return TRUE;
15+
+}
16+
+
17+
// -----------------------------------------------------------------------------------------
18+
// Display wrapper around the wayland abstraction class
19+
// -----------------------------------------------------------------------------------------
20+
@@ -247,6 +258,23 @@
21+
g_source_set_can_recurse(m_eventSource, TRUE);
22+
g_source_attach(m_eventSource, g_main_context_get_thread_default());
23+
}
24+
+ else {
25+
+ const char* _MAXFPS = ::getenv("WEBKIT_MAXIMUM_FPS");
26+
+
27+
+ uint32_t _fps = 60;
28+
+
29+
+ if (_MAXFPS != nullptr) {
30+
+ _fps = ::atoi(_MAXFPS);
31+
+
32+
+ if (_fps == 0 || _fps > 60) {
33+
+ fprintf (stdout, "WEBKIT_MAXIMUM_FPS out of range. Limiting to 60 frames per second.\n");
34+
+ _fps = 60;
35+
+ }
36+
+ }
37+
+
38+
+ /* guint */ g_timeout_add (1000/_fps, vsyncCallback, m_display);
39+
+ }
40+
+
41+
}
42+
43+
Display::~Display()
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
--- a/Source/compositorclient/RPI/Implementation.cpp
2+
+++ b/Source/compositorclient/RPI/Implementation.cpp
3+
@@ -907,7 +907,11 @@
4+
5+
int Display::FileDescriptor() const
6+
{
7+
+#ifndef VC6
8+
return (_platform.Descriptor());
9+
+#else
10+
+ return -1;
11+
+#endif
12+
}
13+
14+
Compositor::IDisplay::ISurface* Display::SurfaceByName(const std::string& name)

0 commit comments

Comments
 (0)