Index: content/renderer/gpu/compositor_thread.cc |
diff --git a/content/renderer/gpu/compositor_thread.cc b/content/renderer/gpu/compositor_thread.cc |
index 8cbe079836732a005c8ed8252948744583d45895..6ef6acd156fb4f93d3123aab3b77e4fd34f25885 100644 |
--- a/content/renderer/gpu/compositor_thread.cc |
+++ b/content/renderer/gpu/compositor_thread.cc |
@@ -6,8 +6,10 @@ |
#include "base/bind.h" |
#include "base/debug/trace_event.h" |
+#include "content/common/view_messages.h" |
#include "content/renderer/gpu/input_event_filter.h" |
#include "third_party/WebKit/Source/WebKit/chromium/public/WebActiveWheelFlingParameters.h" |
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositorFrame.h" |
#include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositorInputHandlerClient.h" |
#include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositorInputHandler.h" |
#include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
@@ -23,11 +25,13 @@ class CompositorThread::InputHandlerWrapper |
public: |
InputHandlerWrapper(CompositorThread* compositor_thread, |
int routing_id, |
+ IPC::Message::Sender* sender, |
WebKit::WebCompositorInputHandler* input_handler, |
scoped_refptr<base::MessageLoopProxy> main_loop, |
const base::WeakPtr<RenderViewImpl>& render_view_impl) |
: compositor_thread_(compositor_thread), |
routing_id_(routing_id), |
+ sender_(sender), |
input_handler_(input_handler), |
main_loop_(main_loop), |
render_view_impl_(render_view_impl) { |
@@ -61,6 +65,17 @@ class CompositorThread::InputHandlerWrapper |
compositor_thread_->filter_->DidNotHandleInputEvent(send_to_widget); |
} |
+ virtual void sendCompositorFrame(const WebKit::WebCompositorFrame& frame) { |
+ std::vector<WebKit::WebCompositorQuad> quads; |
+ for (unsigned int i = 0; i < frame.quadList.size(); i++) |
+ quads.push_back(frame.quadList[i]); |
+ |
+ CompositorHostMsg_DrawFrame_Params params; |
+ params.quads = quads; |
+ params.framebuffer_output_rect = frame.framebufferOutputRect; |
+ sender_->Send(new CompositorHostMsg_DrawFrame(routing_id_, params)); |
+ } |
+ |
private: |
friend class base::RefCountedThreadSafe<InputHandlerWrapper>; |
@@ -70,6 +85,7 @@ class CompositorThread::InputHandlerWrapper |
CompositorThread* compositor_thread_; |
int routing_id_; |
+ IPC::Message::Sender* sender_; |
WebKit::WebCompositorInputHandler* input_handler_; |
scoped_refptr<base::MessageLoopProxy> main_loop_; |
@@ -98,7 +114,7 @@ IPC::ChannelProxy::MessageFilter* CompositorThread::GetMessageFilter() const { |
} |
void CompositorThread::AddInputHandler( |
- int routing_id, int input_handler_id, |
+ int routing_id, IPC::Message::Sender* sender, int input_handler_id, |
const base::WeakPtr<RenderViewImpl>& render_view_impl) { |
DCHECK_NE(thread_.message_loop(), MessageLoop::current()); |
@@ -107,13 +123,14 @@ void CompositorThread::AddInputHandler( |
base::Bind(&CompositorThread::AddInputHandlerOnCompositorThread, |
base::Unretained(this), |
routing_id, |
+ sender, |
input_handler_id, |
base::MessageLoopProxy::current(), |
render_view_impl)); |
} |
void CompositorThread::AddInputHandlerOnCompositorThread( |
- int routing_id, int input_handler_id, |
+ int routing_id, IPC::Message::Sender* sender, int input_handler_id, |
scoped_refptr<base::MessageLoopProxy> main_loop, |
const base::WeakPtr<RenderViewImpl>& render_view_impl) { |
@@ -136,7 +153,7 @@ void CompositorThread::AddInputHandlerOnCompositorThread( |
filter_->AddRoute(routing_id); |
input_handlers_[routing_id] = |
make_scoped_refptr(new InputHandlerWrapper(this, |
- routing_id, input_handler, main_loop, render_view_impl)); |
+ routing_id, sender, input_handler, main_loop, render_view_impl)); |
} |
void CompositorThread::RemoveInputHandler(int routing_id) { |