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

Side by Side Diff: third_party/WebKit/Source/modules/vr/VRDisplay.cpp

Issue 2747903002: Apply sanity check for accelerated rendering unconditionally. (Closed)
Patch Set: use NOTREACHED, rephrase comment 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "modules/vr/VRDisplay.h" 5 #include "modules/vr/VRDisplay.h"
6 6
7 #include "core/css/StylePropertySet.h" 7 #include "core/css/StylePropertySet.h"
8 #include "core/dom/DOMException.h" 8 #include "core/dom/DOMException.h"
9 #include "core/dom/DocumentUserGestureToken.h" 9 #include "core/dom/DocumentUserGestureToken.h"
10 #include "core/dom/FrameRequestCallback.h" 10 #include "core/dom/FrameRequestCallback.h"
(...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after
551 if (!m_submit_frame_client_binding.WaitForIncomingMethodCall()) { 551 if (!m_submit_frame_client_binding.WaitForIncomingMethodCall()) {
552 DLOG(ERROR) << "Failed to receive SubmitFrame response"; 552 DLOG(ERROR) << "Failed to receive SubmitFrame response";
553 break; 553 break;
554 } 554 }
555 } 555 }
556 } 556 }
557 557
558 RefPtr<Image> imageRef = m_renderingContext->getImage( 558 RefPtr<Image> imageRef = m_renderingContext->getImage(
559 PreferAcceleration, SnapshotReasonCreateImageBitmap); 559 PreferAcceleration, SnapshotReasonCreateImageBitmap);
560 560
561 // Hardware-accelerated rendering should always be texture backed. 561 // Hardware-accelerated rendering should always be texture backed,
562 // I hope nobody is trying to do WebVR with software rendering. 562 // as implemented by AcceleratedStaticBitmapImage. Ensure this is
563 DCHECK(imageRef->isTextureBacked()); 563 // the case, don't attempt to render if using an unexpected drawing
564 // path.
565 if (!imageRef->isTextureBacked()) {
566 NOTREACHED() << "WebVR requires hardware-accelerated rendering to texture";
567 return;
568 }
564 569
565 // The AcceleratedStaticBitmapImage must be kept alive until the 570 // The AcceleratedStaticBitmapImage must be kept alive until the
566 // mailbox is used via createAndConsumeTextureCHROMIUM, the mailbox 571 // mailbox is used via createAndConsumeTextureCHROMIUM, the mailbox
567 // itself does not keep it alive. We must keep a reference to the 572 // itself does not keep it alive. We must keep a reference to the
568 // image until the mailbox was consumed. 573 // image until the mailbox was consumed.
569 StaticBitmapImage* staticImage = 574 StaticBitmapImage* staticImage =
570 static_cast<StaticBitmapImage*>(imageRef.get()); 575 static_cast<StaticBitmapImage*>(imageRef.get());
571 staticImage->ensureMailbox(); 576 staticImage->ensureMailbox();
572 577
573 if (waitForPreviousTransferToFinish) { 578 if (waitForPreviousTransferToFinish) {
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
778 visitor->trace(m_stageParameters); 783 visitor->trace(m_stageParameters);
779 visitor->trace(m_eyeParametersLeft); 784 visitor->trace(m_eyeParametersLeft);
780 visitor->trace(m_eyeParametersRight); 785 visitor->trace(m_eyeParametersRight);
781 visitor->trace(m_layer); 786 visitor->trace(m_layer);
782 visitor->trace(m_renderingContext); 787 visitor->trace(m_renderingContext);
783 visitor->trace(m_scriptedAnimationController); 788 visitor->trace(m_scriptedAnimationController);
784 visitor->trace(m_pendingPresentResolvers); 789 visitor->trace(m_pendingPresentResolvers);
785 } 790 }
786 791
787 } // namespace blink 792 } // namespace blink
OLDNEW
« 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