Loading services/vr/vr_window_manager/application.cpp +6 −1 Original line number Original line Diff line number Diff line Loading @@ -174,7 +174,12 @@ void Application::DrawFrame() { // TODO(steventhomas): If we're not visible, block until we are. For now we // TODO(steventhomas): If we're not visible, block until we are. For now we // throttle by calling dvrGraphicsWaitNextFrame. // throttle by calling dvrGraphicsWaitNextFrame. DvrFrameSchedule schedule; DvrFrameSchedule schedule; dvrGraphicsWaitNextFrame(graphics_context_, 0, &schedule); int status = dvrGraphicsWaitNextFrame(graphics_context_, 0, &schedule); if (status < 0) { ALOGE("Context lost, deallocating graphics resources"); SetVisibility(false); DeallocateResources(); } OnDrawFrame(); OnDrawFrame(); Loading services/vr/vr_window_manager/shell_view.cpp +22 −5 Original line number Original line Diff line number Diff line Loading @@ -126,10 +126,6 @@ int ShellView::Initialize() { if (!surface_flinger_view_->Initialize(this)) if (!surface_flinger_view_->Initialize(this)) return 1; return 1; // This is a temporary fix for now. These APIs will be changed when everything // is moved into vrcore. display_client_ = DisplayClient::Create(); return 0; return 0; } } Loading Loading @@ -164,7 +160,14 @@ int ShellView::AllocateResources() { } } void ShellView::DeallocateResources() { void ShellView::DeallocateResources() { surface_flinger_view_.reset(); { std::unique_lock<std::mutex> l(display_frame_mutex_); removed_displays_.clear(); new_displays_.clear(); displays_.clear(); } display_client_.reset(); reticle_.reset(); reticle_.reset(); controller_mesh_.reset(); controller_mesh_.reset(); program_.reset(new ShaderProgram); program_.reset(new ShaderProgram); Loading Loading @@ -283,6 +286,20 @@ base::unique_fd ShellView::OnFrame(std::unique_ptr<HwcCallback::Frame> frame) { bool showing = false; bool showing = false; // This is a temporary fix for now. These APIs will be changed when everything // is moved into vrcore. // Do this on demand in case vr_flinger crashed and we are reconnecting. if (!display_client_.get()) { int error = 0; display_client_ = DisplayClient::Create(&error); if (error) { ALOGE("Could not connect to display service : %s(%d)", strerror(error), error); return base::unique_fd(); } } // TODO(achaulk): change when moved into vrcore. // TODO(achaulk): change when moved into vrcore. bool vr_running = display_client_->IsVrAppRunning(); bool vr_running = display_client_->IsVrAppRunning(); Loading Loading
services/vr/vr_window_manager/application.cpp +6 −1 Original line number Original line Diff line number Diff line Loading @@ -174,7 +174,12 @@ void Application::DrawFrame() { // TODO(steventhomas): If we're not visible, block until we are. For now we // TODO(steventhomas): If we're not visible, block until we are. For now we // throttle by calling dvrGraphicsWaitNextFrame. // throttle by calling dvrGraphicsWaitNextFrame. DvrFrameSchedule schedule; DvrFrameSchedule schedule; dvrGraphicsWaitNextFrame(graphics_context_, 0, &schedule); int status = dvrGraphicsWaitNextFrame(graphics_context_, 0, &schedule); if (status < 0) { ALOGE("Context lost, deallocating graphics resources"); SetVisibility(false); DeallocateResources(); } OnDrawFrame(); OnDrawFrame(); Loading
services/vr/vr_window_manager/shell_view.cpp +22 −5 Original line number Original line Diff line number Diff line Loading @@ -126,10 +126,6 @@ int ShellView::Initialize() { if (!surface_flinger_view_->Initialize(this)) if (!surface_flinger_view_->Initialize(this)) return 1; return 1; // This is a temporary fix for now. These APIs will be changed when everything // is moved into vrcore. display_client_ = DisplayClient::Create(); return 0; return 0; } } Loading Loading @@ -164,7 +160,14 @@ int ShellView::AllocateResources() { } } void ShellView::DeallocateResources() { void ShellView::DeallocateResources() { surface_flinger_view_.reset(); { std::unique_lock<std::mutex> l(display_frame_mutex_); removed_displays_.clear(); new_displays_.clear(); displays_.clear(); } display_client_.reset(); reticle_.reset(); reticle_.reset(); controller_mesh_.reset(); controller_mesh_.reset(); program_.reset(new ShaderProgram); program_.reset(new ShaderProgram); Loading Loading @@ -283,6 +286,20 @@ base::unique_fd ShellView::OnFrame(std::unique_ptr<HwcCallback::Frame> frame) { bool showing = false; bool showing = false; // This is a temporary fix for now. These APIs will be changed when everything // is moved into vrcore. // Do this on demand in case vr_flinger crashed and we are reconnecting. if (!display_client_.get()) { int error = 0; display_client_ = DisplayClient::Create(&error); if (error) { ALOGE("Could not connect to display service : %s(%d)", strerror(error), error); return base::unique_fd(); } } // TODO(achaulk): change when moved into vrcore. // TODO(achaulk): change when moved into vrcore. bool vr_running = display_client_->IsVrAppRunning(); bool vr_running = display_client_->IsVrAppRunning(); Loading