Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/browser/renderer_host/render_widget_host_impl.h" | 5 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 176 in_get_backing_store_(false), | 176 in_get_backing_store_(false), |
| 177 ignore_input_events_(false), | 177 ignore_input_events_(false), |
| 178 input_method_active_(false), | 178 input_method_active_(false), |
| 179 text_direction_updated_(false), | 179 text_direction_updated_(false), |
| 180 text_direction_(blink::WebTextDirectionLeftToRight), | 180 text_direction_(blink::WebTextDirectionLeftToRight), |
| 181 text_direction_canceled_(false), | 181 text_direction_canceled_(false), |
| 182 suppress_next_char_events_(false), | 182 suppress_next_char_events_(false), |
| 183 pending_mouse_lock_request_(false), | 183 pending_mouse_lock_request_(false), |
| 184 allow_privileged_mouse_lock_(false), | 184 allow_privileged_mouse_lock_(false), |
| 185 has_touch_handler_(false), | 185 has_touch_handler_(false), |
| 186 subscribe_uniform_enabled_(false), | |
| 187 next_browser_snapshot_id_(1), | 186 next_browser_snapshot_id_(1), |
| 188 weak_factory_(this) { | 187 weak_factory_(this) { |
| 189 CHECK(delegate_); | 188 CHECK(delegate_); |
| 190 if (routing_id_ == MSG_ROUTING_NONE) { | 189 if (routing_id_ == MSG_ROUTING_NONE) { |
| 191 routing_id_ = process_->GetNextRoutingID(); | 190 routing_id_ = process_->GetNextRoutingID(); |
| 192 surface_id_ = GpuSurfaceTracker::Get()->AddSurfaceForRenderer( | 191 surface_id_ = GpuSurfaceTracker::Get()->AddSurfaceForRenderer( |
| 193 process_->GetID(), | 192 process_->GetID(), |
| 194 routing_id_); | 193 routing_id_); |
| 195 } else { | 194 } else { |
| 196 // TODO(piman): This is a O(N) lookup, where we could forward the | 195 // TODO(piman): This is a O(N) lookup, where we could forward the |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 226 | 225 |
| 227 RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>( | 226 RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>( |
| 228 IsRenderView() ? RenderViewHost::From(this) : NULL); | 227 IsRenderView() ? RenderViewHost::From(this) : NULL); |
| 229 if (BrowserPluginGuest::IsGuest(rvh) || | 228 if (BrowserPluginGuest::IsGuest(rvh) || |
| 230 !base::CommandLine::ForCurrentProcess()->HasSwitch( | 229 !base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 231 switches::kDisableHangMonitor)) { | 230 switches::kDisableHangMonitor)) { |
| 232 hang_monitor_timeout_.reset(new TimeoutMonitor( | 231 hang_monitor_timeout_.reset(new TimeoutMonitor( |
| 233 base::Bind(&RenderWidgetHostImpl::RendererIsUnresponsive, | 232 base::Bind(&RenderWidgetHostImpl::RendererIsUnresponsive, |
| 234 weak_factory_.GetWeakPtr()))); | 233 weak_factory_.GetWeakPtr()))); |
| 235 } | 234 } |
| 236 | |
| 237 subscribe_uniform_enabled_ = | |
| 238 base::CommandLine::ForCurrentProcess()->HasSwitch( | |
| 239 switches::kEnableSubscribeUniformExtension); | |
| 240 } | 235 } |
| 241 | 236 |
| 242 RenderWidgetHostImpl::~RenderWidgetHostImpl() { | 237 RenderWidgetHostImpl::~RenderWidgetHostImpl() { |
| 243 if (view_weak_) | 238 if (view_weak_) |
| 244 view_weak_->RenderWidgetHostGone(); | 239 view_weak_->RenderWidgetHostGone(); |
| 245 SetView(NULL); | 240 SetView(NULL); |
| 246 | 241 |
| 247 GpuSurfaceTracker::Get()->RemoveSurface(surface_id_); | 242 GpuSurfaceTracker::Get()->RemoveSurface(surface_id_); |
| 248 surface_id_ = 0; | 243 surface_id_ = 0; |
| 249 | 244 |
| (...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 895 | 890 |
| 896 if (touch_emulator_ && touch_emulator_->HandleMouseEvent(mouse_event)) | 891 if (touch_emulator_ && touch_emulator_->HandleMouseEvent(mouse_event)) |
| 897 return; | 892 return; |
| 898 | 893 |
| 899 MouseEventWithLatencyInfo mouse_with_latency(mouse_event, ui_latency); | 894 MouseEventWithLatencyInfo mouse_with_latency(mouse_event, ui_latency); |
| 900 latency_tracker_.OnInputEvent(mouse_event, &mouse_with_latency.latency); | 895 latency_tracker_.OnInputEvent(mouse_event, &mouse_with_latency.latency); |
| 901 input_router_->SendMouseEvent(mouse_with_latency); | 896 input_router_->SendMouseEvent(mouse_with_latency); |
| 902 | 897 |
| 903 // Pass mouse state to gpu service if the subscribe uniform | 898 // Pass mouse state to gpu service if the subscribe uniform |
| 904 // extension is enabled. | 899 // extension is enabled. |
| 905 // TODO(orglofch): Only pass mouse information if one of the GL Contexts | 900 if (process_->SubscribeUniformEnabled()) { |
| 906 // is subscribed to GL_MOUSE_POSITION_CHROMIUM | |
| 907 if (subscribe_uniform_enabled_) { | |
| 908 gpu::ValueState state; | 901 gpu::ValueState state; |
| 909 state.int_value[0] = mouse_event.x; | 902 state.int_value[0] = mouse_event.x; |
| 910 state.int_value[1] = mouse_event.y; | 903 state.int_value[1] = mouse_event.y; |
| 911 GpuProcessHost::SendOnIO( | 904 process_->SendUpdateValueState(GL_MOUSE_POSITION_CHROMIUM, state); |
|
piman
2014/12/12 01:47:38
So, you still have the problem that the RPH receiv
orglofch
2014/12/12 02:17:58
I guess I'm missing an understanding of what a RW
piman
2014/12/12 02:41:40
a RW is the contents of a tab. You can have severa
orglofch
2014/12/12 02:58:55
Ok I see what you're saying, I was confused becaus
| |
| 912 GpuProcessHost::GPU_PROCESS_KIND_SANDBOXED, | |
| 913 CAUSE_FOR_GPU_LAUNCH_NO_LAUNCH, | |
| 914 new GpuMsg_UpdateValueState( | |
| 915 process_->GetID(), GL_MOUSE_POSITION_CHROMIUM, state)); | |
| 916 } | 905 } |
| 917 } | 906 } |
| 918 | 907 |
| 919 void RenderWidgetHostImpl::OnPointerEventActivate() { | 908 void RenderWidgetHostImpl::OnPointerEventActivate() { |
| 920 } | 909 } |
| 921 | 910 |
| 922 void RenderWidgetHostImpl::ForwardWheelEvent( | 911 void RenderWidgetHostImpl::ForwardWheelEvent( |
| 923 const WebMouseWheelEvent& wheel_event) { | 912 const WebMouseWheelEvent& wheel_event) { |
| 924 ForwardWheelEventWithLatencyInfo(wheel_event, ui::LatencyInfo()); | 913 ForwardWheelEventWithLatencyInfo(wheel_event, ui::LatencyInfo()); |
| 925 } | 914 } |
| (...skipping 1248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2174 } | 2163 } |
| 2175 #endif | 2164 #endif |
| 2176 | 2165 |
| 2177 SkColorType RenderWidgetHostImpl::PreferredReadbackFormat() { | 2166 SkColorType RenderWidgetHostImpl::PreferredReadbackFormat() { |
| 2178 if (view_) | 2167 if (view_) |
| 2179 return view_->PreferredReadbackFormat(); | 2168 return view_->PreferredReadbackFormat(); |
| 2180 return kN32_SkColorType; | 2169 return kN32_SkColorType; |
| 2181 } | 2170 } |
| 2182 | 2171 |
| 2183 } // namespace content | 2172 } // namespace content |
| OLD | NEW |