<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [macOS] CGL virtual screen changes do not cause us to lose the WebGL context"
   href="https://bugs.webkit.org/show_bug.cgi?id=161026">161026</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[macOS] CGL virtual screen changes do not cause us to lose the WebGL context
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>WebKit
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>WebKit Nightly Build
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>Normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P2
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>WebGL
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>webkit-unassigned&#64;lists.webkit.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>mmaxfield&#64;apple.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dino&#64;apple.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>According to [1],

&quot;A change in the virtual screen indicates a renderer change, a change in renderer capability, or both.&quot;

&quot;When the renderer changes, the limits and extensions available to OpenGL may also change. Your application should retest the capabilities of the renderer and use these to choose its rendering algorithms appropriately.&quot;

This can be achieved by listening for NSWindowDidChangeScreenNotification. We currently do this and plumb it through to the web process, eventually ending up in WebPage::windowScreenDidChange() and Document::windowScreenDidChange(). We should make this function cause WebGL contexts to be lost. This will cause web content to re-investigate the current renderer capabilities.

[1] <a href="https://developer.apple.com/library/prerelease/content/documentation/GraphicsImaging/Conceptual/OpenGL-MacProgGuide/opengl_contexts/opengl_contexts.html#//apple_ref/doc/uid/TP40001987-CH216-SW12">https://developer.apple.com/library/prerelease/content/documentation/GraphicsImaging/Conceptual/OpenGL-MacProgGuide/opengl_contexts/opengl_contexts.html#//apple_ref/doc/uid/TP40001987-CH216-SW12</a></pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>