Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1334)

Unified Diff: third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp

Issue 2461803002: Enable creation of offscreen contexts which own their backing surface. (Closed)
Patch Set: Drop unnecessary dependent patch Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 6a68b1659cd48b1b932d67291b0ab8663a738304..131de15a51d63cb20b646ae69b9a3024d7d01ad3 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
+++ b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
@@ -47,6 +47,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"
@@ -597,6 +598,17 @@ 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.
+ ExecutionContext* executionContext =
+ canvas ? &canvas->document() : scriptState->getExecutionContext();
+ if (RuntimeEnabledFeatures::webVREnabled() ||
+ OriginTrials::webVREnabled(executionContext)) {
+ contextAttributes.ownOffscreenSurface = true;
Ken Russell (switch to Gerrit) 2016/11/29 05:09:06 I haven't reviewed the rest of the patch in depth,
klausw 2017/01/05 02:17:43 For context, the point of this change is to prepar
+ }
+
Platform::GraphicsInfo glInfo;
std::unique_ptr<WebGraphicsContext3DProvider> contextProvider;
if (isMainThread()) {

Powered by Google App Engine
This is Rietveld 408576698