Skip to content

Allow caching various objects (take 2) #1088

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 26, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Allow caching XRViewport objects
  • Loading branch information
Manishearth committed Jun 26, 2020
commit 24b33035788b6fc8ffea6c868a1850b1e763a591
8 changes: 7 additions & 1 deletion index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1959,7 +1959,13 @@ The <dfn method for="XRWebGLLayer">getViewport(|view|)</dfn> method, when invoke
1. If |frame|'s {{XRFrame/session}} is not equal to |layer|'s [=XRWebGLLayer/session=], throw an {{InvalidStateError}} and abort these steps.
1. If |frame|'s [=XRFrame/active=] boolean is <code>false</code>, throw an {{InvalidStateError}} and abort these steps.
1. Let |glViewport| be the [=WebGL viewport=] from the [=list of viewports=] associated with |view|.
1. Let |viewport| be a [=new=] {{XRViewport}} in the [=relevant realm=] of |layer|'s [=XRWebGLLayer/session=].
1. Initialize |viewport| as follows:
<dl class="switch">
<dt>If a |view| with the same underlying [=view=] has been passed to a getViewport() call previously, and |glViewport| has not changed since then, the user agent MUST:</dt>
<dd>Let |viewport| be the same {{XRViewport}} object returned by the earlier call to {{XRWebGLLayer/getViewport()}}</dd>
<dt>Otherwise:</dt>
<dd>Let |viewport| be a [=new=] {{XRViewport}} in the [=relevant realm=] of |layer|'s [=XRWebGLLayer/session=].</dd>
</dl>
1. Initialize |viewport|'s {{XRViewport/x}} to |glViewport|'s <code>x</code> component.
1. Initialize |viewport|'s {{XRViewport/y}} to |glViewport|'s <code>y</code> component.
1. Initialize |viewport|'s {{XRViewport/width}} to |glViewport|'s <code>width</code>.
Expand Down