+
+\begin{frame}[fragile,c]
+ \frametitle{Could we use shared context in WebKit?}
+
+ \setbeamertemplate{itemize/enumerate body begin}{\tiny}
+ \setbeamertemplate{itemize items}[triangle]
+ \begin{center}
+ \scriptsize{
+ \textbf{\color{coolblack} Could we use shared context in WebKit?}\\
+
+ \vspace{0.2cm}
+
+ \textbf{Short answer:} Currently yes (with some workaround) but not in the
+ future.
+
+ \vspace{0.3cm}
+
+ \begin{block}{Requirements to use shared context/textures in \textbf{WebKit}:}
+ \begin{itemize}
+ \item We should use the \textbf{ANGLE EGL/OpenGL backend in
+ WebGL2} to
+ match the main Graphics Pipeline API/driver (both contexts
+ should be OpenGL or GLESv2 and from the same driver!)
+ \item We'd need an \textbf{ANGLE extension} to allow passing
+ native shared context to ANGLE's eglCreateContext instead of
+ ANGLE shared context.
+ \item We should never move WebGL2 and Graphics Pipeline in
+ different processes. Shared contexts should be created by
+ the same process! (\textbf{Reason we've rejected this
+ method}).
+ \end{itemize}
+ \end{block}
+ }
+
+ \vspace{0.3cm}
+
+ \tiny{
+ \textbf{\color{coolblack}{NEW}} ANGLE extension:\\
+ \texttt{EGL\_ANGLE\_native\_shared\_context}
+
+ \vspace{0.2cm}
+
+
+ \textbf{\color{coolblack}NEW} \texttt{\color{afblue}EGLAttrib} attribute can be passed
+ to \texttt{\color{afblue}eglCreateContext}:\\
+ \texttt{EGL\_NATIVE\_SHARED\_CONTEXT\_ANGLE}
+
+ \vspace{0.3cm}
+ {\color{coolblack}
+ This attribute indicates that the shared context in
+ \texttt{\color{deepjunglegreen}eglCreateContext}
+ is \textbf{not ANGLE} and should be used as native in the internal
+ implementation.
+ }
+ }
+ \end{center}
+\end{frame}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\begin{frame}[fragile,c]
+ \frametitle{EGL\_ANGLE\_native\_shared\_context}
+
+ \setbeamertemplate{itemize/enumerate body begin}{\tiny}
+ \setbeamertemplate{itemize items}[triangle]{\tiny}
+ \setbeamercolor{block body}{bg=white}
+
+ \begin{center}
+ \tiny{
+ \begin{block}{This is how we create shared OpenGL
+ context using EGL (system or ANGLE):}
+ \centering
+ \begin{adjustbox}{max width=\textwidth}
+ \adjustbox{valign=t}{\includegraphics[height=1.3cm]{data/shared_ctx1.png}}
+ \end{adjustbox}
+
+ \begin{comment}
+ {\color{coolblack}
+ \begin{table}[t]
+ \centering
+ \begin{adjustbox}{max width=\textwidth}
+ \begin{tabular}{l}
+ · In case of system EGL \texttt{ctx\_A} and
+ \texttt{ctx\_B} are native
+ EGL contexts.\\
+ · In case of ANGLE they are ANGLE EGL contexts.\\
+ \end{tabular}
+ \end{adjustbox}
+ \end{table}
+ }
+ \end{comment}
+ \end{block}
+ }
+
+ \tiny{
+ \begin{block}{This is how we'd create shared
+ OpenGL context between native EGL and ANGLE EGL using
+ \texttt{EGL\_ANGLE\_native\_shared\_context}:}
+
+ \vspace{0.2cm}
+ \begin{itemize}
+ \item \tiny{We'd pass the native EGL context (created by the native system
+ driver) as {\color{black}shared context} to the
+ native OpenGL context that is created {\color{black}in the ANGLE
+ OpenGL backend} using the native system driver!}
+ \item \tiny{We'd need use the {\color{black}new EGL attribute
+ (\texttt{EGL\_NATIVE\_SHARED\_CONTEXT\_ANGLE})} to let ANGLE know
+ that the shared context \textit{\color{coolblack}is not ANGLE but native}
+ context!}
+ \end{itemize}
+ \vspace{-0.2cm}
+
+ \begin{table}[t]
+ \centering
+ \begin{tabular}{l}
+ \begin{adjustbox}{max width=\textwidth}
+ \adjustbox{valign=t}{\includegraphics[height=3.5cm]{data/shared_ctx2.png}}
+ \end{adjustbox}
+ \end{tabular}
+ \end{table}
+ \end{block}
+ }
+
+
+ \end{center}
+\end{frame}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\begin{frame}[fragile,c]
+ \frametitle{Some work on the shared context approach}
+ \setbeamertemplate{itemize/enumerate body begin}{\tiny}
+ \setbeamertemplate{itemize items}[triangle]{\tiny}
+ \setbeamercolor{block body}{bg=white}
+
+ \begin{center}
+ \begin{block}{\tiny{Extension
+ \texttt{EGL\_NATIVE\_SHARED\_CONTEXT\_ANGLE}:}}
+ \vspace{0.2cm}
+ \tiny{
+ \begin{table}[h]
+ \centering
+ Worked on the extension implementation (draft state, there are
+ bugs).\\
+ \begin{tabular}{l}
+ \\
+ \textbf{Concept:}\\
+ \begin{adjustbox}{max width=\textwidth}
+ \adjustbox{valign=t}{\includegraphics[scale=0.2]{data/shared_ctx3.png}}
+ \end{adjustbox}\\
+ \end{tabular}
+ \end{table}
+ }
+ \end{block}
+ \begin{block}{\tiny{Experimental programs (to test the extension and
+ familiarize with the shared context concept):}}
+ \begin{itemize}
+ \item A test program that uses EGL ctxA to create a texture and
+ EGL ctxB to display it on an X11 window.
+ \item The same program written in ANGLE (there were
+ differences!)
+ \item A test program that uses EGL ctxA to create a texture and
+ ANGLE EGL ctxB to display it on an X11 window.
+ \item Variations of the above:
+ \url{https://github.com/hikiko/shctx/branches}
+ \end{itemize}
+ \end{block}
+ \end{center}
+ \end{frame}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ \begin{frame}
+ \frametitle{Abandoned!}
+ \begin{center}
+ \textbf{\color{coolblack} Why not shared context?}
+ \vspace{0.5cm}
+
+ {\footnotesize{
+ \begin{itemize}
+ \item Shared context would be a nice and clean approach if we wanted to use
+ it with our current WebKit code.
+ \item But there is a plan to use \textbf{separate processes} for WebGL2 and
+ the main graphics pipeline!! (Žan Doberšek)
+ \end{itemize}
+ }}
+
+ \vspace{0.5cm}
+ \textbf{\color{coolblack} But there was a \textit{better} approach!}
+ \end{center}
+ \end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%