OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/renderer/gpu/compositor_thread.h" | 5 #include "content/renderer/gpu/compositor_thread.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "content/renderer/gpu/input_event_filter.h" | 8 #include "content/renderer/gpu/input_event_filter.h" |
9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositor.h" | 9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositor.h" |
10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositorClient.h
" | 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositorClient.h
" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 | 56 |
57 //------------------------------------------------------------------------------ | 57 //------------------------------------------------------------------------------ |
58 | 58 |
59 CompositorThread::CompositorThread(IPC::Channel::Listener* main_listener) | 59 CompositorThread::CompositorThread(IPC::Channel::Listener* main_listener) |
60 : thread_("Compositor") { | 60 : thread_("Compositor") { |
61 filter_ = | 61 filter_ = |
62 new InputEventFilter(main_listener, | 62 new InputEventFilter(main_listener, |
63 thread_.message_loop()->message_loop_proxy(), | 63 thread_.message_loop()->message_loop_proxy(), |
64 base::Bind(&CompositorThread::HandleInputEvent, | 64 base::Bind(&CompositorThread::HandleInputEvent, |
65 base::Unretained(this))); | 65 base::Unretained(this))); |
66 WebCompositor::setThread(&thread_); | |
67 } | 66 } |
68 | 67 |
69 CompositorThread::~CompositorThread() { | 68 CompositorThread::~CompositorThread() { |
70 } | 69 } |
71 | 70 |
72 IPC::ChannelProxy::MessageFilter* CompositorThread::GetMessageFilter() const { | 71 IPC::ChannelProxy::MessageFilter* CompositorThread::GetMessageFilter() const { |
73 return filter_; | 72 return filter_; |
74 } | 73 } |
75 | 74 |
76 void CompositorThread::AddCompositor(int routing_id, int compositor_id) { | 75 void CompositorThread::AddCompositor(int routing_id, int compositor_id) { |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 | 112 |
114 CompositorMap::iterator it = compositors_.find(routing_id); | 113 CompositorMap::iterator it = compositors_.find(routing_id); |
115 if (it == compositors_.end()) { | 114 if (it == compositors_.end()) { |
116 // Oops, we no longer have an interested compositor. | 115 // Oops, we no longer have an interested compositor. |
117 filter_->DidNotHandleInputEvent(true); | 116 filter_->DidNotHandleInputEvent(true); |
118 return; | 117 return; |
119 } | 118 } |
120 | 119 |
121 it->second->compositor()->handleInputEvent(*input_event); | 120 it->second->compositor()->handleInputEvent(*input_event); |
122 } | 121 } |
OLD | NEW |