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 886 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
897 return; | 897 return; |
898 | 898 |
899 if (touch_emulator_ && touch_emulator_->HandleMouseEvent(mouse_event)) | 899 if (touch_emulator_ && touch_emulator_->HandleMouseEvent(mouse_event)) |
900 return; | 900 return; |
901 | 901 |
902 input_router_->SendMouseEvent(MouseEventWithLatencyInfo(mouse_event, | 902 input_router_->SendMouseEvent(MouseEventWithLatencyInfo(mouse_event, |
903 latency_info)); | 903 latency_info)); |
904 | 904 |
905 // Pass mouse state to gpu service if the subscribe uniform | 905 // Pass mouse state to gpu service if the subscribe uniform |
906 // extension is enabled. | 906 // extension is enabled. |
907 // TODO(orglofch): Only pass mouse information if one of the GL Contexts | |
908 // is subscribed to GL_MOUSE_POSITION_CHROMIUM | |
909 if (subscribe_uniform_enabled_) { | 907 if (subscribe_uniform_enabled_) { |
910 gpu::ValueState state; | 908 gpu::ValueState state; |
911 state.int_value[0] = mouse_event.x; | 909 state.int_value[0] = mouse_event.x; |
912 state.int_value[1] = mouse_event.y; | 910 state.int_value[1] = mouse_event.y; |
913 GpuProcessHost::SendOnIO( | 911 GpuProcessHost::SendUpdateValueStateOnIOThread( |
914 GpuProcessHost::GPU_PROCESS_KIND_SANDBOXED, | 912 process_->GetID(), GL_MOUSE_POSITION_CHROMIUM, state); |
piman
2014/12/05 21:04:36
I was hoping we could filter here, on the UI threa
orglofch
2014/12/06 21:49:04
Ah I had thought the main concern was IPC overhead
| |
915 CAUSE_FOR_GPU_LAUNCH_NO_LAUNCH, | |
916 new GpuMsg_UpdateValueState( | |
917 process_->GetID(), GL_MOUSE_POSITION_CHROMIUM, state)); | |
918 } | 913 } |
919 } | 914 } |
920 | 915 |
921 void RenderWidgetHostImpl::OnPointerEventActivate() { | 916 void RenderWidgetHostImpl::OnPointerEventActivate() { |
922 } | 917 } |
923 | 918 |
924 void RenderWidgetHostImpl::ForwardWheelEvent( | 919 void RenderWidgetHostImpl::ForwardWheelEvent( |
925 const WebMouseWheelEvent& wheel_event) { | 920 const WebMouseWheelEvent& wheel_event) { |
926 ForwardWheelEventWithLatencyInfo(wheel_event, ui::LatencyInfo()); | 921 ForwardWheelEventWithLatencyInfo(wheel_event, ui::LatencyInfo()); |
927 } | 922 } |
(...skipping 1501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2429 } | 2424 } |
2430 #endif | 2425 #endif |
2431 | 2426 |
2432 SkColorType RenderWidgetHostImpl::PreferredReadbackFormat() { | 2427 SkColorType RenderWidgetHostImpl::PreferredReadbackFormat() { |
2433 if (view_) | 2428 if (view_) |
2434 return view_->PreferredReadbackFormat(); | 2429 return view_->PreferredReadbackFormat(); |
2435 return kN32_SkColorType; | 2430 return kN32_SkColorType; |
2436 } | 2431 } |
2437 | 2432 |
2438 } // namespace content | 2433 } // namespace content |
OLD | NEW |