+ \frametitle{Shared Context}
+ \begin{center}
+ \scriptsize{
+ \textbf{\color{coolblack}{A texture can be accessed by multiple OpenGL or
+ GLESv2 contexts when these contexts are \textit{shared}:}}
+ }
+ \vspace{0.001cm}
+ \texttt{
+ \begin{table}[h]
+ \centering
+ \begin{adjustbox}{max width=\textwidth}
+ \begin{tabular}{|l|}
+ \hline
+ \rowcolor{platinum}
+ \\
+ \rowcolor{platinum}
+ \textbf{new\_ctx} = {\color{mediumred-violet}eglCreateContext}(new\_ctx\_dpy, new\_ctx\_config,
+ \textbf{native\_ctx}, new\_ctx\_attrib);\\
+ \rowcolor{platinum}\\
+ \hline
+ \end{tabular}
+ \end{adjustbox}
+ \end{table}
+ }
+
+ \vspace{0.1cm}
+ \scriptsize{
+ \textbf{\color{coolblack}{A texture generated by each context can be bound and used by the
+ other\\ without ever leaving the GPU!}}
+ }
+ \vspace{0.01cm}
+
+ \tiny{
+ \texttt{
+ \begin{table}[h]
+ \centering
+ \begin{adjustbox}{max width=\textwidth}
+ \begin{tabular}{|l|}
+ \rowcolor{platinum}
+ \hline
+ \rowcolor{platinum}
+ \\
+ \rowcolor{platinum}
+ glBindTexture({\color{mediumred-violet}GL\_TEXTURE\_2D}, \textbf{\color{afblue}gl\_shared\_tex});\\
+ \rowcolor{platinum}
+ {\color{darkgray}/* ... gl operations ... */}\\
+ \rowcolor{platinum}
+ \\
+ \rowcolor{platinum}
+ angle\_glBindTexture({\color{mediumred-violet}GL\_TEXTURE\_2D}, \textbf{\color{afblue}gl\_shared\_tex});\\
+ \rowcolor{platinum}
+ {\color{darkgray}/* ... angle\_gl operations ... */}\\
+ \rowcolor{platinum}
+ \\\hline
+ \end{tabular}
+ \end{adjustbox}
+ \end{table}
+ }}
+
+ \vspace{0.2cm}
+ \setbeamertemplate{itemize/enumerate body begin}{\tiny}
+ \setbeamertemplate{itemize items}[triangle]
+
+ %\setbeamertemplate{blocks}
+ \scriptsize{ \textbf{\color{coolblack}{Shared context restrictions:}}}
+ \vspace{0.1cm}
+ \begin{itemize}
+ \item Contexts must be created by the \textbf{same API} (both OpenGL,
+ or both GLESv2, same driver).
+ \item Contexts must be created by the \textbf{same
+ process}.(\textbf{=>
+ {\color{coolblack}{not
+ suitable for every project!}}})
+ \end{itemize}
+ \end{center}
+\end{frame}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\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}
+