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

Side by Side Diff: content/browser/media/android/browser_surface_view_manager.cc

Issue 2643893002: Skip video overlay surface management when in VR. (Closed)
Patch Set: Created 3 years, 11 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 | content/browser/renderer_host/render_widget_host_view_android.h » ('j') | 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 "content/browser/media/android/browser_surface_view_manager.h" 5 #include "content/browser/media/android/browser_surface_view_manager.h"
6 6
7 #include "base/android/build_info.h" 7 #include "base/android/build_info.h"
8 #include "base/trace_event/trace_event.h" 8 #include "base/trace_event/trace_event.h"
9 #include "content/browser/android/content_view_core_impl.h" 9 #include "content/browser/android/content_view_core_impl.h"
10 #include "content/browser/gpu/gpu_process_host.h" 10 #include "content/browser/gpu/gpu_process_host.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 } 56 }
57 } 57 }
58 58
59 void BrowserSurfaceViewManager::DidExitFullscreen(bool release_media_player) { 59 void BrowserSurfaceViewManager::DidExitFullscreen(bool release_media_player) {
60 DVLOG(3) << __func__; 60 DVLOG(3) << __func__;
61 content_video_view_.reset(); 61 content_video_view_.reset();
62 } 62 }
63 63
64 void BrowserSurfaceViewManager::OnCreateFullscreenSurface( 64 void BrowserSurfaceViewManager::OnCreateFullscreenSurface(
65 const gfx::Size& video_natural_size) { 65 const gfx::Size& video_natural_size) {
66 // If we are in virtual reality, no surface view is needed so just return.
67 // TODO(http://crbug.com/673886): Support overlay surfaces in VR using GVR
68 // reprojection video surface.
69 if (render_frame_host_->GetView()->IsInVR()) {
liberato (no reviews please) 2017/01/18 18:21:48 one migh tneed SendSurfaceID(kNoSurfaceID), else W
amp 2017/01/18 19:30:25 Done. Nice catch, although it seems to work fine
70 return;
71 }
72
66 // It's valid to get this call if we already own the fullscreen view. We just 73 // It's valid to get this call if we already own the fullscreen view. We just
67 // return the existing surface id. 74 // return the existing surface id.
68 if (content_video_view_) { 75 if (content_video_view_) {
69 // Send the surface now if we have it. Otherwise it will be returned by 76 // Send the surface now if we have it. Otherwise it will be returned by
70 // |SetVideoSurface|. 77 // |SetVideoSurface|.
71 if (surface_id_ != media::SurfaceManager::kNoSurfaceID) { 78 if (surface_id_ != media::SurfaceManager::kNoSurfaceID) {
72 SendSurfaceID(surface_id_); 79 SendSurfaceID(surface_id_);
73 OnNaturalSizeChanged(video_natural_size); 80 OnNaturalSizeChanged(video_natural_size);
74 return; 81 return;
75 } 82 }
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 BrowserThread::IO, FROM_HERE, 119 BrowserThread::IO, FROM_HERE,
113 base::Bind(&SendDestroyingVideoSurfaceOnIO, surface_id, 120 base::Bind(&SendDestroyingVideoSurfaceOnIO, surface_id,
114 base::Bind(&base::WaitableEvent::Signal, 121 base::Bind(&base::WaitableEvent::Signal,
115 base::Unretained(&waiter))))) { 122 base::Unretained(&waiter))))) {
116 base::ThreadRestrictions::ScopedAllowWait allow_wait; 123 base::ThreadRestrictions::ScopedAllowWait allow_wait;
117 waiter.Wait(); 124 waiter.Wait();
118 } 125 }
119 } 126 }
120 127
121 } // namespace content 128 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host_view_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698