Index: gpu/ipc/common/android/scoped_surface_request_conduit.h |
diff --git a/gpu/ipc/common/android/scoped_surface_request_conduit.h b/gpu/ipc/common/android/scoped_surface_request_conduit.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..770f986f42f80611250a33c3a7fec65c2486be56 |
--- /dev/null |
+++ b/gpu/ipc/common/android/scoped_surface_request_conduit.h |
@@ -0,0 +1,42 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef GPU_IPC_COMMON_ANDROID_SCOPED_SURFACE_REQUEST_CONDUIT_H_ |
+#define GPU_IPC_COMMON_ANDROID_SCOPED_SURFACE_REQUEST_CONDUIT_H_ |
+ |
+#include <stdint.h> |
+ |
+#include "base/callback_forward.h" |
watk
2016/08/29 19:42:26
Delete
tguilbert
2016/08/30 22:53:09
Done.
|
+#include "gpu/gpu_export.h" |
+ |
+namespace gl { |
+class SurfaceTexture; |
+class ScopedJavaSurface; |
watk
2016/08/29 19:42:27
Delete
tguilbert
2016/08/30 22:53:09
Done.
|
+} |
+ |
+namespace gpu { |
+ |
+// Defines an interface that allows the registration of gl::ScopedJavaSurface |
watk
2016/08/29 19:42:26
Out of date. nit: you can drop the "Defines an int
tguilbert
2016/08/30 22:53:09
Done.
|
+// requests in the browser process, and the forwarding of SurfaceTextures from |
+// the GPU or the browser process to fulfill those requests at a later time. |
+class GPU_EXPORT ScopedSurfaceRequestConduit { |
+ public: |
+ static ScopedSurfaceRequestConduit* GetInstance(); |
+ static void SetInstance(ScopedSurfaceRequestConduit* instance); |
+ |
+ // Gets and unregisters the callback under |request_id|, and runs the callback |
+ // with a gl:ScopedJavaSurface built from |surface_texture|. |
+ // If |request_id| does not map to a request, nothing happens. |
+ // N.B: Can be called from the GPU or the browser process. |
+ virtual void FulfillScopedSurfaceRequest( |
+ uint64_t request_id, |
+ gl::SurfaceTexture* surface_texture) = 0; |
+ |
+ protected: |
+ virtual ~ScopedSurfaceRequestConduit() {} |
+}; |
+ |
+} // namespace gpu |
+ |
+#endif // GPU_IPC_COMMON_ANDROID_SCOPED_SURFACE_REQUEST_CONDUIT_H_ |