Commit 85d2afc7 authored by Brandon Jones's avatar Brandon Jones Committed by Commit Bot

Remove last references to WebVR from blink modules

Updated an error message string to more accurately describe the WebXR
state needed to satisfy it, removed a couple of WebGL helper methods
that were only being called by WebVR previously, and removed a Gamepad
enum from the IDL that was WebVR-specific.

Bug: 1030470
Change-Id: I6a4a53240f761eed94100dd374c4504f28a99b98
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1949298Reviewed-by: default avatarAlexander Cooper <alcooper@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#721274}
parent e13f8b0c
...@@ -23,14 +23,6 @@ ...@@ -23,14 +23,6 @@
* DAMAGE. * DAMAGE.
*/ */
// https://w3c.github.io/gamepad/extensions.html#gamepadhand-enum
[
RuntimeEnabled=WebVR
] enum GamepadHand {
"left",
"right"
};
// https://www.w3.org/TR/gamepad/#gamepadmappingtype-enum // https://www.w3.org/TR/gamepad/#gamepadmappingtype-enum
enum GamepadMappingType { enum GamepadMappingType {
"", "",
......
...@@ -34,6 +34,10 @@ namespace blink { ...@@ -34,6 +34,10 @@ namespace blink {
namespace { namespace {
const char kIncompleteOpaque[] =
"Cannot render to a XRWebGLLayer framebuffer outside of an XRSession "
"animation frame callback.";
class WebGLRenderbufferAttachment final class WebGLRenderbufferAttachment final
: public WebGLFramebuffer::WebGLAttachment { : public WebGLFramebuffer::WebGLAttachment {
public: public:
...@@ -377,7 +381,7 @@ GLenum WebGLFramebuffer::CheckDepthStencilStatus(const char** reason) const { ...@@ -377,7 +381,7 @@ GLenum WebGLFramebuffer::CheckDepthStencilStatus(const char** reason) const {
if (opaque_) { if (opaque_) {
if (opaque_complete_) if (opaque_complete_)
return GL_FRAMEBUFFER_COMPLETE; return GL_FRAMEBUFFER_COMPLETE;
*reason = "cannot render to a WebVR layer outside of a frame callback"; *reason = kIncompleteOpaque;
return GL_FRAMEBUFFER_UNSUPPORTED; return GL_FRAMEBUFFER_UNSUPPORTED;
} }
if (Context()->IsWebGL2OrHigher() || web_gl1_depth_stencil_consistent_) if (Context()->IsWebGL2OrHigher() || web_gl1_depth_stencil_consistent_)
......
...@@ -757,18 +757,6 @@ void WebGLRenderingContextBase::commit() { ...@@ -757,18 +757,6 @@ void WebGLRenderingContextBase::commit() {
MarkLayerComposited(); MarkLayerComposited();
} }
scoped_refptr<StaticBitmapImage>
WebGLRenderingContextBase::GetStaticBitmapImage(
std::unique_ptr<viz::SingleReleaseCallback>* out_release_callback) {
if (!GetDrawingBuffer())
return nullptr;
if (CreationAttributes().preserve_drawing_buffer)
return GetImage();
return GetDrawingBuffer()->TransferToStaticBitmapImage(out_release_callback);
}
scoped_refptr<StaticBitmapImage> WebGLRenderingContextBase::GetImage( scoped_refptr<StaticBitmapImage> WebGLRenderingContextBase::GetImage(
AccelerationHint hint) { AccelerationHint hint) {
if (!GetDrawingBuffer()) if (!GetDrawingBuffer())
...@@ -777,9 +765,9 @@ scoped_refptr<StaticBitmapImage> WebGLRenderingContextBase::GetImage( ...@@ -777,9 +765,9 @@ scoped_refptr<StaticBitmapImage> WebGLRenderingContextBase::GetImage(
ScopedFramebufferRestorer fbo_restorer(this); ScopedFramebufferRestorer fbo_restorer(this);
GetDrawingBuffer()->ResolveAndBindForReadAndDraw(); GetDrawingBuffer()->ResolveAndBindForReadAndDraw();
// Use the drawing buffer size here instead of the canvas size to ensure that // Use the drawing buffer size here instead of the canvas size to ensure that
// sizing is consistent for the GetStaticBitmapImage() result. The forced // sizing is consistent. The forced downsizing logic in Reshape() can lead to
// downsizing logic in Reshape() can lead to the drawing buffer being smaller // the drawing buffer being smaller than the canvas size.
// than the canvas size. See https:://crbug.com/845742. // See https://crbug.com/845742.
IntSize size = GetDrawingBuffer()->Size(); IntSize size = GetDrawingBuffer()->Size();
// Since we are grabbing a snapshot that is not for compositing, we use a // Since we are grabbing a snapshot that is not for compositing, we use a
// custom resource provider. This avoids consuming compositing-specific // custom resource provider. This avoids consuming compositing-specific
...@@ -1502,11 +1490,6 @@ WebGLRenderingContextBase::ClearIfComposited(GLbitfield mask) { ...@@ -1502,11 +1490,6 @@ WebGLRenderingContextBase::ClearIfComposited(GLbitfield mask) {
return combined_clear ? kCombinedClear : kJustClear; return combined_clear ? kCombinedClear : kJustClear;
} }
void WebGLRenderingContextBase::MarkCompositedAndClearBackbufferIfNeeded() {
MarkLayerComposited();
ClearIfComposited();
}
void WebGLRenderingContextBase::RestoreScissorEnabled() { void WebGLRenderingContextBase::RestoreScissorEnabled() {
if (isContextLost()) if (isContextLost())
return; return;
......
...@@ -606,15 +606,6 @@ class MODULES_EXPORT WebGLRenderingContextBase : public CanvasRenderingContext, ...@@ -606,15 +606,6 @@ class MODULES_EXPORT WebGLRenderingContextBase : public CanvasRenderingContext,
void commit(); void commit();
// For use by WebVR which doesn't use the normal compositing path.
// This clears the backbuffer if preserveDrawingBuffer is false.
void MarkCompositedAndClearBackbufferIfNeeded();
// For use by WebVR, commits the current canvas content similar
// to the "commit" JS API.
scoped_refptr<StaticBitmapImage> GetStaticBitmapImage(
std::unique_ptr<viz::SingleReleaseCallback>* out_release_callback);
ScriptPromise makeXRCompatible(ScriptState*); ScriptPromise makeXRCompatible(ScriptState*);
bool IsXRCompatible(); bool IsXRCompatible();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment