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

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

Issue 2870553003: WebVR: Don't crash when receiving null image from rendering context. (Closed)
Patch Set: Created 3 years, 7 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/FrameRequestCallback.h" 9 #include "core/dom/FrameRequestCallback.h"
10 #include "core/dom/ScriptedAnimationController.h" 10 #include "core/dom/ScriptedAnimationController.h"
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after
534 } 534 }
535 } 535 }
536 536
537 RefPtr<Image> image_ref = rendering_context_->GetImage( 537 RefPtr<Image> image_ref = rendering_context_->GetImage(
538 kPreferAcceleration, kSnapshotReasonCreateImageBitmap); 538 kPreferAcceleration, kSnapshotReasonCreateImageBitmap);
539 539
540 // Hardware-accelerated rendering should always be texture backed, 540 // Hardware-accelerated rendering should always be texture backed,
541 // as implemented by AcceleratedStaticBitmapImage. Ensure this is 541 // as implemented by AcceleratedStaticBitmapImage. Ensure this is
542 // the case, don't attempt to render if using an unexpected drawing 542 // the case, don't attempt to render if using an unexpected drawing
543 // path. 543 // path.
544 if (!image_ref->IsTextureBacked()) { 544 if (!image_ref.Get() || !image_ref->IsTextureBacked()) {
545 NOTREACHED() << "WebVR requires hardware-accelerated rendering to texture"; 545 NOTREACHED() << "WebVR requires hardware-accelerated rendering to texture";
546 return; 546 return;
547 } 547 }
548 548
549 // The AcceleratedStaticBitmapImage must be kept alive until the 549 // The AcceleratedStaticBitmapImage must be kept alive until the
550 // mailbox is used via createAndConsumeTextureCHROMIUM, the mailbox 550 // mailbox is used via createAndConsumeTextureCHROMIUM, the mailbox
551 // itself does not keep it alive. We must keep a reference to the 551 // itself does not keep it alive. We must keep a reference to the
552 // image until the mailbox was consumed. 552 // image until the mailbox was consumed.
553 StaticBitmapImage* static_image = 553 StaticBitmapImage* static_image =
554 static_cast<StaticBitmapImage*>(image_ref.Get()); 554 static_cast<StaticBitmapImage*>(image_ref.Get());
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
813 visitor->Trace(stage_parameters_); 813 visitor->Trace(stage_parameters_);
814 visitor->Trace(eye_parameters_left_); 814 visitor->Trace(eye_parameters_left_);
815 visitor->Trace(eye_parameters_right_); 815 visitor->Trace(eye_parameters_right_);
816 visitor->Trace(layer_); 816 visitor->Trace(layer_);
817 visitor->Trace(rendering_context_); 817 visitor->Trace(rendering_context_);
818 visitor->Trace(scripted_animation_controller_); 818 visitor->Trace(scripted_animation_controller_);
819 visitor->Trace(pending_present_resolvers_); 819 visitor->Trace(pending_present_resolvers_);
820 } 820 }
821 821
822 } // namespace blink 822 } // 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