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

Unified Diff: content/renderer/gpu/compositor_output_surface.cc

Issue 10915298: Add CCDelegatingRenderer, and corresponding IPCs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix clang Created 8 years, 2 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 | « content/renderer/gpu/compositor_output_surface.h ('k') | ui/compositor/layer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/gpu/compositor_output_surface.cc
diff --git a/content/renderer/gpu/compositor_output_surface.cc b/content/renderer/gpu/compositor_output_surface.cc
index e50a1e93aa420458328ac9fa3628bb0006a3db65..8671509907758cce8d4d74187a94af9676261bb3 100644
--- a/content/renderer/gpu/compositor_output_surface.cc
+++ b/content/renderer/gpu/compositor_output_surface.cc
@@ -4,11 +4,15 @@
#include "content/renderer/gpu/compositor_output_surface.h"
+#include "base/command_line.h"
#include "base/message_loop_proxy.h"
+#include "cc/compositor_frame.h"
#include "content/common/view_messages.h"
+#include "content/public/common/content_switches.h"
#include "content/renderer/render_thread_impl.h"
#include "ipc/ipc_forwarding_message_filter.h"
#include "ipc/ipc_sync_channel.h"
+#include "ipc/ipc_sync_message_filter.h"
#include "third_party/WebKit/Source/Platform/chromium/public/WebCompositorOutputSurfaceClient.h"
#include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3D.h"
@@ -21,7 +25,10 @@ using WebKit::WebCompositorSoftwareOutputDevice;
IPC::ForwardingMessageFilter* CompositorOutputSurface::CreateFilter(
base::TaskRunner* target_task_runner)
{
- uint32 messages_to_filter[] = {ViewMsg_UpdateVSyncParameters::ID};
+ uint32 messages_to_filter[] = {
+ ViewMsg_UpdateVSyncParameters::ID,
+ ViewMsg_SwapCompositorFrameACK::ID,
+ };
return new IPC::ForwardingMessageFilter(
messages_to_filter, arraysize(messages_to_filter),
target_task_runner);
@@ -38,7 +45,9 @@ CompositorOutputSurface::CompositorOutputSurface(
context3D_(context3D),
software_device_(software_device) {
DCHECK(output_surface_filter_);
- capabilities_.hasParentCompositor = false;
+ CommandLine* command_line = CommandLine::ForCurrentProcess();
+ capabilities_.hasParentCompositor = command_line->HasSwitch(
+ switches::kEnableDelegatedRenderer);
DetachFromThread();
}
@@ -87,9 +96,11 @@ WebCompositorSoftwareOutputDevice* CompositorOutputSurface::softwareDevice()
}
void CompositorOutputSurface::sendFrameToParentCompositor(
- const WebKit::WebCompositorFrame&) {
+ const WebKit::WebCompositorFrame& webFrame) {
DCHECK(CalledOnValidThread());
- NOTREACHED();
+ const cc::CompositorFrame& frame =
+ static_cast<const cc::CompositorFrame&>(webFrame);
+ Send(new ViewHostMsg_SwapCompositorFrame(routing_id_, frame));
}
void CompositorOutputSurface::OnMessageReceived(const IPC::Message& message) {
@@ -98,6 +109,7 @@ void CompositorOutputSurface::OnMessageReceived(const IPC::Message& message) {
return;
IPC_BEGIN_MESSAGE_MAP(CompositorOutputSurface, message)
IPC_MESSAGE_HANDLER(ViewMsg_UpdateVSyncParameters, OnUpdateVSyncParameters);
+ IPC_MESSAGE_HANDLER(ViewMsg_SwapCompositorFrameACK, OnSwapCompositorFrameACK);
IPC_END_MESSAGE_MAP()
}
@@ -112,3 +124,12 @@ void CompositorOutputSurface::OnUpdateVSyncParameters(
static_cast<double>(base::Time::kMicrosecondsPerSecond);
client_->onVSyncParametersChanged(monotonicTimebase, intervalInSeconds);
}
+
+void CompositorOutputSurface::OnSwapCompositorFrameACK(
+ const WebKit::WebCompositorFrameAck& ack) {
+ client_->onSendFrameToParentCompositorAck(ack);
+}
+
+bool CompositorOutputSurface::Send(IPC::Message* message) {
+ return ChildThread::current()->sync_message_filter()->Send(message);
+}
« no previous file with comments | « content/renderer/gpu/compositor_output_surface.h ('k') | ui/compositor/layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698