<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:SimSun;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:SimSun;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:SimSun;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:Verdana;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
code
{mso-style-priority:99;
font-family:"Courier New";}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.apple-converted-space
{mso-style-name:apple-converted-space;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal>Dear all,<o:p></o:p></p><p class=MsoNormal>I have app which was developed by qt4, and we want to port it to tizen ivi wayland platform, so I have to update our app to qt5.<o:p></o:p></p><p class=MsoNormal>We have a feature : drawing something based on egl on a qt window(we use QDialog). <o:p></o:p></p><p class=MsoNormal>Egl need a EGLSurface and a EGLDisplay to get the feature work.<o:p></o:p></p><table class=MsoNormalTable border=0 cellpadding=0><tr><td style='border:solid black 1.0pt;background:#E6E6E6;padding:.75pt .75pt .75pt .75pt'><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";color:black'>EGLSurface <b>eglCreateWindowSurface</b>(</span><span style='font-size:12.0pt;font-family:"Verdana","sans-serif";color:black'><o:p></o:p></span></p></td><td style='border:solid black 1.0pt;background:#E6E6E6;padding:.75pt .75pt .75pt .75pt'><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Verdana","sans-serif";color:black'>EGLDisplay <i>display</i>,<o:p></o:p></span></p></td></tr><tr><td style='border:solid black 1.0pt;background:#E6E6E6;padding:.75pt .75pt .75pt .75pt'><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Verdana","sans-serif";color:black'> <o:p></o:p></span></p></td><td style='border:solid black 1.0pt;background:#E6E6E6;padding:.75pt .75pt .75pt .75pt'><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Verdana","sans-serif";color:black'>EGLConfig <i>config</i>,<o:p></o:p></span></p></td></tr><tr><td style='border:solid black 1.0pt;background:#E6E6E6;padding:.75pt .75pt .75pt .75pt'><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Verdana","sans-serif";color:black'> <o:p></o:p></span></p></td><td style='border:solid black 1.0pt;background:#E6E6E6;padding:.75pt .75pt .75pt .75pt'><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Verdana","sans-serif";color:black'>NativeWindowType <i>native_window</i>,<o:p></o:p></span></p></td></tr><tr><td style='border:solid black 1.0pt;background:#E6E6E6;padding:.75pt .75pt .75pt .75pt'><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Verdana","sans-serif";color:black'> <o:p></o:p></span></p></td><td style='border:solid black 1.0pt;background:#E6E6E6;padding:.75pt .75pt .75pt .75pt'><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Verdana","sans-serif";color:black'>EGLint const * <i>attrib_list</i></span><span style='font-size:10.0pt;font-family:"Courier New";color:black'>)</span><span style='font-size:12.0pt;font-family:"Verdana","sans-serif";color:black'>;<o:p></o:p></span></p></td></tr></table><p class=MsoNormal>In x11 based OS like ubuntu 12.04 , we use EGL_DEFAULT_DISPLAY to get display, the qt window’s winId() to cast to NativeWindowType<o:p></o:p></p><p class=MsoNormal>It works well on X11 based OS.<o:p></o:p></p><p class=MsoNormal>But when it comes to wayland ,it will crash at <b><span style='font-size:10.0pt;font-family:"Courier New";color:black'>eglCreateWindowSurface</span></b><b><span style='font-size:10.0pt;font-family:"Courier New";color:black'>, </span></b>I googled a lot ,but rarely got something useful.<o:p></o:p></p><p class=MsoNormal>Someone said that to get <b><span style='font-size:10.0pt;font-family:"Courier New";color:black'>eglCreateWindowSurface</span></b><b><span style='font-size:10.0pt;font-family:"Courier New";color:black'> </span></b>work on wayland ,the native_window has to be a wl_egl_window type. <o:p></o:p></p><p class=MsoNormal>I tried to get it like bellow:<o:p></o:p></p><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Courier New";color:black'><o:p> </o:p></span></b></p><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Courier New";color:black'>QDialog *dialog = new QDialog(mainW);<o:p></o:p></span></b></p><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Courier New";color:black'>dialog->setGeometry(QRect(0, 0, 720, 430));<o:p></o:p></span></b></p><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Courier New";color:black'>dialog->show();<o:p></o:p></span></b></p><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Courier New";color:black'><o:p> </o:p></span></b></p><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Courier New";color:black'> QPlatformNativeInterface *native =<o:p></o:p></span></b></p><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Courier New";color:black'> QGuiApplication::platformNativeInterface();<o:p></o:p></span></b></p><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Courier New";color:black'> struct wl_display *wl_dpy = (struct wl_display *)<o:p></o:p></span></b></p><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Courier New";color:black'> native->nativeResourceForWindow("display", NULL);<o:p></o:p></span></b></p><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Courier New";color:black'> struct wl_surface *surface = static_cast<struct wl_surface *>(<o:p></o:p></span></b></p><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Courier New";color:black'> native->nativeResourceForWindow("surface", dialog->windowHandle()));<o:p></o:p></span></b></p><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Courier New";color:black'>struct wl_egl_window * wl_wind = wl_egl_window_create(surface, 720,430 );<o:p></o:p></span></b></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>use the wl_wind and wl_dpy to eglCreateWindowSurface , the app didn’t crash ,but the graphics we want to draw on the window can’t be seen.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Is there someone met this before? Can somebody give some advices? <o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Thanks and Best Regards<o:p></o:p></p><p class=MsoNormal>Steve Zhou<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p></div><p>CONFIDENTIALITY NOTICE: The information contained in this message may be privileged and/or confidential. If you are not the intended recipient, or responsible for delivering this message to the intended recipient, any review, forwarding, dissemination, distribution or copying of this communication or any attachment(s) is strictly prohibited. If you have received this message in error, please notify the sender immediately, and delete it and all attachments from your computer and network.</p>
</body></html>