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

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

Issue 11316128: Send compositor frame IPC with metadata. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Clean up and rebase to 173167 Created 8 years 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/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 21eaf809cf4dd6ad64f1a1fd7958ed085ec52514..91c6c948a73f21a7bb90c7f8540e3e8280c44422 100644
--- a/content/renderer/gpu/compositor_output_surface.cc
+++ b/content/renderer/gpu/compositor_output_surface.cc
@@ -5,13 +5,16 @@
#include "content/renderer/gpu/compositor_output_surface.h"
#include "base/message_loop_proxy.h"
+#include "cc/compositor_frame.h"
#include "cc/output_surface_client.h"
#include "content/common/view_messages.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/WebGraphicsContext3D.h"
+using cc::CompositorFrame;
using cc::SoftwareOutputDevice;
using WebKit::WebGraphicsContext3D;
@@ -88,9 +91,20 @@ cc::SoftwareOutputDevice* CompositorOutputSurface::SoftwareDevice() const {
}
void CompositorOutputSurface::SendFrameToParentCompositor(
- const cc::CompositorFrame&) {
+ const cc::CompositorFrame& frame) {
DCHECK(CalledOnValidThread());
- NOTREACHED();
+ switch (frame.type) {
+ case CompositorFrame::DELEGATED:
piman 2012/12/14 22:02:22 nit: indent according to chrome style (case at +2)
aelias_OOO_until_Jul13 2012/12/15 00:06:17 Done.
+ Send(new ViewHostMsg_SwapDelegatedCompositorFrame(routing_id_,
+ static_cast<const cc::DelegatedCompositorFrame&>(frame)));
+ break;
+ case CompositorFrame::GL:
+ Send(new ViewHostMsg_SwapGLCompositorFrame(routing_id_,
+ static_cast<const cc::GLCompositorFrame&>(frame)));
+ break;
+ default:
+ NOTREACHED();
+ }
}
void CompositorOutputSurface::OnMessageReceived(const IPC::Message& message) {
@@ -109,4 +123,8 @@ void CompositorOutputSurface::OnUpdateVSyncParameters(
client_->OnVSyncParametersChanged(timebase, interval);
}
+bool CompositorOutputSurface::Send(IPC::Message* message) {
+ return ChildThread::current()->sync_message_filter()->Send(message);
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698