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

Unified Diff: media/mojo/clients/mojo_android_overlay.cc

Issue 2867633002: Fetch the surface from GpuSurfaceTracker for mojo AndroidOverlay. (Closed)
Patch Set: started checking surface obj 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/mojo/clients/BUILD.gn ('k') | media/mojo/clients/mojo_android_overlay_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/mojo/clients/mojo_android_overlay.cc
diff --git a/media/mojo/clients/mojo_android_overlay.cc b/media/mojo/clients/mojo_android_overlay.cc
index 44934cdbb42be6cc4ad989263ea0d3c0894258e0..ab6554acb7a05799812cf74bb55b86680dd6bd85 100644
--- a/media/mojo/clients/mojo_android_overlay.cc
+++ b/media/mojo/clients/mojo_android_overlay.cc
@@ -4,6 +4,7 @@
#include "media/mojo/clients/mojo_android_overlay.h"
+#include "gpu/ipc/common/gpu_surface_lookup.h"
#include "services/service_manager/public/cpp/connect.h"
#include "services/service_manager/public/interfaces/interface_provider.mojom.h"
@@ -55,8 +56,19 @@ const base::android::JavaRef<jobject>& MojoAndroidOverlay::GetJavaSurface()
}
void MojoAndroidOverlay::OnSurfaceReady(uint64_t surface_key) {
- // TODO(liberato): ask binder for the surface here, and fill in |surface_|.
received_surface_ = true;
+
+ // Get the surface and notify our client.
+ surface_ =
+ gpu::GpuSurfaceLookup::GetInstance()->AcquireJavaSurface(surface_key);
+
+ // If no surface was returned, then fail instead.
+ if (surface_.IsEmpty()) {
+ config_.is_failed(this);
+ // |this| may be deleted.
+ return;
+ }
+
config_.is_ready(this);
}
« no previous file with comments | « media/mojo/clients/BUILD.gn ('k') | media/mojo/clients/mojo_android_overlay_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698