| Index: third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
|
| diff --git a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
|
| index e9d8b80cc9189fba180c977637e133fcb0250e3f..e4dda2d44d30bc75380860dbd2ec25774ddf4a81 100644
|
| --- a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
|
| +++ b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
|
| @@ -46,6 +46,7 @@
|
| #include "core/layout/LayoutBox.h"
|
| #include "core/loader/FrameLoader.h"
|
| #include "core/loader/FrameLoaderClient.h"
|
| +#include "core/origin_trials/OriginTrials.h"
|
| #include "gpu/command_buffer/client/gles2_interface.h"
|
| #include "modules/webgl/ANGLEInstancedArrays.h"
|
| #include "modules/webgl/EXTBlendMinMax.h"
|
| @@ -621,6 +622,15 @@ WebGLRenderingContextBase::createContextProviderInternal(
|
|
|
| Platform::ContextAttributes contextAttributes =
|
| toPlatformContextAttributes(attributes, webGLVersion);
|
| +
|
| + // If there's a possibility this context may be used with WebVR make sure it
|
| + // is created with an offscreen surface that can be swapped out for a
|
| + // VR-specific surface if needed.
|
| + if (RuntimeEnabledFeatures::webVREnabled() ||
|
| + OriginTrials::webVREnabled(scriptState->getExecutionContext())) {
|
| + contextAttributes.supportOwnOffscreenSurface = true;
|
| + }
|
| +
|
| Platform::GraphicsInfo glInfo;
|
| std::unique_ptr<WebGraphicsContext3DProvider> contextProvider;
|
| const auto& url = canvas ? canvas->document().topDocument().url()
|
|
|