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

Unified Diff: content/common/gpu/gpu_command_buffer_stub.cc

Issue 22935009: Add content::SurfaceCapturer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@screencast_stride
Patch Set: af8f3e73 Separated from BrowserCompositorOutputSurface* components. Created 7 years, 4 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
Index: content/common/gpu/gpu_command_buffer_stub.cc
diff --git a/content/common/gpu/gpu_command_buffer_stub.cc b/content/common/gpu/gpu_command_buffer_stub.cc
index 78c0a49aca22b6b9529e957ec4412b980f592fc4..4d1055bfb5f5f48946e7cf1c1959880e84e55831 100644
--- a/content/common/gpu/gpu_command_buffer_stub.cc
+++ b/content/common/gpu/gpu_command_buffer_stub.cc
@@ -18,6 +18,7 @@
#include "content/common/gpu/gpu_messages.h"
#include "content/common/gpu/gpu_watchdog.h"
#include "content/common/gpu/image_transport_surface.h"
+#include "content/common/gpu/media/gl_surface_capturer.h"
#include "content/common/gpu/media/gpu_video_decode_accelerator.h"
#include "content/common/gpu/sync_point_manager.h"
#include "content/public/common/content_client.h"
@@ -206,6 +207,8 @@ bool GpuCommandBufferStub::OnMessageReceived(const IPC::Message& message) {
OnGetTransferBuffer);
IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_CreateVideoDecoder,
OnCreateVideoDecoder)
+ IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_CreateSurfaceCapturer,
+ OnCreateSurfaceCapturer)
IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_SetSurfaceVisible,
OnSetSurfaceVisible)
IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_DiscardBackbuffer,
@@ -727,6 +730,18 @@ void GpuCommandBufferStub::OnCreateVideoDecoder(
// self-delete during destruction of this stub.
}
+void GpuCommandBufferStub::OnCreateSurfaceCapturer(
+ IPC::Message* reply_message) {
+ TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnCreateSurfaceCapturer");
+ int capturer_route_id = channel_->GenerateRouteID();
+ new GLSurfaceCapturer(capturer_route_id, this);
+ // The capturer is registered as a DestructionObserver of this stub and will
+ // self-delete during destruction of this stub.
+ GpuCommandBufferMsg_CreateSurfaceCapturer::WriteReplyParams(
+ reply_message, capturer_route_id);
+ Send(reply_message);
+}
+
void GpuCommandBufferStub::OnSetSurfaceVisible(bool visible) {
TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnSetSurfaceVisible");
if (memory_manager_client_state_)

Powered by Google App Engine
This is Rietveld 408576698