Replace WebVR pose ring buffer with XrPresentationState

The [frame_index % kPoseRingBufferSize] ring buffer indexing used in various
places was confusing. Now that we've changed the semantics to ensure that we
never have more than one frame in each state (animating, processing,
rendering), make this explicit by using a WebXrFrame struct to store the
per-frame lifecycle data, and WebXrPresentationState to handle the lifecycle.

Change-Id: Ieccea90764f481ed8108bc9964dfd7fbd3cf883b
Reviewed-on: https://chromium-review.googlesource.com/985649
Commit-Queue: Klaus Weidner <klausw@chromium.org>
Reviewed-by: Michael Thiessen <mthiesse@chromium.org>
Reviewed-by: Bill Orr <billorr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#549334}
2 files changed