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

Unified Diff: third_party/WebKit/Source/modules/vr/VRDisplay.cpp

Issue 2747903002: Apply sanity check for accelerated rendering unconditionally. (Closed)
Patch Set: Created 3 years, 9 months 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/vr/VRDisplay.cpp
diff --git a/third_party/WebKit/Source/modules/vr/VRDisplay.cpp b/third_party/WebKit/Source/modules/vr/VRDisplay.cpp
index 0c85c13a84877f6bde86a1ac2583841d2cf1ddd4..a6486fd050a9fc13e9c8b7840da6866a22b9947e 100644
--- a/third_party/WebKit/Source/modules/vr/VRDisplay.cpp
+++ b/third_party/WebKit/Source/modules/vr/VRDisplay.cpp
@@ -558,9 +558,15 @@ void VRDisplay::submitFrame() {
RefPtr<Image> imageRef = m_renderingContext->getImage(
PreferAcceleration, SnapshotReasonCreateImageBitmap);
- // Hardware-accelerated rendering should always be texture backed.
- // I hope nobody is trying to do WebVR with software rendering.
- DCHECK(imageRef->isTextureBacked());
+ // Hardware-accelerated rendering should always be texture backed,
+ // as implemented by AcceleratedStaticBitmapImage. Ensure this is
+ // the case, don't attempt to render if using software rendering. We
+ // could implement an alternate slow path here for tests if
ddorwin 2017/03/13 20:05:38 How/when will we know?
klausw 2017/03/13 20:20:26 Symptom would be the eye views staying black with
+ // applicable.
+ if (!imageRef->isTextureBacked()) {
+ DLOG(ERROR) << "WebVR requires hardware-accelerated rendering to texture";
+ return;
+ }
// The AcceleratedStaticBitmapImage must be kept alive until the
// mailbox is used via createAndConsumeTextureCHROMIUM, the mailbox
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698