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

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

Issue 10546115: Quad list IPC infrastructure. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 6 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_thread.h ('k') | content/renderer/render_view_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « content/renderer/gpu/compositor_thread.h ('k') | content/renderer/render_view_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698