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

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

Issue 1998723002: Move code in ui/gl/* from gfx:: to gl:: (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 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
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/child_process_launcher_android.h" 9 #include "content/browser/android/child_process_launcher_android.h"
10 #include "content/browser/android/content_view_core_impl.h" 10 #include "content/browser/android/content_view_core_impl.h"
(...skipping 19 matching lines...) Expand all
30 } 30 }
31 } // namespace 31 } // namespace
32 32
33 BrowserSurfaceViewManager::BrowserSurfaceViewManager( 33 BrowserSurfaceViewManager::BrowserSurfaceViewManager(
34 RenderFrameHost* render_frame_host) 34 RenderFrameHost* render_frame_host)
35 : render_frame_host_(render_frame_host), 35 : render_frame_host_(render_frame_host),
36 surface_id_(media::SurfaceManager::kNoSurfaceID) {} 36 surface_id_(media::SurfaceManager::kNoSurfaceID) {}
37 37
38 BrowserSurfaceViewManager::~BrowserSurfaceViewManager() {} 38 BrowserSurfaceViewManager::~BrowserSurfaceViewManager() {}
39 39
40 void BrowserSurfaceViewManager::SetVideoSurface( 40 void BrowserSurfaceViewManager::SetVideoSurface(gl::ScopedJavaSurface surface) {
41 gfx::ScopedJavaSurface surface) {
42 TRACE_EVENT0("media", "BrowserSurfaceViewManager::SetVideoSurface"); 41 TRACE_EVENT0("media", "BrowserSurfaceViewManager::SetVideoSurface");
43 if (surface.IsEmpty()) { 42 if (surface.IsEmpty()) {
44 DCHECK_NE(surface_id_, media::SurfaceManager::kNoSurfaceID); 43 DCHECK_NE(surface_id_, media::SurfaceManager::kNoSurfaceID);
45 GpuSurfaceTracker::Get()->RemoveSurface(surface_id_); 44 GpuSurfaceTracker::Get()->RemoveSurface(surface_id_);
46 UnregisterViewSurface(surface_id_); 45 UnregisterViewSurface(surface_id_);
47 SendDestroyingVideoSurfaceIfRequired(surface_id_); 46 SendDestroyingVideoSurfaceIfRequired(surface_id_);
48 surface_id_ = media::SurfaceManager::kNoSurfaceID; 47 surface_id_ = media::SurfaceManager::kNoSurfaceID;
49 } else { 48 } else {
50 // We mainly use the surface tracker to allocate a surface id for us. The 49 // We mainly use the surface tracker to allocate a surface id for us. The
51 // lookup will go through the Android specific path and get the java 50 // lookup will go through the Android specific path and get the java
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 BrowserThread::IO, FROM_HERE, 112 BrowserThread::IO, FROM_HERE,
114 base::Bind(&SendDestroyingVideoSurfaceOnIO, surface_id, 113 base::Bind(&SendDestroyingVideoSurfaceOnIO, surface_id,
115 base::Bind(&base::WaitableEvent::Signal, 114 base::Bind(&base::WaitableEvent::Signal,
116 base::Unretained(&waiter))))) { 115 base::Unretained(&waiter))))) {
117 base::ThreadRestrictions::ScopedAllowWait allow_wait; 116 base::ThreadRestrictions::ScopedAllowWait allow_wait;
118 waiter.Wait(); 117 waiter.Wait();
119 } 118 }
120 } 119 }
121 120
122 } // namespace content 121 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/media/android/browser_surface_view_manager.h ('k') | content/browser/renderer_host/compositor_impl_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698